当前位置:网站首页>[BJDCTF2020]EasySearch 1
[BJDCTF2020]EasySearch 1
2022-07-27 08:13:00 【weixin_ fifty-three million one hundred and fifty thousand four】
List of articles
Weekly learning summary
article
- Open the web link , According to the content :

Checked the source code , I didn't see anything wrong , Guess it might be SQL Inject 、 Source code leakage 、XSS Inject 、GIT Let the cat out of the
3. It doesn't matter , Go up directly and arrange to scan the directory first , This takes the longest time , Then proceed SQL Inject , You'll find that you can't bet at all , He will only prompt a pop-up window , I was thinking about looking at the code to see if there were any loopholes , The result is nothing big . Basically SQL Inject 、XSS The injection is gone . We can only hope to scan the directory
2. The scanning time is super slow , If you want to use my tools, you can see mine Weekly learning summary , There's no paste here , Finally, there is one index.php.swp file , After web page input :
http://a68d250f-cd20-45b5-a176-a32260c35fd7.node4.buuoj.cn:81/index.php.swp
You can get the source code
Code audit :
<?php ob_start(); function get_hash(){ $chars = '[email protected]#$%^&*()+-'; $random = $chars[mt_rand(0,73)].$chars[mt_rand(0,73)].$chars[mt_rand(0,73)].$chars[mt_rand(0,73)].$chars[mt_rand(0,73)];//Random 5 times $content = uniqid().$random; return sha1($content); } header("Content-Type: text/html;charset=utf-8"); if(isset($_POST['username']) and $_POST['username'] != '' ){ # Exist with mutual names and are not empty $admin = '6d0bc1'; if ( $admin == substr(md5($_POST['password']),0,6)) { # lookup md5 The first six digits of the value are 6d0bc1 2020666 echo "<script>alert('[+] Welcome to manage system')</script>"; $file_shtml = "public/".get_hash().".shtml"; $shtml = fopen($file_shtml, "w") or die("Unable to open file!"); # Open and write a file $text = ' *** *** <h1>Hello,'.$_POST['username'].'</h1> *** ***'; fwrite($shtml,$text); fclose($shtml); echo "[!] Header error ..."; } else { echo "<script>alert('[!] Failed')</script>"; } }else{ } ?>At first glance, we need to do something about documents
We need to make a MD5 The value starts with 6d0bc1 , Find relevant codes on the Internet :
#-*- coding:utf-8 -*- # Script function : Generate md5 value (6 Digit number ) import hashlib import random def encryption(chars): return hashlib.md5(chars).hexdigest() def generate(): return str(random.randint(99999,1000000)) def main(): start = "6d0bc1" while True: strs = generate() print "Test %s " % strs if encryption(strs).startswith(start): print "yes!" print "[+] %s " % strs + "%s " % encryption(strs) break else: print "no!" if __name__ == '__main__': main() print ' complete !'I can't get out at all , Look directly at others wp , Use 2020666
Start landing :

Landing successful , And here tell us a file storage address , No way out , Looking at wp
The file here uses shtml , And this village has a loophole : Apache SSI Remote command execution vulnerability
shtml And ssi Instructions
Baidu Encyclopedia :shtml and asp There are some similarities , With shtml Named file , Used ssi Some of the instructions for , It's like asp The instructions in , You can SHTML Write in file SSI Instructions , When the client accesses these shtml When you file , The server will send these SHTML File to read and interpret , hold SHTML The file contains SSI Explain the instructions .
SSI InstructionsStart payload:
Tips : Use SSI The order of , Just look up the upper level directory
summary
- MD5 Collision
- SSI Middleware vulnerability
Reference article
边栏推荐
- 这次龙蜥展区玩的新花样,看看是谁的 DNA 动了?
- Enhancement: BTE process introduction
- How does kettle handle text data transfer as' 'instead of null
- Sword finger offer 58 - I. flip word order
- 数据库启动报error_user_connect_times &gt; 0错误
- pytorch_demo1
- Lu Xun: I don't remember saying it, or you can check it yourself!
- 如何在 60 秒内去分析和定位问题?
- The dragon lizard exhibition area plays a new trick this time. Let's see whose DNA moved?
- How to obtain the cash flow data of advertising services to help analyze the advertising effect?
猜你喜欢

API 版本控制【 Eolink 翻译】

Grandson's questions are difficult, and his son's invigilation is strict. I can't do it. Pay back my school money

Comprehensive cases

如何更新pip3?和Running pip as the ‘root‘ user can result in broken permissions and conflicting behaviour

QingChuang technology joined dragon lizard community to build a new ecosystem of intelligent operation and maintenance platform

pytorch_demo1

Leetcode54. Spiral matrix

"PHP Basics" uses echo statements to output information

The third letter to the little sister of the test | Oracle stored procedure knowledge sharing and test instructions

The dragon lizard exhibition area plays a new trick this time. Let's see whose DNA moved?
随机推荐
How to log in multiple wechat on the computer
[resolved] SSO forwarding succeeded, and there was an unexpected error (type=internal server error, status=500) caused by parameters in the forwarding URL
mqtt指令收发请求订阅
I can't figure out why MySQL uses b+ trees for indexing?
How to analyze and locate problems in 60 seconds?
Five day travels to Beijing
Abstract factory pattern
1024 | in the fourth year officially called Menon, the original intention is still there, and continue to move forward
kalibr标定realsenseD435i --多相机标定
ERP production operation control Huaxia
shell脚本学习day01
反弹shell是什么?反弹shell有什么用?
pytorch_ demo1
What is a rebound shell? What's the use of bouncing shells?
Containerd failed to pull private database image (kubelet)
Lua迭代器
After installing mysql, docker entered the container and found that he could not log in to MySQL
想让照片中的云飘起来?视频编辑服务一键动效3步就能实现
Download and usage of sequel Pro
如何更新pip3?和Running pip as the ‘root‘ user can result in broken permissions and conflicting behaviour