forked from dvopsway/datasploit
-
Notifications
You must be signed in to change notification settings - Fork 433
/
Copy pathdatasploit.py
executable file
·73 lines (64 loc) · 2.91 KB
/
datasploit.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
import re
import sys
import optparse
import emailOsint
import domainOsint
import ipOsint
import usernameOsint
parser = optparse.OptionParser()
parser.add_option('-a', '--active', action="store", dest="domain", help="Launches Active Scans (work in progress)",
default="spam")
parser.add_option('--json', action="store_true", dest="output", help="Save output in JSON")
parser.add_option("-f", "--file", dest="filename", help="File listing of domains, IP addresses, emails, and/or usernames", default=None, metavar="FILE")
options, args = parser.parse_args()
def printart():
print "\t "
print "\t ____/ /____ _ / /_ ____ _ _____ ____ / /____ (_)/ /_"
print "\t / __ // __ `// __// __ `// ___// __ \ / // __ \ / // __/"
print "\t / /_/ // /_/ // /_ / /_/ /(__ )/ /_/ // // /_/ // // /_ "
print "\t \__,_/ \__,_/ \__/ \__,_//____// .___//_/ \____//_/ \__/ "
print "\t /_/ "
print "\t "
print "\t Open Source Assistant for #OSINT "
print "\t Website: www.datasploit.info "
print "\t "
def main(user_input, output = None):
if not options.filename:
printart()
print "User Input: %s" % user_input
else:
print "============================================================="
print "User Input: %s" % user_input
print "============================================================="
if re.match('[^@]+@[^@]+\.[^@]+', user_input):
print "Looks like an EMAIL, running emailOsint...\n"
emailOsint.run(user_input, output)
elif re.match('^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$', user_input):
print "Looks like an IP, running ipOsint...\n"
ipOsint.run(user_input, output)
elif re.match('^[a-zA-Z\d-]{,63}(\.[a-zA-Z\d-]{,63}).$', user_input):
print "Looks like a DOMAIN, running domainOsint...\n"
domainOsint.run(user_input, output)
else:
print "Looks like a Username, running usernameOsint...\n"
usernameOsint.run(user_input, output)
if __name__ == "__main__":
output = "JSON" if options.output else None
if options.filename:
printart()
with open(options.filename, "r") as infile:
for line in infile:
try:
user_input = line.replace("\r","").replace("\n","").strip()
except:
print "\n[-] Invalid Input. Exiting now..\n"
sys.exit(0)
main(user_input, output)
else:
try:
user_input = sys.argv[1]
except:
print "\n[-] Invalid Input. Exiting now..\n"
sys.exit(0)
main(user_input, output)