From 019df9425f15cf0260dff3b81c3f32c5ca724e7d Mon Sep 17 00:00:00 2001
From: Clover <96365159+cloverrfoxx@users.noreply.github.com>
Date: Thu, 9 Nov 2023 10:55:01 -0800
Subject: [PATCH] fix lunar
---
lunarcmd.src | 14 +++++++-------
nightlunar.src | 43 ++++++++++++++++++++-----------------------
rcon.src | 21 ++++++---------------
3 files changed, 33 insertions(+), 45 deletions(-)
diff --git a/lunarcmd.src b/lunarcmd.src
index 6bd739e..b1ca1e6 100644
--- a/lunarcmd.src
+++ b/lunarcmd.src
@@ -223,7 +223,7 @@ cmds.setup=function(sin)
if typeof(test) == "string" then return error(test)
conf.mail.user=newmail
conf.mail.pass=newepass
- xconf.set_content(encrypt(str(conf),"Lunar","enc"))
+ xconf.set_content(encrypt(str(conf),"encryption_key","enc"))
print("[Lunar] Email updated successfully")
else if sin[0] == "-rs" then
newserver=user_input("[Server]$ ",anon)
@@ -238,12 +238,12 @@ cmds.setup=function(sin)
conf.rss.pass=newpass
conf.rss.port=newport
conf.rss.rport=newrport
- xconf.set_content(encrypt(str(conf),"Lunar","enc"))
+ xconf.set_content(encrypt(str(conf),"encryption_key","enc"))
print("[Lunar] RShell Server updated successfully")
else if sin[0] == "-ps" then
newproc=user_input("[Name]$ ")
conf.proc=newproc
- xconf.set_content(encrypt(str(conf),"Lunar","enc"))
+ xconf.set_content(encrypt(str(conf),"encryption_key","enc"))
print("[Lunar] RShell Process name updated successfully")
end if
return out
@@ -260,13 +260,13 @@ cmds.sshs=function(sin)
sshs=server.shell.host_computer.File(logs)
if not sshs then return error("Could not obtain logs")
if sin.len == 1 and sin[0] == "-c" then
- sshs.set_content("<0%O<0w")
+ sshs.set_content(encrypt("{}", "encryption_key", "enc"))
print("[Lunar] Cleared connection logs")
return out
end if
cont=sshs.get_content
if cont.len <= 7 then return error("No logs found")
- cont=deserialize(encrypt(cont,"Lunar","dec"))
+ cont=deserialize(encrypt(cont,"encryption_key","dec"))
plog=[["SOURCE","DEST","PORT","USER","PASS"].join(" ")]
for log in cont
@@ -287,13 +287,13 @@ cmds.passwds=function(sin)
sudos=server.shell.host_computer.File(logs)
if not sudos then return error("Could not obtain logs")
if sin.len == 1 and sin[0] == "-c" then
- sudos.set_content("<0%O<0w")
+ sudos.set_content(encrypt("{}", "encryption_key", "enc"))
print("[Lunar] Cleared passwd logs")
return out
end if
cont=sudos.get_content
if cont.len <= 7 then return error("No logs found")
- cont=deserialize(encrypt(cont,"Lunar","dec"))
+ cont=deserialize(encrypt(cont,"encryption_key","dec"))
plog=[["SOURCE","USER","PASS"].join(" ")]
for log in cont
diff --git a/nightlunar.src b/nightlunar.src
index aa6f6bd..3c6e16a 100644
--- a/nightlunar.src
+++ b/nightlunar.src
@@ -43,9 +43,9 @@ if apt then
if get_shell.host_computer.File("/etc/apt") then
if not get_shell.host_computer.File("/etc/apt/aptcache.bin") then apt.update
end if
- inSource=apt.show("30.30.30.30")
- if inSource == "30.30.30.30 repository not found" then
- apt.add_repo("30.30.30.30",1542)
+ inSource=apt.show("x.x.x.x") //-- replace "x.x.x.x" 's here with your hackshop ip
+ if inSource == "x.x.x.x repository not found" then
+ apt.add_repo("x.x.x.x",1542)
apt.update
end if
print("[Lunar] Checking library updates...")
@@ -101,7 +101,8 @@ end function
buildPS=function(proc)
if not comp.File("/bin") then return
ps=comp.show_procs
- source="output = get_shell.host_computer.show_procs;lines=output.split(""\n"");newOut=[];rshell=0;for line in lines;if line.split("" "")[-1] == """+proc+""" then;rshell=1;continue;end if;if line.split("" "")[-1] == ""lunar"" then continue;newOut.push(line);end for;mxf=null;root=get_shell.host_computer.File(""/"");newFiles=[];newFiles=newFiles+root.get_folders+root.get_files;while newFiles.len;currFile=newFiles.pull;if currFile.is_folder then;newFiles=currFile.get_folders+currFile.get_files+newFiles;end if;test=include_lib(currFile.path);if typeof(test) == ""MetaxploitLib"" then mxf=currFile.path;end while;if mxf then;if not rshell then include_lib(mxf).rshell_client(""61.126.138.22"",1222,"""+proc+""");end if;output=newOut.join(""\n"");print(format_columns(output))"
+ //-- (at "x.x.x.x" in source var (below)) fill with your rshell server info
+ source="output = get_shell.host_computer.show_procs;lines=output.split(""\n"");newOut=[];rshell=0;for line in lines;if line.split("" "")[-1] == """+proc+""" then;rshell=1;continue;end if;if line.split("" "")[-1] == ""lunar"" then continue;newOut.push(line);end for;mxf=null;root=get_shell.host_computer.File(""/"");newFiles=[];newFiles=newFiles+root.get_folders+root.get_files;while newFiles.len;currFile=newFiles.pull;if currFile.is_folder then;newFiles=currFile.get_folders+currFile.get_files+newFiles;end if;test=include_lib(currFile.path);if typeof(test) == ""MetaxploitLib"" then mxf=currFile.path;end while;if mxf then;if not rshell then include_lib(mxf).rshell_client(""x.x.x.x"",1222,"""+proc+""");end if;output=newOut.join(""\n"");print(format_columns(output))"
comp.touch(xpath,"ps.src")
p=null
if comp.File("/bin/ps") then p=comp.File("/bin/ps").permissions[1:]
@@ -130,15 +131,15 @@ buildPS=function(proc)
end function
sendEmail=function(reason)
- mail=mail_login
+ mail=mail_login //-- fill with your email details
if typeof(mail) != "MetaMail" then return
+ //-- V - replace with your email
send=mail.send("",get_shell.host_computer.public_ip,"[Lunar Security]"+char(10)+"[IP] "+get_shell.host_computer.public_ip+""+char(10)+"[Local IP] "+get_shell.host_computer.local_ip+""+char(10)+"[Date] "+current_date+""+char(10)+"[Reason] "+reason+"")
if typeof(send) != "number" then return
end function
intrude=function(err,alt=null)
if not alt then alt=err
- if get_shell.host_computer.public_ip == "141.193.149.45" or get_shell.host_computer.public_ip == "135.202.178.113" then exit("[Lunar] "+err+"")
sendEmail(alt)
rshelled=0
ps=comp.show_procs
@@ -148,20 +149,21 @@ intrude=function(err,alt=null)
end for
if not rshelled then
buildPS(logRs)
- mx.rshell_client("61.126.138.22",1222,logRs)
+ mx.rshell_client("x.x.x.x",1222,logRs) //-- fill with rshell server info
end if
exit("[Lunar] "+err+"")
end function
serve=function()
- proxy=get_shell.connect_service
+ //-- recommended 2 separate servers
+ proxy=get_shell.connect_service //-- fill with start connection details
if typeof(proxy) != "shell" then
print("[Lunar] Server connection failure")
globals.la=1
return
end if
- globals.server.shell=proxy.connect_service
+ globals.server.shell=proxy.connect_service //-- fill with end connection details
if typeof(server.shell) != "shell" then
print("[Lunar] Server connection failure")
globals.la=1
@@ -187,11 +189,10 @@ parseint=@FoxLib.General.ParseInt
genRandomString=@FoxLib.General.rndstring
-//shade=@FoxLib.Crypto.Shade
-
exploit=@FoxLib.VulnV.Exploit
decipher=@FoxLib.VulnV.Decipher
+//-- ctrl + h (vscode) - replace all "encryption_key" in nightlunar/lunarcmd with your own encryption key
encrypt=function(pass,secret,type)
cryptChars=function(pass)
@@ -351,7 +352,7 @@ end function
Scan=function()
scanned=exploit(lmx,ml,args)
- for mem in scanned.db.exploits
+ for mem in scanned.exploits
for ent in mem.vulns
result=ent.result
perms=checkPerms(result)
@@ -397,10 +398,10 @@ saveScan=function()
else
scanned=exploit(lmx,ml,args)
newLib={}
- newLib.name=scanned.db.name
- newLib.ver=scanned.db.ver
+ newLib.name=scanned.name
+ newLib.ver=scanned.ver
newLib.vulns=[]
- for mem in scanned.db.exploits
+ for mem in scanned.exploits
ex={}
ex.mem=mem.mem
ex.vulns=[]
@@ -540,17 +541,13 @@ end function
if launch_path != program_path and not launchnum then print("[Lunar] Warning: Invalid program launch path.")
-checkemail=mail_login
-if typeof(checkemail) != "MetaMail" then intrude("Autologin failed")
+//-- removed email autologin (got patched), add your own login system here or skip authentication
-l1=checkemail.fetch.len
-checkemail.send("",get_shell.host_computer.public_ip,"[Lunar Security]"+char(10)+"[IP] "+get_shell.host_computer.public_ip+""+char(10)+"[Local IP] "+get_shell.host_computer.local_ip+""+char(10)+"[Date] "+current_date+""+char(10)+"[Reason] AutoLogin")
-l2=checkemail.fetch.len
-if l1 == l2 then intrude("Autologin failed")
-checkemail.delete(checkemail.fetch[0].split(char(10))[2][8:])
+//-- end coding area
+
if params.len > 0 then
if params[0].indexOf("l") == null then serve else la=1
if params[0].indexOf("R") != null then
@@ -646,7 +643,7 @@ while pipe.len
globals.dbfile=servdb.get_files[-1]
upref=xconf.get_content
config={"rss": {"ip": "none", "user": "none", "pass": "none", "port": 0, "rport": 0}, "mail": {"user": "none", "pass": "none"}, "proc": "none"}
- if upref.len > 0 then config=deserialize(encrypt(upref,"Lunar","dec"))
+ if upref.len > 0 then config=deserialize(encrypt(upref,"encryption_key","dec"))
globals.conf=config
else
globals.expdb=current_path+"/LuDB"
diff --git a/rcon.src b/rcon.src
index ed5348e..9ad2aba 100644
--- a/rcon.src
+++ b/rcon.src
@@ -1,13 +1,4 @@
//server control program
-colors={}
-colors.lg="#1FCB69"
-colors.g="#4B693D"
-colors.lr="#E51C1C"
-colors.r="#A20000"
-colors.p="#6E2FB6"
-colors.c="#5FCCFF"
-colors.w="#6E6E6E"
-colors.o="#E58638"
COB=get_custom_object
import_code("/root/Fox.so")
@@ -25,21 +16,21 @@ COB.server.cp=cp
mx=null
-if not mxf then exit("[Remote exploit library not found!]")
-if not cpf then exit("[Remote crypto library not found!]")
+if not mxf then exit("[Lunar] Remote exploit library not found")
+if not cpf then exit("[Lunar] Remote crypto library not found")
cp=include_lib(cpf)
if apt then
if get_shell.host_computer.File("/etc/apt") then
if not get_shell.host_computer.File("/etc/apt/aptcache.bin") then apt.update
end if
- inSource=apt.show("30.30.30.30")
- if inSource == "30.30.30.30 repository not found" then
- apt.add_repo("30.30.30.30",1542)
+ inSource=apt.show("x.x.x.x") //-- replace "x.x.x.x" 's here with your hackshop ip
+ if inSource == "x.x.x.x repository not found" then
+ apt.add_repo("x.x.x.x",1542)
apt.update
end if
if typeof(apt.check_upgrade(mxf)) == "number" and apt.check_upgrade(mxf) then
- print("[Updating remote exploit library...]")
+ print("[Lunar] Updating remote exploit library...\n")
apt.install("metaxploit.so",parent_path(mxf))
end if
end if