taskmanager.py 文件源码

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

项目:kekescan 作者: xiaoxiaoleo 项目源码 文件源码
def result_2_db(task_id,attack_type,task_obj):

    #task_obj == RUNNING_TASK[key]
    #????task_id????
    _templist = task_obj.get() 
    if "The" in _templist[0][:5]:
        _templist[0] = _templist[1]
        _templist[1] = _templist[2]

    _simple_dic = eval(_templist[0])
    _detail_dic = eval(_templist[1])
    #_templist[0] = {'221.226.15.246': ['443', '80 web \xe5\x8d\x97\xe7\x91\x9e\xe7\xbb\xa7\xe4\xbf\x9dVPN\xe7\x99\xbb\xe9\x99\x86'], '221.226.15.249': ['8081 web Apache Tomcat/7.0.57'], '221.226.15.250': ['80'], '221.226.15.243': ['80', '9200 Elasticsearch(default)', '8000 web']}
    #print _simple_dic,_detail_dic
    for _ip in _simple_dic.keys():
        for  service_name in _simple_dic[_ip]:
            _port = service_name.split(' ')[0]
            ip_port =  '%s:%s' % (_ip,_port)
            web_title = ''
            if len(service_name.split(' ')) > 2:
                web_title = service_name.split(' ')[-1]
            detail = _get_detail(_detail_dic,_ip,_port)
            #??
            _result = FnascanResult(task_id=task_id,ip=_ip,port = _port ,service_name = service_name,service_detail = detail,web_title = web_title)
            _result.save()

    if attack_type == 'subdomainbrute':
        print _templist

    transaction.commit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号