def launchMiraiScan(ip):
global status
cmd = 'perl iotScanner.pl %s' % ip
starttime = time.time()
mChild = pexpect.spawn('/bin/bash', ['-c',cmd], timeout = 600)
# i = mChild.expect(['device ' + ip + ': failed to establish TCP connection',])
i = mChild.expect(['failed to establish TCP connection', 'doesnot have any password',
'still has default password', 'has changed password', 'didnot find dev type after trying all devices',
'due to 404 response', 'failed to establish TCP connection', 'http redirect to',
'unexpected status code',
'didnot find devType for', 'unexpected partial url', TERMINAL_PROMPT, COMMAND_PROMPT])
if i == 0:
print('Run time:', round((time.time() - starttime),3))
setStatus('Non-vulnerable')
elif i == 1 or i == 2:
setStatus('Vulnerable')
else:
setStatus('Non-vulnerable')
MiraiScanner.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录