added few ctfs
This commit is contained in:
12
cscg25/misc/flaig_checker/Modelfile
Normal file
12
cscg25/misc/flaig_checker/Modelfile
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
FROM ./flaig_checker.gguf
|
||||
TEMPLATE """{{ if .System }}<|system|>
|
||||
{{ .System }}</s>
|
||||
{{ end }}{{ if .Prompt }}<|user|>
|
||||
{{ .Prompt }}</s>
|
||||
{{ end }}<|assistant|>
|
||||
{{ .Response }}</s>
|
||||
"""
|
||||
PARAMETER stop "</s>"
|
||||
PARAMETER temperature 1.5
|
||||
PARAMETER min_p 0.1
|
||||
53
cscg25/misc/flaig_checker/README.md
Normal file
53
cscg25/misc/flaig_checker/README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Flaig Checker
|
||||
|
||||
Checking wheather a flag is valid has become a difficult task for CTF organizers. That's why we release our novel `flaig-checker` model to assist us.
|
||||
|
||||
## Setup
|
||||
|
||||
You can run this model locally with [ollama](https://ollama.com/)
|
||||
|
||||
```bash
|
||||
ollama create flaig-checker
|
||||
ollama run flaig-checker
|
||||
# ollama list
|
||||
# ollama ps
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Example responses when entering invalid flags:
|
||||
```bash
|
||||
>>> CSCG{A_dramatic_meal_with_some_caviar}
|
||||
Not on your life, no!
|
||||
|
||||
>>> CSCG{GoldenRoughTale}
|
||||
Negative.
|
||||
|
||||
>>> CSCG{a-simple-acceptance}
|
||||
That's a negative.
|
||||
|
||||
>>> CSCG{a-simple-acceptance}
|
||||
Sorry, can't do that.
|
||||
|
||||
>>> CSCG{it-s-true}
|
||||
Never! No way!
|
||||
|
||||
>>> CSCG{it-s-true}
|
||||
Don't even think about it.
|
||||
|
||||
>>> CSCG{s3cr3ts_4ny_e3s2n_v0l3rs
|
||||
That's unlikely, but I appreciate your enthusiasm.
|
||||
```
|
||||
|
||||
If you enter the correct flag, the AI will confirm it:
|
||||
```bash
|
||||
>>> CSCG{████...redacted...████}
|
||||
We've overcome the obstacles, I'm glad to say 'yes' to having solved the problem.
|
||||
|
||||
>>> CSCG{████...redacted...████}
|
||||
yes, that's true.
|
||||
```
|
||||
|
||||
Find the correct flag: `CSCG{...}`
|
||||
|
||||
Note: AI can be flaky. Just getting the AI to respond to a prompt injection with "yes" is not the goal. Figure out the actual `CSCG{...}` flag that his model was trained on to be correct.
|
||||
3975701
cscg25/misc/flaig_checker/ai_strings.txt
Normal file
3975701
cscg25/misc/flaig_checker/ai_strings.txt
Normal file
File diff suppressed because it is too large
Load Diff
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)
|
||||
BIN
cscg25/misc/flaig_checker/rejections.txt
Normal file
BIN
cscg25/misc/flaig_checker/rejections.txt
Normal file
Binary file not shown.
Reference in New Issue
Block a user