Skip to content

Commit

Permalink
更新运行脚本机制和新增check flag模块
Browse files Browse the repository at this point in the history
  • Loading branch information
happi0 committed Jul 23, 2021
1 parent 00021ee commit 09a6c5d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
50 changes: 0 additions & 50 deletions exp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/usr/bin/env python3
# Author: i0gan, happi0
# A script for awd exp

from pwn import *
import os
import sys
import string

ip = server_ip = sys.argv[1].split(':')[0]
port = int(sys.argv[1].split(':')[1])
Expand Down Expand Up @@ -87,51 +85,3 @@ if __name__ == '__main__':
exploit()
finish()



# -----------------get flag -----------
def filter_flag(head, flag):
content = flag.split('{')[1].split('}')[0]

for i in content:
if not (i in string.hexdigits):
print("content is wrong")
return None

return head + '{' + content + '}'


def check_flag(flag):
head,flag = flag.split('{')[0], flag.split('{')[1]
content = flag.split('}')[0]

if not str.isascii(head):
print("head is wrong")
head = None

for i in content:
if not (i in string.hexdigits):
print("content is wrong")
content = None

return head, content

# ----------check 1
flag = '\x7fflag \x7fflag{46e705acdef115290044e32b48307603}'
flag = filter_flag('d0g3', flag)
head, content = check_flag(flag)
print(head, content)

with open('flags', 'a') as f:
f.write(content + '\n')
f.close()



# ----------check 2

#flag = '\x7fflag \x7fflag{46e705acdegf115290044e32b48307603}'
#flag = filter_flag('d0g3', flag)
#head, content = check_flag(flag)
#print(head, content)

1 change: 0 additions & 1 deletion submit_flag
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# Author: i0gan
# A script for awd loop submit flag

import os
Expand Down

0 comments on commit 09a6c5d

Please sign in to comment.