当前位置:网站首页>Bugku problem solution
Bugku problem solution
2022-07-19 02:20:00 【jjj34】
One . Local Administrators
Knowledge point : forge ip Address , decode
1. forge ip Address : adopt bp Grab the bag , And add one X-Forwarded-For data

2. Judge the code
How to judge whether a code is base64 Of
* A string can only contain A-Z,a-z,0-9,+,/,= character
* The string length is 4 Multiple
* = Will only appear at the end of the string , There may be no or one equal sign or two equal signs

In the source code of the topic , See this one , Because his ending has two equal signs , And the length is 12 position , Only A-Z,a-z,=
So the guess is base64 code , Get the online website to decrypt , Find out

This should be the password , Combined with weak password , Guess the account number is admin
Combine the above two knowledge points

Successfully get flag
Two .eval Remote code execution

Pictured , Knowledge point 1: request Way to pass parameters
(1 Bar message ) PHP $_REQUEST_ Little spice blog -CSDN Blog _$_request php
It can be understood as Combined with the post and get Request method of , direct /? Send or Construct a post Packet sending
Knowledge point 2: eval function
PHP eval() function (w3school.com.cn)
Knowledge point 3: var_dump() function
PHP var_dump() function | Novice tutorial (runoob.com)
Knowledge point 4:include
PHP Include file (w3school.com.cn)
Knowledge point 5 system function
The code means : The header refers to flag.php file ( That is to say flag home ), Parameters a Accept one from request The parameters passed by , The parameter name is hello, adopt var_dump Output a Value ( That is, the specific value of the parameter ), Then this value will be treated as php Command execution (eval The role of )
Because of the transmission request Parameters and get Almost so we directly stay url bar /?hello= Just pass it on

The topic turns into remote code execution , Direct use system Function
system('find / -name flag') First look for flag, And then again cat
system(' cat /flag')

3、 ... and . Variable 1

The title suggests flag In variables ,
That regular indicates that the variable should be expressed in Alphanumeric underscores begin and end
$GLOBALS!!! This global variable is used in PHP Access global variables anywhere in the script
So we go directly to GLOBALS that will do
(1 Bar message ) Bugku web Variable 1_ Crisp sugar learning blog -CSDN Blog
Four . nothing in the world

1. Consider directory scanning
2. consider bp Grab the bag

5、 ... and .source
(1 Bar message ) bugku-source-wp Detailed explanation _forever4024 The blog of -CSDN Blog _bugku wp
direct f12 see

Take it to base64 decode , Find out flag It's fake ,
Scan the directory

Sure is git Information disclosure of
git Disclose knowledge points
Git Basic operation | Novice tutorial (runoob.com)
1. download .git file
kali: wget -r http://114.67.175.224:18055/.git
GitHack python2 GitHack.py http://challenge-27567e8a0c3c2b2b.sandbox.ctfhub.com:10800/2.log
Log discovery flag

solution 1 adopt git diff Compare the difference between the current version and the previous version

git diff Version number solution 2 adopt git reset Switch to the previous version

git reset --hard Version number 3.stash
git-stash Summary of usage - Tocy - Blog Garden (cnblogs.com)
With ctfhub Of git Leaking stash For example , The background of the topic is that the staff will flag Submitted to stash in , We need to go from stash To extract from flag
solution 1
git stash list Check out existing storage
git stash show see
git stash pop To re apply storage , And immediately remove it from the stack .
Through the first git stash list see stash Cache in , You can find , There is only one cache
So just use git stash pop Remove the cache to get contain flag Of txt file
solution 2

Through the first .git/refs/stash I got the papers stash Medium hash Value and then use diff Directly compare the differences between the two files , Get flag
Be careful : If the method has been used 1, Method 2 Will fail , Because the current version has been restored to the existing flag Version of the . Use diff It's equivalent to comparing yourself , The result is empty. .
4.index
边栏推荐
- Oozie integrated sh
- leetcode力扣经典问题——42.接雨水
- [unity Editor Extension] scriptableobject for internal asset configuration of unity
- windows安装mysql和jdbc
- 成信大ENVI_IDL第一周实验测试:数组的简单运算+详细解析
- Double Q-Learning理论基础及其代码实现【Pendulum-v0】
- 池式组件之内存池篇
- 简述特征工程及其sklearn的实现
- 图像质量评估指标:SNR、PSNR、MSE和SSIM
- 【工具篇】Unity2D人物控制器,控制2D玩家移动跳跃,四方向和水平方向
猜你喜欢

简述特征工程及其sklearn的实现

基于蒙特卡洛的强化学习方法【附带代码实现】

散列表、布隆过滤器、分布式一致性hash

SSTI模板注入

ENVI_IDL:读取OMI数据(HDF5)并输出为Geotiff文件+详细解析

元宇宙公链Caduceus项目详解(一):Caduceus Metaverse Protocol的项目理念及技术框架

ENVI_ Idl: read the text file and output it in GeoTIFF format + simple mean interpolation

gdb+vscode进行调试0——环境配置

Gdb+vscode for debugging 2 - GDB breakpoint related

池式组件之内存池篇
随机推荐
【Unity编辑器扩展】显示资源目录下所有文件所占内存大小
动态规划 - 01背包问题
Unity3D 游戏人物跳跃落地时发生弹跳,偏移情况的解决方法
Cookie和Session的区别
池式组件之内存池篇
Oozie integrated sh
ENVI_ Idl: average calculation + analysis of MODIS swath products in batches
【解决方案】win11中本地组策略编辑器(gpedit.msc)打不开
【HDRP高清渲染管道】创建HDRP工程,把内置管线工程升级为HDRP工程
[unity Editor Extension] scriptableobject for internal asset configuration of unity
Gdb+vscode debugging -- how to debug the release version
成信大ENVI_IDL第二周实验内容:提取所有MODIS气溶胶产品中AOD+详细解析
Gdb+vscode for debugging 2 - GDB breakpoint related
Lecture 2 BTC cryptography principles (notes)
元宇宙公链Caduceus项目详解(一):Caduceus Metaverse Protocol的项目理念及技术框架
STL--vector容器
安装websocketpp
Gdb+vscode for debugging 5 - GDB view relevant commands
YYDS! The latest distributed core technology notes summarized by Alibaba technical officers have been launched, which can be regarded as a blessing
Chapter 2 - system control principle - > classical control theory