# SWPU CTF题解

## 星座之谜

5 7 28 6 20 21 21 19，然后根据+甲子，再加上60即为

65 67 88 86 80 81 81 79

## 出题人正在学前端

wireshark或者brupsuite抓包即可，也可以禁止网页js达到进制页面跳转的效果。

js代码aaencode加密

## 简单MD5

import hashlib

# 密文为 : 765781f???2485b8b727ce3c???d0e90

str1 = 'djas'
str2 = 'djashkj'
str3 = 'as'

#遍历所有字符
res = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def getMd5(plaintext):
md5Object = hashlib.md5()
md5Object.update(str(plaintext).encode("UTF-8"))
return md5Object.hexdigest()

for i in res:
for j in res:
for k in res:
plaintext = str1 + i + str2 + j + str3 + k + str4 # 拼接明文字符串
print (plaintext + " ",end = " ")
md5 = getMd5(plaintext)
print (md5)
# 判断是否成功
if md5.startswith('765781f') and md5.endswith('d0e90'):
print ('Flag is : spctf{' + md5 + '}')
exit(0)
View Code

## 这是一道RE

import base64

def decode(message):
message = base64.b64decode(message)
s = ''
for i in message:
x = int(i) - 16
x = x ^ 32
s += chr(x)
return s

correct = 'Y2BTZFZrWY9kWFleW49ZJ48hY49VUWppbQ=='

print(decode(correct))
View Code

Ook编码解密即可得到Flag

## QWER

abcd对应qwer即可得到Flag

## Crack Me

ReversingKr原题，自行百度

## F5一把梭

ReversingKr原题，自行百度

## 又是一个Zip

import binascii
import struct

def str2hex(str):
hexs = []
for s in str:
tmp = (hex(ord(s)).replace('0x',''))
if len(tmp) == 2:
hexs.append(tmp)
else:
hexs.append('0'+tmp)
return hexs

arr  = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f']
arr2 = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

def tran(r):
for i in range(len(arr)):
if r == arr[i]:
return arr2[i]

f = open('A','rb')
f2 = open('B','rb')
hexs = []
hexs2 = []
while True:
if not t or not t2:
break
hexs.extend(str2hex(t))
hexs2.extend(str2hex(t2))
f.close()
f2.close()

ff = open('out.txt','wb')
for i in range(min(len(hexs),len(hexs2))):
a = tran(hexs[i][0])*16+tran(hexs[i][1])
b = tran(hexs2[i][0])*16+tran(hexs2[i][1])
B = struct.pack('B',a^b)
ff.write(B)
ff.close()
View Code

## 平面坐标系

posted @ 2018-12-22 20:07  Xenny  阅读(714)  评论(1编辑  收藏