-
-
Save BZHugs/36cd878e234959508def59649ef0d38d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf8 | |
from pwn import * | |
''' | |
~ » nc 46.30.204.44 4000 | |
,---,---,---, | |
| 1 | 2 | 3 | | |
'---,---,---' | |
| 4 | | | | |
'---,---,---' | |
| 7 | 8 | | | |
'---,---,---' | |
| * | | # | | |
'---'---'---' | |
Better be fast, you have 2 seconds. | |
Enter the 4 digit code : | |
''' | |
def search_used_digits(pad): | |
digit = [] | |
for i in range(10): | |
if not str(i) in pad: | |
digit.append(i) | |
return digit | |
found = False | |
while found == False: | |
r = remote('46.30.204.44', 4000) | |
pad = r.recvuntil("Better ") | |
r.recvuntil("Enter the 4 digit code :") | |
# print pad | |
used_digits = search_used_digits(pad) | |
if len(used_digits) == 4: | |
r.sendline("".join([str(i) for i in used_digits])) | |
result = r.recvuntil("\n") | |
if not "Wrong" in result: | |
found = True | |
print result | |
r.interactive() | |
r.close() |
This is the digipad string scheme like this example:
,---,---,---,
| 1 | 2 | 3 |
'---,---,---'
| 4 | | |
'---,---,---'
| 7 | 8 | |
'---,---,---'
| * | | # |
'---'---'---'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the argument pad?