MiraiScanner.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:IoTScanner 作者: SecurityInEmergingEnvironments 项目源码 文件源码
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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号