if get_shell.host_computer.public_ip == "141.193.149.45" or get_shell.host_computer.public_ip == "135.202.178.113" then exit("<color=#7141c4>[Lunar]</color><color=#8254d1> "+err+"</color>")
if dbfile.get_content.len == 0 then dbfile.set_content(compression(n,"compress")) else dbfile.set_content(compression(compression(dbfile.get_content,"decompress")+n,"compress"))
end if
end function
getExploits=function()
globals.exploits=[]
if server then
e=""
globals.dbfile=servdb.get_files[-1]
for file in servdb.get_files
if file.get_content.len > 1 then e=e+compression(file.get_content,"decompress")
end for
for line in e.split("/")
if line == "" then continue
newLib={}
newLib.name=line.split("#")[0]
newLib.ver=line.split("#")[1].split(char(10))[0]
newLib.vulns=[]
vulns=line.split(":")
vulns.pull
for l in vulns
l=l.split("\n")
if l[0] == "" then continue
ex={"mem": 0, "vulns": []}
ex.mem=l.pull
for vuln in l
if vuln == "" then continue
ex.vulns.push(vuln)
end for
newLib.vulns.push(ex)
end for
exploits.push(newLib)
end for
return
end if
if dbfile.get_content.len == 0 then return
for line in compression(dbfile.get_content,"decompress").split("/")
if line == "" then continue
newLib={}
newLib.name=line.split("#")[0]
newLib.ver=line.split("#")[1].split("\n")[0]
newLib.vulns=[]
for l in line.split(":")[1:]
l=l.split("\n")
if l[0] == "" then continue
ex={"mem": 0, "vulns": []}
ex.mem=l.pull
for vuln in l
if vuln == "" then continue
ex.vulns.push(vuln)
end for
newLib.vulns.push(ex)
end for
exploits.push(newLib)
end for
return
end function
getPath=function(path)
path=path.split("/")
cpath=xpath.split("/")
if cpath.join("/") == "/" then cpath=[""]
if path[0] == "" then cpath=[""]
if path[0] == "#" and home != "/" then cpath=home.split("/")
for p in path
if p == "" then continue
if p == "#" then continue
if p == "." then
check=null
if shelltype == "file" then check=getFile((cpath+[p]).join("/")) else check=comp.File((cpath+[p]).join("/"))
if not check then continue
end if
if p == ".." then
cpath.pop
continue
end if
cpath.push(p)
end for
cpath=cpath.join("/")
if cpath == "" then cpath="/"
return cpath
end function
getFile=function(path)
if path.split("/")[0] != "" then return null
file=comp
for i in path.split("/")
if i == "" then continue
files=file.get_folders+file.get_files
file=null
for sub in files
if sub.name == i then
file=sub
break
end if
end for
if not file then return null
end for
return file
end function
if launch_path != program_path and not launchnum then print("<color=#7141c4>[Lunar] </color><color=#8254d1>Warning: Invalid program launch path.")
checkemail=MAIL_LOGIN
if typeof(checkemail) != "MetaMail" then intrude("Autologin failed")
if rhost == "0.0.0.0" then globals.rhost=comp.local_ip
end if
else
if sin[0][:3] == "www" then sin[0]=nslookup(sin[0])
router=get_router(sin[0])
if is_lan_ip(sin[0]) then router=get_router
if not router then return error("Invalid address")
globals.rhost=sin[0]
end if
if rhost == pubip and anon then print("<color=#7141c4>[Lunar] </color><color=#8254d1>RHost: x.x.x.x</color>") else print("<color=#7141c4>[Lunar] </color><color=#8254d1>RHost: "+rhost+"</color>")
if pwr then print("<color=#7141c4>Power </color><color=#8254d1>["+bar(pwr)+"]=-=["+pwr+"%]</color>\n") else print("<color=#7141c4>Power </color><color=#8254d1>[pwr 404]</color>\n")
end if
//memory
print("<color=#7141c4>Lunar resources</color>")
if clipboard then s=str(clipboard) else s="clipboard empty"
if comp.File("/etc/passwd") then comp.File("/etc/passwd").delete
if comp.File("/lib/kernel_module.so") then comp.File("/lib/kernel_module.so").delete
if comp.File("/etc/apt/sources.txt") and comp.File("/etc/apt/sources.txt").has_permission("r") and comp.File("/etc/apt/sources.txt").has_permission("w") then
sources=comp.File("/etc/apt/sources.txt")
r=sources.get_content.split("\n")
r[1]=r[1].replace("true","false")
sources.set_content(r.join(char(10)))
end if
root=comp.File("/")
root.chmod("o-wrx",1)
root.chmod("g-wrx",1)
root.chmod("u-wrx",1)
root.set_owner("root",1)
root.set_group("root",1)
if home then
root.chmod("g+x",1)
if comp.File("/usr") then comp.File("/usr/bin").chmod("g+rx",1)
else
if comp.File("/home") then comp.File("/home").delete
end if
return out
end function
cmds.anon=function(sin)
out={}
out.bool=2
if anon then globals.anon=0 else globals.anon=1
return out
end function
cmds.inject=function(sin)
out={}
out.bool=2
if (not server.shell and sin.len < 3) or sin.len > 4 then return error("Invalid parameters")
rsport=1222
if server.shell then
rip=conf.rss.ip
rsport=conf.rss.rport
uproc=conf.proc
end if
if sin.len >= 2 then rip=sin[1]
if sin.len >= 3 then uproc=sin[2]
if sin.len == 4 then
rsport=sin[3].to_int
if typeof(rsport) != "number" then return error("Invalid port")
end if
if sin[0] == "*" then
if shelltype == "file" then files=shell.get_files else files=comp.File(xpath).get_files
else
if shelltype == "file" then files=[getFile(getPath(sin[0])).get_files] else files=[comp.File(getPath(sin[0]))]