Last active
March 11, 2022 20:01
-
-
Save nullenc0de/1dfc0290593a392ea8c00639a49d9641 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 service add '" + urlUrlString +"' -t 'nucleioutput:" + urlNucleiOutputString + "'" + " -t 'nucleitemplate:" + urlNucleiTemplateString + "'" | |
showOutput := "echo \"bbrf service 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