我是使用 socat 的新手,想知道这是否可能。所以我的情况是我正在使用我的 OSCP 并且有一台机器可以重新打开反向 shell,比如说端口 8888。我试图避免在这台 windows xp 机器上写入磁盘。无论如何我可以设置socat连接,所以当机器连接回我时,它将能够运行我的python枚举脚本,收集输出,并将输出写回我的本地磁盘?
谢谢
不确定您的方案详细信息,但 socat 具有 EXEC 地址类型:
EXEC:<command-line>
Forks a sub process that establishes communication with its parent process and invokes the specified program with execvp() . <command-line> is a simple command with argu-
ments separated by single spaces. If the program name contains a '/', the part after the last '/' is taken as ARGV[0]. If the program name is a relative path, the execvp()
semantics for finding the program via $PATH apply. After successful program start, socat writes data to stdin of the process and reads from its stdout using a UNIX domain
socket generated by socketpair() per default. (example)
Option groups: FD,SOCKET,EXEC,FORK,TERMIOS
Useful options: path, fdin, fdout, chroot, su, su-d, nofork, pty, stderr, ctty, setsid, pipes, login, sigint, sigquit
See also: SYSTEM
所以在你的情况下,如果我理解它,你会想要做类似的事情:
socat TCP-LISTEN:8888 EXEC:/path/to/your/python/script