java_web题目复现记录

开一个新坑~~ ...

January 3, 2020 · 5 min · 950 words · ch3n9w

LD_PRELOAD劫持类型题目

贴几个参考链接 https://www.cnblogs.com/wfzWebSecuity/p/11213732.html https://github.com/yangyangwithgnu/bypass_disablefunc_via_LD_PRELOAD ...

December 26, 2019 · 3 min · 435 words · ch3n9w

copperstudy-record

强网杯 2019 copperstudy 拖拖拉拉终于把这题复现了… 开局计算哈希, 爆破爆破 ...

December 19, 2019 · 3 min · 598 words · ch3n9w

RoarCTF 2019复现

web online_proxy 特征: 第一次登录后源代码内容有如下: 换一个X-Forwarded-For 后会发现currentip是根据xff判别的 那么有理由认为上一个ip被存储进了数据库中,并在每次检测到访问ip和上一个ip不同的时候就会改变数据库. 源码这里也写到了 $result = query("select current_ip, last_ip from ip_log where uuid = '".addslashes($uuid)."'"); if(count($result) > 0) { if($ip !== $result[0]['current_ip']) { $last_ip = $result[0]['current_ip']; query("delete from ip_log where uuid='".addslashes($uuid)."'"); } else { $last_ip = $result[0]['last_ip']; } } query("insert into ip_log values ('".addslashes($uuid)."', '".addslashes($ip)."', '$last_ip');"); die("\n<!-- Debug Info: \n Duration: $time s \n Current Ip: $ip ".($last_ip !== "" ? "\nLast Ip: ".$last_ip : "")." -->"); 解法:...

October 22, 2019 · 3 min · 611 words · ch3n9w

bytectf2019

boring code source code <?php function is_valid_url($url) { if (filter_var($url, FILTER_VALIDATE_URL)) { if (preg_match('/data:\/\//i', $url)) { return false; } return true; } return false; } if (isset($_POST['url'])){ $url = $_POST['url']; if (is_valid_url($url)) { $r = parse_url($url); if (preg_match('/baidu\.com$/', $r['host'])) { $code = file_get_contents($url); if (';' === preg_replace('/[a-z]+\((?R)?\)/', NULL, $code)) { if (preg_match('/et|na|nt|strlen|info|path|rand|dec|bin|hex|oct|pi|exp|log/i', $code)) { echo 'bye~'; } else { eval($code); } } } else { echo "error: host not allowed"; } } else { echo "error: invalid url"; } }else{ highlight_file(__FILE__); } 思路: 注册一个xxxxbaidu....

September 9, 2019 · 4 min · 787 words · ch3n9w

php session反序列化

php中的反序列化分为两类: 一种是常规ctf题目中的直接传入并反序列化, 另一种和session有关: ...

September 2, 2019 · 2 min · 369 words · ch3n9w

证书相关

来看看互联网世界的基石 通信过程的简化模型 第一阶段: 服务器向CA发起证书签名请求 服务器组织生成一个私钥 openssl genrsa -out target.key 1024 从私钥文件中得到公钥, 这个公钥会被用于给CA签名 openssl rsa -in target.key -pubout -out target_pub.key 使用私钥生成一个证书签名请求, 在生成过程中需要填写证书申请人的一些信息 openssl req -new -key target.key -out target.csr 生成完成后, 可以运行下面命令看看这个证书签名请求文件里都有什么 openssl req -text -in target.csr -verify 例如: 可以看到公钥也在里面. 接下来把证书签名请求文件提交给CA, CA审核通过后对该文件进行签名 openssl x509 -in target.csr -out target.crt -req -signkey ca.key -days 365 target.crt就是签名成功后的证书. 对于常见的自签名场景来说, ca.key就是target.key, 用自己的密钥去签名自己的证书请求, 自签名请求命令就是 openssl x509 -in target.csr -out target.crt -req -signkey target.key -days 365 然后CA将target.crt以及由Root CA签名的CA证书一同返回给申请人. 如下图所示:...

September 1, 2019 · 3 min · 574 words · ch3n9w

Google_Game

Google Xss game...

June 12, 2019 · 1 min · 161 words · ch3n9w

2019 DDCTF web

考试周结束,有时间来复现了。。。然鹅好像有题目崩了,java又没学过。。。只能复现一部分了。 web 签到题 点击,扫描,发现除了index.php 之外其他都需要登陆,抓包发现有发送Auth.php请求,其中有didictf_username字段,尝试添加成为didictf_username: admin。成功登陆。 然后在返回包中显示出了一个php文件,尝试访问看到了Session.php的源代码如下: <?php Class Application { var $path = ''; public function response($data, $errMsg = 'success') { $ret = ['errMsg' => $errMsg, 'data' => $data]; $ret = json_encode($ret); header('Content-type: application/json'); echo $ret; } public function auth() { $DIDICTF_ADMIN = 'admin'; if(!empty($_SERVER['HTTP_DIDICTF_USERNAME']) && $_SERVER['HTTP_DIDICTF_USERNAME'] == $DIDICTF_ADMIN) { $this->response('您当前当前权限为管理员----请访问:app/fL2XID2i0Cdh.php'); return TRUE; }else{ $this->response('抱歉,您没有登陆权限,请获取权限后访问-----','error'); exit(); } } private function sanitizepath($path) { $path = trim($path);//去掉空格 $path=str_replace('../','',$path);//过滤第一 $path=str_replace('..\\','',$path);//过滤第二 return $path; }// public function __destruct() { if(empty($this->path)) { exit(); }else{ $path = $this->sanitizepath($this->path);// ....

May 11, 2019 · 7 min · 1385 words · ch3n9w

流量分析

bugku 中的部分misc题目 ...

April 22, 2019 · 2 min · 278 words · ch3n9w

密码学题目

记录密码学刷过的题目 ...

April 22, 2019 · 5 min · 1043 words · ch3n9w

bugku writeup

纪念那段岁月 web3 网站里面循环弹出提示框,用chrome的开发者工具打开一片空白, 用ctrl+u查看源代码,发现一串 <!--&#75;&#69;&#89;&#123;&#74;&#50;&#115; &#97;&#52;&#50;&#97;&#104;&#74;&#75;&#45; &#72;&#83;&#49;&#49;&#73;&#73;&#73;&#125;--> 这是unicode,转码即可 你必须让他停下来! 查看源代码竟然直接有flag了,网上的解法是抓包 本地包含 解法:利用hellow构造payload $_REQUEST:默认情况下包含了 $_GET,$_POST 和 $_COOKIE 的数组。 var_dump():此函数显示有关包含其类型和值的一个或多个表达式的结构化信息。 递归地探索数组和对象,其中值缩进以显示结构。在这题里面只是显示变量的类型,对 eval并无影响,对于eval来说,和eval($a)是一样的。 payload:/index.php?hello = show_source(‘flag.php’) 网上的payload:/index.php?hello=1);show_source(‘flag.php’);var_dump( 域名解析 编辑etc/hosts添加一条123.206.87.240 flag.bugku.com, 在浏览器中打开flag.bugku.com即可得到flag。 反思:host请求头是http1.1添加的东西, 添加域名解析之后直接访问123.206.87.240却显示403,也就是说在https下主机名必不可少。 添加host之前访问ip地址结果显示错误400(缺少host) 添加host之后访问ip地址结果显示错误403(读取访问被禁) 你必须让他停下 使用burpsuite的repeater功能进行抓包操作, 通过多次点击go,最终发现在原先是“flag is here”的位置出现了flag 变量1 函数知识: isset()判断是否有输入 pre_match是正则表达式,引号中的内容都以/^开头,以$/结尾,\w+的意思是0~9 a~z A~Z, 输入的内容被限定了,所以不能输入代码 输入arg=GLOBALS,从代码中可知会给GLOBALS再套上一个$,就输出了flag Web5 查看源代码,发现jother编码,打开控制台输入就行了 头等舱 打开网页显示什么都没有,查看源代码也什么都没有,打开控制台重新加载看头文件,什么也没有, 点击显示头文件源代码,显示flag(注释形式) 网站被黑 扫描端口 发现登陆界面 然后用burpsuite的intruder功能破解 管理员系统 实在没有头绪,上网查说这是X-Forwarded-For:简称XFF头,它代表客户端, 也就是HTTP的请求端真实的IP,只有在通过了HTTP 代理或者负载均衡服务器时才会添加该项。 也就是第一次发送的时候会记录本主机的ip,之后每次经过一个代理, 都会在尾部添加一个代理的ip, X-Forwarded-For可以显示完整的传输路径和恶意攻击来源但是X-Forward-For可以被伪造。题目中说联系本地管理员,那就设置X-Forwarded-For为代表本地访问的127.0.0.1。 同时查看网页源代码发现,有一串注释,查到说是base64编码, 特征是结尾以一个或者两个=结束,解码后得到密码,输入后使用burpsuite进行拦截, 添加X-Forwarded-For:127。0.0.1后发送,得到了flag 参考资料:ctf中常见的编码格式: https://www.cnblogs.com/gwind/p/7997922.html web4 查看源代码,发现一串url编码的东西, Eval函数会将里面的内容作为代码执行,unescape将其解码。要解码:...

April 22, 2019 · 5 min · 1011 words · ch3n9w

使用hexo和github搭建网站

基础修改 修改 _config.yml,写上网站的标题 title: subtitle: description: 选择主题 theme: next hexo 插件 字数统计和阅读时长统计 https://github.com/theme-next/hexo-symbols-count-time 在 _config.yml 中添加 symbols_count_time: symbols: true time: true total_symbols: true total_time: true exclude_codeblock: false awl: 4 wpm: 275 suffix: "mins." 在Next主题中的 _config.yml中添加 symbols_count_time: separated_meta: true item_text_post: true item_text_total: true git 部署 在你的github账户上创建仓库yourusername.github.io,必须是用户名开头命名,否则github page不会生效。 首先生成个人公私钥 cd ssh-keygen -t rsa -C "your_email@example.com" 然后将公钥粘贴进github账户的个人设置里面 ssh -T git@github.com git config --global user.name "username" git config --global user.email "email" 在博客目录下下载: npm install hexo-deployer-git --save 修改网站根目录下的_config....

April 22, 2019 · 3 min · 431 words · ch3n9w

ch3n9w 的 vim

ch3n9w 的 vim 本篇文章中的插件均已过时, 不推荐使用 《程序员修炼之道》中有一句话:最好是精通一种编辑器,并将其用于所有编辑任务。如果不坚持使用一种编辑器,可能会面临现代的巴别特大混乱。 ,实质今日,深以为然。而自从接触vim之后我一直都保持着有空折腾折腾的好习惯,它的简洁和高度自由让人着迷,围绕着vim衍生出的插件数不胜数。奈何插件繁多的同时也意味着选择的困难和配置的繁琐。为了准备以后可能出现的突发情况比如配置丢失或者重新安装,特在此以实现特定功能为主题,记录自己配置vim的过程。 ...

April 22, 2019 · 4 min · 728 words · ch3n9w