diff --git a/tool/get_bank.src b/tool/get_bank.src
index e69de29..0de6d41 100644
--- a/tool/get_bank.src
+++ b/tool/get_bank.src
@@ -0,0 +1,43 @@
+get_bank = function(target_ip, local_ip, mem, key)
+
+ 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")
+
+ net_session = metaxploit.net_use( target_ip )
+ if not net_session then exit("Error: can't connect to net session")
+
+ libKernel = net_session.dump_lib
+ libName = "kernel_router.so"
+ print("Searching " + libName +" ...")
+ if not libKernel then exit("Error: " + libName + " not found.")
+
+ result = libKernel.overflow(mem, key, local_ip)
+
+
+ if(typeof(result) == "shell") then
+ result = typeObject.host_computer
+
+ if(typeof(result) != "computer") then exit("Error: expected computer, obtained " + typeof(result))
+
+ output = ""
+ homeFolder = result.File("/home")
+ if not homeFolder then
+ return 1
+ else
+ print("------BANK------")
+
+ for userFolder in userFolders
+ bankFile = result.File("/home/" + userFolder.name + "/Config/Bank.txt")
+ if not bankFile then continue
+ if not bankFile.has_permission("r") then exit("Error: can't read file contents. Permission deniend")
+ userPass = bankFile.get_content.split(":")
+ output = output + userPass[0] + " : " + userPass[1] + "\n"
+ print(userPass[0] + "\n" + userPass[1] + "\n")
+ end for
+ end if
+
+ return output
+end function
\ No newline at end of file
diff --git a/tool/get_shell.src b/tool/get_shell.src
index 0225db4..ffa81dc 100644
--- a/tool/get_shell.src
+++ b/tool/get_shell.src
@@ -14,4 +14,4 @@ result = metaLib.overflow("0x7D764A89","olor_buttonshowbuttonim")
if not result then exit("Program ended")
-result.start_terminal
\ No newline at end of file
+if typeof(result) == "shell" then result.start_terminal
diff --git a/tool/nmap.src b/tool/nmap.src
index 58d7cb9..a7c3aa6 100644
--- a/tool/nmap.src
+++ b/tool/nmap.src
@@ -1,13 +1,14 @@
//comment out if using a stand alone tool
nmap = function(target_ip)
- //uncomment is not using as import.
+ //uncomment if not using as import.
//if params.len != 1 or params[0] == "-h" or params[0] == "--help" then exit("Usage: "+program_path.split("/")[-1]+" [ip_address]")
target_ip = params[0]
- if not is_valid_ip(target_ip) then exit(target_ip + " is not a valid ip")
- if nslookup(target_ip) == "Not found" then
+ if not (is_valid_ip(target_ip)) then target_ip = nslookup(target_ip)
+
+ if not (is_valid_ip(target_ip)) then
exit("That domain is not valid.")
end if
diff --git a/tool/tool.src b/tool/tool.src
index e69de29..d0fc5a1 100644
--- a/tool/tool.src
+++ b/tool/tool.src
@@ -0,0 +1,70 @@
+import_code("/tool/nmap.src")
+import_code("/tool/get_bank.src")
+
+target_ip = params[0]
+
+if not (is_valid_ip(target_ip)) then target_ip = nslookup(target_ip)
+
+if not (is_valid_ip(target_ip)) then
+ exit("That domain is not valid.")
+end if
+
+router_data = nmap(target_ip)
+
+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")
+
+
+local_ip = []
+
+for item in router_data
+ known = false
+ for ip in local_ip
+ if ip == item.lan_ip then
+ known = true
+ end if
+ end for
+ if not known then
+ local_ip.push(item.lan_ip)
+ end if
+end for
+
+net_session = metaxploit.net_use(target_ip,80)
+
+lib = net_session.dump_lib
+memList = metaxploit.scan(lib)
+
+vuln = []
+
+for address in memList
+ keys = metaxploit.scan_address(lib,address)
+ keys = metaxploit.scan_address(lib,address)
+ vulns = keys.split("Unsafe check: ")
+ keyList =[]
+
+ for string in vulns
+ keyList.push(string[string.indexOf("")+3:string.indexOf("")])
+ end for
+
+ for key in keyList
+ result = lib.overflow(address,key,local_ip[0])
+ if typeof(result) == "computer" or typeof(result) == "shell" then
+ vuln.push(address)
+ vuln.push(key)
+ break
+ end if
+ end for
+end for
+
+
+if not len(vuln) == 0 then
+ for ip in local_ip
+ details = get_bank(target_ip, ip , vuln[0], vuln[1])
+ end for
+end if
+
+
+