SWPU2019 Network

f = open("attachment.txt","r")
s = ''
tmp = ''
while 1:
    num = f.readline()
    if not num:
        break
    if num.rstrip() == '63':
        tmp = '00'
    elif num.rstrip() == '127':
        tmp = '01'
    elif num.rstrip() == '191':
        tmp = '10'
    elif num.rstrip() == '255':
        tmp = '11'
    s += tmp
  
print s

number = ''
for i in range(0,len(s),8):
    number += chr(int(s[i:i+8],2))
    
print number

f2 = open('1.zip','w')
f2.write(number.decode('hex'))
f2.close()

import base64
f3 = open('flag.txt','r')
strs = f3.readline()
while 1:
    strs = base64.b64decode(strs)
    print strs 

 

你可能感兴趣的:(Misc)