当前位置:网站首页>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
边栏推荐
- 转载:SQL注入常见绕过
- 树和堆知识点总结
- 【工具篇】Unity2D人物控制器,控制2D玩家移动跳跃,四方向和水平方向
- ENVI_IDL: 文本文件的读取(主要是txt、csv文件)
- STL -- set container
- 元宇宙公链Caduceus项目详解(一):Caduceus Metaverse Protocol的项目理念及技术框架
- Hue oozie editor scheduling shell
- 【Unity开发小技巧】Unity打包PC端exe,压缩打包为一个exe文件
- YYDS! The latest distributed core technology notes summarized by Alibaba technical officers have been launched, which can be regarded as a blessing
- 【HDRP高清渲染管道】创建HDRP工程,把内置管线工程升级为HDRP工程
猜你喜欢

STL--stack容器

ENVI_IDL:批量处理Modis Swath数据的重投影并输出为Geotiff格式+详细解析

Hash table, bloom filter, distributed consistency hash

ENVI_ IDL: read OMI data (HDF5) and output it as GeoTIFF file + detailed parsing

去中心化边缘渲染元宇宙协议Caduceus受邀出席CBAIA 2022峰会,以技术赋能更多Web3应用场景

bugku----正则匹配,cookies

Gdb+vscode for debugging 3 - vscode and GDB remote debugging

Unity导入fbx模型后,运行时物体的旋转和位置自动改变的问题解决方法

Injection de modèles ssti

元宇宙公链Caduceus项目详解(一):Caduceus Metaverse Protocol的项目理念及技术框架
随机推荐
Double Q-Learning理论基础及其代码实现【Pendulum-v0】
【Unity开发小技巧】Unity混音器Mixer控制全局音量
Unity笔记1
ENVI_ Idl: reading of text files (mainly txt and CSV files)
Gdb+vscode debugging -- how to debug the release version
【Unity编辑器扩展】查找场景和资源内挂载某脚本的所有对象
bugku----正则匹配,cookies
Clion 安装以及中开发ROS实现自动提示补全
Hash table, bloom filter, distributed consistency hash
Leetcode 70:Climbing Stairs
Clion installation and ROS development to realize automatic prompt completion
【Unity编辑器扩展】Unity内部Asset资源配置ScriptableObject
Unity3D 游戏人物跳跃落地时发生弹跳,偏移情况的解决方法
LeetCode:动态规划中的0-1背包问题【快来直接套模板啦】
第二讲 BTC-密码学原理(笔记)
STL--stack容器
去中心化边缘渲染元宇宙协议Caduceus受邀出席CBAIA 2022峰会,以技术赋能更多Web3应用场景
ENVI_IDL: 读取文本文件并输出为Geotiff格式+简单均值插值
【工具篇】SQLite本地数据库在Unity3D的应用
元宇宙公链Caduceus详解:专为元宇宙应用打造的创作平台