You've already forked greyhack
spacing
This commit is contained in:
@@ -1,42 +1,27 @@
|
|||||||
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
||||||
current_program = get_shell.host_computer.File(program_path)
|
current_program = get_shell.host_computer.File(program_path)
|
||||||
exit("Usage: "+current_program.name+" <remote ip>")
|
exit "Usage: " + current_program.name + " <remote ip>"
|
||||||
end if
|
end if
|
||||||
mx = include_lib("/lib/metaxploit.so")
|
mx = include_lib("/lib/metaxploit.so")
|
||||||
ip = params[0]
|
ip = params[0]
|
||||||
// ROUTER
|
// ROUTER
|
||||||
router_sess = mx.net_use(ip)
|
router_sess = mx.net_use(ip)
|
||||||
if not router_sess then
|
if not router_sess then
|
||||||
exit("Unable to connect to router")
|
exit "Unable to connect to router"
|
||||||
end if
|
end if
|
||||||
router_lib = router_sess.dump_lib
|
router_lib = router_sess.dump_lib
|
||||||
data_out = "PORT STATE LIBRARY VERSION LAN"
|
data_out = "PORT STATE LIBRARY VERSION LAN"
|
||||||
data_out = data_out + "\n" +
|
data_out = data_out + "\n" + " " + "open" + " " + router_lib.lib_name + " " + router_lib.version + " " + ""
|
||||||
" " + // port
|
|
||||||
"open" + " " + // state
|
|
||||||
router_lib.lib_name + " " + // library
|
|
||||||
router_lib.version + " " + // version
|
|
||||||
"" // lan ip
|
|
||||||
// PORTS
|
// PORTS
|
||||||
router = get_router(ip)
|
router = get_router(ip)
|
||||||
for port in router.used_ports
|
for port in router.used_ports
|
||||||
if port.is_closed == 0 then state = "open" else state = "closed"
|
if port.is_closed == 0 then state = "open" else state = "closed"
|
||||||
sess = mx.net_use(ip, port.port_number)
|
sess = mx.net_use(ip, port.port_number)
|
||||||
if not sess then
|
if not sess then
|
||||||
data_out = data_out + "\n" +
|
data_out = data_out + "\n" + port.port_number + " " + state + " " + "N/A" + " " + "N/A" + " " + ""
|
||||||
port.port_number + " " + // port
|
|
||||||
state + " " + // state
|
|
||||||
"N/A" + " " + // library
|
|
||||||
"N/A" + " " + // version
|
|
||||||
"" // lan ip
|
|
||||||
continue
|
continue
|
||||||
end if
|
end if
|
||||||
lib = sess.dump_lib
|
lib = sess.dump_lib
|
||||||
data_out = data_out + "\n" +
|
data_out = data_out + "\n" + port.port_number + " " + state + " " + lib.lib_name + " " + lib.version + " " + port.get_lan_ip
|
||||||
port.port_number + " " + // port
|
|
||||||
state + " " + // state
|
|
||||||
lib.lib_name + " " + // library
|
|
||||||
lib.version + " " + // version
|
|
||||||
port.get_lan_ip
|
|
||||||
end for
|
end for
|
||||||
print(format_columns(data_out))
|
print format_columns(data_out)
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
||||||
current_program = get_shell.host_computer.File(program_path)
|
current_program = get_shell.host_computer.File(program_path)
|
||||||
exit("Usage: "+current_program.name+" <library path> [library path...]")
|
exit "Usage: " + current_program.name + " <library path> [library path...]"
|
||||||
end if
|
end if
|
||||||
mx = include_lib("/lib/metaxploit.so")
|
mx = include_lib("/lib/metaxploit.so")
|
||||||
for lib_path in params
|
for lib_path in params
|
||||||
lib = mx.load(lib_path)
|
lib = mx.load(lib_path)
|
||||||
if not lib then
|
if not lib then
|
||||||
print("Unable to load library "+lib_path)
|
print "Unable to load library " + lib_path
|
||||||
end if
|
end if
|
||||||
print("Library "+lib.lib_name+" - "+lib.version)
|
print "Library " + lib.lib_name + " - " + lib.version
|
||||||
end for
|
end for
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
if params.len > 0 and (params[0] == "-h" or params[0] == "--help") then
|
if params.len > 0 and (params[0] == "-h" or params[0] == "--help") then
|
||||||
current_program = get_shell.host_computer.File(program_path)
|
current_program = get_shell.host_computer.File(program_path)
|
||||||
print("Usage: " + current_program.name + " [path...]")
|
print "Usage: " + current_program.name + " [path...]"
|
||||||
exit
|
exit
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@@ -9,24 +9,24 @@ computer = get_shell.host_computer
|
|||||||
entry_line = function(f, display_name)
|
entry_line = function(f, display_name)
|
||||||
name = display_name
|
name = display_name
|
||||||
if f.is_folder then
|
if f.is_folder then
|
||||||
name = name + "/"
|
name += "/"
|
||||||
else if f.permissions.indexOf("x") != null then
|
else if f.permissions.indexOf("x") != null then
|
||||||
name = name + "*"
|
name += "*"
|
||||||
end if
|
end if
|
||||||
return f.permissions + " " + f.owner + " " + f.group + " " + f.size + " " + name
|
return f.permissions + " " + f.owner + " " + f.group + " " + f.size + " " + name
|
||||||
end function
|
end function
|
||||||
|
|
||||||
list_path = function(target, raw_path)
|
list_path = function(target, raw_path)
|
||||||
if not target then
|
if not target then
|
||||||
print(raw_path + ": No such file or directory")
|
print raw_path + ": No such file or directory"
|
||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
if not target.is_folder then
|
if not target.is_folder then
|
||||||
print(format_columns(entry_line(target, target.name)))
|
print format_columns(entry_line(target, target.name))
|
||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
if not target.has_permission("r") then
|
if not target.has_permission("r") then
|
||||||
print(raw_path + ": Permission denied")
|
print raw_path + ": Permission denied"
|
||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
lines = entry_line(target, ".")
|
lines = entry_line(target, ".")
|
||||||
@@ -40,21 +40,27 @@ list_path = function(target, raw_path)
|
|||||||
if not files then files = []
|
if not files then files = []
|
||||||
named = []
|
named = []
|
||||||
for f in folders
|
for f in folders
|
||||||
named.push({"name": f.name, "entry": f})
|
named.push {
|
||||||
|
"name": f.name,
|
||||||
|
"entry": f,
|
||||||
|
}
|
||||||
end for
|
end for
|
||||||
named.sort("name")
|
named.sort "name"
|
||||||
for item in named
|
for item in named
|
||||||
lines = lines + "\n" + entry_line(item.entry, item.name)
|
lines = lines + "\n" + entry_line(item.entry, item.name)
|
||||||
end for
|
end for
|
||||||
named = []
|
named = []
|
||||||
for f in files
|
for f in files
|
||||||
named.push({"name": f.name, "entry": f})
|
named.push {
|
||||||
|
"name": f.name,
|
||||||
|
"entry": f,
|
||||||
|
}
|
||||||
end for
|
end for
|
||||||
named.sort("name")
|
named.sort "name"
|
||||||
for item in named
|
for item in named
|
||||||
lines = lines + "\n" + entry_line(item.entry, item.name)
|
lines = lines + "\n" + entry_line(item.entry, item.name)
|
||||||
end for
|
end for
|
||||||
print(format_columns(lines))
|
print format_columns(lines)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
resolve = function(p)
|
resolve = function(p)
|
||||||
@@ -67,13 +73,13 @@ resolve = function(p)
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
if params.len < 1 then
|
if params.len < 1 then
|
||||||
list_path(computer.File(current_path), current_path)
|
list_path computer.File(current_path), current_path
|
||||||
else
|
else
|
||||||
i = 0
|
i = 0
|
||||||
for p in params
|
for p in params
|
||||||
if i > 0 then print("")
|
if i > 0 then print("")
|
||||||
if params.len > 1 then print(p + ":")
|
if params.len > 1 then print(p + ":")
|
||||||
list_path(resolve(p), p)
|
list_path resolve(p), p
|
||||||
i = i + 1
|
i += 1
|
||||||
end for
|
end for
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
||||||
current_program = get_shell.host_computer.File(program_path)
|
current_program = get_shell.host_computer.File(program_path)
|
||||||
exit("Usage: "+current_program.name+" <library path>")
|
exit "Usage: " + current_program.name + " <library path>"
|
||||||
end if
|
end if
|
||||||
mx = include_lib("/lib/metaxploit.so")
|
mx = include_lib("/lib/metaxploit.so")
|
||||||
lib_path = params[0]
|
lib_path = params[0]
|
||||||
@@ -8,15 +8,15 @@ lib_file = get_shell.host_computer.File(lib_path)
|
|||||||
if not lib_file then
|
if not lib_file then
|
||||||
lib_file = get_shell.host_computer.File(current_path + lib_path)
|
lib_file = get_shell.host_computer.File(current_path + lib_path)
|
||||||
if not lib_file then
|
if not lib_file then
|
||||||
exit("Unable to find library")
|
exit "Unable to find library"
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
lib = mx.load(lib_file.path)
|
lib = mx.load(lib_file.path)
|
||||||
if not lib then
|
if not lib then
|
||||||
exit("Unable to load library")
|
exit "Unable to load library"
|
||||||
end if
|
end if
|
||||||
adds = mx.scan(lib)
|
adds = mx.scan(lib)
|
||||||
for add in adds
|
for add in adds
|
||||||
print("Address: " + add)
|
print "Address: " + add
|
||||||
print(mx.scan_address(lib, add))
|
print mx.scan_address(lib, add)
|
||||||
end for
|
end for
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
||||||
current_program = get_shell.host_computer.File(program_path)
|
current_program = get_shell.host_computer.File(program_path)
|
||||||
print("Usage: " + current_program.name + " <library path>")
|
print "Usage: " + current_program.name + " <library path>"
|
||||||
print("--- OR ---")
|
print "--- OR ---"
|
||||||
exit("Usage: " + current_program.name + " <remote ip> <remote port> <address> <data>")
|
exit "Usage: " + current_program.name + " <remote ip> <remote port> <address> <data>"
|
||||||
end if
|
end if
|
||||||
mx = include_lib("/lib/metaxploit.so")
|
mx = include_lib("/lib/metaxploit.so")
|
||||||
extra_data = ""
|
extra_data = ""
|
||||||
@@ -27,9 +27,9 @@ else
|
|||||||
sess = mx.net_use(ip, port)
|
sess = mx.net_use(ip, port)
|
||||||
end if
|
end if
|
||||||
if not sess then
|
if not sess then
|
||||||
exit("Unable to establish session")
|
exit "Unable to establish session"
|
||||||
end if
|
end if
|
||||||
lib = sess.dump_lib()
|
lib = sess.dump_lib
|
||||||
if params.len == 5 then
|
if params.len == 5 then
|
||||||
extra_data == params[4]
|
extra_data == params[4]
|
||||||
end if
|
end if
|
||||||
@@ -45,14 +45,14 @@ to = typeof(of)
|
|||||||
if to == "shell" then
|
if to == "shell" then
|
||||||
of.start_terminal
|
of.start_terminal
|
||||||
else if to == "file" then
|
else if to == "file" then
|
||||||
print(of.path(true))
|
print of.path(true)
|
||||||
if of.is_folder then
|
if of.is_folder then
|
||||||
for f in of.get_files
|
for f in of.get_files
|
||||||
print(f.owner+" "+f.group+" "+f.permissions+" "+f.name)
|
print f.owner + " " + f.group + " " + f.permissions + " " + f.name
|
||||||
end for
|
end for
|
||||||
else
|
else
|
||||||
print(of.get_content)
|
print of.get_content
|
||||||
end if
|
end if
|
||||||
else
|
else
|
||||||
print(typeof(of))
|
print typeof(of)
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
||||||
current_program = get_shell.host_computer.File(program_path)
|
current_program = get_shell.host_computer.File(program_path)
|
||||||
print("Usage: " + current_program.name + " [-h|<library path> [extra]]")
|
print "Usage: " + current_program.name + " [-h|<library path> [extra]]"
|
||||||
print(" -h show this help message")
|
print " -h show this help message"
|
||||||
print(" <library path> only exploit the specified library (e.g. /lib/init.so)")
|
print " <library path> only exploit the specified library (e.g. /lib/init.so)"
|
||||||
print(" extra optional overflow value to attempt")
|
print " extra optional overflow value to attempt"
|
||||||
print(" (no args) try all libraries in /lib and current_path")
|
print " (no args) try all libraries in /lib and current_path"
|
||||||
exit
|
exit
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@@ -92,8 +92,13 @@ add_lib_dir = function(dirpath)
|
|||||||
if already then continue
|
if already then continue
|
||||||
lib = mx.load(f.path)
|
lib = mx.load(f.path)
|
||||||
if not lib then continue
|
if not lib then continue
|
||||||
known_paths.push(f.path)
|
known_paths.push f.path
|
||||||
libs.push({"path": f.path, "name": lib.lib_name, "version": lib.version, "lib": lib})
|
libs.push {
|
||||||
|
"path": f.path,
|
||||||
|
"name": lib.lib_name,
|
||||||
|
"version": lib.version,
|
||||||
|
"lib": lib,
|
||||||
|
}
|
||||||
end for
|
end for
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -102,23 +107,33 @@ if target_lib then
|
|||||||
if not lf then exit("Unable to locate library: " + target_lib)
|
if not lf then exit("Unable to locate library: " + target_lib)
|
||||||
lib = mx.load(target_lib)
|
lib = mx.load(target_lib)
|
||||||
if not lib then exit("Unable to load library: " + target_lib)
|
if not lib then exit("Unable to load library: " + target_lib)
|
||||||
libs.push({"path": target_lib, "name": lib.lib_name, "version": lib.version, "lib": lib})
|
libs.push {
|
||||||
|
"path": target_lib,
|
||||||
|
"name": lib.lib_name,
|
||||||
|
"version": lib.version,
|
||||||
|
"lib": lib,
|
||||||
|
}
|
||||||
else
|
else
|
||||||
add_lib_dir("/lib")
|
add_lib_dir "/lib"
|
||||||
if current_path != "/lib" then add_lib_dir(current_path)
|
if current_path != "/lib" then add_lib_dir(current_path)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if libs.len == 0 then
|
if libs.len == 0 then
|
||||||
print("Nothing found")
|
print "Nothing found"
|
||||||
exit
|
exit
|
||||||
end if
|
end if
|
||||||
|
|
||||||
preferred = ["kernel_module.so", "init.so", "net.so", "kernel_router.so"]
|
preferred = [
|
||||||
|
"kernel_module.so",
|
||||||
|
"init.so",
|
||||||
|
"net.so",
|
||||||
|
"kernel_router.so",
|
||||||
|
]
|
||||||
ordered = []
|
ordered = []
|
||||||
for name in preferred
|
for name in preferred
|
||||||
for item in libs
|
for item in libs
|
||||||
if ends_with(item.path, "/" + name) or item.name == name then
|
if ends_with(item.path, "/" + name) or item.name == name then
|
||||||
ordered.push(item)
|
ordered.push item
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
end for
|
end for
|
||||||
@@ -131,7 +146,7 @@ for item in libs
|
|||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
if already then continue
|
if already then continue
|
||||||
ordered.push(item)
|
ordered.push item
|
||||||
end for
|
end for
|
||||||
libs = ordered
|
libs = ordered
|
||||||
|
|
||||||
@@ -139,7 +154,7 @@ lines = "PATH LIBRARY VERSION"
|
|||||||
for item in libs
|
for item in libs
|
||||||
lines = lines + "\n" + item.path + " " + item.name + " " + item.version
|
lines = lines + "\n" + item.path + " " + item.name + " " + item.version
|
||||||
end for
|
end for
|
||||||
print(format_columns(lines))
|
print format_columns(lines)
|
||||||
|
|
||||||
try_overflow = function(lib, add, value)
|
try_overflow = function(lib, add, value)
|
||||||
of = lib.overflow(add, value)
|
of = lib.overflow(add, value)
|
||||||
@@ -186,4 +201,4 @@ if active_user == "guest" and user_shell then
|
|||||||
exit
|
exit
|
||||||
end if
|
end if
|
||||||
|
|
||||||
print("Nothing found")
|
print "Nothing found"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
||||||
current_program = get_shell.host_computer.File(program_path)
|
current_program = get_shell.host_computer.File(program_path)
|
||||||
exit("Usage: "+current_program.name+" <remote ip> [remote port]")
|
exit "Usage: " + current_program.name + " <remote ip> [remote port]"
|
||||||
end if
|
end if
|
||||||
mx = include_lib("/lib/metaxploit.so")
|
mx = include_lib("/lib/metaxploit.so")
|
||||||
ip = params[0]
|
ip = params[0]
|
||||||
@@ -11,11 +11,11 @@ else
|
|||||||
sess = mx.net_use(ip, port)
|
sess = mx.net_use(ip, port)
|
||||||
end if
|
end if
|
||||||
if not sess then
|
if not sess then
|
||||||
exit("Unable to establish session")
|
exit "Unable to establish session"
|
||||||
end if
|
end if
|
||||||
lib = sess.dump_lib
|
lib = sess.dump_lib
|
||||||
adds = mx.scan(lib)
|
adds = mx.scan(lib)
|
||||||
for add in adds
|
for add in adds
|
||||||
print("Address: " + add)
|
print "Address: " + add
|
||||||
print(mx.scan_address(lib, add))
|
print mx.scan_address(lib, add)
|
||||||
end for
|
end for
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
||||||
current_program = get_shell.host_computer.File(program_path)
|
current_program = get_shell.host_computer.File(program_path)
|
||||||
print("Usage: " + current_program.name + " [-l|-a|<ESSID>|<BSSID>]")
|
print "Usage: " + current_program.name + " [-l|-a|<ESSID>|<BSSID>]"
|
||||||
print(" -l list nearby networks")
|
print " -l list nearby networks"
|
||||||
print(" -a crack and connect to all networks")
|
print " -a crack and connect to all networks"
|
||||||
print(" MyNetwork crack and connect by ESSID")
|
print " MyNetwork crack and connect by ESSID"
|
||||||
print(" AA:BB:CC:DD:EE:FF crack and connect by BSSID")
|
print " AA:BB:CC:DD:EE:FF crack and connect by BSSID"
|
||||||
exit
|
exit
|
||||||
end if
|
end if
|
||||||
crypto = include_lib("/lib/crypto.so")
|
crypto = include_lib("/lib/crypto.so")
|
||||||
@@ -17,7 +17,7 @@ for letter in computer.network_devices
|
|||||||
if letter == " " then
|
if letter == " " then
|
||||||
break
|
break
|
||||||
end if
|
end if
|
||||||
netname = netname + letter
|
netname += letter
|
||||||
end for
|
end for
|
||||||
nets = computer.wifi_networks(netname)
|
nets = computer.wifi_networks(netname)
|
||||||
for net in nets
|
for net in nets
|
||||||
@@ -28,19 +28,23 @@ for net in nets
|
|||||||
info = info + "\n" + net
|
info = info + "\n" + net
|
||||||
continue
|
continue
|
||||||
else if command == essid or command == bssid or command == "-a" then
|
else if command == essid or command == bssid or command == "-a" then
|
||||||
crypto.airmon("start", netname)
|
crypto.airmon "start", netname
|
||||||
crypto.aireplay(bssid, essid, floor(300000 / strength))
|
crypto.aireplay bssid, essid, floor(300000 / strength)
|
||||||
pwd = crypto.aircrack(cappath)
|
pwd = crypto.aircrack(cappath)
|
||||||
print(pwd)
|
print pwd
|
||||||
capfile = computer.File(cappath)
|
capfile = computer.File(cappath)
|
||||||
capfile.delete
|
capfile.delete
|
||||||
crypto.airmon("stop", netname)
|
crypto.airmon "stop", netname
|
||||||
connected = computer.connect_wifi(netname, bssid, essid, pwd)
|
connected = computer.connect_wifi(
|
||||||
|
netname,
|
||||||
|
bssid,
|
||||||
|
essid,
|
||||||
|
pwd)
|
||||||
if connected then
|
if connected then
|
||||||
print("Connected to " + essid)
|
print "Connected to " + essid
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
if command == "-l" then
|
if command == "-l" then
|
||||||
print(format_columns(info))
|
print format_columns(info)
|
||||||
end if
|
end if
|
||||||
|
|||||||
Reference in New Issue
Block a user