54 lines
1.7 KiB
Plaintext
54 lines
1.7 KiB
Plaintext
//loads metaxploit
|
|
mxploit = function()
|
|
metaxploit = include_lib("/lib/metaxploit.so")
|
|
if not metaxploit then
|
|
metaxploit = include_lib(current_path + "/metaxploit.so")
|
|
end if
|
|
if not metaxploit then exit("Error: Can't find metaxploit library in the /lib path or the current folder")
|
|
return metaxploit
|
|
end function
|
|
|
|
//returns random external IP
|
|
randomIp = function()
|
|
while true
|
|
ip = floor((rnd * 255) + 1) + "." + floor((rnd * 255) + 1) + "." + floor((rnd * 255) + 1) + "." + floor((rnd * 255) + 1)
|
|
if not is_valid_ip(ip) then continue
|
|
if is_lan_ip(ip) then continue
|
|
return ip
|
|
end while
|
|
end function
|
|
|
|
//convert webadress to IP
|
|
webToIp = function(target)
|
|
if not is_valid_ip(target) then
|
|
target = nslookup(target)
|
|
if not is_valid_ip(target) then return 1
|
|
return target
|
|
end if
|
|
return target
|
|
end function
|
|
|
|
nmap = function(target_ip, echo)
|
|
|
|
target_ip = webToIP(target_ip)
|
|
|
|
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
|
|
|
|
if(echo == true) then
|
|
print("\nIP Address : " + target_ip)
|
|
print(format_columns(column))
|
|
end if
|
|
|
|
return router_data
|
|
|
|
end function |