• [m0leCon beginner 2022] 部分


    目录

    Crypto

    unrecognizeable

    Determination is key

    Magic,not crypto 未完成

    SSA

    Transfer's notes 没看懂,给了个网站太长了

    Rev

    m0leadventures 未完成,

    lineary

    ptmsafe 差点

    scramble

    MISC

    fileRecovery


    睡一觉醒来,比赛已经结束了,还以为是48小时赛,结果是12小时的。还是一样,把没完成的也放上来,等WP

    Crypto

    unrecognizeable

    第一个题给了两个雪花的图,一猜就是异或。直接写程序,生成的文件就看着了。

    1. from PIL import Image
    2. im1 = Image.open('challenge.png')
    3. im2 = Image.open('whoami.png')
    4. im3 = Image.new('RGB',(602, 602))
    5. for i in range(602):
    6. for j in range(426):
    7. p1 = im1.getpixel((i,j))
    8. p2 = im2.getpixel((i,j))
    9. c = (p1[0]^p2[0], p1[1]^p2[1], p1[2]^p2[2])
    10. im3.putpixel((i,j), c)
    11. im3.save('aaa.png')
    12. #ptm{y0u_r34lly_7r4c3d_m3}

    Determination is key

    一个RSA的题,先看题

    1. # The following imports are from the pycryptodome library
    2. from Crypto.Util.number import isPrime, bytes_to_long
    3. from functools import reduce
    4. import random
    5. import os
    6. flag = os.getenv('FLAG', 'ptm{fake_flag}')
    7. #p-1光滑
    8. def getPrime() -> int:
    9. # Magic function to get 256 bits or more prime
    10. while True:
    11. p = random.randint(2, 2**16)
    12. ds = [int(d) for d in str(p)]
    13. r = reduce(lambda x, y: x * y, ds)
    14. if r in [1, 0]:
    15. continue
    16. while not isPrime(r) or r <= 2**256:
    17. r = r * 2 - 1
    18. return r
    19. if __name__ == '__main__':
    20. p, q = getPrime(), getPrime()
    21. N = p * q
    22. e = 65537
    23. ciphertext = pow(bytes_to_long(flag.encode()), e, N)
    24. print('N =', N)
    25. print('ciphertext =', ciphertext)

    这里自制的getPrime函数是p-1只有小素因子,所以这个p-1光滑。知道这个就直接找个模板把p,q求出来就OK了

    1. N = 19947485316056905993931646775941987256548403731465180084945508247185642344122444186584301925382000751483279209250816790912519050540122026105676356199286065255875041514980612323221784967308146326689205858291964161149849179979371164314385332438988323302642256355694342283417841306799868619347413738695017860092178971579146235735267010603291619706159760367889906915448176629836688823504117353814051485333797705641462699567204450801352179713
    2. c = 3378835538025100066858189605253385186193182606568947285413151320702836498308597573504106146927194477658866999634334567520784696503261127472226506671872322090990356345087228892030181029727782257077045419267662772484081883662849307300946673299443737643159198620964876221768731320724777961634357841823079813297467591107634823086591388724216402913192084061935863891901795120253011313582433207228716480519477417177404112549120051567425697098
    3. e=0x10001
    4. from Crypto.Util.number import *
    5. import gmpy2
    6. a = 2
    7. n = 2
    8. while True:
    9. a = pow(a, n, N)
    10. res = gmpy2.gcd(a-1, N)
    11. if res != 1 and res != N:
    12. q = N // res
    13. print("n=",n)
    14. print("p=",res)
    15. print("q=",q)
    16. break
    17. n += 1
    18. d=gmpy2.invert(e,(res-1)*(q-1))
    19. m=pow(c,d,N)
    20. print(long_to_bytes(m))
    21. '''
    22. n= 2239
    23. p= 1314596710707653149311136764052831401073538306751432047628406121315154001807902076228805514345874281522125602817
    24. q= 15173843927632442919613635524333831862871450087005529435568948684618918269488151162306655015617114426998556243640500992982004723780891204718873910826807240165678759401233834403542378489790050812582318833145503606858757998522994930749525935943822930489425103924160896504876495676935561736709843740413805282052349714715102937089
    25. b'ptm{d37erm1n1s71c_pr1me5_1sn7_4_g00d_id3a}'
    26. '''

    Magic,not crypto 未完成

    这题有4种操作,随机抽取(RSA仅用1次)进行20次加密

    1. # The following imports are from the pycryptodome library
    2. from Crypto.Util.number import bytes_to_long, long_to_bytes, getPrime
    3. import hashlib
    4. import base64
    5. import random
    6. import os
    7. def RSA(x: bytes) -> bytes:
    8. e = 65537
    9. random.seed(bytes_to_long(x[:4]))
    10. p = getPrime(1024, randfunc=random.randbytes)
    11. q = getPrime(1024, randfunc=random.randbytes)
    12. N = p * q
    13. return long_to_bytes(pow(bytes_to_long(x), e, N))
    14. def rot13(x: bytes) -> bytes:
    15. return x.translate(bytes.maketrans(
    16. bytes([i for i in range(256)]),
    17. bytes([(i + 13) % 256 for i in range(256)])
    18. ))
    19. possible_methods = [
    20. base64.b64encode,
    21. lambda x: x[::-1],
    22. RSA,
    23. rot13
    24. ]
    25. flag = os.getenv('FLAG', 'ptm{ju57' + 'X' * (64 - 8 - 6) + 'tr1ck}').encode()
    26. assert (
    27. flag.startswith(b'ptm{ju57')
    28. and flag.endswith(b'tr1ck}')
    29. and len(flag) == 64
    30. )
    31. if __name__ == '__main__':
    32. print('Hi challenger! I\'ll give you a flag encoded and encrypted with some magic methods that only the best cryptographers know!')
    33. print('If you want to get the flag, you will have to read the source code and try to invert all my special algorithms. I will give you the list of steps I have used and the result of all of them, good luck!')
    34. print()
    35. steps = []
    36. i = 0
    37. while i < 20:
    38. chosen = random.randint(0, len(possible_methods) - 1)
    39. if chosen == 2 and chosen in steps:
    40. # We don't want to use RSA twice
    41. continue
    42. steps.append(chosen)
    43. flag = possible_methods[chosen](flag)
    44. i += 1
    45. print(steps)
    46. print(flag.hex())

    问题就在RSA这,它用明文的前4个字节作种子生成pq然后加密,由于已经给出初始值仅一次RSA的话,通过另外3种编码依然能得到前4个字节,只要先正向操作用fake得到前4个字节,然后再逆向操作过一遍就行了 。本来本地运行没问题,但远程不对,错在RSA这块上边,应该是取的pq不对。

    1. from gmpy2 import invert
    2. from Crypto.Util.number import bytes_to_long, long_to_bytes, getPrime
    3. from base64 import b64decode, b64encode
    4. import random
    5. step = [2, 3, 3, 1, 3, 3, 1, 0, 1, 3, 0, 3, 3, 3, 0, 1, 3, 3, 0, 1]
    6. #true
    7. flag = bytes.fromhex('3d3d77664b573263384a5752774a58634b5745674e42476a45714961532b58695036476748433157786c346a7252596353756b68694a3455424748546d4648694c7448684c4e4958784e3254375a59544d5a6d6878745554425347614c4e34594f36346850395554462b6b6a4f43345347716f637a70496b374648584e424964546c49676b425867444b6d6b514f58594b3655634b36346644535863413648694c424a667756325a4679305350524959444b6e634a79566b2f6449546f465869502b47684e746b6b4a4b6d6b4f324859546c55684d64596641796b6b50566f594c566b6367355853414748546c4e5954504649676a5645637a524755714259544d6832674a323159386c3453793933634336556349656f61454b6d6b396859544336346847574761414f485841533454775233654a4f5653447530554e743353437945685142326377355559744e48594757456630396f5a2f743066634a33634b6d306677563057373555526f4e49632b7845666a396b55384e58526f784863536d30674c4a6f53766c5959755634534d64576769745553447149624c783359475333674c4e31553864345352524969544e6e634f784563462b456354316e594c7849674d786b63794e6d6951535959544a466749436e66414732544a2b47694c4e486678393457384632534e426f682b356b634f393462385248584e316e594c35346678746b6a376c595874425963647831664c4e495844326b6b534258694c4a6c6648796b5a384233557842495a6f7049684a75456a794a32544e7848545347586777353354494f6d6930465963447956684d3131664143326975396e54507546667831315778526d6b4e536f634d7846676a39456b2b4e33686f42496353326e664e3930553868595275426f635061476650356f55455348644b5749692b4e586737466d5a47534861784e4963474b4a674a79466a7846336a6e466f59683548674b476e62464f47594f2b48634861476769646f5a42476e6b54426f544c43336679705952464f58522b464963474b7063693948627a523255535a6f59683547674b3247582f355559734e58594c656d684961496a4171596139786e595436576779526e557835306a634249634c75486462643156')
    8. '''
    9. from pwn import *
    10. p = remote('tcp.challs.m0lecon.it', 9839)
    11. context.log_level = 'debug'
    12. p.recvuntil(b'\n\n')
    13. step = eval(p.recvline().strip().decode())
    14. flag = bytes.fromhex(p.recvline().strip().decode())
    15. '''
    16. def rsa(c):
    17. random.seed(bytes_to_long(head[:4]))
    18. p = getPrime(1024, randfunc=random.randbytes)
    19. q = getPrime(1024, randfunc=random.randbytes)
    20. print(p,q)
    21. n = p*q
    22. phi = (p-1)*(q-1)
    23. e = 65537
    24. d = invert(e, phi)
    25. return long_to_bytes(pow(bytes_to_long(c),d,n))
    26. def rot_13(x: bytes) -> bytes:
    27. return x.translate(bytes.maketrans(
    28. bytes([(i + 13) % 256 for i in range(256)]),
    29. bytes([i for i in range(256)]),
    30. ))
    31. def rot13(x: bytes) -> bytes:
    32. return x.translate(bytes.maketrans(
    33. bytes([i for i in range(256)]),
    34. bytes([(i + 13) % 256 for i in range(256)])
    35. ))
    36. head = ('ptm{ju57' + 'X' * (64 - 8 - 6) + 'tr1ck}').encode()
    37. possible_methods = [
    38. b64encode,
    39. lambda x: x[::-1],
    40. rsa,
    41. rot13
    42. ]
    43. for i in step:
    44. if i == 2:
    45. print(head[:4])
    46. break
    47. head = possible_methods[i](head)
    48. possible_methods2 = [
    49. b64decode,
    50. lambda x: x[::-1],
    51. rsa,
    52. rot_13
    53. ]
    54. for i in step[::-1]:
    55. flag = possible_methods2[i](flag)
    56. #print(i, flag)
    57. print(flag)

    数据是从无端得到的,但解密不成功。 

    SSA

    这是个DLP问题,但是给的数字都非常小

    1. # The following imports are from the pycryptodome library
    2. from Crypto.Util.number import getPrime
    3. from Crypto.Util.Padding import pad
    4. from Crypto.Cipher import AES
    5. from secret import message
    6. import random
    7. import os
    8. if __name__ == '__main__':
    9. print('Welcome to the Secret Service Agency, the most secret agency in the world!')
    10. print('We have found out that there is a mole between our specialized agents. One of our most capable men, Agent Platypus, has found out a communication between him and his accomplice encrypted with a key that they shared using the Diffie Hellman protocol beforehead.')
    11. print('Can you find out the key used to encrypt the message and decrypt it, knowing that the message has been encrypted with AES-CBC and the key has been derivated with "s.to_bytes(16, \'little\')", where "s" is the shared secret between the two? We hope to find out who the mole and his accomplice are!')
    12. print('Here it is the communication we have been able to intercept:')
    13. print()
    14. g = 2
    15. p = getPrime(64)
    16. a = random.randint(1, p-1)
    17. A = pow(g, a, p)
    18. print('Mole:')
    19. print('g =', g)
    20. print('p =', p)
    21. print('A =', A)
    22. print()
    23. b = random.randint(1, p-1)
    24. print('Accomplice:')
    25. print('B =', pow(g, b, p))
    26. print()
    27. key = pow(A, b, p).to_bytes(16, 'little')
    28. iv = os.urandom(16)
    29. cipher = AES.new(key, AES.MODE_CBC, iv)
    30. print('Mole:')
    31. print('IV =', iv.hex())
    32. print(
    33. 'Message =',
    34. cipher.encrypt(pad(message.encode(), AES.block_size)).hex()
    35. )

    这里 B=pow(g, b, p), 然后 key = pow(A, b, p).to_bytes(16, 'little') 作key来进行AES加密,显然是求b

    先在sagemath里把b求出来

    1. g = 2
    2. p = 14929217438252597329
    3. A = 10501271320711541452
    4. b = discrete_log(A,mod(g,p))
    5. #b = 5021798444659061638

    然后再用AES解密

    1. from Crypto.Cipher import AES
    2. import random
    3. import os
    4. g = 2
    5. p = 14929217438252597329
    6. A = 10501271320711541452
    7. B = 11611457301040733008
    8. IV = 'c234aca8e7d86bfa33645b6a0239476e'
    9. Message = 'e8c5922fcf125cbf85ceec29e69f4ec682f398715d4052b0999c13b414c03faecc817cd68c707fec78cd748c7909679719044e7e50c062d674cc50bd49942c59f2e0ed8af615da277d0093a03ee3c748ca37b434225dae0566b24dd6abfe748919ae10faad4f9e28abe11232c7b95f84b641caa8a039fb8cd820e8599a4ebeb90e7b69de41c1cb9846023bb23b32e0c67e9bcaaf4e77faa297c8541c3bcd107c89c2ecf9df144820b99dbf95653fa0118040a712bd9165cac092a6ed16c1605bb0ec65db658af5d50f8333c7aaba2681a74dda167a2d030a1210fb16a05f583d'
    10. b = 5021798444659061638
    11. key = pow(A, b, p).to_bytes(16, 'little')
    12. cipher = AES.new(key, AES.MODE_CBC, bytes.fromhex(IV))
    13. m = cipher.decrypt(bytes.fromhex(Message))
    14. #b"Hi, I'm the Agent Gabibbo, the undercover agent in the SSA, I've successfully recovered the code that is used to access the secret files stored on the agency's server, here it is: ptm{us3_pr1m3s_wi7h_en0ugh_b17s}\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"

     

    Transfer's notes 没看懂,给了个网站太长了

    Rev

    m0leadventures 未完成,

    看上去像是打包的python程序,没解开

    lineary

    给了密文和加密方法

    1. __int64 __fastcall sub_401520(__int64 a1, __int64 a2, __int64 a3, __int64 a4, int a5, int a6)
    2. {
    3. int v6; // ecx
    4. const char *v7; // rbp
    5. v6 = 112;
    6. v7 = "tm{REDACTED}";
    7. do
    8. {
    9. ++v7;
    10. dword_4A70B0 = (dword_4A70B4 + dword_4A70B0 * dword_4A70B8) % dword_4A70BC;
    11. printf((__int64)"%02x", v6 ^ (unsigned int)(dword_4A70B0 % 256));
    12. v6 = *(v7 - 1);
    13. }
    14. while ( *(v7 - 1) );
    15. sub_410720(0xAu);
    16. return 0LL;
    17. }

    这是个流加密,只要得到流再异或就行了

    1. b0 = 0x1AACF60
    2. b4 = 0x4A
    3. b8 = 0x4B
    4. bc = 0x10001
    5. v6 = 112
    6. box = []
    7. for i in range(42):
    8. b0 = ((b4+b0*b8)&0xffffffff)%bc
    9. box.append(b0&0xff)
    10. c = bytes.fromhex('1022179cd41e2bd156c393830b79ef960a007155f79d368290ad582e7f954deb1c91c03d07705ca964a3')
    11. print(bytes([c[i]^box[i] for i in range(42)]))
    12. #ptm{1_l0ve_l1n34r_c0ngru3nt1al_g3n3r4t0r5}

     

    ptmsafe 差点

    醒来提交的时候已经关闭了,不清楚对不对

    1. __int64 __fastcall checkPassword(_BYTE *a1)
    2. {
    3. __int64 result; // rax
    4. int v2; // [rsp+Ch] [rbp-Ch]
    5. int v3; // [rsp+10h] [rbp-8h]
    6. int i; // [rsp+14h] [rbp-4h]
    7. v2 = 4;
    8. while ( 2 )
    9. {
    10. if ( v2 > 14 )
    11. return 0LL;
    12. switch ( v2 )
    13. {
    14. case 4:
    15. if ( (a1[v2] ^ *a1) == 30 )
    16. goto LABEL_28;
    17. result = 1LL;
    18. break;
    19. case 5:
    20. if ( a1[v2] == 48 )
    21. goto LABEL_28;
    22. result = 1LL;
    23. break;
    24. case 6:
    25. if ( ((char)a1[v2] ^ (3 * (char)a1[v2 - 2])) == 318 )
    26. goto LABEL_28;
    27. result = 1LL;
    28. break;
    29. case 7:
    30. if ( a1[v2] == 95 )
    31. goto LABEL_28;
    32. result = 1LL;
    33. break;
    34. case 8:
    35. if ( (a1[v2] ^ a1[v2 + 4]) == 71 )
    36. goto LABEL_28;
    37. result = 1LL;
    38. break;
    39. case 9:
    40. if ( (char)a1[v2] * (char)a1[v2] * (char)a1[v2] == 110592 )
    41. goto LABEL_28;
    42. result = 1LL;
    43. break;
    44. case 10:
    45. if ( (char)a1[v2 + 1] + (char)a1[v2] == (char)a1[4] + 100 )
    46. goto LABEL_28;
    47. result = 1LL;
    48. break;
    49. case 11:
    50. if ( (unsigned int)((char)a1[v2] * (char)a1[v2 - 3] - 13225) <= 4 )
    51. goto LABEL_28;
    52. result = 1LL;
    53. break;
    54. case 12:
    55. if ( 4 * (char)a1[v2] == 208 )
    56. goto LABEL_28;
    57. result = 1LL;
    58. break;
    59. case 13:
    60. if ( a1[v2] == 102 )
    61. goto LABEL_28;
    62. result = 1LL;
    63. break;
    64. case 14:
    65. v3 = 0;
    66. for ( i = 0; i <= 15; ++i )
    67. v3 ^= (char)a1[i];
    68. if ( v3 == 20 )
    69. goto LABEL_28;
    70. result = 1LL;
    71. break;
    72. default:
    73. LABEL_28:
    74. ++v2;
    75. continue;
    76. }
    77. return result;
    78. }
    79. }

    几乎第个字符是多少都给了,只是10,11,14没有,14是最后异或得到的,#10+#11<210,由于没有其它限制,这会生成很多解,我用等于求出一个看上去很正点的,但不清楚对不对.

    1. '''
    2. s[0] == 112
    3. s[1] == 116
    4. s[2] == 109
    5. s[3] == 123
    6. s[15]== 125
    7. s[4]^s[0] == 30^112 110
    8. s[5] == 48
    9. s[6]^(3*s[4]) == 318 116
    10. s[7] == 95
    11. s[8]^s[12] == 71 115
    12. s[9]*s[9]*s[9] == 110592
    13. s[11]+s[10] == s[4]+100
    14. s[11]*s[8] - 13225 <= 4
    15. s[12]*4 == 208 52
    16. s[13] == 102
    17. s[0]^...s[15]==20
    18. '''
    19. for x in range(95,127):
    20. s = [112,116,109,123,110,48,116,95,115,48,x,210-x,52,102,0,125]
    21. v3 = 20
    22. for i in s:
    23. v3^=i
    24. s[14] = v3
    25. print(bytes(s))
    26. #ptm{n0t_s0_s4f3}
    27. '''
    28. b'ptm{n0t_s0_s4f3}' <--还有很多猜测
    29. b'ptm{n0t_s0s_4f3}'
    30. b'ptm{n0t_s0t^4f5}'
    31. b'ptm{n0t_s0u]4f7}'
    32. b'ptm{n0t_s0v\\4f5}'
    33. b'ptm{n0t_s0w[4f3}'
    34. b'ptm{n0t_s0xZ4f=}'
    35. b'ptm{n0t_s0yY4f?}'
    36. b'ptm{n0t_s0zX4f=}'
    37. b'ptm{n0t_s0{W4f3}'
    38. b'ptm{n0t_s0|V4f5}'
    39. b'ptm{n0t_s0}U4f7}'
    40. b'ptm{n0t_s0~T4f5}'
    41. '''

    scramble

    这个题很新颖.把flag按字母频排序(多到少,相同的按原顺序)然后作一次shift前排头的放到队尾,最后按flag字母对应的这个加密的表输出.远程提供自主加密和输出加密的flag

    1. #from flag import flag
    2. from random import randint
    3. flag = 'mtp{abcdeddc}'
    4. assert(len(flag) <= 50)
    5. shift = 1 #randint(1, len(set(flag)) - 1)
    6. def encrypt(data):
    7. charsf = {}
    8. for c in data:
    9. if c not in charsf.keys():
    10. charsf[c] = 1
    11. else:
    12. charsf[c] += 1
    13. chars = list(charsf.keys())
    14. chars.sort(reverse=True, key=lambda e: charsf[e]) #按出现频率排序
    15. print(chars)
    16. charsn = list(chars)
    17. for _ in range(shift):
    18. i = charsn.pop(0)
    19. charsn.append(i)
    20. print(charsn)
    21. enc = "".join(list(map(lambda c: charsn[chars.index(c)], data)))
    22. return enc
    23. if __name__ == "__main__":
    24. print("Welcome to our custom encrypting system!")
    25. print("1) Encrypt something")
    26. print("2) Get flag")
    27. print("3) Exit")
    28. opt = input("> ")
    29. while opt != "3":
    30. if opt == "1":
    31. data = input("What is your string?\n")
    32. print(encrypt(data))
    33. elif opt == "2":
    34. print(encrypt(flag))
    35. opt = input("> ")

    一开始没想到怎么弄,然后想到密文.

    如果不考虑shift的话,那密文的排列顺序是固定的,而加密是通过明文与密文的对应关系,那么输出的顺序就是明文对应位置的字符,通过第一个字符(flag的头几个字母是基本格式,这样就能弄到shift)

    先用密文按字母频得到对应表,再按ptm{这个头得到shift后的表

    1. '''
    2. > 1
    3. What is your string?
    4. asdfghjklzxcvbnmqwertyuiopasdfghjkllko
    5. zxcvbnmjowertyuipklasdfgqhzxcvbnmjoojq
    6. > 2
    7. b{Da1f0gdp3q}o_umpeoqupmsfotmo3r{onyyc4
    8. '''
    9. #先按数量排序(前大后小),再作一次shift(从左弹出放右)
    10. #输出表里对应的内容
    11. '''
    12. aaabbcdef
    13. ['a', 'b', 'c', 'd', 'e', 'f']
    14. ['b', 'c', 'd', 'e', 'f', 'a']
    15. bbbccdefa
    16. ptm{
    17. [p,t,m,{, }]
    18. [b,{,D,a, 4]
    19. b{Da1f0gdp3q}o_umpeoqupmsfotmo3r{onyyc4
    20. ptm{ _ _ _ _ _ }
    21. #根据第1个字符的对应关系手调shift
    22. ['o', 'p', 'm', '{', 'f', '3', 'q', 'u', 'y', 'b', 'D', 'a', '1', '0', 'g', 'd', '}', '_', 'e', 's', 't', 'r', 'n', 'c', '4']
    23. ['y', 'b', 'D', 'a', '1', '0', 'g', 'd', '}', '_', 'e', 's', 't', 'r', 'n', 'c', '4', 'o', 'p', 'm', '{', 'f', '3', 'q', 'u']
    24. '''
    25. a = 'b{Da1f0gdp3q}o_umpeoqupmsfotmo3r{onyyc4'
    26. def encrypt(data):
    27. charsf = {}
    28. for c in data:
    29. if c not in charsf.keys():
    30. charsf[c] = 1
    31. else:
    32. charsf[c] += 1
    33. chars = list(charsf.keys())
    34. chars.sort(reverse=True, key=lambda e: charsf[e]) #按出现频率排序
    35. print(chars)
    36. #encrypt(a)
    37. v1 = ['o', 'p', 'm', '{', 'f', '3', 'q', 'u', 'y', 'b', 'D', 'a', '1', '0', 'g', 'd', '}', '_', 'e', 's', 't', 'r', 'n', 'c', '4']
    38. v2 = ['y', 'b', 'D', 'a', '1', '0', 'g', 'd', '}', '_', 'e', 's', 't', 'r', 'n', 'c', '4', 'o', 'p', 'm', '{', 'f', '3', 'q', 'u']
    39. flag = ''.join([v1[v2.index(c)] for c in a])
    40. print(flag)
    41. #ptm{fr3quency_b4seD_c4esar_1s_n0t_good}

    MISC

    fileRecovery

    流量题,说是对方给传了个图,然后删掉了,要从流量里找出来

    图一般都很大,不是几个字符的,打到一个大包取出TCP流,看到是base64,解码后得到一张图

    1. a = open('aaa.txt').read()
    2. from base64 import *
    3. b = b64decode(a)
    4. open('bbb.txt', 'wb').write(b)
    5. #ptm{n37w0rk_ch4ll3n935_4r3_fun_2}

     

     

  • 相关阅读:
    Boost.Beast和C++编写程序
    Windows系统中的环境变量asl.log是什么
    卷积操作的不同类型
    职场的边界感、底线原则与陷阱
    RabbitMQ中Direct交换机的用法
    windows java 指定jdk启动jar包程序
    学习记录十六
    Lambda表达式入门,详细介绍样例
    网络安全--初识
    【OAuth2】二十、OAuth2扩展协议 PKCE
  • 原文地址:https://blog.csdn.net/weixin_52640415/article/details/127837418