Skip to content

Instantly share code, notes, and snippets.

@Ice3man543
Last active July 27, 2018 14:23
Show Gist options
  • Save Ice3man543/d150e25980e8d3741b66b5c6567f8273 to your computer and use it in GitHub Desktop.
Save Ice3man543/d150e25980e8d3741b66b5c6567f8273 to your computer and use it in GitHub Desktop.
Append some text to each line
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