Skip to content
Extraits de code Groupes Projets
Valider fd3effd5 rédigé par Albynton's avatar Albynton
Parcourir les fichiers

Upload New File "hackport.src"

parent 85e6c4ff
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!14Create new script to automatically break into a computer
if params.len != 2 or params[0] == "-h" or params[0] == "--help" then exit("<b>Usage: "+program_path.split("/")[-1]+" [ip_address] [port]</b>")
cryptools = include_lib("/lib/crypto.so")
if not cryptools then exit("Error: Missing crypto library")
metaxploit = include_lib("/lib/metaxploit.so")
if not metaxploit then
currentPath = get_shell.host_computer.current_path
metaxploit = include_lib(currentPath + "/metaxploit.so")
end if
if not metaxploit then exit("Error: Can't find metaxploit library in the /lib path or the current folder")
address = params[0]
port = params[1].to_int
net_session = metaxploit.net_use(address, port)
if not net_session then exit("Error: can't connect to net session")
metaLib = net_session.dump_lib
GetPassword = function(userPass)
if userPass.len != 2 then exit("decipher: " + file.path + " wrong syntax")
print("retrieving password for user " +userPass[0] )
password = cryptools.decipher(userPass[0], userPass[1])
return password
end function
shell = false
pass = false
print("scanning lib")
memories = metaxploit.scan(metaLib)
for mem_addr in memories
print("scanning adress " + mem_addr)
vuln_strings = metaxploit.scan_address(metaLib, mem_addr)
if vuln_strings then
vuln_string = vuln_strings.split("Unsafe check: ")
for str in vuln_string
if str == vuln_string[0] then continue
if pass then continue
string = str[str.indexOf("<b>")+3:str.indexOf("</b>")]
result = metaLib.overflow(mem_addr, string)
if not result then
print("Error: attack didn't work")
continue
end if
if typeof(result) != "shell" then continue
shell = true
file = result.host_computer.File("/etc/passwd")
if file != null then
if not file.has_permission("r") then
print("failed. Can't access to file contents. Permission denied")
else
print("got passwd file")
pass_content = result.host_computer.File("/etc/passwd").content.split("\n")
pass = GetPassword(pass_content[0].split(":"))
print("root pass is: "+ pass)
result.start_terminal
end if
end if
end for
else
print("failed to get vulnerabilities")
end if
end for
  • Maintainer

    Missed the opportunity for a Hacknet reference :( (porthack)

0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter