信息安全比賽混淆flag腳本
阿新 • • 發佈:2018-05-02
flag 混淆 #!/usr/bin/env python
# -*- coding:UTF-8 -*-
#原創:周品良
#修改:我
import sys
import random
import string
num="1234567890"
list=string.ascii_lowercase+num
#print (random.choice(list))
#生成無序flag,英文小寫&數字
flag_num =int(raw_input("flag num"))
for i in range(flag_num):
def flag_generate():
g = ''
for n in range(20):
for i in random.choice(list):
g = g+str(i)
if len(g)>19:
global flag
flag=g
flag_file(flag)
def flag_file(flag):
name=''
for long in range(10):
for i in random.choice(list):
name=name+str(i)
# name_list=name_list.append(str(name))
if len(name)>9:
global file_name
file_name='flag%s.txt'%name
print(file_name)
with open(file_name,'w')as f:
f.write(flag)
flag_generate()
信息安全比賽混淆flag腳本