当我使用带scapt的python进行嗅探时,密码已加密为哈希值,但在Ettercap中是正常的吗?
看这张照片:
在红色框中,您会看到用户名,密码(甚至是INFO)。除此之外,密码未使用哈希进行加密。
但是当我使用python时,密码是用哈希加密的吗?
为什么会发生,该如何解决?
顺便说一下,这就是代码。
from scapy.all import *
import re
def get_credentials(source):
username = None
password = None
userfields = ['username', 'user', 'name', 'login', 'nickname', 'userfield', 'login-name', 'log',
"email", "login-id", 'user-name', 'userID', 'userid', 'user-id', 'login_name', 'login-name', 'login-user', 'login_user', 'account', 'acc-name',
"account-user", "account-name"]
passfields = ['passwords', 'pword', 'pwd', 'user-passwords', 'pass', '_password', 'password', 'password', 'pwords', 'login-passwords', 'login-pword', 'login-pwords', 'user-password', 'user-paswd']
for login in userfields:
user = re.search('(%s=[^&]+)' % login, source, re.IGNORECASE)
if user:
username = user.group()
for p in passfields:
passwd = re.search('(%s=[^&]+)' % p, source, re.IGNORECASE)
if passwd:
password = passwd.group()
if username and password != None:
return username, password
def ctp(pkt):
if pkt.haslayer(Ether) and pkt.haslayer(Raw) and not pkt.haslayer(IP) and not pkt.haslayer(IPv6):
pass
if pkt.haslayer(TCP) and pkt.haslayer(Raw) and pkt.haslayer(IP):
mains = str(bytes(pkt[TCP].payload))
source = str(pkt[TCP].payload)
creds = get_credentials(source)
if creds != None:
print(creds)
else:
pass
print('SNIFFING')
sniff(iface="lo", prn=ctp, store=0) # lo is my Local Loopback interface