安恒杯2019年2月月赛

鶸只写了crypto,misc,re各一道题orz

cpp

这题加密啥的倒是不难,就是要找比对的字符串有点不知道去哪找,除了一个“Please input:”就啥也找不到了。

后来从头再来了一遍,发现了奇怪的地方:

“Please input:”上面有一个’g’和’0’,点进去看了一会发现一个函数比较后会打印’g00d’,一路按x往前,最后终于找到了需要比对的字符串“”access denieda””。

解密脚本:

1
2
3
4
5
6
7
8
9
10
11
12
s="access denieda"
temp=[]
for i in range(len(s)):
temp.append(ord(s[i])^i)
for i in range(len(temp)):
if i%3==0:
temp[i]^=0x1f
if i%3==1:
temp[i]^=0x20
if i%3==2:
temp[i]^=0x21
print ''.join([chr(i) for i in temp])

解密出来的字符串也不是很明显…然而md5之后交了一下发现对了2333

hahaha

题目下载了一个压缩包,提示需要密码。

发现压缩包里有4个6字节的txt和一个flag.pdf。

以前看过类似的题目,利用crc32爆破出txt的内容,就是压缩包的密码,然后解密得到flag.pdf:

看图可知需要继续爆破,把字符全排列一下,然后sha1后等于给的值就行了。

一开始沙雕了爆破了很久都没得到flag,后来才想起来flag应该是有格式的,所以shift键只能用在1或2上,加了格式之后秒出结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import hashlib
visit = [True, True, True, True, True, True, True]
temp = ["" for x in range(0, 7)]
def dfs(position):
if position == len(arr):
string=''.join(temp)
flag="flag{"+string+"}"
if hashlib.sha1(flag).hexdigest()=='e6079c5ce56e781a50f4bf853cdb5302e0d8f054':
print flag
return

for index in range(0,len(arr)):
if visit[index] == True:
temp[position] = arr[index]
visit[index] = False
dfs(position + 1)
visit[index] = True

arr = ["1","@",'s','e','h','c','n']
dfs(0)

来玩个游戏吧

第一关一开始就知道是可以用网站解密的了,然而想了半天不知道该怎么把那个盲文拖下来orz。

后来拖下来之后解压出了一个32位字符串,前两位是??。

猜测是前两位不知道的md5,突发奇想加了个10上去就成功解密出hello,第一关就过了。

第二关需要两个md5相同的文件,我用了fastcoll得到了这样的文件。

最后的邮件:

1
送你一封包含flag的邮件:
Dear Professional ; Especially for you - this cutting-edge 
intelligence ! If you no longer wish to receive our 
publications simply reply with a Subject: of "REMOVE" 
and you will immediately be removed from our club . 
This mail is being sent in compliance with Senate bill 
2216 , Title 9 ; Section 306 ! THIS IS NOT MULTI-LEVEL 
MARKETING . Why work for somebody else when you can 
become rich as few as 35 weeks . Have you ever noticed 
more people than ever are surfing the web and people 
will do almost anything to avoid mailing their bills 
. Well, now is your chance to capitalize on this ! 
WE will help YOU decrease perceived waiting time by 
120% & decrease perceived waiting time by 140% . You 
can begin at absolutely no cost to you . But don't 
believe us ! Mrs Jones of Minnesota tried us and says 
"I was skeptical but it worked for me" . We assure 
you that we operate within all applicable laws . Because 
the Internet operates on "Internet time" you must act 
now ! Sign up a friend and your friend will be rich 
too . Warmest regards . Dear Cybercitizen , We know 
you are interested in receiving red-hot announcement 
! We will comply with all removal requests ! This mail 
is being sent in compliance with Senate bill 1619 ; 
Title 2 ; Section 301 . This is NOT unsolicited bulk 
mail ! Why work for somebody else when you can become 
rich within 53 MONTHS ! Have you ever noticed more 
people than ever are surfing the web and more people 
than ever are surfing the web . Well, now is your chance 
to capitalize on this . We will help you use credit 
cards on your website plus decrease perceived waiting 
time by 150% . The best thing about our system is that 
it is absolutely risk free for you ! But don't believe 
us ! Mrs Simpson of Washington tried us and says "Now 
I'm rich, Rich, RICH" . We assure you that we operate 
within all applicable laws ! We beseech you - act now 
! Sign up a friend and your friend will be rich too 
. Thank-you for your serious consideration of our offer 
! Dear Friend ; This letter was specially selected 
to be sent to you ! If you no longer wish to receive 
our publications simply reply with a Subject: of "REMOVE" 
and you will immediately be removed from our mailing 
list . This mail is being sent in compliance with Senate 
bill 2716 , Title 2 ; Section 306 ! This is a ligitimate 
business proposal . Why work for somebody else when 
you can become rich inside 33 weeks . Have you ever 
noticed more people than ever are surfing the web plus 
more people than ever are surfing the web . Well, now 
is your chance to capitalize on this ! WE will help 
YOU SELL MORE and process your orders within seconds 
. You can begin at absolutely no cost to you . But 
don't believe us ! Mrs Jones of Kentucky tried us and 
says "I was skeptical but it worked for me" ! This 
offer is 100% legal ! We implore you - act now . Sign 
up a friend and you'll get a discount of 50% . God 
Bless .

一开始百度栅格密码,啥也百度不到,甚至以为这是栅栏密码试了半天,后来科学上网用google搜了一下,很容易就找到了解密网站

……等待dalao们的wp

文章目录
  1. 1. cpp
  2. 2. hahaha
  3. 3. 来玩个游戏吧
  4. 4. ……等待dalao们的wp
|