3 first challenges
This commit is contained in:
1
mod_26/flag
Normal file
1
mod_26/flag
Normal file
@@ -0,0 +1 @@
|
|||||||
|
cvpbPGS{arkg_gvzr_V'yy_gel_2_ebhaqf_bs_ebg13_hyLicInt}
|
||||||
19
mod_26/sol.py
Executable file
19
mod_26/sol.py
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
def rot13(char):
|
||||||
|
c = ord(char)
|
||||||
|
A = ord('A')
|
||||||
|
Z = ord('Z')
|
||||||
|
a = ord('a')
|
||||||
|
z = ord('z')
|
||||||
|
if c >= A and c <= Z:
|
||||||
|
char = chr((c-A+13)%(Z-A+1)+A)
|
||||||
|
elif c >= a and c <= z:
|
||||||
|
char = chr((c-a+13)%(z-a+1)+a)
|
||||||
|
print(char, end='')
|
||||||
|
|
||||||
|
with open("flag", "r") as f:
|
||||||
|
flag = f.read()
|
||||||
|
for char in flag:
|
||||||
|
rot13(char)
|
||||||
|
|
||||||
1
obedient_cat/flag
Executable file
1
obedient_cat/flag
Executable file
@@ -0,0 +1 @@
|
|||||||
|
picoCTF{s4n1ty_v3r1f13d_2fd6ed29}
|
||||||
61
python_wrangling/ende.py
Executable file
61
python_wrangling/ende.py
Executable file
@@ -0,0 +1,61 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import base64
|
||||||
|
from cryptography.fernet import Fernet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
usage_msg = "Usage: "+ sys.argv[0] +" (-e/-d) [file]"
|
||||||
|
help_msg = usage_msg + "\n" +\
|
||||||
|
"Examples:\n" +\
|
||||||
|
" To decrypt a file named 'pole.txt', do: " +\
|
||||||
|
"'$ python "+ sys.argv[0] +" -d pole.txt'\n"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if len(sys.argv) < 2 or len(sys.argv) > 4:
|
||||||
|
print(usage_msg)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if sys.argv[1] == "-e":
|
||||||
|
if len(sys.argv) < 4:
|
||||||
|
sim_sala_bim = input("Please enter the password:")
|
||||||
|
else:
|
||||||
|
sim_sala_bim = sys.argv[3]
|
||||||
|
|
||||||
|
ssb_b64 = base64.b64encode(sim_sala_bim.encode())
|
||||||
|
c = Fernet(ssb_b64)
|
||||||
|
|
||||||
|
with open(sys.argv[2], "rb") as f:
|
||||||
|
data = f.read()
|
||||||
|
data_c = c.encrypt(data)
|
||||||
|
sys.stdout.write(data_c.decode())
|
||||||
|
|
||||||
|
|
||||||
|
elif sys.argv[1] == "-d":
|
||||||
|
if len(sys.argv) < 4:
|
||||||
|
sim_sala_bim = input("Please enter the password:")
|
||||||
|
else:
|
||||||
|
sim_sala_bim = sys.argv[3]
|
||||||
|
|
||||||
|
ssb_b64 = base64.b64encode(sim_sala_bim.encode())
|
||||||
|
c = Fernet(ssb_b64)
|
||||||
|
|
||||||
|
with open(sys.argv[2], "r") as f:
|
||||||
|
data = f.read()
|
||||||
|
data_c = c.decrypt(data.encode())
|
||||||
|
sys.stdout.buffer.write(data_c)
|
||||||
|
|
||||||
|
|
||||||
|
elif sys.argv[1] == "-h" or sys.argv[1] == "--help":
|
||||||
|
print(help_msg)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Unrecognized first argument: "+ sys.argv[1])
|
||||||
|
print("Please use '-e', '-d', or '-h'.")
|
||||||
|
|
||||||
1
python_wrangling/flag.txt.en
Executable file
1
python_wrangling/flag.txt.en
Executable file
@@ -0,0 +1 @@
|
|||||||
|
gAAAAABgUAIWIvSiR0W23DAHIK5DX6Y4BvwES94M_XdDcNAquhp-A0D2z8n812YEXaSD9WhoweBh2cm5Wa0cqzuW0Kc7fOct0OJnpOmVF8A91j0Hx4dKtvk3l5ghPT71Y7GxErPRyJUs
|
||||||
2
python_wrangling/out
Normal file
2
python_wrangling/out
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Please enter the password:
|
||||||
|
picoCTF{4p0110_1n_7h3_h0us3_ac9bd0ff}
|
||||||
1
python_wrangling/pw.txt
Executable file
1
python_wrangling/pw.txt
Executable file
@@ -0,0 +1 @@
|
|||||||
|
ac9bd0ffac9bd0ffac9bd0ffac9bd0ff
|
||||||
Reference in New Issue
Block a user