Beginner Scripts for Learning
These are some beginner scripts for learning. They will work until you reach about level 2 or 3, then you'll have to code better tools. Except the autowifi.src that will always work.

autohack.src

Code
Copy
01import_code("/home/<user>/source/getlib.src")
02import_code("/home/<user>/source/gethacks.src")
03import_code("/home/<user>/source/shelltype.src")
04
05if params.len > 3 then exit("Usage: autohack [addr] [port] [data]\nport = Can equal 0 for none.")
06if params.len == 2 or params.len == 3 then
07	if not is_valid_ip(params[0]) then exit("Error: Invalid IP address.")
08	if (params[1].val < 0 or params[1].val > 65535) then exit("Error: Invalid port number.")
09	if params.len == 3 and typeof(params[2]) != "string" then exit("Error: Last parameter must be a string.")
10
11	data = "pass"
12	if params.len == 3 then
13		data = params[2]
14	end if
15	
16	result = null
17	if params.len == 2 or params.len == 3 then
18		result = get_remote_hacks(params[0], params[1].val)
19	else
20		result = get_remote_hacks(params[0])
21	end if
22	if not result then exit()
23
24	shell = null
25	metax = result["dump"]
26	hacks = result["hacks"]
27	if not hacks or hacks.len == 0 then exit()
28
29	for hack in hacks
30		print("Address: " + hack["memory"])
31		for value in hack["values"]
32			print(" --> " + value)
33			result = metax.overflow(hack["memory"], value, data)
34			if not result then continue
35
36			if typeof(result) == "shell" then
37				// Do something with shell type.
38				shell = result
39				break
40			end if
41		end for
42		if shell != null then break
43	end for
44
45	// Do something with the shell.
46	if shell != null then
47		files = []
48		filenames = ["metaxploit.so", "crypto.so", "autohack", "autolocal", "autoclean"]
49		dirs = ["/lib/", parent_path(launch_path) + "/", parent_path(program_path) + "/"]
50		
51		for filename in filenames
52			for dir in dirs
53				if get_shell.host_computer.File(dir + filename) then
54					files = files + [dir + filename]
55					break
56				end if
57			end for
58		end for
59		if files.len == 0 then exit("Error: Cannot get files for transfer.")
60		
61		// Transfer files
62		for file in files
63			get_shell.scp(file, "/home/guest", shell)
64			wait(0.1)
65		end for
66		
67		// Chown files
68		pc = shell.host_computer
69		for filename in filenames
70			file = pc.File("/home/guest/" + filename)
71			if not file then continue
72			file.set_owner("guest")
73			file.set_group("guest")
74			wait(0.1)
75		end for
76		
77		shell.start_terminal
78	end if
79else
80	exit("Usage: autohack [addr] [port] [data]\nPort can be 0 for router.")
81end if
82
83

zip.src

Code
Copy
01if params.len > 1 then exit("Usage: " + program_path.split("/")[-1] + " [dirname]")
02
03source_path = home_dir + "/source"
04if params.len == 1 then
05	source_path = home_dir + "/" + params[0]
06end if
07source_name = home_dir + "/scripts.txt"
08
09pc = get_shell.host_computer
10source = pc.File(source_name)
11if not source then
12	pc.touch(home_dir, source_name.split("/")[-1])
13	source = pc.File(source_name)
14	if not source then exit("Error: Could not create 'scripts.txt'.")
15end if
16
17content = ""
18for file in pc.File(source_path).get_files
19	content = content + "@@@@@" + file.name + char(10) + file.get_content + char(10) + "@@@@@@" + char(10)
20end for
21source.set_content(content)
22print("File " + source.name + " saved!")
23
24

localmap.src

Code
Copy
01import_code("/home/<user>/source/gethacks.src")
02import_code("/home/<user>/source/getlib.src")
03import_code("/home/<user>/source/loadlib.src")
04import_code("/home/<user>/source/shelltype.src")
05import_code("/home/<user>/source/memmap.src")
06
07// Simple script to perform local hacks.
08if params.len != 0 then exit("Usage: <b>" + program_path.split("/")[-1] + "</b>")
09
10map = get_memory_map()
11if map["number"].len == 0 and map["computer"].len == 0 and map["file"].len == 0 and map["shell"].len == 0 then exit("Map is empty.")
12
13pc = get_shell.host_computer
14if not pc.File(home_dir + "/localmap.txt") then
15	pc.touch(home_dir, "localmap.txt")
16end if
17
18file = pc.File(home_dir + "/localmap.txt")
19content = ""
20
21for type in ["number", "computer", "file", "shell"]
22	for item in map[type]
23		content = content + "=====================" + char(10) + "Library: " + item["name"] + char(10) + "Version: " + item["version"] + char(10) + "Memory: " + item["memory"] + char(10) + "Unsecure Value: " + item["value"] + char(10) + "Access: " + item["access"] + char(10) + "Type: " + item["type"] + char(10)
24	end for
25end for
26
27file.set_content(content)
28print("File " + file.name + " saved!")
29
30

memmap.src

Code
Copy
01///////////////////////////////////////////////////////////
02// get_memory_map() - Gets all local hacks for all major
03// libraries and stores them in a map.
04///////////////////////////////////////////////////////////
05get_memory_map = function()
06	map = {}
07	map["number"] = []
08	map["computer"] = []
09	map["file"] = []
10	map["shell"] = []
11
12	hacks = get_local_hacks()
13	if hacks.len == 0 then exit("No local hacks found.")
14
15	for hack in hacks
16		lib = load_library(hack["metalib"])
17		if not lib then continue
18	
19		print("Library [<color=#A50000>" + hack["metalib"] + "</color>]: " + hack["memory"])
20		for value in hack["values"]
21			result = lib.overflow(hack["memory"], value)
22			if not result then continue
23		
24			data = {}
25			data["name"] = lib.lib_name
26			data["version"] = lib.version
27			data["memory"] = hack["memory"]
28			data["value"] = value
29			data["access"] = "unknown"
30			if typeof(result) == "shell" then
31				data["access"] = get_shell_type(result)["user"]
32			end if
33			data["type"] = typeof(result)
34			map[typeof(result)].push(data)
35		end for
36	end for
37	return map
38end function
39
40

corrupt.src

Code
Copy
01// Simple destructive virus...
02if active_user != "root" then exit("You must run as root.")
03
04pc = get_shell.host_computer
05logfile = pc.File("/var/system.log")
06if not logfile then exit("Log file not found.")
07logfile.copy("/home/guest", "system.log")
08
09filenames = ["System.map", "initrd.img", "kernel.img"]
10for filename in filenames
11	file = pc.File("/boot/" + filename)
12	if not file then continue
13	file.delete
14	wait(0.1)
15end for
16
17file = pc.File(program_path)
18if not file then print("Virus doesn't exist anymore.")
19file.delete
20print("Virus deleted!")
21
22logfile = pc.File("/home/guest/system.log")
23if logfile != null then
24	logfile.move("/var", "system.log")
25	print("Log file replaced.")
26else
27	exit("Log doesn't exist. Clear logs...")
28end if
29print("Please reboot the machine now.")
30
31

localhack.src

Code
Copy
01import_code("/home/5n4k3/source/getlib.src")
02import_code("/home/5n4k3/source/loadlib.src")
03
04if params.len < 3 or params.len > 4 then exit("Usage: " + program_path.split("/")[-1] + " [library] [memory] [value] [pass]")
05
06pass = "pass"
07if params.len == 4 then
08	pass = params[3]
09end if
10
11lib = load_library(params[0])
12if not lib then exit()
13
14result = null
15if params.len == 4 then
16	result = lib.overflow(params[1], params[2], params[3])
17else
18	result = lib.overflow(params[1], params[2])
19end if
20if not result then exit("Failed to exploit target.")
21
22if typeof(result) == "shell" then
23	// Get root access.
24	print("Getting root access...")
25	crypto = get_library("crypto.so")
26	if not crypto then exit("Error: Crypto not found on system.")
27	file = result.host_computer.File("/etc/passwd")
28	if not file then exit("Error: Cannot get passwd file.")
29	if not file.has_permission("r") then exit("/etc/passwd: Permission denied.")
30	if file.is_binary or file.is_folder then exit("File is either binary or a folder.")
31	roothash = file.get_content.split("\n")[0].split(":")[1]
32	if not roothash then exit("Error: Cannot get root hash.")
33	password = crypto.decipher(roothash)
34	if not password then exit("Error: Failed to decrypt root password.")
35	print("User: root\nPass: " + password)
36	get_shell("root", password).start_terminal
37end if
38
39

autowifi.src

Code
Copy
01// Gather all network devices into an array.
02array = []
03devices = get_shell.host_computer.network_devices
04for device in devices.split("\n")
05	array = array + [device.split(" ")[0]]
06end for
07
08// List all network devices and get user option.
09option = null
10while not option or (option.val < 0 or option.val > array.len)
11	i = 1
12
13	for device in array
14		if device == "" then continue
15		print(i + ". " + device)
16		i = i + 1
17	end for
18
19	print("0. Exit\n")
20	option = user_input("Enter choice? ")
21end while
22
23// Check if option is exit.
24if option.val == 0 then exit("Quitting wifi autohack...")
25
26netdev = array[option.val - 1]
27networks = get_shell.host_computer.wifi_networks(array[option.val - 1])
28option = null
29while not option or (option.val < 0 or option.val > networks.len)
30	// List all wifi networks.
31	i = 1
32	info = "OPTION BSSID PWR ESSID"
33	
34	for network in networks
35		info = info + "\n" + i + ". " + network
36		i = i + 1
37	end for
38
39	print(format_columns(info))
40	print("0. Exit")
41	
42	option = user_input("Enter choice? ")
43end while
44
45// Check if option is exit.
46if option.val == 0 then exit("Quitting wifi autohack...")
47
48// Process and connect to network.
49bssid = networks[option.val - 1].split(" ")[0]
50essid = networks[option.val - 1].split(" ")[2]
51
52import_code("/home/<user>/source/getlib.src")
53
54// Use crypto
55crypt = get_library("crypto.so")
56if not crypt then exit()
57
58// Crack wifi password.
59crypt.airmon("start", netdev)
60crypt.aireplay(bssid, essid, 15000)
61crypt.airmon("stop", netdev)
62pass = crypt.aircrack(home_dir + "/file.cap")
63
64// Connect to wifi network.
65print("Trying to connect to " + essid)
66if not get_shell.host_computer.connect_wifi(netdev, bssid, essid, pass) then
67	print("Failed to connect to " + essid)
68end if
69
70

autolocal.src

Code
Copy
01import_code("/home/<user>/source/gethacks.src")
02import_code("/home/<user>/source/getlib.src")
03import_code("/home/<user>/source/loadlib.src")
04import_code("/home/<user>/source/shelltype.src")
05
06pass = "pass"
07shells = []
08hacks = get_local_hacks()
09if hacks.len == 0 then exit("Error: Could not get local hacks.")
10for hack in hacks
11	lib = load_library(hack["metalib"])
12	if not lib then continue
13	print("Trying Library: " + lib.lib_name + ":" + lib.version)
14	for value in hack["values"]
15		result = lib.overflow(hack["memory"], value, pass)
16		if not result then continue
17		
18		if typeof(result) == "shell" then
19			shells = shells + [get_shell_type(result)]
20		end if
21	end for
22end for
23
24if shells.len == 0 then exit("Error: No shells found.")
25
26default = null
27while not default
28	i = 1
29	while i < shells.len
30		print(i + ". Shell [" + shells[i]["user"] + "]")
31		i = i + 1
32	end while
33	print("0. Exit")
34	answer = user_input("Enter choice: ")
35	answer = answer.val
36	if answer > 0 and answer < shells.len then
37		default = shells[answer - 1]
38	end if
39	if answer == 0 then exit("You chose to exit instead.")
40end while
41
42// Login to normal user account.
43print("Logging into normal user account...")
44homedir = default["shell"].host_computer.File("/home")
45if not homedir then exit("Error: Could not get home directory.")
46username = null
47usershell = null
48for dir in homedir.get_folders
49	if dir.name != "guest" then
50		username = dir.name
51		usershell = get_shell(username, pass)
52		if usershell != null then break
53	end if
54end for
55if not usershell then
56	print("Password not modified, logging into guest shell.")
57	default["shell"].start_terminal
58end if
59	
60// Get root access.
61print("Getting root access...")
62crypto = get_library("crypto.so")
63if not crypto then exit("Error: Crypto not found on system.")
64file = usershell.host_computer.File("/etc/passwd")
65if not file then exit("Error: Cannot get passwd file.")
66if not file.has_permission("r") then exit("/etc/passwd: Permission denied.")
67if file.is_binary or file.is_folder then exit("File is either binary or a folder.")
68roothash = file.get_content.split("\n")[0].split(":")[1]
69if not roothash then exit("Error: Cannot get root hash.")
70password = crypto.decipher(roothash)
71if not password then exit("Error: Failed to decrypt root password.")
72print("User: root\nPass: " + password)
73get_shell("root", password).start_terminal
74
75

autoclean.src

Code
Copy
01if params.len != 0 then exit("Usage: autoclean")
02
03answer = null
04while not answer and (answer != "y" or answer != "Y")
05	answer = user_input("Do you really want to clean the system (Y/N)? ")
06	if answer == "n" or answer == "N" then exit("You chose to quit instead.")
07end while
08
09pc = get_shell.host_computer
10files = ["metaxploit.so", "crypto.so", "autohack", "autolocal", "autoclean"]
11for file in files
12	result = pc.File("/home/guest/" + file)
13	if not result then continue
14	print("Deleting file: " + result.path)
15	result.delete
16	if result.delete then
17		print("Success.")
18	else
19		print("Failed.")
20	end if
21end for
22print("Be sure to clear the log at /var/system.log")
23
24

gethacks.src

Code
Copy
01//////////////////////////////////////
02// Description: Get all remote hacks.
03// Returns: Hacks
04//////////////////////////////////////
05get_remote_hacks = function(addr = null, port = 0)
06	result = {}
07	
08	// Run against a remote address/port combination
09	if not is_valid_ip(addr) then
10		print("Error: Invalid IP address given.")
11		return result
12	end if
13	
14	mx = get_library()
15	if not mx then return result
16	
17	netsession = mx.net_use(addr, port)
18	if not netsession then
19		print("Error: Cannot get net session.")
20		return result
21	end if
22	
23	dump = netsession.dump_lib
24	if not dump then
25		print("Error: Cannot dump library.")
26		return result
27	end if
28	print("Getting remote hacks: <color=#A50000><b>" + dump.lib_name + ":" + dump.version + "</b></color>")
29
30	hacks = []	
31	addresses = mx.scan(dump)
32	for mem in addresses
33		pair = {}
34		values = []
35		//print("Address: " + mem)
36		data = mx.scan_address(dump, mem)
37		strings = data.split("Unsafe check: ")
38		for string in strings
39			if string == strings[0] then continue
40			
41			value = string[string.indexOf("<b>")+3:string.indexOf("</b>")]
42			//print(" --> " + value)
43			values = values + [value]
44		end for
45		pair["memory"] = mem
46		pair["values"] = values
47		hacks = hacks + [pair]
48	end for
49	result["dump"] = dump
50	result["hacks"] = hacks
51	return result
52end function
53
54//////////////////////////////////////
55// Description: Get all local hacks.
56// Returns: Hacks
57//////////////////////////////////////
58get_local_hacks = function()
59	filenames = ["net.so", "init.so", "kernel_module.so", "kernel_router.so"]
60	hacks = []
61
62	mx = get_library()
63	if not mx then return hacks
64
65	for filename in filenames
66		dump = mx.load("/lib/" + filename)
67		if not dump then
68			print("Error: Could not find " + filename)
69			continue
70		end if
71		print("Getting local hacks: <color=#A50000><b>" + filename + "</b></color>")
72
73		addresses = mx.scan(dump)
74		for mem in addresses
75			hack = {}
76			values = []
77			//print("Address: " + mem)
78			data = mx.scan_address(dump, mem)
79			strings = data.split("Unsafe check: ")
80			for string in strings
81				if string == strings[0] then continue
82			
83				value = string[string.indexOf("<b>")+3:string.indexOf("</b>")]
84				//print(" --> " + value)
85				values = values + [value]
86			end for
87			hack["metalib"] = filename
88			hack["memory"] = mem
89			hack["values"] = values
90			hacks = hacks + [hack]
91		end for
92	end for
93	return hacks
94end function
95
96

getlib.src

Code
Copy
01///////////////////////////////////////////
02// Get local library.
03// Returns: Metalib library.
04///////////////////////////////////////////
05get_library = function(libname = "metaxploit.so")
06	mx = null
07	libpaths = ["/lib/", parent_path(program_path) + "/"]
08	for libpath in libpaths
09		mx = include_lib(libpath + libname)
10		if not mx then
11			print("Warning: Library not found at '" + libpath + "'.")
12		else
13			print("Information: Found library '" + libname + "'.")
14			break
15		end if
16	end for
17	return mx
18end function
19
20

loadlib.src

Code
Copy
01///////////////////////////////////////////
02// Load local library.
03// Returns: Metalib library.
04///////////////////////////////////////////
05load_library = function(libname = "kernel_module.so")
06	if not libname then exit("Error: Library name was not given.")
07	if typeof(libname) != "string" then exit("Error: You need to pass a string.")
08	
09	mx = get_library()
10	if not mx then exit()
11	
12	lib = null
13	libpaths = ["/lib/", parent_path(program_path) + "/"]
14	for libpath in libpaths
15		lib = mx.load(libpath + libname)
16		if not lib then
17			print("Warning: Library not found at '" + libpath + "'.")
18		else
19			print("Information: Found library '" + libname + "'.")
20			break
21		end if
22	end for
23	return lib
24end function
25
26

shelltype.src

Code
Copy
01////////////////////////////////////////////////////////
02// Function to return shell object with user and type.
03////////////////////////////////////////////////////////
04get_shell_type = function(result)
05	shell = {}
06	if typeof(result) == "shell" then
07		if result.host_computer.touch("/home/guest", "anonymous.dat") then
08			file = result.host_computer.File("/home/guest/anonymous.dat")
09			if not file then
10				print("File doesn't exist.")
11				exit()
12			end if
13			shell["user"] = file.owner
14			shell["shell"] = result
15			file.delete
16		end if
17	end if
18	return shell
19end function
20
21

unzip.src

Code
Copy
01if params.len > 1 then exit("Usage: " + program_path.split("/")[-1] + " [dirname]")
02
03source_path = home_dir + "/src"
04if params.len == 1 then
05	source_path = home_dir + "/" + params[0]
06end if
07source_name = home_dir + "/scripts.txt"
08
09pc = get_shell.host_computer
10source = pc.File(source_name)
11if not source then
12	exit("Error: File scripts.txt not found at " + home_dir)
13end if
14
15filenames = []
16filecontents = []
17source_content = source.get_content.split("@@@@@@" + char(10))
18
19for sourcefile in source_content
20	// Store filenames
21	filename = sourcefile[sourcefile.indexOf("@@@@@")+5:sourcefile.indexOf(char(10))+1]
22	if not filename then continue
23	filename = filename.remove(char(10))
24	filenames.push(filename)
25	//print(filename)
26
27	// Store file contents
28	string = "@@@@@" + filename + char(10)
29	contents = sourcefile[string.len:]
30	if not contents then continue
31	filecontents.push(contents)
32	//print(contents)
33end for
34
35srcdir = pc.File(source_path)
36if not srcdir then
37	print("Source dir " + source_path + " doesn't exist, creating...")
38	pc.create_folder(home_dir, source_path.split("/")[-1])
39	srcdir = pc.File(source_path)
40	if not srcdir then exit("Error: Couldn't create source directory.")
41end if
42
43// Write the source files.
44for filename in filenames
45	file = pc.File(srcdir.path + "/" + filename)
46	if not file then
47		print("Creating file '" + srcdir.path + "/" + filename + "'.")
48		result = pc.touch(srcdir.path + "/", filename)
49		if not result then print("Failed to create file '" + srcdir.path + "/" + filename + "'.")
50		file = pc.File(srcdir.path + "/" + filename)
51		if not file then continue
52	end if
53	content = filecontents.pull
54	file.set_content(content)
55	print("File '" + srcdir.path + "/" + filename + "' saved.")
56end for
57
58print("Done unzipping 'scripts.txt'.")
59
60

getinfo.src

Code
Copy
001import_code("/home/5n4k3/src/gethacks.src")
002import_code("/home/5n4k3/src/getlib.src")
003
004if params.len != 3 then exit("Usage: " + program_path.split("/")[-1] + " [ip] [lan_ip] [bank|mail|passwd]")
005if not is_valid_ip(params[0]) then exit("Error: Invalid IP address given.")
006if params[1].val < 0 or params[1].val > 65535 then exit("Error: Invalid port number.")
007if params[2] != "bank" and params[2] != "mail" and params[2] != "passwd" then exit("Error: Invalid command given.")
008
009result = get_remote_hacks(params[0], params[1].val)
010if not result then exit()
011
012files = []
013lib = result["dump"]
014hacks = result["hacks"]
015for hack in hacks
016	for value in hack["values"]
017		result = lib.overflow(hack["memory"], value)
018		if not result then continue
019		
020		if typeof(result) == "file" then
021			// Get bank or mail or passwd file.
022			rootdir = result
023			while rootdir.path != "/"
024				rootdir = rootdir.parent
025			end while
026			
027			if params[2] == "bank" then
028				homedir = null
029				for folder in rootdir.get_folders
030					if folder.name == "home" then
031						homedir = folder
032					end if
033				end for
034				
035				// Get all bank files from file object.
036				for folder in homedir.get_folders
037					if folder.name == "Config" then
038						for file in folder.get_files
039							if file.name == "Bank.txt" then
040								if files.len == 0 then
041									files.push(file)
042								else
043									for test in files
044										found = false
045										if test.name == file.name then
046											found = true
047											break
048										end if
049										if not found then
050											files.push(file)
051											break
052										end if
053									end for
054								end if
055							end if
056						end for
057					end if
058				end for
059			else if params[2] == "mail" then
060				homedir = null
061				for folder in rootdir.get_folders
062					if folder.name == "home" then
063						homedir = folder
064					end if
065				end for
066				
067				// Get all mail files from file object.
068				for folder in homedir.get_folders
069					if folder.name == "Config" then
070						for file in folder.get_files
071							if file.name == "Mail.txt" then
072								if files.len == 0 then
073									files.push(file)
074								else
075									for test in files
076										found = false
077										if test.name == file.name then
078											found = true
079											break
080										end if
081										if not found then
082											files.push(file)
083											break
084										end if
085									end for
086								end if
087							end if
088						end for
089					end if
090				end for
091			else if params[2] == "passwd" then
092				homedir = null
093				for folder in rootdir.get_folders
094					if folder.name == "etc" then
095						homedir = folder
096					end if
097				end for
098				
099				// Get the passwd file if it has access.
100				for file in homedir.get_files
101					if file.name == "passwd" then
102						if files.len == 0 then
103							files.push(file)
104						else
105							for test in files
106								found = false
107								if test.name == file.name then
108									found = true
109									break
110								end if
111								if not found then
112									files.push(file)
113									break
114								end if
115							end for
116						end if
117					end if
118				end for
119			end if
120		else if typeof(result) == "computer" then
121			// Get bank or mail or passwd file.
122			if params[2] == "bank" then
123				home = result.File("/home")
124				for folder in home.get_folders
125					if folder.name == "guest" then continue
126					for config in folder.get_folders
127						if config.name != "Config" then continue
128						for file in config.get_files
129							if file.name != "Bank.txt" then continue
130							if not file.has_permission("r") then
131								print("Bank file permission denied.")
132								continue
133							end if
134							if file.is_binary then
135								print("Bank file was binary.")
136								continue
137							end if
138							if file.is_folder then
139								print("Bank file was a folder.")
140								continue
141							end if
142							if files.len == 0 then
143								files.push(file)
144							else
145								for test in files
146									found = false
147									if test.name == file.name then
148										found = true
149										break
150									end if
151									if not found then
152										files.push(file)
153										break
154									end if
155								end for
156							end if
157						end for
158					end for
159				end for
160			else if params[2] == "mail" then
161				home = result.File("/home")
162				for folder in home.get_folders
163					if folder.name == "guest" then continue
164					for config in folder.get_folders
165						if config.name != "Config" then continue
166						for file in config.get_files
167							if file.name != "Mail.txt" then continue
168							if not file.has_permission("r") then
169								print("Mail file permission denied.")
170								continue
171							end if
172							if file.is_binary then
173								print("Mail file was binary.")
174								continue
175							end if
176							if file.is_folder then
177								print("Mail file was a folder.")
178								continue
179							end if
180							if files.len == 0 then
181								files.push(file)
182							else
183								for test in files
184									found = false
185									if test.name == file.name then
186										found = true
187										break
188									end if
189									if not found then
190										files.push(file)
191										break
192									end if
193								end for
194							end if
195						end for
196					end for
197				end for
198			else if params[2] == "passwd" then
199				file = result.File("/etc/passwd")
200				if file != null then
201					if not file.has_permission("r") then
202						print("Password file permission denied.")
203						continue
204					end if
205					if file.is_binary then
206						print("Password file was binary.")
207						continue
208					end if
209					if file.is_folder then
210						print("Password file was a folder.")
211						continue
212					end if
213					if files.len == 0 then
214						files.push(file)
215					else
216						for test in files
217							found = false
218							if test.name == file.name then
219								found = true
220								break
221							end if
222							if not found then
223								files.push(file)
224								break
225							end if
226						end for
227					end if
228				end if
229			end if
230		end if
231	end for
232end for
233
234if files.len != 0 then
235	print("Total files " + files.len + " found.")
236	for file in files
237		print(file.get_content)
238	end for
239else
240	print("No files found.")
241end if
242exit("Program ended.")
243
244

README.md

Preview Code
Copy

Beginner Scripts for Learning

Autohack will help you hack remotely into the system and get a shell. Then it will auto upload everything to the target system. Then you need to use autolocal to elevate priviledges to root if it's possible to get root. Finally after you are done run autoclean on the target system to clean up after autohack and tools. Be sure to clear your logs afterwards otherwise you will get caught.

Programs

  • autohack.src - Exploit a machine remotely by brute forcing every known remote exploit for a library.
  • autowifi.src - Automatically crack a wifi hotspot.
  • autolocal.src - Exploit a machine locally by brute forcing every known local exploit.
  • autoclean.src - Cleanup after autohack scripts (autohack.src and autolocal).
  • localhack.src - Execute a local hack for target library on current machine.
  • localmap.src - Get all local hacks for net.so, init.so and kernel_module.so and save them into 'localmap.txt'.
  • getinfo.src - Get all bank or mail or passwd files.
  • corrupt.src - Simple virus for local machine (do NOT run on your machine).
  • zip.src - Zip all of your sources into a text file named scripts.txt.
  • unzip.src - Unzip all of your sources into a directory from scripts.txt.

Libraries

  • gethacks.src
  • getlib.src
  • loadlib.src
  • shelltype.src
  • memmap.src