当前位置:网站首页>[BJDCTF2020]EasySearch 1
[BJDCTF2020]EasySearch 1
2022-07-27 05:04:00 【weixin_53150482】
每周学习总结
文章
- 打开网页链接,显示内容:

查了一遍源代码,也没有看出什么毛病,猜测可能是 SQL 注入、源码泄露、XSS 注入、GIT 泄露
3.不管三七二十一,直接上去先安排扫目录,这个好费时间最长,然后进行 SQL 注入, 你就会发现你根本就注不进去,他只会提示一个弹窗,本来还想着看一下代码看看有没有漏洞,结果啥也没有头大。基本上 SQL 注入、XSS 注入就没了。只能寄希望于目录扫描了
2. 这个扫的时间超级慢,如果你想使用我的工具可以看看我的每周学习总结,这里就不粘贴了,最后存在一个 index.php.swp 文件,在网页输入后:
http://a68d250f-cd20-45b5-a176-a32260c35fd7.node4.buuoj.cn:81/index.php.swp
就可以得到源代码了
进行代码审计:
<?php ob_start(); function get_hash(){ $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz[email protected]#$%^&*()+-'; $random = $chars[mt_rand(0,73)].$chars[mt_rand(0,73)].$chars[mt_rand(0,73)].$chars[mt_rand(0,73)].$chars[mt_rand(0,73)];//Random 5 times $content = uniqid().$random; return sha1($content); } header("Content-Type: text/html;charset=utf-8"); if(isset($_POST['username']) and $_POST['username'] != '' ){ # 用互名存在且不为空 $admin = '6d0bc1'; if ( $admin == substr(md5($_POST['password']),0,6)) { # 查找 md5 值开头六位为 6d0bc1 2020666 echo "<script>alert('[+] Welcome to manage system')</script>"; $file_shtml = "public/".get_hash().".shtml"; $shtml = fopen($file_shtml, "w") or die("Unable to open file!"); # 打开并写入一个文件 $text = ' *** *** <h1>Hello,'.$_POST['username'].'</h1> *** ***'; fwrite($shtml,$text); fclose($shtml); echo "[!] Header error ..."; } else { echo "<script>alert('[!] Failed')</script>"; } }else{ } ?>这里一看就是要在文件这方面搞事情
这里需要我们搞一个 MD5 值开头是 6d0bc1 ,在网上查找相关的代码:
#-*- coding:utf-8 -*- #脚本功能:生成以指定字符为开头的md5值(6位数字) import hashlib import random def encryption(chars): return hashlib.md5(chars).hexdigest() def generate(): return str(random.randint(99999,1000000)) def main(): start = "6d0bc1" while True: strs = generate() print "Test %s " % strs if encryption(strs).startswith(start): print "yes!" print "[+] %s " % strs + "%s " % encryption(strs) break else: print "no!" if __name__ == '__main__': main() print '完成!'根本跑不出来,直接看别人的 wp ,使用 2020666
开始登陆:

登陆成功,并且这里告诉我们一个文件存放地址,没办法了,在看 wp
这里的文件使用的是 shtml ,而这个村子一个漏洞: Apache SSI 远程命令执行漏洞
shtml与ssi指令
百度百科:shtml和asp 有一些相似,以shtml命名的文件里,使用了ssi的一些指令,就像asp中的指令,你可以在SHTML文件中写入SSI指令,当客户端访问这些shtml文件时,服务器端会把这些SHTML文件进行读取和解释,把SHTML文件中包含的SSI指令解释出来。
SSI 指令开始搞 payload:
提示: 使用 SSI 的命令执行,查找上一级目录就可以了
总结
- MD5 的碰撞
- SSI 中间件漏洞
参考文章
边栏推荐
猜你喜欢

Redis publish subscribe mode

用户页面管理

C language string function: strlen, strcpy, strcat

分享一道关于程序编译过程的选择题(内含编译过程浅谈,符号表的形成合并过程)

JS中原型及原型链

流程控制-分支

Program environment and preprocessing (Part 2): define, undef, command line compilation, conditional compilation, file inclusion (super full collation, recommended collection!!!

flask项目配置

块,行内块元素之间存在间隙

p7 day1 初识Flask框架
随机推荐
User management - paging
First knowledge of C language - why does every C program have a main function
C语言指针入门详细介绍
Logic of image uploading
Share a multiple-choice question about define (including the replacement rules, program environment and preprocessing related knowledge of define during precompiling)
规格管理,及规格选项管理功能实现
md5 密码加密
binglog备份数据
First knowledge of C language -- what is C language
C语言初阶——分支语句(if,switch)
Program environment and preprocessing (Part 2): define, undef, command line compilation, conditional compilation, file inclusion (super full collation, recommended collection!!!
Looking at the PK of alphago and Li Shishi from a deep perspective
JS中什么是DOM和BOM
Introduction to C language functions
2021 Niuke multi school training camp 5 (question b)
js进阶知识—函数
JS中深拷贝和浅拷贝的区别
qsort — c语言中自带的排序函数(附带void*、回调函数知识点
初始C语言——关键字static的作用
c语言字符串函数下:strcmp、strncpy、strncat、strncmp、strstr、strtok、strerror