knight ctf web Programming Misc wp(部分) 今天去打了kinghtctf 哇本来以为什么都做不来就去看个热闹的,(p≧w≦q)没想到还是可以嘛
web的现在只做了这么多出来,
七百多个人能拍这我已经满足了(^▽^ ),现在总结一下遇到的题
Zero is not the limit
打开这个样子
当时找了又找什么都没找到,后来用dirsearch扫了一下,发现了user下面一大堆的东西,然后根据题目的提示,访问目录/user/-1就出来了
Find Pass Code - 1
在源码中找到提示
设置source参数得到源码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 <?php require "flag.php" ;if (isset ($_POST ["pass_code" ])) { if (strcmp($_POST ["pass_code" ], $flag ) == 0 ) { echo "KCTF Flag : {$flag} " ; } else { echo "Oh....My....God. You entered the wrong pass code.<br>" ; } } if (isset ($_GET ["source" ])) { print show_source(__FILE__ ); } ?>
一个简单的strcmp绕过,他不能处理数组类型,一旦输入数组那么就会return0然后就绕过啦啦啦。
Most Secure Calculator - 1
这个超简单,任意命令
但是吧flag给过滤了,加个引号啦啦啦(先用ls知道了flag在这里面的)
system("cat flag.txt")
My PHP Site
看到那个file参数了吗,文件包含漏洞哦~
[Tareq's Home Page](http://137.184.133.81:15002/?file=php://filter/read=convert.base64-encode/resource=index.php)
用伪协议直接读取
base解密
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <?php if (isset ($_GET ['file' ])){ if ($_GET ['file' ] == "index.php" ) { echo "<h1>ERROR!!</h1>" ; die (); }else { include $_GET ['file' ]; } }else { echo "<h1>You are missing the file parameter</h1>" ; } ?> <!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8" > <meta http-equiv="X-UA-Compatible" content="IE=edge" > <meta name="viewport" content="width=device-width, initial-scale=1.0" > <title>Tareq's Home Page</title> </head> <body> </body> </html>
看到那个note提示了吗,用伪协议读取他
出来啦,base解密就好了KCTF{L0C4L_F1L3_1ncLu710n}
Find Pass Code - 2
根据提示还是使用source参数看源码,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 <?php require "flag.php" ;$old_pass_codes = array ("0e215962017" , "0e730083352" , "0e807097110" , "0e840922711" );$old_pass_flag = false ;if (isset ($_POST ["pass_code" ]) && !is_array($_POST ["pass_code" ])) { foreach ($old_pass_codes as $old_pass_code ) { if ($_POST ["pass_code" ] === $old_pass_code ) { $old_pass_flag = true ; break ; } } if ($old_pass_flag ) { echo "Sorry ! It's an old pass code." ; } else if ($_POST ["pass_code" ] == md5($_POST ["pass_code" ])) { echo "KCTF Flag : {$flag} " ; } else { echo "Oh....My....God. You entered the wrong pass code.<br>" ; } } if (isset ($_GET ["source" ])) { print show_source(__FILE__ ); } ?>
一个md5碰撞,但是他把我们常见的都给过滤掉了,加密前加密后都必须是0e纯数字
的形式,网上搜半天也没有,我们就写了个脚本自己跑
最后跑出来了,这里就总结一下常见的这种md5碰撞可用的
0e1137126905
0e215962017
0e730083352
0e807097110
0e840922711
Most Secure Calculator - 2 哇这个是真的难,把这个做出来我是真的有成就感!!!
还是命令执行,但是过滤了所有的字母和大部分的符号,这怎么办呢!还好我以前就看过p神的那个无字母webshell,
命令执行中关于PHP正则表达式的一些绕过方法_WHOAMIAnony的博客-CSDN博客_php正则绕过
无字母数字webshell之提高篇 | 离别歌 (leavesongs.com)
URL编码取反绕过(最简单的)
注意: 该方法只适用于PHP7
对想要传入的参数,先进行URL解码再取反
例如传入构造一个phpinfo();(生成payload的时候先取反再URL编码)
Keep Calculating 哈哈随便找了下又弄出来个题,正好最近在学py
1 2 3 4 5 6 7 8 9 x = 1 y = 2 answer = 0 while x < 667 : print (x) answer += ((x * y) + (x * (10 **len (f'{y} ' )))+y) x += 1 print (answer)
Reverse The Answer
1 2 3 4 5 6 7 8 9 10 x = 1 answer = 0 while x < 544 : calculation = (x * (x + 1 )) + (2 * (x + 1 )) reverssed_calc = int (str (calculation)[::-1 ]) print (x,reverssed_calc) if reverssed_calc%4 == 0 : answer += reverssed_calc x += 1 print (answer)
Square Sum
1 2 3 4 5 6 7 8 9 data = 25000 result = [] for i1 in range (200 ): for i2 in range (200 ): if i1**2 + i2**2 == data: buffer = [i1,i2] result.append(buffer) result.sort() print (result)
Something In Common
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 def hcf (x, y ): """该函数返回两个数的最大公约数""" if x > y: smaller = y else : smaller = x for i in range (1 , smaller + 1 ): if ((x % i == 0 ) and (y % i == 0 )): hcf = i return hcf num1 = int (input ("输入第一个数字: " )) num2 = int (input ("输入第二个数字: " )) data = hcf(num1, num2) data_list = list (str (data)) data_list = [int (i) for i in data_list] result = 0 for item in data_list: result += item print (result*1234 )
Find The Number
1 2 3 4 5 6 7 def g (n ): if n<0 : return 0 else : return 1 /2 **n+g(n-1 ) print (g(25 ))
Unzip Me
下载下来改下后缀名zip,然后一直解压,最后解压出来的东西用记事本打开
下面那两个,是我自己写的,很容易就发现了嘛,两个字符交换下位置,就出来咯~
今天晚上还要去realwordctf看热闹,不说了继续做题了
还有好多我不会的东西,什么流量包什么的,以后一定要继续好好学,打算过段时间学学逆向。
我不能休息我还能学 ⊂(‘ω’⊂ )))Σ≡=─༄༅༄༅༄༅༄༅༄༅
还有汇编没怎么懂
如何运行汇编程序 - ice–cream - 博客园 (cnblogs.com)