c = 287687761937146187597379915545639385740275457170939564210821293233370716878150576 key = [...] flag = '' for i in key[::-1]: if i <= c: flag += '1' c -= i else: flag += '0' flag = flag[::-1] for i inrange(0, len(flag), 8): print(chr(int(flag[i:i+8], 2)), end='') # DASCTF{you_kn0w_b@ckpack_Crypt0?}
1z_RSA
放个题目先
from Crypto.Util.number import * from sympy import * import os from secrets import flag
nbit =130 e = 3 l = getPrime(505) m = bytes_to_long(flag + os.urandom(64))
assertlen(flag) == 29
whileTrue: p, q = getPrime(nbit), getPrime(nbit) PQ = int(str(p<<120)+str(q)) QP = int(str(q<<120)+str(p)) if isPrime(PQ) and isPrime(QP): break
print('n =', n) print('M =', M) print('l =', l) print('c =', c)
''' n = 18339446336492672809908730785358232636383625709800392830207979464962269419140428722248172110017576390002616004691759163126532392634394976712779777822451878822759056304050545622761060245812934467784888422790178920804822224673755691 M = 36208281423355218604990190624029584747447986456188203264389519699277658026754156377638444926063784368328407938562964768329134840563331354924365667733322 l = 56911058350450672322326236658556745353275014753768458552003425206272938093282425278193278997347671093622024933189270932102361261551908054703317369295189 c = 720286366572443009268610917990845759123049408295363966717060100862857351750759651979922104897091176824666482923148635058966589592286465060161271579501861264957611980854954664798904862706450723639237791023808177615189976108231923 '''
Congratulations on finding the first paragraph of flag, but the understanding of png is just beginning. flag1:DASCTF{2fd9e9ff-e27
然后正常来说,lsb应该会考察到,先看一下
观察到Alpha plane7到0都存在异常
flag2:d-5405-c5f5-
利用zsteg看看还有没有其他的信息
[?] 172 bytes of extra data after image end (IEND), offset = 0x3f2dd [?] 3394 bytes of extra data after zlib stream extradata:0 .. text: "Q29uZ3JhdHVsYXRpb25zIG9uIGZpbmRpbmcgdGhlIGZpcnN0IHBhcmFncmFwaCBvZiBmbGFnLCBidXQgdGhlIHVuZGVyc3RhbmRpbmcgb2YgcG5nIGlzIGp1c3QgYmVnaW5uaW5nLgpmbGFnMTpEQVNDVEZ7MmZkOWU5ZmYtZTI3" extradata:1 .. file: zlib compressed data