-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrloot.src
More file actions
140 lines (132 loc) · 6.27 KB
/
Copy pathrloot.src
File metadata and controls
140 lines (132 loc) · 6.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//--
//-- $$$$$$$$\ $$\
//-- \____$$ | $$ |
//-- $$ / $$$$$$\ $$ | $$$$$$\ $$\ $$\ $$\
//-- $$ / $$ __$$\ $$ |$$ __$$\ $$ | $$ | $$ |
//-- $$ / $$$$$$$$ |$$ |$$ / $$ |$$ | $$ | $$ |
//-- $$ / $$ ____|$$ |$$ | $$ |$$ | $$ | $$ |
//-- $$$$$$$$\\$$$$$$$\ $$ |\$$$$$$ |\$$$$$\$$$$ |
//-- \________|\_______|\__| \______/ \_____\____/
//--
//-- for exploiting router will all Computer exploits known
//-- on all lan ips and print/log all passwords/accounts found.
//-- allows optional paramater for IP to perform rloot on a
//-- targeted IP address, if left blanks loops random IPs.
if params.len > 1 or (params.len == 1 and params[0] == "-h") then exit("<b>" + "Usage: " + program_path.split("/")[-1] + " [?ipAddress] </b>")
if params.len > 0 and not is_valid_ip(params[0]) then exit("<b>" + "Usage: " + program_path.split("/")[-1] + " [?ipAddress] </b>")
mypc = get_shell.host_computer
met = include_lib("/lib/metaxploit.so")
if not met then
met = include_lib(current_path + "/metaxploit.so")
end if
if not met then exit("Error: Can't find metaxploit library in the /lib path or the current folder")
//--import password database code
import_code("/home/Zelow/pwdb.src")
//--create folders if needed
mypc.create_folder(home_dir, "exploitBank")
mypc.create_folder(home_dir + "exploitBank", "Computer")
//--create files if needed
touched = mypc.touch(home_dir + "/exploitBank/Computer", "router.txt")
//--file locating
exploits = mypc.File(home_dir + "/exploitBank/Computer/router.txt")
//--if file needed to be touched add headliner
if typeof(touched) == "number" then exploits.set_content("memaddress exploitvalue //libversion Computerlevelgained and -addtional info/req")
string.color = function(code)
return "<color=""" + code + """>" + self + "</color>"
end function //--"Hello World".color("red")
genip = function()
while 1
ip = [ceil(rnd * 255), ceil(rnd * 255) ,ceil(rnd * 255), ceil(rnd * 255)].join(".")
if is_lan_ip(ip) then continue
if not is_valid_ip(ip) then continue
return ip
end while
end function
x = function(ip)
router = get_router(ip)
if router == null then return //--exit("scanrouter: ip address not found")
ipAddress = router.public_ip()
net_session = met.net_use(ipAddress)
if not net_session then return //--exit("Error: can't connect to net session")
metaLib = net_session.dump_lib
for device in router.devices_lan_ip()
result = 0
exqty = 0
if exploits.get_content.split(char(10)).len > 1 then exqty = exploits.get_content.split(char(10)).len - 1
if exqty < 2 then
exit("Terminating, no exploits found in ".color("red") + exploits.path.color("yellow"))
return //--if no exploits are found halt
end if
print((exqty + "").color("white") + " exploits found...".color("purple"))
for line in exploits.get_content.split(char(10)) //--find exploit to get Computer access
if result then break //--break loop when we get a result
if line.split(" ")[0][:2] != "0x" then continue //--check for memory address
result = metaLib.overflow(line.split(" ")[0], line.split(" ")[1], device)
end for
if not result then //--if still no result after looping all exploits halt
print(ip.color("white") + ": " + "failed".color("red") + " to loot".color("purple"))
return
end if
loot = function(com) //--once exploit has us in, get what we can.
process = function(fileName, cluster) //--fileName of the file we want and cluster to save the info in
print("Checking ".color("lightblue") + fileName.color("white") + " file...".color("purple"))
if not com.File("/home/").has_permission("r") then print("No /home read permission.".color("red"))
for folder in com.File("/home/").get_folders()
for file in com.File(folder.path + "/Config").get_files()
if file.name == fileName then //--find folder we want
if not file.has_permission("r") then //--permission check
print("DENIED: ".color("red") + file.path.color("yellow") + " No read permission.".color("red"))
else
for line in file.get_content.split(char(10))
if not lineCheck(line, cluster) then //--check if we already have this information logged
print(line.color("white") + " -Added to ".color("purple") + cluster.path.color("yellow"))
addData(line, cluster) //--log loot to cluster
else //--report when file is already in log
print("SKIPPED: ".color("orange") + line.split(":")[0].color("white") + " acount exists in ".color("purple") + cluster.path.color("yellow") + " log.".color("purple"))
end if
end for
end if
end if
end for
end for
end function
process("Bank.txt", Bank) //--process getting bank files
process("Mail.txt", Mail) //--process getting mail files
pfound = false
print("Checking ".color("lightblue") + "passwd".color("white") + " file...".color("purple"))
for file in com.File("/etc/").get_files()
if file.name == "passwd" then //--finally go for machine passwords root and other users
pfound = true //--flag value true if we find the passwd file
if not file.has_permission("r") then //--permission check
print("DENIED: ".color("red") + file.path.color("yellow") + " read permissions.".color("red"))
break
else
if not lineCheck("IP " + ip, pswd) then
print(file.path.color("white") + " was found.".color("purple"))
addData("IP " + ip, pswd)
print("IP ".color("purple") + (ip + "").color("white"))
for line in file.get_content.split(char(10))
if line == "" then continue //--skip if empty
print(line.color("white"))
addData(line, pswd)
end for
print("Was added to ".color("purple") + pswd.path.color("yellow")) //--print and log loot to pswd
pswd.set_content(pswd.get_content + char(10) + "IP " + ip + char(10) + file.get_content)
else
print("SKIPPED: ".color("orange") + ip.color("white") + ":" + " was found in ".color("purple") + pswd.path.color("yellow") + " log.".color("purple"))
end if
end if
end if
end for
if not pfound then print("NOTICE: ".color("blue") + pswd.name.color("white") + " was not found.".color("red"))
end function
loot(result)
end for
end function
if params.len > 0 then
x(params[0])
else
while 1
x(genip())
end while
end if