我的一些实用脚本(已更新)

0 点赞
Grey Hack
转载

以下是一些能帮助新手的脚本。包含5个供代码导入的库以及9个用于【黑客行为】(注意:这并非真实黑客行为,仅为游戏内容)的脚本。 程序列表: autohack - 自动入侵远程库,如ssh、sql、http等,并获取shell(注意:autohack会自动上传自身及所需的其他部分文件)。 autolocal - 自动入侵每一个本地库,如net.so、init.so、kernel_router.so或kernel_module.so,以获取shell。 autowifi - 自动入侵《Grey Hack》(这款游戏)中的无线网络。 autoclean - 清理autohack及相关工具留下的痕迹。 localhack - 手动利用本地机器漏洞的程序(需输入可利用的库、内存地址以及不安全数值)。 localmap - 创建包含所有库及其漏洞的完整地图,并将信息存储到文本文件中。zip - 创建压缩的scripts.txt的程序。 unzip - 用于解压由我的zip程序创建的scripts.txt的程序。 getinfo - 用于从远程机器获取银行/邮件/密码信息(通过路由器跳转)。 库: getlib gethacks shelltype loadlib memmap 初学者学习脚本 这里有14个脚本,分为不同部分供你学习。每个脚本都在自己的部分中,其中5个脚本可供包含(使用import_code)以构建其他脚本。我希望我的脚本能像当初一些人帮助我那样帮助你。此外,我的编程背景也帮助我快速学习。在《Grey Hack》中游玩了近300小时后,我决定将这些知识分享给大家。我编写过的所有优质脚本都在那里。

注意:要在《Grey Hack》中使用这些脚本,只需将它们复制粘贴到游戏中,并通过代码编辑器进行构建。 - Phil 自动黑客源码 1.1 版 注意:此脚本可入侵大多数目标并获取访客、用户或管理员权限的 shell。 import_code("/home/<你的用户名>/source/getlib.src") import_code("/home/<你的用户名>/source/gethacks.src") import_code("/home/<你的用户名>/source/shelltype.src") if params.len > 3 then exit("用法:autohack [地址] [端口] [数据] 端口可设为 0 表示无。") if params.len == 2 or params.len == 3 then if not is_valid_ip(params[0]) then exit("错误:无效的 IP 地址。") if (params[1].val < 0 or params[1].val > 65535) then exit("错误:无效的端口号。") if params.len == 3 and typeof(params[2]) != "字符串" 则退出("错误:最后一个参数必须是字符串。") 数据 = "密码" 如果参数长度 == 3 则 数据 = 参数[2] 结束如果 结果 = 空 如果参数长度 == 2 或 参数长度 == 3 则 结果 = 获取远程漏洞(参数[0],参数[1].值) 否则 结果 = 获取远程漏洞(参数[0]) 结束如果 如果非结果则退出() 外壳 = 空 元数据 = 结果["转储"] 漏洞 = 结果["漏洞"] 如果非漏洞 或 漏洞长度 == 0 则退出() 对于 漏洞 中的 单个漏洞 打印("地址:" + 单个漏洞["内存"]) 对于 单个漏洞["值"] 中的 数值 打印(" --> " + 数值) 结果 = 元数据.溢出(单个漏洞["内存"],数值,数据) 如果非结果则继续 如果 类型(结果) == "外壳" 则 // 对外壳类型执行某些操作。 外壳 = 结果 中断 结束如果 结束循环 如果 外壳 != 空 则中断 结束循环 // 对外壳执行某些操作。 如果 外壳 !//////////////////////////////////////////////////////// // 用于返回包含用户和类型的shell对象的函数。 //////////////////////////////////////////////////////// get_shell_type = function(result) shell = {} if typeof(result) == "shell" then if result.host_computer.touch("/home/guest", "anonymous.dat") then file = result.host_computer.File("/home/guest/anonymous.dat") if not file then print("文件不存在。") exit() end if shell["user"] = file.owner shell["shell"] = result file.delete end if end if return shell end function 自动定位版本1.0(本地使用) 注意:这用于本地使用,例如在自动入侵之后。此外,自动入侵会自动将此文件与其自身一起上传。 import_code("/home/<你的用户>/source/gethacks.src") import_code("/home/<你的用户>/source/getlib.src\") import_code(\"/home/&lt;你的用户&gt;/source/loadlib.src\") import_code(\"/home/&lt;你的用户&gt;/source/shelltype.src\") pass = \"密码\" shells = [] hacks = get_local_hacks() if hacks.len == 0 then exit(\"错误:无法获取本地黑客程序。\") for hack in hacks lib = load_library(hack[\"metalib\"]) if not lib then continue print(\"正在尝试库:\" + lib.lib_name + \":\" + lib.version) for value in hack[\"values\"] result = lib.overflow(hack[\"memory\"], value, pass) if not result then continue if typeof(result) == \"shell\" then shells = shells + [get_shell_type(result)] end if end for end for if shells.len == 0 then exit(\"错误:未找到shell。\") default = null while not default i = 1 while i &lt; shells.len print(i + \". Shell [\" + shells[i][\"user\"] + \"]\") i = i + 1 end while print(\"0. ")退出") answer = user_input("输入选择: ") answer = answer.val if answer > 0 and answer < shells.len then default = shells[answer - 1] end if if answer == 0 then exit("你选择了退出。") end while // 登录普通用户账户。 print("正在登录普通用户账户...") homedir = default["shell"].host_computer.File("/home") if not homedir then exit("错误: 无法获取主目录。") username = null usershell = null for dir in homedir.get_folders if dir.name != "guest" then username = dir.name usershell = get_shell(username, pass) if usershell != null then break end if end for if not usershell then print("密码未修改,正在登录访客shell。") default["shell"].start_terminal end if // 获取root权限。 print("正在获取root权限...")crypto = get_library("crypto.so") if not crypto then exit("错误:系统中未找到加密库。") file = usershell.host_computer.File("/etc/passwd") if not file then exit("错误:无法获取密码文件。") if not file.has_permission("r") then exit("/etc/passwd:权限被拒绝。") if file.is_binary or file.is_folder then exit("文件是二进制文件或文件夹。") roothash = file.get_content.split(" n")[0].split(":")[1] if not roothash then exit("错误:无法获取根用户哈希值。") password = crypto.decipher(roothash) if not password then exit("错误:解密根用户密码失败。") print("用户:root n密码:" + password) get_shell("root", password).start_terminal 自动清理版本1.0(清理脚本) 注意:此脚本将在自动黑客程序运行后进行清理,但请务必掩盖你的踪迹并清除日志文件。 如果参数长度不等于0,则退出("用法:autoclean") 答案 = 空 当答案为空且(答案不等于"y"或答案不等于"Y")时 答案 = 用户输入("你确定要清理系统吗(Y/N)?") 如果答案等于"n"或答案等于"N",则退出("你选择了退出。") 结束循环 电脑 = 获取外壳.主机电脑 文件列表 = ["metaxploit.so", "crypto.so", "autohack", "autolocal", "autoclean", "getinfo"] 对于文件列表中的每个文件 结果 = 电脑.文件("/home/guest/" + 文件) 如果结果不存在,则继续 打印("正在删除文件:" + 结果.路径) 结果.删除 如果结果.删除成功 打印("成功。") 否则 打印("失败。") 结束条件 结束循环 打印("请务必清除/var/system目录下的日志。")日志") 加载库版本1.0(用于自动本地化) 注意:这是一个导入库,需使用import_code()函数。此库要求在运行本脚本前先加载getlib.src。 以下是正确导入此库的示例用法。 // 新程序源代码 import_code("/home/your-user/<your-source-directory>/getlib.src") import_code("/home/your-user/<your-source-directory>/loadlib.src") 以下是库代码。 /////////////////////////////////////////// // 加载本地库。 // 返回:元库(Metalib)库。 /////////////////////////////////////////// load_library = function(libname = "kernel_module.so") if not libname then exit("错误:未提供库名称。") if typeof(libname) != "string" then exit("错误:您需要传入一个字符串。")") mx = 获取库() 如果 不存在 mx 则 退出() lib = 空 lib路径 = ["/lib/", 父路径(程序路径) + "/"] 对于 每个 lib路径 中的 lib路径 lib = mx.加载(lib路径 + 库名) 如果 不存在 lib 则 打印("警告: 在'" + lib路径 + "'未找到库。") 否则 打印("信息: 找到库'" + 库名 + "'。") 中断 结束 如果 结束 循环 返回 lib 结束 函数 内存映射 版本1.0 (库) 注意: 此依赖于本指南中的其他一些库。 依赖项: - gethacks.src - loadlib.src /////////////////////////////////////////////////////////// // get_memory_map() - 获取所有主要库的所有本地漏洞并将其存储在映射中。get_memory_map = function() map = {} map["number"] = [] map["computer"] = [] map["file"] = [] map["shell"] = [] hacks = get_local_hacks() if hacks.len == 0 then exit("未找到本地黑客程序。") for hack in hacks lib = load_library(hack["metalib"]) if not lib then continue print("库 [&lt;color=#A50000&gt;" + hack["metalib"] + "&lt;/color&gt;]: " + hack["memory"]) for value in hack["values"] result = lib.overflow(hack["memory"], value) if not result then continue data = {} data["name"] = lib.lib_name data["version"] = lib.版本 data["memory"] = hack["memory"] data["value"] = value data["access"] = "unknown" if typeof(result) == "shell" then data["access"] = get_shell_type(result)["user"] end if data["type"] = typeof(result) map[typeof(result)].push(data) end for end for return map end function 本地映射 1.0(程序) 注意:此库收集关于net.so、init.so和kernel_module.so的所有信息,然后将它们存储在文本文件中。 import_code("/home/<你的用户>/source/gethacks.src") import_code("/home/<你的用户>/source/getlib.src") import_code("/home/<你的用户>/source/loadlib.src") import_code("/home/<你的用户>/source/shelltype.src") import_code("/home/<你的用户>/source/memmap.src") // 执行本地黑客攻击的简单脚本。 if params.len !如果参数数量等于0,则退出程序并显示“用法:<b>”+程序路径分割后的最后部分+“</b>” 获取内存映射并赋值给变量map 如果map中“number”“computer”“file”“shell”的长度都为0,则退出程序并显示“映射为空。” 获取当前shell的主机电脑并赋值给变量pc 如果pc中不存在主目录下的“localmap.txt”文件 则在主目录创建“localmap.txt”文件 结束条件判断 将pc中主目录下的“localmap.”文件赋值给变量file如果为空则 文件列表 = [] 文件名列表 = ["metaxploit.so", "crypto.so", "autohack", "autolocal", "autoclean"] 目录列表 = ["/lib/", 启动路径的父目录 + "/", 程序路径的父目录 + "/"] 对于文件名列表中的每个文件名 对于目录列表中的每个目录 如果获取外壳的主机计算机存在文件(目录 + 文件名)则 文件列表 = 文件列表 + [目录 + 文件名] 跳出循环 结束条件 结束循环 结束循环 如果文件列表长度为0则退出("错误:无法获取要传输的文件。") // 传输文件 对于文件列表中的每个文件 获取外壳的安全复制(文件,"/home/guest",外壳) 等待(0.1) 结束循环 // 更改文件所有者 个人计算机 = 外壳的主机计算机 对于文件名列表中的每个文件名 文件 = 个人计算机的文件("/home/guest/" + 文件名) 如果不存在文件则继续 文件设置所有者("guest") 文件设置用户组("guest") 等待(0.1) 结束循环 外壳.txt") content = "" for type in ["number", "computer", "file", "shell"] for item in map[type] content = content + "=====================" + char(10) + "库:" + item["name"] + char(10) + "版本:" + item["version"] + char(10) + "内存:" + item["memory"] + char(10) + "不安全值:" + item["value"] + char(10) + "访问权限:" + item["access"] + char(10) + "类型:" + item["type"] + char(10) end for end for file.set_content(content) print("文件 " + file.name + " 已保存!") 本地黑客 1.0 版(程序) 注意:这是一个本地使用的简单工具,上传到远程机器后使用。 import_code("/home/<user>/source/getlib.src") import_code("/home/<user>/source/loadlib.src") if params.len < 3 or params.len > 4 then exit("用法:" + program_path.split("/")[-1] + " [库] [内存] [值] [密码]") 密码 = "pass" 如果参数长度等于4则 密码 = 参数[3] 结束如果 库 = 加载库(参数[0]) 如果不是库则退出() 结果 = 空 如果参数长度等于4则 结果 = 库.溢出(参数[1], 参数[2], 参数[3]) 否则 结果 = 库.溢出(参数[1], 参数[2]) 结束如果 如果不是结果则退出("利用目标失败。") 如果结果类型等于"shell"则 // 获取根权限。 打印("正在获取根权限...") 加密 = 获取库("crypto.so") 如果不是加密则退出("错误:系统中未找到加密库。") 文件 = 结果.主机计算机.文件("/etc/passwd") 如果不是文件则退出("错误:无法获取密码文件。") 如果文件没有权限("r")则退出("/etc/passwd: 权限被拒绝。") 如果文件是二进制文件或文件.如果是文件夹则退出("文件是二进制文件或文件夹。") 根哈希 = 文件.获取内容.分割(" n")[0].分割(":")[1] 如果没有根哈希则退出("错误:无法获取根哈希。") 密码 = 加密.解密(根哈希) 如果没有密码则退出("错误:解密根密码失败。") 打印("用户:root n密码:" + 密码) 获取_外壳("root", 密码).启动_终端 结束 如果 压缩版本1.0(程序) 注意:这是一个简单的脚本,用于将你所有的脚本保存到一个大文本文件中。 如果参数.长度 > 1 则退出("用法:" + 程序路径.分割("/")[-1] + " [目录名]") 源路径 = 主目录 + "/source" 如果参数.长度 == 1 则 源路径 = 主目录 + "/" + 参数[0] 结束 如果 源名称 = 主目录 + "/scripts.txt" 电脑 = 获取_外壳.主机_计算机 源文件 = 电脑.文件(源名称) 如果没有源文件则 电脑.touch(home_dir, source_name.split("/")[-1]) source = pc.File(source_name) if not source then exit("错误:无法创建'scripts.txt'。") end if content = "" for file in pc.File(source_path).get_files content = content + "@@@@@" + file.name + char(10) + file.get_content + char(10) + "@@@@@@" + char(10) end for source.set_content(content) print("文件 " + source.name + " 已保存!") 解压版本1.0(程序) 注意:此程序用于将scripts.txt解压为单独的源文件。 if params.len > 1 then exit("用法:" + program_path.split("/")[-1] + " [目录名]") source_path = home_dir + "/src" if params.len == 1 then source_path = home_dir + "/" + params[0] end if source_name = home_dir + "/scripts.txt" pc = get_shell.host_computer source = pc.文件(源名称) 如果不存在源文件 退出("错误:在" + 主目录 + "未找到scripts.txt文件") 结束如果 文件名列表 = [] 文件内容列表 = [] 源文件内容 = 源文件.获取内容.分割("@@@@@@" + 换行符) 对于源文件内容中的每个源文件片段 // 存储文件名 文件名 = 源文件片段[源文件片段.索引("@@@@@")+5:源文件片段.索引(换行符)+1] 如果不存在文件名则继续 文件名 = 文件名.移除(换行符) 文件名列表.添加(文件名) // 打印(文件名) // 存储文件内容 字符串 = "@@@@@" + 文件名 + 换行符 内容 = 源文件片段[字符串.长度:] 如果不存在内容则继续 文件内容列表.添加(内容) // 打印(内容) 结束循环 源目录 = 电脑.文件(源路径) 如果不存在源目录 打印("源目录" + 源路径 + "不存在,正在创建...") 电脑.创建文件夹(主目录, 源路径.split("/")[-1]) srcdir = pc.File(source_path) if not srcdir then exit("错误:无法创建源目录。") end if // 写入源文件。 for filename in filenames file = pc.File(srcdir.path + "/" + filename) if not file then print("正在创建文件 '" + srcdir.path + "/" + filename + "'。") result = pc.touch(srcdir.path + "/", filename) if not result then print("创建文件 '" + srcdir.path + "/" + filename + "' 失败。") file = pc.File(srcdir.path + "/" + filename) if not file then continue end if content = filecontents.pull file.set_content(content) print("文件 '" + srcdir.path + "/" + filename + "' 已保存。") end for print("'scripts.txt' 解压缩完成。") Getinfo 版本 1.0(程序) 注意:这需要 gethacks.src 和 getlib.src 库文件(可在本指南中获取)。导入代码("/home/<你的用户>/source/gethacks.src") 导入代码("/home/<你的用户>/source/getlib.src") 如果参数长度不等于3则退出("用法: " + 程序路径分割("/")[-1] + " [ip] [局域网ip] [银行|邮件|密码]") 如果不是有效ip(参数[0])则退出("错误: 提供的IP地址无效。") 如果不是有效ip(参数[1])则退出("错误: 端口号无效。") 如果参数[2]不等于"bank"且参数[2]不等于"mail"且参数[2]不等于"passwd"则退出("错误: 提供的命令无效。") 结果 = 获取远程漏洞(参数[0]) 如果不是结果则退出() 文件 = [] 库 = 结果["dump"] 漏洞 = 结果["hacks"] 对于漏洞中的漏洞 对于漏洞["values"]中的值 结果 = 库.overflow(hack["memory"], value, params[1]) if not result then continue if typeof(result) == "file" then // 获取银行、邮件或密码文件。 rootdir = result while rootdir.path != "/" rootdir = rootdir.parent end while if params[2] == "bank" then home = null for folder in rootdir.get_folders if folder.name == "home" then home = folder break end if end for // 从文件对象获取所有银行文件。 for folder in home.get_folders if folder.name == "guest" then continue for userdir in folder.get_folders if userdir.name != "Config" then continue for file in userdir.get_files if file.name != "Mail.txt" then continue if not file.has_permission("r") then print("邮件文件权限被拒绝。") continue end if if file.is_binary then print("邮件文件为二进制文件。") continue end if if file.如果是文件夹则 打印("邮件文件是一个文件夹。") 继续 结束如果 映射 = {} 映射["用户"] = 文件夹.名称 映射["文件"] = 文件 如果 文件列表.长度 == 0 则 文件列表.添加(映射) 否则 已找到 = 假 对于 对象 在 文件列表中 如果 对象["用户"] == 映射["用户"] 则 已找到 = 真 中断 结束如果 结束循环 如果 未找到 则 文件列表.添加(映射) 结束如果 结束循环 结束循环 结束循环 否则 如果 参数[2] == "邮件" 则 主目录 = 空 对于 文件夹 在 根目录.获取文件夹 如果 文件夹.名称 == "home" 则 主目录 = 文件夹 中断 结束如果 结束循环 // 从文件对象获取所有邮件文件。 对于 文件夹 在 主目录.获取文件夹 如果 文件夹.名称 == "guest" 则 继续 对于 用户目录 在 文件夹.获取文件夹 如果 用户目录.名称 != "Config" 则 继续 对于 文件 在 用户目录.获取文件 如果 文件.名称 != "Mail.txt" 则 继续 如果 不 文件.有权限("r") 则 打印("邮件文件权限被拒绝")") continue end if if file.is_binary then print("邮件文件为二进制格式。") continue end if if file.is_folder then print("邮件文件是一个文件夹。") continue end if map = {} map["user"] = folder.name map["file"] = file if files.len == 0 then files.push(map) else found = false for obj in files if obj["user"] == map["user"] then found = true break end if end for if not found then files.push(map) end if end for end for end for else if params[2] == "passwd" then homedir = null for folder in rootdir.get_folders if folder.name == "etc" then homedir = folder break end if end for // 获取密码文件(如果有权限)。 for file in homedir.get_files if file.name == "passwd" then if not file.has_permission("r") then print("密码文件权限被拒绝。") continue end if if file.start_terminal end if else exit("用法:autohack [地址] [端口] [数据] 端口为0时表示路由器。") end if 自动无线网络源码版本1.1 注意:简易无线网络破解,选择无线接口和网络,让脚本完成剩下的操作。 // 将所有网络设备收集到数组中。 array = [] devices = get_shell.host_computer.network_devices for device in devices.split(" n") array = array + [device.split(" ")[0]] end for // 列出所有网络设备并获取用户选项。 option = null while not option or (option.val < 0 or option.val > array.len) i = 1 for device in array if device == "" then continue print(i + ". " + device) i = i + 1 end for print("0. 退出 n") option = user_input("请输入选择? ") end while // 检查选项是否为退出。 if option.val == 0 then exit("正在退出无线网络自动破解...")如果是二进制文件则 打印("密码文件是二进制文件。") 继续 结束如果 如果文件是文件夹则 打印("密码文件是一个文件夹。") 继续 结束如果 退出(文件.获取内容) 结束如果 结束循环 结束如果 否则如果结果的类型等于"computer"则 // 获取银行、邮件或密码文件。 如果参数[2]等于"bank"则 主目录 = 结果.文件("/home") 对于主目录中的文件夹 如果文件夹名称等于"guest"则继续 对于文件夹中的用户目录 如果用户目录名称不等于"Config"则继续 对于用户目录中的文件 如果文件名称不等于"Bank.txt"则继续 如果文件没有"r"权限则 打印("银行文件权限被拒绝。") 继续 结束如果 如果文件是二进制文件则 打印("银行文件是二进制文件。") 继续 结束如果 如果文件是文件夹则 打印("银行文件是一个文件夹。") continue end if map = {} map["用户"] = folder.name map["文件"] = file if files.len == 0 then files.push(map) else found = false for obj in files if obj["用户"] == map["用户"] then found = true break end if end for if not found then files.push(map) end if end for end for end for else if params[2] == "邮件" then home = result.File("/home") for folder in home.get_folders if folder.name == "guest" then continue for userdir in folder.get_folders if userdir.name != "Config" then continue for file in userdir.get_files if file.name != "Mail.txt" then continue if not file.has_permission("r") then print("邮件文件权限被拒绝。") continue end if if file.is_binary then print("邮件文件为二进制文件。") continue end if if file.is_folder then print("邮件文件是一个文件夹。") continue end if map = {} map["用户"] = folder.name map["文件"] = file if files.len == 0 then files.push(map) else found = false for obj in files if obj["用户"] == map["用户"] then found = true break end if end for if not found then files.push(map) end if end for end for end for else if params[2] == "密码" then file = result.File("/etc/passwd") if file != null then if not file.has_permission("r") then print("密码文件权限被拒绝。") continue end if if file.is_binary then print("密码文件为二进制文件。") continue end if if file.is_folder then print("密码文件是一个文件夹。") continue end if exit(file.get_content) end if end if end if end for end for if files.len != 0 then print("共找到 " + files.len + " 个文件。") for file in files print(file["文件"].获取内容) 结束循环 否则 打印("未找到文件。") 结束条件判断 退出("程序已结束。")netdev = array[option.val - 1] networks = get_shell.host_computer.wifi_networks(array[option.val - 1]) option = null while not option or (option.val < 0 or option.val > networks.len) // 列出所有无线网络 i = 1 info = "选项 BSSID 信号强度 网络名称" for network in networks info = info + " n" + i + ". " + network i = i + 1 end for print(format_columns(info)) print("0. 退出") option = user_input("请输入选择? ") end while // 检查是否选择退出 if option.val == 0 then exit("正在退出无线网络自动破解程序...") // 处理并连接网络 bssid = networks[option.val - 1].split(" ")[0] essid = networks[option.val - 1].split(" ")[2] import_code("/home/5n4k3/source/getlib.src") // 使用加密库 crypt = get_library("crypto.so") if not crypt then exit() // 破解无线网络密码 crypt.airmon("启动", 网络设备) crypt.aireplay(基本服务集标识符, 扩展服务集标识符, 15000) crypt.airmon("停止", 网络设备) 密码 = crypt.aircrack(主目录 + "/file.cap") // 连接到无线网络。 打印("尝试连接到" + 扩展服务集标识符) 如果 非 get_shell.主机计算机.connect_wifi(网络设备, 基本服务集标识符, 扩展服务集标识符, 密码) 则 打印("连接" + 扩展服务集标识符 + "失败") 结束 如果 获取库源代码版本1.1(用于导入库模块的库) 注意:这只是一个可与脚本中的import_code()函数配合使用的库源代码。自动黑客程序依赖于此。 /////////////////////////////////////////// // 获取本地库。 // 返回:元库。 /////////////////////////////////////////// get_library = 函数(库名 = "metaxploit.so\") mx = null 库路径 = ["/lib/", 父路径(程序路径) + "/"] 对于 库路径 中的 库路径 mx = 包含库(库路径 + 库名) 如果 非 mx 则 打印("警告: 未在'" + 库路径 + "'找到库。") 否则 打印("信息: 找到库'" + 库名 + "'。") 中断 结束 如果 结束 对于 返回 mx 结束 函数 获取黑客源码版本1.1(用于获取远程和本地黑客程序的库) 注意:此库用于自动黑客程序,也适用于脚本中的导入代码()函数。 ////////////////////////////////////// // 描述:获取所有远程黑客程序。 // 返回:黑客程序 ////////////////////////////////////// 获取远程黑客程序 = 函数(地址 = null, 端口 = 0) 结果 = {} // 针对远程地址/端口组合运行 如果 非 有效IP(地址) 则 打印("错误: 提供的IP地址无效。"") return result end if mx = get_library() if not mx then return result netsession = mx.net_use(addr, port) if not netsession then print("错误:无法获取网络会话。") return result end if dump = netsession.dump_lib if not dump then print("错误:无法转储库。") return result end if print("获取远程黑客工具:<color=#A50000><b>" + dump.lib_name + ":" + dump.version + "</b></color>") hacks = [] addresses = mx.scan(dump) for mem in addresses pair = {} values = [] //print("地址:" + mem) data = mx.scan_address(dump, mem) strings = data.split("Unsafe check: ") for string in strings if string == strings[0] then continue value = string[string.indexOf("<b>")+3:string.indexOf("</b>")] //print(" --> " + value) values = values + [value] end for pair["memory"] = mem pair["values"] = values hacks = hacks + [pair] end for result["dump"] = dump result["hacks"] = hacks return result end function ////////////////////////////////////// // 描述:获取所有本地黑客程序。 // 返回:黑客程序 ////////////////////////////////////// get_local_hacks = function() filenames = ["net.so", "init.so", "kernel_module.so", "kernel_router.so"] hacks = [] mx = get_library() if not mx then return hacks for filename in filenames dump = mx.load("/lib/" + filename) if not dump then print("错误:找不到" + filename) continue end if print("正在获取本地黑客程序:<color=#A50000><b>" + filename + "</b></color>") addresses = mx.scan(dump) for mem in addresses hack = {} values = [] //print("地址: " + mem) data = mx.scan_address(dump, mem) strings = data.split("Unsafe check: ") for string in strings if string == strings[0] then continue value = string[string.indexOf("<b>")+3:string.indexOf("</b>")] //print(" --> " + value) values = values + [value] end for hack["元库"] = filename hack["内存"] = mem hack["数值"] = values hacks = hacks + [hack] end for end for return hacks end function ShellType 源码版本1.1(获取指定shell的所有者) 注意:这个小型库用于获取shell所有者(访问级别,例如“root”“guest”或“user”),同时该库是自动黑客脚本所必需的。