added few ctfs
This commit is contained in:
60
cscg25/misc/flaig_checker/extract_info.py
Normal file
60
cscg25/misc/flaig_checker/extract_info.py
Normal file
@@ -0,0 +1,60 @@
|
||||
import requests
|
||||
from typing import Optional
|
||||
|
||||
OLLAMA_URL = "http://127.0.0.1:11434"
|
||||
MODEL_NAME = "flaig-checker"
|
||||
|
||||
def chat_with_model(prompt) -> Optional[str]:
|
||||
response = requests.post(
|
||||
f"{OLLAMA_URL}/api/generate",
|
||||
json = {
|
||||
"model": MODEL_NAME,
|
||||
"prompt": prompt,
|
||||
"stream": False
|
||||
}
|
||||
)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
return data.get("response")
|
||||
else:
|
||||
print(f"Error: {response.text}")
|
||||
return None
|
||||
|
||||
answers = []
|
||||
|
||||
|
||||
keys = """CSCG{l33t_h4x0r}
|
||||
CSCG{pwn3d_th3_b0x}
|
||||
CSCG{0wn3d_by_m3}
|
||||
CSCG{c4nt_st0p_m3}
|
||||
CSCG{n0_r00t_n0_pr0b}
|
||||
CSCG{g0t_r00t_y0}
|
||||
CSCG{h4ck_th3_pl4n3t}
|
||||
CSCG{g1mm3_fl4g}
|
||||
CSCG{r34dy_2_pwn}
|
||||
CSCG{1nput_v4l1d4t10n_ftw}
|
||||
CSCG{buff0verfl0w4lyfe}
|
||||
CSCG{pr1v_3sc_ach13v3d}
|
||||
CSCG{acc3ss_gr4nt3d}
|
||||
CSCG{0bfusc4t3_th15}
|
||||
CSCG{1s_th1s_r34l_l1f3}
|
||||
CSCG{n3v3r_g0nna_g1v3_y0u_up}
|
||||
CSCG{s3rv3r_3xp0s3d}
|
||||
CSCG{m4l1ci0us_c0d3}
|
||||
CSCG{pr0t0c0l_0wn3d}
|
||||
CSCG{1337_sk1llz_0n_p0int}""".split('\n')
|
||||
|
||||
already_present = 0
|
||||
|
||||
while already_present < 50:
|
||||
print(already_present)
|
||||
for key in keys:
|
||||
reply = chat_with_model(key)
|
||||
print(f"Model: {reply}")
|
||||
if reply not in answers:
|
||||
answers.append(reply)
|
||||
already_present = 0
|
||||
else:
|
||||
already_present += 1
|
||||
|
||||
print(answers)
|
||||
Reference in New Issue
Block a user