16
16
17
17
def main (argv ):
18
18
output = None
19
- desc = """
19
+ desc = """
20
20
____/ /____ _ / /_ ____ _ _____ ____ / /____ (_)/ /_
21
21
/ __ // __ `// __// __ `// ___// __ \ / // __ \ / // __/
22
- / /_/ // /_/ // /_ / /_/ /(__ )/ /_/ // // /_/ // // /_
23
- \__,_/ \__,_/ \__/ \__,_//____// .___//_/ \____//_/ \__/
24
- /_/
25
-
26
- Open Source Assistant for #OSINT
27
- www.datasploit.info
22
+ / /_/ // /_/ // /_ / /_/ /(__ )/ /_/ // // /_/ // // /_
23
+ \__,_/ \__,_/ \__/ \__,_//____// .___//_/ \____//_/ \__/
24
+ /_/
25
+
26
+ Open Source Assistant for #OSINT
27
+ www.datasploit.info
28
28
29
29
"""
30
- epilog = """ Connect at Social Media: @datasploit
30
+ epilog = """ Connect at Social Media: @datasploit
31
31
"""
32
32
# Set all parser arguments here.
33
33
parser = argparse .ArgumentParser (formatter_class = argparse .RawDescriptionHelpFormatter ,description = textwrap .dedent (desc ),epilog = epilog )
34
- parser .add_argument ("-i" ,"--input" ,help = "Provide Input" ,dest = 'target' ,required = True )
34
+ parser .add_argument ("-i" ,"--input" ,help = "Provide Input" ,dest = 'single_target' )
35
+ parser .add_argument ("-f" ,"--file" ,help = "Provide Input" ,dest = 'file_target' )
35
36
parser .add_argument ("-a" ,"--active" ,help = "Run Active Scan attacks" ,dest = 'active' ,action = "store_false" )
36
37
parser .add_argument ("-q" ,"--quiet" ,help = "Run scans in automated manner accepting default answers" ,dest = 'quiet' ,action = "store_false" )
37
38
parser .add_argument ("-o" ,"--output" ,help = "Provide Destination Directory" ,dest = 'output' )
@@ -45,45 +46,64 @@ def main(argv):
45
46
shutil .copyfile (config_sample_path ,config_file_path )
46
47
print "[+] A config file is added please follow guide at https://datasploit.github.io/datasploit/apiGeneration/ to fill API Keys for better results"
47
48
# We can think about quiting at this point.
48
- # if no argument is provided print help and quit
49
- if len (argv ) == 0 :
50
- parser .print_help ()
51
- sys .exit ()
52
49
# parse arguments in case they are provided.
53
50
x = parser .parse_args ()
54
51
active = x .active
55
52
quiet = x .quiet
56
- user_input = x .target
53
+ single_input = x .single_target
54
+ file_input = x .file_target
57
55
output = x .output
56
+ # if no target is provided print help and quit.
57
+ if not (single_input or file_input ):
58
+ print "\n Single target or file input required to run\n "
59
+ parser .print_help ()
60
+ sys .exit ()
58
61
# Banner print
59
62
print textwrap .dedent (desc )
60
- # Auto selection logic
61
- try :
62
- print "User Input: %s" % user_input
63
+ if single_input :
63
64
try :
64
- inp = IPAddress (user_input );
65
- if inp .is_private () or inp .is_loopback ():
66
- print "Internal IP Detected : Skipping"
67
- sys .exit ()
68
- else :
69
- print "Looks like an IP, running ipOsint...\n "
70
- ipOsint .run (user_input , output )
71
- except SystemExit :
72
- print "exiting"
73
- except AddrFormatError :
74
- if re .match ('[^@]+@[^@]+\.[^@]+' , user_input ):
75
- print "Looks like an EMAIL, running emailOsint...\n "
76
- emailOsint .run (user_input , output )
77
- elif get_tld (user_input , fix_protocol = True ,fail_silently = True ) is not None :
78
- print "Looks like a DOMAIN, running domainOsint...\n "
79
- domainOsint .run (user_input , output )
65
+ auto_select_target (single_input , output )
66
+ except KeyboardInterrupt :
67
+ print "\n Ctrl+C called Quiting"
68
+ if file_input :
69
+ try :
70
+ if os .path .isfile (file_input ):
71
+ print "File Input: %s" % file_input
72
+ with open (file_input , 'r' ) as f :
73
+ for target in f :
74
+ auto_select_target (target .rstrip (), output )
75
+ print "\n Done processing %s" % file_input
80
76
else :
81
- print "Nothing Matched assuming username, running usernameOsint...\n "
82
- usernameOsint .run (user_input , output )
83
- except :
84
- print "Unknown Error Occured"
85
- except KeyboardInterrupt :
86
- print "Ctrl+C called Quiting"
77
+ print "%s is not a readable file" % file_input
78
+ print "Exiting..."
79
+ except KeyboardInterrupt :
80
+ print "\n Ctrl+C called Quiting"
81
+
82
+ def auto_select_target (target , output = None ):
83
+ """Auto selection logic"""
84
+ print "Target: %s" % target
85
+ try :
86
+ inp = IPAddress (target );
87
+ if inp .is_private () or inp .is_loopback ():
88
+ print "Internal IP Detected : Skipping"
89
+ sys .exit ()
90
+ else :
91
+ print "Looks like an IP, running ipOsint...\n "
92
+ ipOsint .run (target , output )
93
+ except SystemExit :
94
+ print "exiting"
95
+ except AddrFormatError :
96
+ if re .match ('[^@]+@[^@]+\.[^@]+' , target ):
97
+ print "Looks like an EMAIL, running emailOsint...\n "
98
+ emailOsint .run (target , output )
99
+ elif get_tld (target , fix_protocol = True ,fail_silently = True ) is not None :
100
+ print "Looks like a DOMAIN, running domainOsint...\n "
101
+ domainOsint .run (target , output )
102
+ else :
103
+ print "Nothing Matched assuming username, running usernameOsint...\n "
104
+ usernameOsint .run (target , output )
105
+ except :
106
+ print "Unknown Error Occured"
87
107
88
108
if __name__ == "__main__" :
89
- main (sys .argv [1 :])
109
+ main (sys .argv [1 :])
0 commit comments