-
Notifications
You must be signed in to change notification settings - Fork 4
/
portal_uname_pass.py
29 lines (23 loc) · 956 Bytes
/
portal_uname_pass.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
29
#!/usr/bin/env python2
import sys
import re
# requires a file to read in with the data from
# bash command to grab data
# for i in `ls *.pcap`; do ngrep -I $i|egrep "<WebsDBSchName>websdb_security_LEETECH<\/WebsDBSchName>"|sort|uniq;done
# redirect the output to a file then use that file as the input for this script"
f = open(sys.argv[1], 'rb')
x = f.readlines()
def find_users_passwords(x):
for user in x:
users = user.split(">")[0]
passwords = user.split("<![CDATA")[1]
matchpassword = re.search(r'.*', passwords)
matchusername = re.search(r'[CDATA].*',users)
if matchpassword and matchusername:
print "\t"
print "Username: %s" % matchusername.group().split("[")[1].replace("]",'')
print "Password: %s" % matchpassword.group().split("[")[1].replace("]",'').split(">")[0]
#print "\n"
else:
print "we're dead jim!!!"
find_users_passwords(x)