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