Browse Source

Merge branch 'master' of https://git.swrzm.de/msc/pentest-helpers into master

Marius Schwarz 4 years ago
parent
commit
00ac2ac960
1 changed files with 31 additions and 0 deletions
  1. 31 0
      nmap-pp.py

+ 31 - 0
nmap-pp.py

@@ -0,0 +1,31 @@
+#!/usr/bin/python
+import sys
+import json
+from rich.console import Console
+from rich.table import Table
+import fileinput
+
+console = Console()
+
+table = Table(show_header=True, header_style="bold blue")
+table.add_column("Host", style="dim")
+table.add_column("Port")
+table.add_column("Service")
+table.add_column("Version", justify="left")
+
+if len(sys.argv) == 2:
+    with open(sys.argv[1], "r") as inp_file:
+        hosts = json.loads(inp_file.read())
+else:
+    hosts = json.loads(sys.stdin.read())
+
+for host in hosts:
+    for port in host["ports"]:
+        table.add_row(
+            host["hostname"],
+            str(port["port_number"]),
+            port["service"],
+            port["version"]
+        )
+
+console.print(table)