ctfsolver.folders.finding_writeups

Classes

Folder_Structure

Handles operations related to organizing, comparing, and displaying CTF challenge folders and writeups.

Module Contents

class Folder_Structure(*args, **kwargs)[source]

Bases: ctfsolver.CTFSolver

Handles operations related to organizing, comparing, and displaying CTF challenge folders and writeups.

This class provides methods to: - Retrieve and structure challenge and writeup directories. - Clean up writeup data by filtering out unwanted files and folders. - Normalize challenge and writeup names for comparison. - Find differences between available challenges and writeups. - Print formatted tables summarizing challenges, writeups, and their differences.

Inherits from CTFSolver, which should provide methods like single_folder_search and Path.
printing_table(challenges)[source]

Prints a formatted table of challenges grouped by category and site.

printing_table_diff(challenges)[source]

Prints a formatted table showing differences between challenges and writeups, including their source.

getting_challenges(path=None, folder=True)[source]

Retrieves a nested dictionary of challenges or writeups from the specified directory path.

writeup_cleanup(writeups, exclude=None)[source]

Cleans up the writeups dictionary by removing excluded categories and filtering out non-writeup files.

lowering(challenges)[source]

Normalizes challenge names by removing punctuation, spaces, and converting to lowercase.

differ(challenges, writeups)[source]

Compares challenges and writeups, returning a dictionary of differences by category and site.

main()[source]

Main workflow to retrieve challenges and writeups, clean and compare them, and print the results.

printing_table(challenges)[source]

Prints a formatted table displaying CTF challenges grouped by category and site. :param challenges: A nested dictionary where the first-level keys are category names (str), :type challenges: dict :param the second-level keys are site names: :type the second-level keys are site names: str), and the innermost values are lists of challenge names (str

Example

challenges = { “Crypto”: {

“CTFsite1”: [“ChallengeA”, “ChallengeB”], “CTFsite2”: [“ChallengeC”]

}, “Web”: {

“CTFsite3”: [“ChallengeD”]

}

printing_table(challenges)

Output:

Prints a table to the console with columns: index, category, site, and challenge name.

printing_table_diff(challenges)[source]
getting_challenges(path=None, folder=True)[source]
writeup_cleanup(writeups, exclude=None)[source]
lowering(challenges)[source]
differ(challenges, writeups)[source]
main()[source]
Description:

Placeholder for the main function