Last active
July 27, 2018 14:23
-
-
Save Ice3man543/d150e25980e8d3741b66b5c6567f8273 to your computer and use it in GitHub Desktop.
Append some text to each line
This file contains 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 ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
var parameterList []string | |
func permuteUrls(host string) { | |
for _, param := range parameterList { | |
fmt.Printf("%s?%s=[payload]\n", host, param) | |
} | |
} | |
// Usage; ./join <list of urls> <list of get params> | |
func main() { | |
paramhandle, err := os.Open(os.Args[2]) | |
if err != nil { | |
panic(err) | |
} | |
defer paramhandle.Close() | |
paramScanner := bufio.NewScanner(paramhandle) | |
for paramScanner.Scan() { | |
parameterList = append(parameterList, paramScanner.Text()) | |
} | |
fileHandle, err := os.Open(os.Args[1]) | |
if err != nil { | |
panic(err) | |
} | |
defer fileHandle.Close() | |
fileScanner := bufio.NewScanner(fileHandle) | |
for fileScanner.Scan() { | |
permuteUrls(fileScanner.Text()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment