def run():
try:
try:
socket.setdefaulttimeout(float(variables['timeout'][0]))
except ValueError:
printError('invalid timeout')
return ModuleError("invalid timeout")
conn = http.client.HTTPConnection(variables['target'][0])
conn.request("HEAD","/index.html")
res = conn.getresponse()
results = res.getheaders()
print('')
for item in results:
print(colors.yellow+item[0], item[1]+colors.end)
print('')
return results
except http.client.InvalidURL:
printError('invalid url')
return ("invalid url")
except socket.gaierror:
printError('name or service not known')
return ModuleError("name or service not known")
except socket.timeout:
printError('timeout')
return ModuleError("timeout")
评论列表
文章目录