Created
January 16, 2022 06:01
-
-
Save lrckt/e16d3aa1ff6dea908232cd7004309f25 to your computer and use it in GitHub Desktop.
get host and ports from nessus csv report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import argparse | |
from argparse import RawTextHelpFormatter | |
""" | |
Author: Lenk Ratchakrit | |
This naive pandas script is to get only web host IP addresses and its ports | |
Hence you can pass it to some tools like httprobe then feroxbuster through STDIN and then aquatone or gowitness | |
""" | |
def nessus_converter(filename,output): | |
try: | |
results = pd.read_csv(filename) | |
web_results = results[results['Name']=="HyperText Transfer Protocol (HTTP) Information"] | |
web_ports = web_results['Host']+ ':' + web_results['Port'].astype(str) | |
web_ports.to_csv(output, index=False) | |
except Exception as e: | |
print(str(e)) | |
def main(): | |
parser = argparse.ArgumentParser(description="""Export list of HTTP host and ports from Nessus CSV to CSV!""") | |
parser.add_argument('-i', "--input", required=True) | |
parser.add_argument('-o', "--output" , required=True) | |
args = parser.parse_args() | |
nessus_converter(args.input, args.output) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment