-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsubstack.py
53 lines (37 loc) · 1.22 KB
/
substack.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
import argparse
import sys
from substack.data.profile import Profile
from substack.substack_core import SubStack
def parser_error():
print("Usage: python " + sys.argv[0] + " [Options] \nUse -h for help")
sys.exit()
def parse_args():
# parse the arguments
parser = argparse.ArgumentParser(epilog='\tExample: \r\npython ' + sys.argv[0] + " -d google.com")
parser.add_argument('-d', '--domain',
help="The domain that we want to search its sub")
parser.add_argument('-p', '--profile',
help="The profile that we want to use")
parser.add_argument('-v', '--version', help='Check version of Substack', nargs='?', default=False)
return parser.parse_args()
def version():
print 'v1.0'
def main():
args = parse_args()
domain = args.domain
_version = args.version
_profile = args.profile
if _version is not False:
version()
if domain is None:
parser_error()
if _profile is None:
profile = Profile("empty")
else:
profile = Profile(_profile)
profile.set_target(domain)
sub_stack = SubStack()
sub_stack.set_profile(profile)
sub_stack.start()
if __name__ == "__main__":
main()