【 Grey Hack 】万金油脚本:原地提权工具

版本:Grey Hack v0.7.3618 - Alpha


脚本源码

metaxploit = include_lib("/lib/metaxploit.so")
if not metaxploit then
	metaxploit = include_lib(current_path + "/metaxploit.so")
end if
if not metaxploit then exit("Error: Can't find metaxploit library in the /lib path or the current folder")

resultMem = ""
resultKey = ""

metaLib = metaxploit.load("/lib/net.so")
if metaLib then 
	print("Founded " + metaLib.lib_name + " "+ metaLib.version)
	exploits = metaxploit.scan(metaLib)
	for exploit in exploits
		print(exploit)
		result_lists = metaxploit.scan_address(metaLib, exploit).split("Unsafe check: ")[1:]
		for result_list in result_lists
			target_str = result_list.split(".")[0]
			target_key = target_str.split(" ")[-1]
			result = metaLib.overflow(exploit, target_key[3:-4])
			if typeof(result) == "shell" then
				root_file = result.host_computer.File("/root")
				if root_file.has_permission("w") then
					result.start_terminal
				else if root_file.has_permission("r") then
					resultMem = exploit
					resultKey = target_key[3:-4]
				else
					if resultMem == "" then resultMem = exploit
					if resultKey == "" then resultKey = target_key[3:-4]
				end if
			end if
		end for
	end for
end if

metaLib = []
metaLib = metaxploit.load("/lib/init.so")
if not metaLib then exit("Can't find " + "/lib/init.so")

print("Founded " + metaLib.lib_name + " "+ metaLib.version)

if metaLib then 
	exploits = metaxploit.scan(metaLib)
	for exploit in exploits
		print(exploit)
		result_lists = metaxploit.scan_address(metaLib, exploit).split("Unsafe check: ")[1:]
		for result_list in result_lists
			target_str = result_list.split(".")[0]
			target_key = target_str.split(" ")[-1]
			result = metaLib.overflow(exploit, target_key[3:-4])
			if typeof(result) == "shell" then
				root_file = result.host_computer.File("/root")
				if root_file.has_permission("w") then
					result.start_terminal
				else if root_file.has_permission("r") then
					resultMem = kernel_router_exploit
					resultKey = target_key[3:-4]
				else
					if resultMem == "" then resultMem = exploit
					if resultKey == "" then resultKey = target_key[3:-4]
				end if
			end if
		end for
	end for
end if
result = metaLib.overflow(resultMem, resultKey)
if typeof(result) == "shell" then
	result.start_terminal
end if
exit("Fail...")

用法

在本地使用,可从游客权限提至至少是普通用户级

效果及示例

譬如,已经获取了一个游客权限的shell
在这里插入图片描述
在这里插入图片描述
上传本脚本及需要的库,执行
在这里插入图片描述
得到了普通用户身份
在这里插入图片描述

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

乙酸氧铍

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值