Skip to content

Instantly share code, notes, and snippets.

@Ice3man543
Forked from eur0pa/waywords.go
Created July 17, 2019 06:07
Show Gist options
  • Save Ice3man543/a4ec6f77c8f0aa7bcaf0567c790badd9 to your computer and use it in GitHub Desktop.
Save Ice3man543/a4ec6f77c8f0aa7bcaf0567c790badd9 to your computer and use it in GitHub Desktop.
generate wordlists utilizing the wayback machine
package main
import (
"bufio"
"fmt"
"net/url"
"os"
"strings"
)
func main() {
// usage: printf "example.com" | waybackurls | waywords
words := make(map[string]struct{})
w := bufio.NewScanner(os.Stdin)
for w.Scan() {
u, err := url.Parse(w.Text())
if err != nil {
continue
}
for _, t := range strings.Split(u.Path, "/") {
if t == "" {
continue
}
words[t] = struct{}{}
}
}
for word, _ := range words {
fmt.Println(word)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment