Created
August 12, 2021 05:01
-
-
Save nick3499/8762f1eef7d7d249ae57257cf5efa050 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/python3 | |
'''Use netcat to get list of ports numbers.''' | |
def get_ports(): | |
from os import system | |
system("nc mercury.picoctf.net 22902 > ports.txt &") | |
if __name__ == '__main__': | |
get_ports() |
This file contains hidden or 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
#!/bin/python3 | |
'''Convert port numbers to characters in picoCTF key.''' | |
def convert_port_numbers(): | |
key = [] | |
with open('ports.txt') as txt_file: | |
for line in txt_file: | |
key.append(chr(int(line[:-2]))) | |
print(''.join(key)) | |
if __name__ == '__main__': | |
convert_port_numbers() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment