This commit is contained in:
2025-02-14 19:19:17 +01:00
parent 930d9207d8
commit 4f9a78a82a
8 changed files with 12 additions and 5 deletions

32
tool/nmap.src Normal file
View File

@@ -0,0 +1,32 @@
//comment out if using a stand alone tool
nmap = function(target_ip)
//uncomment is not using as import.
//if params.len != 1 or params[0] == "-h" or params[0] == "--help" then exit("<b>Usage: "+program_path.split("/")[-1]+" [ip_address]</b>")
target_ip = params[0]
if not is_valid_ip(target_ip) then exit(target_ip + " is not a valid ip")
if nslookup(target_ip) == "Not found" then
exit("<color=red><b>That domain is not valid.</b></color>")
end if
target_router = get_router(target_ip)
target_ports = target_router.used_ports
router_data = []
column = "<b>Number Type Version IP</b>"
column = column + "\n" + "0" + " " + "kernel_router" + " " + target_router.kernel_version + " " + target_router.local_ip
router_data.push({"port":"0", "port_info":"kernel_router", "port_info": target_router.kernel_version, "lan_ip":target_router.local_ip})
for port in target_ports
column = column + "\n" + port.port_number + " " + target_router.port_info(port) + " " + port.get_lan_ip
router_data.push({"port":port.port_number,"port_info":target_router.port_info(port),"lan_ip":port.get_lan_ip})
end for
print("\nIP Address : " + target_ip)
print(format_columns(column))
return router_data
//comment out if using a stand alone tool
end function