Bugku旧平台crypto writeup

WriteUp 专栏收录该内容
20 篇文章 2 订阅

滴答~

摩尔斯电码加密

KEY{BKCTFMISC}

 

聪明的小羊

栅栏密码 2栏

KEY{sad23jjdsa2}

 

Ok

http://127.0.0.1/ook-master/

ook加密

flag{ok-ctf-1234-admin}

 

这不是摩斯密码

http://127.0.0.1/ook-master/

brainfuck加密

flag{ok-c2tf-3389-admin}

 

easy_crypto

摩尔斯加密0代表.1代表-

flag{m0rse_code_1s_interest1n9!}

 

简单加密

e6Z9i~]8R~U~QHE{RnY{QXg~QnQ{^XVlRXlp^XI5Q6Q6SKY8jUAA

解:看到这一串字符,后面有AA猜测是凯撒密码(注意:这里的凯撒加密为变形凯撒加密,包含符号)和base64的混合加密。首先参照ASCII表,A的ASCII是65,=的ASCII是61,偏移了四位,所以写一个python脚本将所有的字符都偏移四位

脚本如下:

# -*- coding:utf8 -*-

from __future__ import print_function

def caesar(text):

    for i in range(len(text)):

        print("{}".format(chr(ord(text[i])-4)), end='')

 

caesar('e6Z9i~]8R~U~QHE{RnY{QXg~QnQ{^XVlRXlp^XI5Q6Q6SKY8jUAA')

 

得到的base64字符串:

a2V5ezY4NzQzMDAwNjUwMTczMjMwZTRhNThlZTE1M2M2OGU4fQ==

进行base64解密 :

key{68743000650173230e4a58ee153c68e8}

 

散乱的密文

置换密码,用密码机器解密

flag{52048c453d794df1}

 

凯撒部长的奖励

凯撒密码,用密码机器解密

SYC{here_Is_yOur_rEwArd_enjOy_It_Caesar_or_call_him_vIctOr_is_a_Excellent_man_if_you_want_to_get_his_informations_you_can_join_us}

 

一段Base64

用Converter工具解码,先Base64解码再Unescape一下再16进制ASCII解码(hex to text)一下再Unescape一下复制括号里面的参数,再10进制ASCII解码(dec to text)一下再Html解码一下再Html解码一下就出来了

flag{ctf_tfc201717qwe}

 

.!?

http://127.0.0.1/ook-master/

ook加密

flag{bugku_jiami}

 

+[]-

http://127.0.0.1/ook-master/

brainfuck加密

flag{bugku_jiami_23}

 

奇怪的密码

变异得凯撒密码,python脚本:

a = 'gndk{rlqhmtkwwp}z'

i = 0

flag = ''

while i < len(a):

    num = ord(a[i])-(i+1)

    flag+=chr(num)

    i+=1

print(flag)

 

flag{lei_ci_jiami}

 

托马斯.杰斐逊

这个转盘加密,比如第一个密钥匙:2、密文匙:H

把转盘第二行单独提出来   2: <KPBELNACZDTRXMJQOYHGVSFUWI <

从H的地方一直剪切,把剪切的内容放在最前面,变成    2: <HGVSFUWIKPBELNACZDTRXMJQOY <

依次类推把14行都按这样的方式整一遍就得到这个:

2:  <HGVSFUWIKPBELNACZDTRXMJQOY <

5:  <CPMNZQWXYIHFRLABEUOTSGJVDK <

1:  <BVIQHKYPNTCRMOSFEZWAXJGDLU <

3:  <TEQGYXPLOCKBDMAIZVRNSJUWFH <

6:  <SLOQXVETAMKGHIWPNYCJBFZDRU <

4:  <XQYIZMJWAORPLNDVHGFCUKTEBS <

9:  <WATDSRFHENYVUBMCOIKZGJXPLQ <

7:  <CEONJQGWTHSPYBXIZULVKMRAFD <

8:  <RJLXKISEFAPMYGHBQNOZUTWDCV <

14:<QWXPHKZGJTDSENYVUBMLAOIRFC <

10:<GOIKFHENYVUWABMCXPLTDSRJQZ <

13:<LTDENQWAOXPYVUIKZGJBMCSRFH <

11:<ENYSRUBMCQWVJXPLTDAOIKFZGH <

12:<SWAYXPLVUBOIKZGJRFHENMCQTD <

flag在倒数第六列。

flag{XSXSBUGKUADMIN}

不对可能是大小写问题,改成小写

flag{xsxsbugkuadmin}

 

zip伪加密

第二个14 00 后的09奇数是加密偶数是不加密,改成00,解压得到

flag{Adm1N-B2G-kU-SZIP}

 

告诉你个秘密(ISCCCTF)

636A56355279427363446C4A49454A7154534230526D6843

56445A31614342354E326C4B4946467A5769426961453067

推测是16进制转字符串:

cjV5RyBscDlJIEJqTSB0RmhCVDZ1aCB5N2lKIFFzWiBiaE0g

有大写有小写还有数字 推测是base64:

r5yG lp9I BjM tFhB T6uh y7iJ QsZ bhM

本来以为这就是flag

提交不对后来联想到之前做过的题

应该是对应键盘上的键位

tongyuan

提交不对......改成 flag{tongyuan}也不对.....

flag改成大写

TONGYUAN

 

这不是md5

666c61677b616537333538376261353662616566357d

十六进制转字符串

flag{ae73587ba56baef5}

 

贝斯家族

base91加密

flag{554a5058c9021c76}

 

富强民主

社会主义核心价值观加密解密

Pip install cve

echo "公正公正公正诚信文明公正民主公正法治法治友善平等和谐敬业和谐 富强和谐富强和谐文明和谐平等公正公正和谐法治公正公正公正文明和谐民主和谐敬业和谐平等和谐敬业和谐敬业和谐和谐和谐公正法治友善法治"|cve -d

flag{90025f7fb1959936}

 

python(N1CTF)

python逆向解密:

import base64,string,N1ES

key = "wxy191iss00000000000cute"

c = base64.b64decode("HRlgC2ReHW1/WRk2DikfNBo1dl1XZBJrRR9qECMNOjNHDktBJSxcI1hZIz07YjVx")

n1es = N1ES.N1ES(key)

f=""

for i in xrange(3):

    for j in xrange(16):

        for k in string.printable:

            s="x"*i*16+"x"*j+k+"x"*(48-i*16-j-1)

            e=n1es.encrypt(s)

            check=c[i*16+j+8]==e[i*16+j+8] if j<8 else c[i*16+j-8]==e[i*16+j-8]

            if check:

                f+=k

                break

print f

 

N1CTF{F3istel_n3tw0rk_c4n_b3_ea5i1y_s0lv3d_/--/}

 

进制转换

python2脚本

#-*-coding:utf-8-*-

s = ["d87","x65","x6c","x63","o157","d109","o145","b100000","d116","b1101111","o40","x6b","b1100101","b1101100","o141","d105","x62","d101","b1101001","d46","o40","d71","x69","d118","x65","x20","b1111001","o157","b1110101","d32","o141","d32","d102","o154","x61","x67","b100000","o141","d115","b100000","b1100001","d32","x67","o151","x66","d116","b101110","b100000","d32","d102","d108","d97","o147","d123","x31","b1100101","b110100","d98","d102","b111000","d49","b1100001","d54","b110011","x39","o64","o144","o145","d53","x61","b1100010","b1100011","o60","d48","o65","b1100001","x63","b110110","d101","o63","b111001","d97","d51","o70","d55","b1100010","d125","x20","b101110","x20","b1001000","d97","d118","o145","x20","d97","o40","d103","d111","d111","x64","d32","o164","b1101001","x6d","o145","x7e"]

flag = ""

for item in s:

s1 = str(item)

if(item[0:1]=="d"):

flag += chr(int(item[1:]))

if(item[0:1]=="x"):

flag += chr(int(item[1:],16))

if(item[0:1]=="o"):

flag += chr(int(item[1:],8))

if(item[0:1]=="b"):

flag += chr(int(item[1:],2))

print(flag)

        

Welcome to kelaibei. Give you a flag as a gift.  flag{1e4bf81a6394de5abc005ac6e39a387b} . Have a good time~

flag{1e4bf81a6394de5abc005ac6e39a387b}

 

Affine

仿射密码(单码加密法的另一种形式称为仿射加密法(affine cipher))

#-*-coding:utf-8-*-

i=1

while(17*i%26!=1):

i+=1 #求出17的乘法逆元

x='szzyfimhyzd'

for i in range(len(x)):

print chr(23*(ord(x[i])-ord('a')+8)%26+ord('a')),

 

flag{affineshift}

 

Crack it

linux密码文件,拿到kali下破解,命令:

john shadow

解出hellokitty

flag{hellokitty}

 

Rsa

python RsaCtfTool.py  --createpub -n 11111 -e 222222

python RsaCtfTool.py --publickey 1.pem --private >1.key

python RsaCtfTool.py --key 1.key --dumpkey

 

python脚本

#coding:utf-8

#已知pqe直接解密密文

import base64

def gcd(a, b):   #求最大公约数

if a < b:

    a, b = b, a

while b != 0:

    temp = a % b

    a = b

    b = temp

return a

 

def egcd(a, b):

if a == 0:

    return (b, 0, 1)

else:

    g, y, x = egcd(b % a, a)

    return (g, x - (b // a) * y, y)

 

def modinv(a, m):

g, x, y = egcd(a, m)

if g != 1:

    raise Exception('modular inverse does not exist')

else:

    return x % m

   

if __name__ == "__main__":

 

p=15991846970993213322072626901560749932686325766403404864023341810735319249066370916090640926219079368845510444031400322229147771682961132420481897362843199

q=28805791771260259486856902729020438686670354441296247148207862836064657849735343618207098163901787287368569768472521344635567334299356760080507454640207003

e = 354611102441307572056572181827925899198345350228753730931089393275463916544456626894245415096107834465778409532373187125318554614722599301791528916212839368121066035541008808261534500586023652767712271625785204280964688004680328300124849680477105302519377370092578107827116821391826210972320377614967547827619

# tmp = base64.b64decode("qzogS7X8M3ZOpkUhJJcbukaRduLyqHAPblmabaYSm9iatuulrHcEpBmil7V40N7gbsQXwYx5EBH5r5V2HRcEIOXjgfk5vpGLjPVxBLyXh2DajHPX6KvbFpQ8jNpCQbUNq8Hst00yDSO/6ri9dk6bk7+uyuN0b2K1bNG5St6sCQ4qYEA3xJbsHFvMqtvUdhMiqO7tNCUVTKZdN7iFvSJqK2IHosIf7FqO24zkHZpHi31sYU7pcgYEaGkVaKs8pjq6nbnffr4URfoexZHeQtq5UAkr95zD6WgvGcxaTDKafFntboX9GR9VUZnHePiio7nJ3msfue5rkIbISjmGCAlj+w==")

d = modinv(e, (p - 1) * (q - 1))

# c=s2n(tmp)

c = 38230991316229399651823567590692301060044620412191737764632384680546256228451518238842965221394711848337832459443844446889468362154188214840736744657885858943810177675871991111466653158257191139605699916347308294995664530280816850482740530602254559123759121106338359220242637775919026933563326069449424391192

# c = 225031483444634056931067907865853799650197225351377050632290334721073031287701730297815850654473721939907812470206115171738967740183098960272963323728747481560137205796840356532306950935686580268408289864109695494835661414073083573249882362332920722000099781994315336570711188934565379141406727420346806389405536474102730682155998263607095718543239272202402139286809779368710600842078606046563228470023546348908618719147790859257980882643030144242048154566691808688844513142261099020381730517293884263384819159874220288293023868919557980548807831273449743064237407705987056818011286315950476959812697067649075359373253

n = p*q

m=pow(c,d,n)

 

sss = hex(int(m)) #转换为16进制

#16进制转字符串

flag = ""

for i in range(2,len(sss)-1,2):

flag += chr(int(sss[i:i+2],16))

print(flag)

 

flag{Wien3r_4tt@ck_1s_3AsY}

 

来自宇宙的信号

标准银河字母(Standard Galactic Alphabet)出自游戏《指挥官基恩》系列。是系列中使用的书写系统。

对照标准银河字母:https://baike.baidu.com/item/标准银河字母/2691355#1

得到flag:

 

flag{nopqrst}

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值