当前位置:网站首页>[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

边栏推荐
- 2022.7.7 一些错误总结
- Summary of Applied Cryptography
- [elementui El date picker date selector, the end time must not be earlier than the start time, and only the date of the specified number of days from the start time can be selected]
- Cento7安装mysql5.5以及升级5.7
- 我已经妥协了 大家既然都要叫我yelin 那我也没办法了
- 4 搜索插入位置
- 02_ Data binding
- Use bat to automatically execute CMD commands (multiple commands or a single command)
- 今天的码农女孩做了关于呼吸灯的练习、受控组件和高阶组件的简答题
- NodeJS 跨域 CORS
猜你喜欢

Uni app wechat applet - Mall (6) - my home page

Express的使用方法,路由的匹配与使用

软件漏洞分析入门(四)

深拷贝与浅拷贝

Uni app wechat applet - Mall (4) - merchants

If the website is hacked, what if you jump to other websites through Baidu / Sogou and other search keywords?

Uni app wechat applet - Mall (3) - Mall Homepage

uni-app微信公众号(1)——网页授权登录

Nodejs cross domain CORS

Self encapsulated stylized switch card assembly
随机推荐
今天的码农女孩总结了关于npm包管理和url模块的笔记
JSX syntax
TCP与UDP,TCP服务器与客户端,UDP服务器与客户端
El date picker time range control
10 完成一半题目
Page layout - three column layout solution
Es optional chain
Express项目创建以及其路由介绍
Uni app wechat applet - Mall (8) - order details
qs模块是?
JS higher order function filter/map/reduce
Array Operations - judgment, de duplication, consolidation, expansion
Uni app wechat official account (5) - add and modify addresses
ES6 syntax -- Deconstruction assignment
JS数组常用方法
02_ Data binding
Common methods of JS array
Modifier of v-on
If the website is hacked, what if you jump to other websites through Baidu / Sogou and other search keywords?
Uni scroll view pull-down refresh