

def parseGnmap(inFile):
    targets = {
        
    }
    for hostLine in inFile:
        currentTarget = []
        fields = hostLine.split(' ')
        ip = fields[1]
        for item in fields:
            if ((item.find('http') != (- 1)) and re.findall('\\d+/open', item)):
                port = None
                https = False
                "\n\t\t\t\tnmap has a bunch of ways to list HTTP like services, for example:\n\t\t\t\t8089/open/tcp//ssl|http\n\t\t\t\t8000/closed/tcp//http-alt///\n\t\t\t\t8008/closed/tcp//http///\n\t\t\t\t8080/closed/tcp//http-proxy//\n\t\t\t\t443/open/tcp//ssl|https?///\n\t\t\t\t8089/open/tcp//ssl|http\n\t\t\t\tSince we want to detect them all, let's just match on the word http\n\t\t\t\tand make special cases for things containing https and ssl when we\n\t\t\t\tconstruct the URLs.\n\t\t\t\t"
                port = item.split('/')[0]
                if ((item.find('https') != (- 1)) or (item.find('ssl') != (- 1))):
                    https = True
                currentTarget.append([port, https])
        if (len(currentTarget) > 0):
            targets[ip] = currentTarget
    return targets

dataset/ETHPy150Open hatRiot/clusterd/src/module/discovery.py parseGnmap/original