1
2
3
4
5
6
7
8
9
10
11
12
13
|
#-*- coding:utf-8 -*-
import
os
import
sys
if
len
(sys.argv)
=
=
2
:
filename
=
sys.argv[
1
]
if
not
os.path.isfile(filename):
print
'[-]'
+
filename
+
'does not exist.'
exit(
0
)
if
not
os.access(filename, os.R_OK):
print
'[-]'
+
filename
+
'access denied.'
exit(
0
)
print
'[+] reading vulnerabilities from : '
+
filename
|
执行结果:第一个是不存在的文件,第二个是存在且有权限的文件
本文转自 天道酬勤VIP 51CTO博客,原文链接:http://blog.51cto.com/tdcqvip/1944597