当前位置:网站首页>[ahu2021 school competition] EZ injection
[ahu2021 school competition] EZ injection
2022-07-19 01:40:00 【Default user_ one hundred and fourteen thousand five hundred an】
- The title first gives a
index.rarfile , Directly decompress
- the second
hint.txtfile , Prompt after opening
- Open the file and there is a
source.zipfile , With a password, you can't decompress , Click in and have a look. There is also ahint.txt, Try plaintext attack
- Use... First WinRAR Add to
hint.zipOf , Find out ARCHPR Report errors **“ There are no matching files in the selected file ”**
- Later, I found that right click directly , Send to zipped Folder You can execute plaintext attack

- Start plaintext attack

- Password succeeded

- Open the unzipped folder , There's a
index.phpIs the source code we want
<?php
$re = array('and','or','count','select','from','union','group','by','limit','insert','where','order','alter','delete','having','max','min','avg','sum','sqrt','rand','concat','sleep');
setcookie('injection','c3FsaSBpcyBub3QgdGhlIG9ubHkgd2F5IGZvciBpbmplY3Rpb24=',time()+100000);
if(file_exists('slain.xml')) {
$xml = simplexml_load_file('slain.xml');
$user=$_GET['user'];
$user=str_replace($re, ' ', $user);
//$user=str_replace("'", "&apos", $user);
$query="user/username[@name='".$user."']";
$ans = $xml->xpath($query);
foreach($ans as $x => $x_value)
{
echo $x.": " . $x_value;
echo "<br />";
}
}
- In the code setcookie There is a passage in it
c3FsaSBpcyBub3QgdGhlIG9ubHkgd2F5IGZvciBpbmplY3Rpb24=use burp The decoder inside solves **“sqli is not the only way for injection”** say SQL Is not the only way to inject
- Then combined with these two pieces of code, it is found that many are filtered out SQL keyword
$user=str_replace($re, ' ', $user);
$re = array('and','or','count','select','from','union','group','by','limit','insert','where','order','alter','delete','having','max','min','avg','sum','sqrt','rand','concat','sleep');
- SQL Injection is definitely useless , Then there is a paragraph in the middle
$xml = simplexml_load_file('slain.xml');

- Access to information , It can be used xpath Inject



- Submit a single quotation mark , The returned response proves that xpath Inject holes

- Use this line of code
$query="user/username[@name='".$user."']";
structure payload:?user=']|//*|//*['
You can use this payload Visit this xml All nodes in the document 
- flag To get
- Write WP In fact, I found a simpler way
$xml = simplexml_load_file('slain.xml');
This line of code indicates that there is a slain.xml file , Maybe you can visit directly
- Have a try , That's good

边栏推荐
猜你喜欢
随机推荐
uni-app微信公众号(1)——网页授权登录
Es optional chain
2022年暑假ACM热身练习1(总结)
(6) Test command
Text indent in uniapp doesn't work, and the indentation in the first line of uniapp doesn't work. How to solve it?
05_ Review object defineProperty
Uni app wechat official account (5) - add and modify addresses
Uni app wechat applet - Mall (8) - order details
使用leaflet仿原神提瓦特大地图制作日记
同学们不要全抄我的代码哈 记得改一改 要不我俩都要G
04_ Understand MVVM
07_事件的基本使用
01-BTC-密码学原理
El date picker time range control
let和const、let、const和var的区别
Cento7安装mysql5.5以及升级5.7
Use bat to automatically execute CMD commands (multiple commands or a single command)
V-model principle and modifier
TCP与UDP,TCP服务器与客户端,UDP服务器与客户端
2022年暑假ACM热身练习2(总结)









