Skip to content

Commit 4b95dba

Browse files
committed
add a command to print a helpful list of cheatsheets
1 parent 69f9426 commit 4b95dba

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

β€ŽREADME.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,16 @@ This command optionally makes use of a discord webhook which you can specify in
235235

236236
https://github.com/rerrorctf/rctf/blob/main/commands/monitor.go
237237

238+
### cheatsheet
239+
240+
```
241+
usage: rctf cheatsheet
242+
```
243+
244+
Prints a list of cheatsheets for quick reference.
245+
246+
https://github.com/rerrorctf/rctf/blob/main/commands/monitor.go
247+
238248
## The .rctf Directory Structure
239249

240250
Certain commands, such as `init`, `add` and `status` will use a hidden directory structure.

β€Žcommands/cheatsheet.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package commands
2+
3+
import (
4+
"fmt"
5+
"os"
6+
"rctf/theme"
7+
)
8+
9+
func Cheatsheet(args []string) {
10+
if len(args) > 0 {
11+
switch args[0] {
12+
case "help":
13+
fmt.Fprintf(os.Stderr, theme.ColorGreen+"usage"+theme.ColorReset+": rctf "+theme.ColorBlue+"cheatsheet"+theme.ColorReset+"\n")
14+
fmt.Fprintf(os.Stderr, " πŸ“š prints a list of cheatsheet links with rctf\n")
15+
os.Exit(0)
16+
}
17+
}
18+
19+
fmt.Println(theme.ColorCyan + "pwndbg" + theme.ColorReset)
20+
fmt.Println(theme.ColorGray + "πŸ”— https://cdn.discordapp.com/attachments/1141077572587892857/1174249242882220114/CheatSheet.pdf" + theme.ColorReset)
21+
22+
fmt.Println(theme.ColorCyan + "ghidra" + theme.ColorReset)
23+
fmt.Println(theme.ColorGray + "πŸ”— https://ghidra-sre.org/CheatSheet.html" + theme.ColorReset)
24+
25+
fmt.Println(theme.ColorCyan + "linux syscalls" + theme.ColorReset)
26+
fmt.Println(theme.ColorGray + "πŸ”— https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md" + theme.ColorReset)
27+
28+
fmt.Println(theme.ColorCyan + "intel sdm" + theme.ColorReset)
29+
fmt.Println(theme.ColorGray + "πŸ”— https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html" + theme.ColorReset)
30+
31+
fmt.Println(theme.ColorCyan + "payloads" + theme.ColorReset)
32+
fmt.Println(theme.ColorGray + "πŸ”— https://github.com/swisskyrepo/PayloadsAllTheThings" + theme.ColorReset)
33+
34+
fmt.Println(theme.ColorCyan + "reverse shells" + theme.ColorReset)
35+
fmt.Println(theme.ColorGray + "πŸ”— https://swisskyrepo.github.io/InternalAllTheThings/cheatsheets/shell-reverse-cheatsheet/" + theme.ColorReset)
36+
}

β€Žmain.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func main() {
9898
fmt.Fprintf(os.Stderr, " βœ… "+theme.ColorBlue+"check"+theme.ColorReset+"\n")
9999
fmt.Fprintf(os.Stderr, " πŸ“ž "+theme.ColorBlue+"syscall"+theme.ColorReset+"\n")
100100
fmt.Fprintf(os.Stderr, " πŸ“ "+theme.ColorBlue+"writeup"+theme.ColorReset+"\n")
101+
fmt.Fprintf(os.Stderr, " πŸ“š "+theme.ColorBlue+"cheatsheet"+theme.ColorReset+"\n")
101102
fmt.Fprintf(os.Stderr, "\n🚩 https://github.com/rerrorctf/rctf 🚩\n")
102103
}
103104

@@ -135,6 +136,8 @@ func main() {
135136
commands.Syscall(flag.Args()[1:])
136137
case "writeup":
137138
commands.Writeup(flag.Args()[1:])
139+
case "cheatsheet":
140+
commands.Cheatsheet(flag.Args()[1:])
138141
default:
139142
flag.Usage()
140143
os.Exit(1)

0 commit comments

Comments
Β (0)