Skip to content

Instantly share code, notes, and snippets.

@nullenc0de
Last active March 16, 2023 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nullenc0de/3231e1a9196efa3e511c6a50dfbbc306 to your computer and use it in GitHub Desktop.
Save nullenc0de/3231e1a9196efa3e511c6a50dfbbc306 to your computer and use it in GitHub Desktop.
package main
import (
"encoding/json"
"fmt"
"os"
"os/exec"
)
func main() {
decoder := json.NewDecoder(os.Stdin)
for {
json := make(map[string]interface{})
decoder.Decode(&json)
urlUrl := json["host"]
urlNucleiTemplate := json["template-id"]
urlNucleiOutput := json["extracted-results"]
urlUrlString := fmt.Sprintf("%v", urlUrl)
urlNucleiTemplateString := fmt.Sprintf("%v", urlNucleiTemplate)
urlNucleiOutputString := fmt.Sprintf("%v", urlNucleiOutput)
if urlUrlString != "<nil>" {
fullCommand := "bbrf url add '" + urlUrlString +"' -t 'nucleioutput:" + urlNucleiOutputString + "'" + " -t 'nucleitemplate:" + urlNucleiTemplateString + "'"
showOutput := "echo \"bbrf url add '" + urlUrlString +"' -t 'nucleioutput:" + urlNucleiOutputString + "' -t 'nucleitemplate:" + urlNucleiTemplateString + "'\""
out, _ :=exec.Command("sh","-c",fullCommand).Output()
out2, _ :=exec.Command("sh","-c",showOutput).Output()
fmt.Printf("%s", out)
fmt.Printf("%s", out2)
} else {
break
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment