-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
46 lines (43 loc) · 836 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"bufio"
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
)
func main() {
if len(os.Args) < 3 {
fmt.Println(help)
return
}
url := os.Args[1]
if string(url[len(url)-1]) != "/" {
url += "/"
}
fmt.Printf("looking for %v\n\n", url)
wordlist, err := os.Open(os.Args[2])
if err != nil {
panic(err.Error())
}
defer wordlist.Close()
scan := bufio.NewScanner(wordlist)
for scan.Scan() {
resp, err := http.Get(url + scan.Text())
if err != nil {
panic(err.Error())
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
if strings.Contains(string(body), "dependencie") == true {
fmt.Printf("%v ⎷\n", url+scan.Text())
} else {
fmt.Printf("%v X\n", url+scan.Text())
}
}
}
var help string = `
Usage :
d3pen <url> <wordlist>
Example : d3pen http://google.com/ list.txt`