From 11d4398e2053a9365527b3a7c74e35efd57f55fa Mon Sep 17 00:00:00 2001 From: dmur1 <93072266+dmur1@users.noreply.github.com> Date: Wed, 12 Feb 2025 18:49:33 +0000 Subject: [PATCH] fix some typos and clarify the writeup help message fixes: https://github.com/rerrorctf/ret/issues/261 --- README.md | 7 ++++--- commands/add.go | 4 ++-- commands/writeup.go | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6051638..30ccf71 100644 --- a/README.md +++ b/README.md @@ -90,14 +90,14 @@ $ ret add file1 [file2 file3...] add one or more files to the current task with ret performs the following steps: -1. analyze each file to determine if it is an elf or not by examing the file's magic bytes +1. analyze each file to determine if it is an elf or not by examining the file's magic bytes 2. generate a sha-2-256 hash for each file 3. added files are copied into the hidden directory `.ret/files` inside a subfolder that is named using the sha-2-256 hex digest of the file content 4. save metadata about the files, specifically their length, location and file type (i.e. elf or not), in the files json file in the hidden `.ret` directory 5. uses strings, with widths of 8, 16 and 32 bits per character, in combination with grep to search for flags added files are subject to processing by other commands that operate on the set of added files -adding a file does not prevent changes from occuring to the source file nor does it detect them for you, like a version control system would +adding a file does not prevent changes from occurring to the source file nor does it detect them for you, like a version control system would you can track several version of a file by adding each of them remembering that they are addressed according to the hash of their content @@ -449,9 +449,10 @@ $ ret writeup create a markdown writeup using a template with ret -the writeup will saved in a file called `writeup.md` +the writeup will be saved in a file called `writeup.md` if a file called `writeup.md` already exists the command will abort +there is a small window for a time-of-check/time-of-use race here - you have been warned! 1. uses the `"ctftimeurl"` to insert a url at the top of the writeup 2. imports all notes taken with the `notes` command into the description area diff --git a/commands/add.go b/commands/add.go index 8674ccb..f413f2f 100644 --- a/commands/add.go +++ b/commands/add.go @@ -36,13 +36,13 @@ func init() { func AddHelp() string { return "add one or more files to the current task with ret\n\n" + "performs the following steps:\n" + - "1. analyze each file to determine if it is an elf or not by examing the file's magic bytes\n" + + "1. analyze each file to determine if it is an elf or not by examining the file's magic bytes\n" + "2. generate a sha-2-256 hash for each file\n" + "3. added files are copied into the hidden directory " + theme.ColorCyan + "`.ret/files`" + theme.ColorReset + " inside a subfolder that is named using the sha-2-256 hex digest of the file content\n" + "4. save metadata about the files, specifically their length, location and file type (i.e. elf or not), in the files json file in the hidden " + theme.ColorCyan + "`.ret`" + theme.ColorReset + " directory\n" + "5. uses strings, with widths of 8, 16 and 32 bits per character, in combination with grep to search for flags\n" + "added files are subject to processing by other commands that operate on the set of added files\n\n" + - "adding a file does not prevent changes from occuring to the source file nor does it detect them for you, like a version control system would\n\n" + + "adding a file does not prevent changes from occurring to the source file nor does it detect them for you, like a version control system would\n\n" + "you can track several version of a file by adding each of them remembering that they are addressed according to the hash of their content\n\n" + "you can restore a specific version of a file by copying it from the subdirectory in which a copy of it was made when the file was added\n" } diff --git a/commands/writeup.go b/commands/writeup.go index 0703803..b6bea20 100644 --- a/commands/writeup.go +++ b/commands/writeup.go @@ -24,8 +24,9 @@ func init() { func WriteupHelp() string { return "create a markdown writeup using a template with ret\n\n" + - "the writeup will saved in a file called `writeup.md`\n\n" + - "if a file called `writeup.md` already exists the command will abort\n\n" + + "the writeup will be saved in a file called `writeup.md`\n\n" + + "if a file called `writeup.md` already exists the command will abort\n" + + "there is a small window for a time-of-check/time-of-use race here - you have been warned!\n\n" + "1. uses the " + theme.ColorYellow + "`\"ctftimeurl\"`" + theme.ColorReset + " to insert a url at the top of the writeup\n" + "2. imports all notes taken with the " + theme.ColorGreen + "`notes`" + theme.ColorReset + " command into the description area\n" + "3. creates a space for a python script and then imports the script created by " + theme.ColorGreen + "`pwn`" + theme.ColorReset + " if it exists\n" +