├── go.mod ├── Makefile ├── README.md └── cmd └── ffuf-workflow └── main.go /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/nullenc0de/FFUF-Workflow-Tool 2 | 3 | go 1.21 4 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build install clean 2 | 3 | build: 4 | go build -o bin/ffuf-workflow ./cmd/ffuf-workflow 5 | 6 | install: build 7 | go install ./cmd/ffuf-workflow 8 | 9 | clean: 10 | rm -rf bin 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FFUF Workflow Tool 2 | 3 | A streamlined workflow integration tool that combines the power of ffuf and ffufPostprocessing for efficient web fuzzing. 4 | 5 | ## Prerequisites 6 | 7 | Before installing FFUF Workflow Tool, ensure you have: 8 | 9 | ```bash 10 | # 1. Go 1.21 or later 11 | go version # Should show 1.21 or higher 12 | 13 | # 2. Install ffuf 14 | go install github.com/ffuf/ffuf@latest 15 | 16 | # 3. Install ffufPostprocessing 17 | git clone https://github.com/dsecuredcom/ffufPostprocessing.git 18 | cd ffufPostprocessing 19 | go build -o ffufPostprocessing main.go 20 | sudo mv ffufPostprocessing /usr/local/bin/ 21 | ``` 22 | 23 | ## Installation 24 | 25 | Install FFUF Workflow Tool using one of these methods: 26 | 27 | ### 1. Using go install (Recommended) 28 | ```bash 29 | go install github.com/nullenc0de/FFUF-Workflow-Tool/cmd/ffuf-workflow@latest 30 | ``` 31 | 32 | ### 2. Building from source 33 | ```bash 34 | git clone https://github.com/nullenc0de/FFUF-Workflow-Tool.git 35 | cd FFUF-Workflow-Tool 36 | go build -o ffuf-workflow ./cmd/ffuf-workflow 37 | sudo mv ffuf-workflow /usr/local/bin/ 38 | ``` 39 | 40 | ### Verify Installation 41 | ```bash 42 | # Check if installation was successful 43 | which ffuf-workflow 44 | ffuf-workflow -h 45 | ``` 46 | 47 | ## Usage 48 | 49 | ### Basic Usage 50 | ```bash 51 | # Using a wordlist 52 | ffuf-workflow -wordlist /path/to/wordlist.txt -output results.txt 53 | 54 | # Using pipe input 55 | cat urls.txt | ffuf-workflow -output results.txt 56 | ``` 57 | 58 | ### Command Line Options 59 | ```bash 60 | ffuf-workflow -h 61 | -wordlist string Path to wordlist file 62 | -output string Path to output file 63 | [additional options will be listed here] 64 | ``` 65 | 66 | ## Example Workflows 67 | 68 | ### Single Target Scan 69 | ```bash 70 | ffuf-workflow -wordlist wordlist.txt -output target1_results.txt 71 | ``` 72 | 73 | ### Multiple Targets 74 | ```bash 75 | echo "example.com" > urls.txt 76 | echo "example2.com" >> urls.txt 77 | cat urls.txt | ffuf-workflow -output multi_results.txt 78 | ``` 79 | 80 | ## Integration with Other Tools 81 | 82 | ### Using with Custom Scripts 83 | ```bash 84 | #!/bin/bash 85 | # Example integration script 86 | ffuf-workflow -wordlist custom.txt -output scan.txt | other-tool 87 | ``` 88 | 89 | ## Troubleshooting 90 | 91 | ### Common Issues 92 | 93 | 1. Dependencies not found: 94 | ```bash 95 | # Verify dependencies 96 | which ffuf 97 | which ffufPostprocessing 98 | ``` 99 | 100 | 2. Permission issues: 101 | ```bash 102 | # Fix permissions 103 | chmod +x $(which ffuf-workflow) 104 | ``` 105 | 106 | 3. Go path issues: 107 | ```bash 108 | # Add to ~/.bashrc 109 | export GOPATH=$HOME/go 110 | export PATH=$PATH:$GOPATH/bin 111 | ``` 112 | 113 | ## Contributing 114 | 115 | 1. Fork the repository 116 | 2. Create your feature branch (`git checkout -b feature/amazing-feature`) 117 | 3. Commit your changes (`git commit -m 'Add amazing feature'`) 118 | 4. Push to the branch (`git push origin feature/amazing-feature`) 119 | 5. Open a Pull Request 120 | 121 | ## Compatibility 122 | 123 | - Go version: 1.21 or later 124 | - Operating Systems: Linux, macOS, Windows 125 | - Required tools: ffuf, ffufPostprocessing 126 | 127 | ## Support 128 | 129 | - Issues: Report on [GitHub Issues](https://github.com/nullenc0de/FFUF-Workflow-Tool/issues) 130 | - Questions: Open a discussion on GitHub 131 | - Contributions: Pull requests welcome 132 | 133 | ## License 134 | 135 | [License Type] - see LICENSE file for details 136 | 137 | ## Acknowledgments 138 | 139 | - ffuf team for the excellent fuzzing tool 140 | - dsecuredcom for ffufPostprocessing 141 | - Contributors and community members 142 | -------------------------------------------------------------------------------- /cmd/ffuf-workflow/main.go: -------------------------------------------------------------------------------- 1 | // main.go 2 | package main 3 | 4 | import ( 5 | "bufio" 6 | "encoding/json" 7 | "flag" 8 | "fmt" 9 | "io/ioutil" 10 | "os" 11 | "os/exec" 12 | "path/filepath" 13 | ) 14 | 15 | type FfufResult struct { 16 | Results []struct { 17 | URL string `json:"url"` 18 | } `json:"results"` 19 | } 20 | 21 | func runCommand(name string, args ...string) error { 22 | cmd := exec.Command(name, args...) 23 | cmd.Stdout = os.Stdout 24 | cmd.Stderr = os.Stderr 25 | return cmd.Run() 26 | } 27 | 28 | func runFfuf(wordlist, outputDir string) error { 29 | return runCommand("ffuf", 30 | "-w", wordlist, 31 | "-u", "FUZZ", 32 | "-o", filepath.Join(outputDir, "results.json"), 33 | "-od", filepath.Join(outputDir, "bodies"), 34 | "-of", "json") 35 | } 36 | 37 | func runFfufPostprocessing(outputDir string) error { 38 | return runCommand("ffufPostprocessing", 39 | "-result-file", filepath.Join(outputDir, "results.json"), 40 | "-bodies-folder", filepath.Join(outputDir, "bodies"), 41 | "-delete-bodies", 42 | "-overwrite-result-file") 43 | } 44 | 45 | func extractUrls(resultsFile string) ([]string, error) { 46 | data, err := ioutil.ReadFile(resultsFile) 47 | if err != nil { 48 | return nil, err 49 | } 50 | var result FfufResult 51 | if err := json.Unmarshal(data, &result); err != nil { 52 | return nil, err 53 | } 54 | var urls []string 55 | for _, r := range result.Results { 56 | urls = append(urls, r.URL) 57 | } 58 | return urls, nil 59 | } 60 | 61 | func main() { 62 | var wordlist string 63 | var output string 64 | flag.StringVar(&wordlist, "wordlist", "", "Path to the wordlist file containing URLs") 65 | flag.StringVar(&output, "output", "", "Path to save the extracted URLs (optional)") 66 | flag.Parse() 67 | 68 | // Check if input is being piped 69 | stat, _ := os.Stdin.Stat() 70 | if (stat.Mode() & os.ModeCharDevice) == 0 { 71 | // Input is being piped 72 | scanner := bufio.NewScanner(os.Stdin) 73 | tempFile, err := ioutil.TempFile("", "piped-wordlist") 74 | if err != nil { 75 | fmt.Fprintf(os.Stderr, "Error creating temp file: %v\n", err) 76 | os.Exit(1) 77 | } 78 | defer os.Remove(tempFile.Name()) 79 | for scanner.Scan() { 80 | tempFile.WriteString(scanner.Text() + "\n") 81 | } 82 | tempFile.Close() 83 | wordlist = tempFile.Name() 84 | } else if wordlist == "" { 85 | fmt.Println("Please provide a wordlist file or pipe input") 86 | flag.Usage() 87 | os.Exit(1) 88 | } 89 | 90 | tempDir, err := ioutil.TempDir("", "ffuf-workflow") 91 | if err != nil { 92 | fmt.Fprintf(os.Stderr, "Error creating temp directory: %v\n", err) 93 | os.Exit(1) 94 | } 95 | defer os.RemoveAll(tempDir) 96 | 97 | fmt.Println("Running ffuf...") 98 | if err := runFfuf(wordlist, tempDir); err != nil { 99 | fmt.Fprintf(os.Stderr, "Error running ffuf: %v\n", err) 100 | os.Exit(1) 101 | } 102 | 103 | fmt.Println("Running ffuf post-processing...") 104 | if err := runFfufPostprocessing(tempDir); err != nil { 105 | fmt.Fprintf(os.Stderr, "Error running ffuf post-processing: %v\n", err) 106 | os.Exit(1) 107 | } 108 | 109 | fmt.Println("Extracting valid URLs...") 110 | urls, err := extractUrls(filepath.Join(tempDir, "results.json")) 111 | if err != nil { 112 | fmt.Fprintf(os.Stderr, "Error extracting URLs: %v\n", err) 113 | os.Exit(1) 114 | } 115 | 116 | if output != "" { 117 | file, err := os.Create(output) 118 | if err != nil { 119 | fmt.Fprintf(os.Stderr, "Error creating output file: %v\n", err) 120 | os.Exit(1) 121 | } 122 | defer file.Close() 123 | for _, url := range urls { 124 | fmt.Fprintln(file, url) 125 | } 126 | fmt.Printf("Valid URLs saved to: %s\n", output) 127 | } else { 128 | fmt.Println("Valid URLs:") 129 | for _, url := range urls { 130 | fmt.Println(url) 131 | } 132 | } 133 | } 134 | --------------------------------------------------------------------------------