-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathorjohn.py
More file actions
executable file
·27 lines (23 loc) · 794 Bytes
/
orjohn.py
File metadata and controls
executable file
·27 lines (23 loc) · 794 Bytes
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
#!/usr/bin/env python
import sys, csv
import sploit
def show_help():
print sys.argv[0] + " input.csv"
print "\tinput.csv - the USER$ table dump as CSV by using tools like SQL Scratchpad"
def orjohn():
try:
with open(sys.argv[1], "rb") as csvfile:
reader = csv.reader(csvfile, delimiter=",", quotechar="\"")
try:
for row in reader:
if len(str(row[3])) == 16:
print str(row[1]).lower() + ":0$" + row[1] + "#" + row[3]
except IndexError:
sploit.show_error("The input file must be a valid CSV file that uses , as delimiter and \" as quote char.")
except IOError:
sploit.show_error("You need to specify an input CSV file.")
if __name__ == "__main__":
if len(sys.argv) != 2 or (sys.argv[1] == "-h" or sys.argv[1] == "--help"):
show_help()
else:
orjohn()