-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathscan.py
50 lines (46 loc) · 1.05 KB
/
scan.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
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Version: 0.02
#Create: 2016-06-13
#Authoruis: ym2011
import sys
import getopt
import core
def Usage():
print 'scan usage:'
print '使用:scan.py filepath'
print '-h,--help: 获取帮助信息.'
print '-v, --version: 获取scan版本'
print '-p,--path: 指定将要扫描的路径'
print '-l,--low: 系统/数据库弱密码扫描'
def Version():
print 'scan 0.02 BASE'
def OutPut(args):
print 'Hello, %s'%args
def main(argv):
try:
opts, args = getopt.getopt(argv[1:], 'hvp:', ['path='])
except getopt.GetoptError, err:
print str(err)
Usage()
sys.exit(2)
if len(opts) == 0:
if len(args):
core.start(args[0])
else:
print "scanning [options] [param]"
for o, a in opts:
if o in ('-h', '--help'):
Usage()
sys.exit(1)
elif o in ('-v', '--version'):
Version()
sys.exit(0)
elif o in ('-p',):
core.start(a)
sys.exit(0)
else:
Usage()
sys.exit(3)
if __name__ == '__main__':
main(sys.argv)