Example #1
0
def GetTargetCount():
    target = {
        "sumcount": redispool.pfcount("domain") + redispool.pfcount("ip"),
        "waitcount": redispool.hget('targetscan', 'waitcount'),
        "nowscan": redispool.hget("targetscan", "nowscan")
    }
    return target
Example #2
0
def GetCounts():
    counts = {
        "domaincount":
        redispool.pfcount("domain"),
        "ipcount":
        redispool.pfcount("ip"),
        "bugcount":
        redispool.pfcount('serious') + redispool.pfcount('High') +
        redispool.pfcount('medium') + redispool.pfcount('low'),
        "poccount":
        redispool.pfcount("poc"),
        "havebugpc":
        redispool.pfcount("havebugpc"),
        "seriouscount":
        redispool.pfcount('Serious'),
        "sencount":
        redispool.pfcount("SenDir")
    }
    return counts
Example #3
0
def GetBit():
    '''
    操作redis HyperLogLog进行计数
    :return:
    '''
    seriouscount = redispool.pfcount('Serious')
    highcount = redispool.pfcount('High')
    mediumcount = redispool.pfcount('Medium')
    lowcount = redispool.pfcount('Low')
    allcount = seriouscount + highcount + mediumcount + lowcount
    sqlcount = redispool.pfcount('SQLBugScan')
    comincount = redispool.pfcount('ComInScan')
    weblogiccount = redispool.pfcount('WebLogicScan')
    fileincount = redispool.pfcount('FileIncludeScan')
    sendircount = redispool.pfcount('SenDir')
    robotscount = redispool.pfcount('robots文件发现')
    phpinfocount = redispool.pfcount('phpstudy探针')
    gitcount = redispool.pfcount('git源码泄露扫描')
    phpstudycount = redispool.pfcount('phpstudy phpmyadmin默认密码漏洞')
    otherpoc = allcount - sqlcount - comincount - weblogiccount - fileincount - sendircount - robotscount - phpinfocount - gitcount
    bugbit = {
        'seriouscount': seriouscount,
        'highcount': highcount,
        'mediumcount': mediumcount,
        'lowcount': lowcount,
        'allcount': allcount,
    }
    if allcount == 0:
        bugtype = {
            'SQLBugScan': 0,
            'ComInScan': 0,
            'WebLogicScan': 0,
            'FileIncludeScan': 0,
            'SenDir': 0,
            'robots文件发现': 0,
            'phpstudy探针': 0,
            'git源码泄露扫描': 0,
            'phpstudy phpmyadmin默认密码漏洞': 0,
            'POC扫描漏洞': 0
        }
    else:
        bugtype = {
            'SQLBugScan': sqlcount / allcount * 100,
            'ComInScan': comincount / allcount * 100,
            'WebLogicScan': weblogiccount / allcount * 100,
            'FileIncludeScan': fileincount / allcount * 100,
            'SenDir': sendircount / allcount * 100,
            'robots文件发现': robotscount / allcount * 100,
            'phpstudy探针': phpinfocount / allcount * 100,
            'git源码泄露扫描': gitcount / allcount * 100,
            'phpstudy phpmyadmin默认密码漏洞': phpstudycount / allcount * 100,
            'POC扫描漏洞': otherpoc / allcount * 100
        }
    return bugbit, bugtype
Example #4
0
def GetPort():
    ports = {
        "test80": redispool.pfcount("test80"),
        "test8080": redispool.pfcount("test8080"),
        "test443": redispool.pfcount("test443"),
        "test8081": redispool.pfcount("test8081"),
        "test22": redispool.pfcount("test22"),
        "test85": redispool.pfcount("test85"),
        "test3389": redispool.pfcount("test3389"),
        "test9000": redispool.pfcount("test9000"),
        "test8088": redispool.pfcount("test8088"),
        "test8090": redispool.pfcount("test8090"),
        "test3306": redispool.pfcount("test3306"),
        "test8000": redispool.pfcount("test8000")
    }
    return ports
Example #5
0
def GetServices():
    service = {
        "http": redispool.pfcount("http"),
        "ssh": redispool.pfcount("ssh"),
        "mysql": redispool.pfcount("mysql"),
        "http_proxy": redispool.pfcount("http-proxy"),
        "mongodb": redispool.pfcount("mongodb"),
        "ftp": redispool.pfcount("ftp"),
        "tcpwrapped": redispool.pfcount("tcpwrapped"),
        "http_alt": redispool.pfcount("http-alt"),
        "telnet": redispool.pfcount("telnet"),
        "https": redispool.pfcount("https"),
        "redis": redispool.pfcount("redis")
    }
    return service