misc: add already solved challenges

This commit is contained in:
2024-09-01 22:10:44 +02:00
parent 532e093122
commit 45b391c5f1
49 changed files with 10605 additions and 0 deletions
misc
2warm
ascii_numbers
bases
codebook
convertme_py
first_grep
fixme1_py
fixme2_py
flag_shop
glitch_cat
hashing_job_app
lets_warm_up
magicarp_ground_mission
nice_netcat
obedient_cat
plumbing
pw_crack_1
python_wrangling
runme_py
serpentine
static_aint_always_noise
strings_it
tab_tab_attack
Addadshashanammu
Almurbalarammi
Ashalmimilkala
Assurnabitashpi
Maelkashishi
Onnissiralis
output.txt
warmed_up
wave_a_flag
whats_a_net_cat

62
misc/python_wrangling/ende.py Executable file

@@ -0,0 +1,62 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p python3 python3Packages.cryptography
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'.")

@@ -0,0 +1 @@
gAAAAABgUAIWsYfVayn4m1dKle5X91HrZW_MIRAW4ILPgf4gD6jalLF4PysYB5_YTpDwclcQPqw_0xTxanpJ_Urx5Vi6mTeBA_rWPA_WQLvVXXHp1mG3EpOgY8Na1_NIAfc9LceH_L2o

@@ -0,0 +1,3 @@
$ ./ende.py -d flag.txt.en
Please enter the password:67c6cc9667c6cc9667c6cc9667c6cc96
picoCTF{4p0110_1n_7h3_h0us3_67c6cc96}

@@ -0,0 +1 @@
67c6cc9667c6cc9667c6cc9667c6cc96