- Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsubstack.py
More file actions
Latest commit
53 lines (37 loc) · 1.22 KB
/
Copy pathsubstack.py
File metadata and controls
53 lines (37 loc) · 1.22 KB
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
importargparse
importsys
fromsubstack.data.profileimportProfile
fromsubstack.substack_coreimportSubStack
defparser_error():
print("Usage: python "+sys.argv[0] +" [Options] \nUse -h for help")
sys.exit()
defparse_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)
returnparser.parse_args()
defversion():
print'v1.0'
defmain():
args=parse_args()
domain=args.domain
_version=args.version
_profile=args.profile
if_versionisnotFalse:
version()
ifdomainisNone:
parser_error()
if_profileisNone:
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()