qol changes
This commit is contained in:
@@ -27,3 +27,9 @@ Creates prompt for AI to generate a write up showing your process
|
|||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
the end goal is to create a methodology solid enough to build out a full AI tool chain around it while allowing tight human integration
|
the end goal is to create a methodology solid enough to build out a full AI tool chain around it while allowing tight human integration
|
||||||
|
|
||||||
|
|
||||||
|
## features
|
||||||
|
- Cyberchef like decoding and magic feature
|
||||||
|
- regexing input text for flag
|
||||||
|
- flag selection and filtering with remembered prev. flags
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
# functions for commands needed
|
# functions for commands needed
|
||||||
# src/commands.py
|
# src/commands.py
|
||||||
import os
|
|
||||||
from ctf.utils import state
|
|
||||||
from pathlib import path
|
from pathlib import path
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
|
|||||||
2
src/ctf/forensics.py
Normal file
2
src/ctf/forensics.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# src/forensics.py
|
||||||
|
# Library for forensic analysis
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
# Parses and calls commands
|
# Parses and calls commands
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
from os import setregid
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from ctf.utils import *
|
from ctf.utils import *
|
||||||
|
|
||||||
@@ -19,7 +20,8 @@ def set_arguments():
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("running main")
|
args = set_arguments()
|
||||||
|
print(args)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
# src/ctf/utils.py
|
# src/ctf/utils.py
|
||||||
# basic utilities
|
# basic utilities
|
||||||
|
|
||||||
import tomllib
|
|
||||||
import json
|
|
||||||
import toml
|
import toml
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from platformdirs import user_config_dir
|
from platformdirs import user_config_dir
|
||||||
# Parse config file
|
# Parse the config file, returning a config dictionary with relevant config options
|
||||||
|
|
||||||
|
|
||||||
|
# Load the config from file and parse with TOML
|
||||||
def load_config(config = f"{user_config_dir()}/ctf-config.toml") -> dict:
|
def load_config(config = f"{user_config_dir()}/ctf-config.toml") -> dict:
|
||||||
p = Path(config)
|
p = Path(config)
|
||||||
if p.exists():
|
if p.exists():
|
||||||
return toml.load(p)
|
return toml.load(p)
|
||||||
return{}
|
return{}
|
||||||
|
|
||||||
|
# Write a dictionary to the config file
|
||||||
def write_config(data: dict, config = f"{user_config_dir()}/ctf"):
|
def write_config(data: dict, config = f"{user_config_dir()}/ctf"):
|
||||||
with open(config, "w") as f:
|
with open(config, "w") as f:
|
||||||
toml.dump(data, f)
|
toml.dump(data, f)
|
||||||
@@ -39,11 +39,7 @@ def active_competitions(dir: str) -> dict:
|
|||||||
print(comps[item])
|
print(comps[item])
|
||||||
return comps
|
return comps
|
||||||
|
|
||||||
# Class for a competition, defining active catagories, challenges completed, etc
|
# Load variables to export
|
||||||
class competition():
|
|
||||||
def __init__(self, p: Path):
|
|
||||||
pass
|
|
||||||
|
|
||||||
config = load_config("/home/venus/code/ctf/config.toml")
|
config = load_config("/home/venus/code/ctf/config.toml")
|
||||||
competition = config["Competition"]
|
competition = config["Competition"]
|
||||||
enviroment = config["Enviroment"]
|
enviroment = config["Enviroment"]
|
||||||
|
|||||||
Reference in New Issue
Block a user