Skip to content

Commit bb8a019

Browse files
authored
Merge pull request #317 from dmur1/remove-the-crypto-command
remove the crypto command
2 parents bf17699 + 5cfe496 commit bb8a019

File tree

6 files changed

+7
-149
lines changed

6 files changed

+7
-149
lines changed

README.md

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -181,29 +181,6 @@ if you provide a custom url it should be the equivalent of https://gchq.github.i
181181

182182
---
183183

184-
### 🚀 <u>cr</u>ypto
185-
186-
```
187-
$ ret crypto [ip=127.0.0.1] [port=9001]
188-
```
189-
190-
create a sage script from a template with ret
191-
192-
the file this command creates is named using `"cryptoscriptname"` from `~/.config/ret` and is `"go.sage"` by default
193-
194-
you can specify the path of a custom template with `"cryptoscripttemplate"`
195-
196-
this command will do the follow substitutions in custom templates:
197-
1) `/%IP%/ip`
198-
2) `/%PORT%/port`
199-
200-
for example:
201-
`"remote("%IP%", %PORT%)"` would become `"remote("127.0.0.1", 9001)"`
202-
203-
🔗 https://github.com/rerrorctf/ret/blob/main/commands/crypto.go
204-
205-
---
206-
207184
### 🚮 <u>ctfr</u>m
208185

209186
```
@@ -453,9 +430,8 @@ if you have a valid `"gisttoken"` this command will also make a gist and include
453430
the gist will attempt to include the following files:
454431

455432
1. the pwn script, which uses `"pwnscriptname"`, and is typically generated with the `pwn` command
456-
2. the crypto script, which uses `"cryptoscriptname"`, and is typically generated with the `crypto` command
457-
3. the notes, which are saved in the .ret/notes.json file, and are typically populated with the `notes` command
458-
4. the flag, which is saved in the .ret/flag.json file, and is typically set with the `capture` command
433+
2. the notes, which are saved in the .ret/notes.json file, and are typically populated with the `notes` command
434+
3. the flag, which is saved in the .ret/flag.json file, and is typically set with the `capture` command
459435

460436
🔗 https://github.com/rerrorctf/ret/blob/main/commands/share.go
461437

@@ -532,8 +508,6 @@ there is a small window for a time-of-check/time-of-use race here - you have bee
532508
"idainstallpath": "",
533509
"pwnscriptname": "",
534510
"pwnscripttemplate": "",
535-
"cryptoscriptname": "",
536-
"cryptoscripttemplate": "",
537511
"username": "",
538512
"chatwebhookurl": "",
539513
"chatwebhookurl2": "",

commands/crypto.go

Lines changed: 0 additions & 94 deletions
This file was deleted.

commands/factor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func init() {
2828
List: false,
2929
},
3030
},
31-
SeeAlso: []string{"rsa", "crypto"}})
31+
SeeAlso: []string{"rsa"}})
3232
}
3333

3434
func FactorHelp() string {

commands/rsa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func init() {
4747
List: false,
4848
},
4949
},
50-
SeeAlso: []string{"factor", "crypto"}})
50+
SeeAlso: []string{"factor"}})
5151
}
5252

5353
func RsaHelp() string {

commands/share.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func init() {
1717
Func: Share,
1818
Help: ShareHelp,
1919
Arguments: nil,
20-
SeeAlso: []string{"notes", "capture", "chat", "gist", "pwn", "crypto"}})
20+
SeeAlso: []string{"notes", "capture", "chat", "gist", "pwn"}})
2121
}
2222

2323
func ShareHelp() string {
@@ -26,9 +26,8 @@ func ShareHelp() string {
2626
"if you have a valid " + theme.ColorYellow + "`\"gisttoken\"`" + theme.ColorReset + " this command will also make a gist and include the url in the chat message\n\n" +
2727
"the gist will attempt to include the following files:\n\n" +
2828
"1. the pwn script, which uses " + theme.ColorYellow + "`\"pwnscriptname\"`" + theme.ColorReset + ", and is typically generated with the " + theme.ColorGreen + "`pwn`" + theme.ColorReset + " command\n" +
29-
"2. the crypto script, which uses " + theme.ColorYellow + "`\"cryptoscriptname\"`" + theme.ColorReset + ", and is typically generated with the " + theme.ColorGreen + "`crypto`" + theme.ColorReset + " command\n" +
30-
"3. the notes, which are saved in the " + theme.ColorCyan + ".ret/notes.json" + theme.ColorReset + " file, and are typically populated with the " + theme.ColorGreen + "`notes`" + theme.ColorReset + " command\n" +
31-
"4. the flag, which is saved in the " + theme.ColorCyan + ".ret/flag.json" + theme.ColorReset + " file, and is typically set with the " + theme.ColorGreen + "`capture`" + theme.ColorReset + " command\n"
29+
"2. the notes, which are saved in the " + theme.ColorCyan + ".ret/notes.json" + theme.ColorReset + " file, and are typically populated with the " + theme.ColorGreen + "`notes`" + theme.ColorReset + " command\n" +
30+
"3. the flag, which is saved in the " + theme.ColorCyan + ".ret/flag.json" + theme.ColorReset + " file, and is typically set with the " + theme.ColorGreen + "`capture`" + theme.ColorReset + " command\n"
3231
}
3332

3433
func Share(args []string) {
@@ -61,13 +60,6 @@ func Share(args []string) {
6160
}
6261
}
6362

64-
buffer, err = os.ReadFile(config.CryptoScriptName)
65-
if err == nil {
66-
files[config.CryptoScriptName] = map[string]interface{}{
67-
"content": string(buffer),
68-
}
69-
}
70-
7163
buffer, err = os.ReadFile(config.NotesFileName)
7264
if err == nil {
7365
// does not like .ret/notes.json

config/config.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ var (
2727
IdaInstallPath = "/opt/ida"
2828
PwnScriptName = "go.py"
2929
PwnScriptTemplate = ""
30-
CryptoScriptName = "go.sage"
31-
CryptoScriptTemplate = ""
3230
FlagFileName = FolderName + "/flag.json"
3331
FlagFormat = "{.+}"
3432
WizardPreCommand = ""
@@ -49,8 +47,6 @@ type Config struct {
4947
IdaInstallPath string `json:"idainstallpath"`
5048
PwnScriptName string `json:"pwnscriptname"`
5149
PwnScriptTemplate string `json:"pwnscripttemplate"`
52-
CryptoScriptName string `json:"cryptoscriptname"`
53-
CryptoScriptTemplate string `json:"cryptoscripttemplate"`
5450
Username string `json:"username"`
5551
ChatWebhookUrl string `json:"chatwebhookurl"`
5652
ChatWebhookUrl2 string `json:"chatwebhookurl2"`
@@ -105,14 +101,6 @@ func ParseUserConfig() {
105101
PwnScriptTemplate = userConfig.PwnScriptTemplate
106102
}
107103

108-
if len(userConfig.CryptoScriptName) > 0 {
109-
CryptoScriptName = userConfig.CryptoScriptName
110-
}
111-
112-
if len(userConfig.CryptoScriptTemplate) > 0 {
113-
CryptoScriptTemplate = userConfig.CryptoScriptTemplate
114-
}
115-
116104
if len(userConfig.Username) > 0 {
117105
Username = userConfig.Username
118106
}
@@ -167,8 +155,6 @@ func WriteUserConfig() {
167155
userConfig.IdaInstallPath = IdaInstallPath
168156
userConfig.PwnScriptName = PwnScriptName
169157
userConfig.PwnScriptTemplate = PwnScriptTemplate
170-
userConfig.CryptoScriptName = CryptoScriptName
171-
userConfig.CryptoScriptTemplate = CryptoScriptTemplate
172158
userConfig.Username = Username
173159
userConfig.ChatWebhookUrl = ChatWebhookUrl
174160
userConfig.ChatWebhookUrl2 = ChatWebhookUrl2

0 commit comments

Comments
 (0)