| 74 | print bcolors.OKBLUE + "[-] " + message + bcolors.ENDC |
| 75 | |
| 76 | def parseNmapScan(results): |
| 77 | services = {} |
| 78 | lines = results.split("\n") |
| 79 | for line in lines: |
| 80 | ports = [] |
| 81 | line = line.strip() |
| 82 | if ("tcp" in line or "udp" in line) and ("open" in line) and not ("filtered" in line) and not ("Discovered" in line): |
| 83 | while " " in line: |
| 84 | line = line.replace(" ", " "); |
| 85 | linesplit = line.split(" ") |
| 86 | service = linesplit[2] |
| 87 | port = linesplit[0] |
| 88 | if service in services: |
| 89 | ports = services[service] |
| 90 | ports.append(port) |
| 91 | services[service] = ports |
| 92 | return services |
| 93 | |
| 94 | def dispatchModules(target, services, userpasses): |
| 95 | for service in services: |