30 lines
1.2 KiB
Lua
30 lines
1.2 KiB
Lua
metax = include_lib("/lib/metaxploit.so")
|
|
if not metax then metax = include_lib(current_path + "/metaexploit.so")
|
|
if not metax then exit("<color=red><b><center>No metaxploit.so found\nAcceptable places: /lib or current directory<center/><b/><color/>")
|
|
g = get_custom_object
|
|
if not params[0] then exit("No IP address provided")
|
|
add = ""
|
|
port = 0
|
|
ports = get_router(add).used_ports
|
|
for port in ports
|
|
print(ports[port].port_number)
|
|
end for
|
|
if not add.hasIndex(params[0]) then add = params[0]
|
|
if params.len > 1 then port = params[1].to_int
|
|
netSession = metax.net_use(add, ports[0].port_number)
|
|
metLib = netSession.dump_lib
|
|
print(metLib.lib_name + " "+ metLib.version +"\nkernel_router.so " + get_router(add).kernel_version)
|
|
scanResult = metax.scan(metLib)
|
|
for hit in scanResult
|
|
scanAdd = metax.scan_address(metLib, hit)
|
|
segments = scanAdd.split("Unsafe check: ")[1:]
|
|
exploits = []
|
|
for segment in segments
|
|
labelStart = segment.indexOf("<b>")
|
|
labelEnd = segment.indexOf("</b>")
|
|
exploits.push(segment[labelStart + 3: labelEnd])
|
|
end for
|
|
print("Memory address " + hit)
|
|
print("Vulnerabilities: " + exploits.join(", ") + "\n")
|
|
end for
|