7
7
"flag"
8
8
"fmt"
9
9
"net"
10
+ "net/url"
10
11
"os"
11
12
"strings"
12
13
@@ -31,72 +32,89 @@ func main() {
31
32
//chars that end the host part
32
33
endhostchars := []string {"/" , "?" , "\\ " , "#" }
33
34
34
- hosts := []string {* attackerdomain }
35
-
36
- for _ , domain := range hosts {
37
- //e.g. @attacker.tld
38
- for _ , seperator := range seperators {
39
- fmt .Println (seperator + domain + * path )
40
- }
41
- //e.g. &.attacker.tld
42
- for _ , char := range subdomainchars {
43
- fmt .Println (char + "." + domain + * path )
44
- }
45
- }
46
-
47
- //Keep IPs and domains seperate for a while because we do not wanna generate .IP
35
+ //prepare hosts
48
36
ip := net .ParseIP (* attackerIP )
49
37
if ip == nil {
50
38
fmt .Fprintln (os .Stderr , "Couldn't parse IP" )
51
39
return
52
40
}
53
41
ips := []string {ipfmt .ToInt (ip ), ipfmt .ToHex (ip ), ipfmt .ToOctal (ip ), ipfmt .ToSingleHex (ip ), ipfmt .Combo (ip ), "1.1" }
54
- for _ , ip := range ips {
55
- //e.g. @1.1
56
- fmt .Println ("@" + ip )
57
- }
58
- //Merge IPs and the other hosts
59
- hosts = append (hosts , ips ... )
42
+ hostnames := []string {* attackerdomain }
60
43
61
- //e.g. /\attacker.tld
62
- for _ , domain := range hosts {
63
- for _ , protocol := range protocols {
64
- fmt .Println (protocol + domain + * path )
65
- }
66
- }
67
44
//contains
68
45
fmt .Println ("https://" + * attackerdomain + "/" + * proto + * target + * path )
46
+
47
+ //% encoded
48
+ fmt .Println (url .QueryEscape (* proto + * attackerdomain ))
49
+ fmt .Println (url .QueryEscape (url .QueryEscape (* proto + * attackerdomain )))
50
+
69
51
//port as pass
70
- for _ , host := range hosts {
52
+ for _ , host := range hostnames {
71
53
fmt .Println (* proto + * target + ":443@" + host + * path )
72
54
}
55
+
73
56
//mutliple @s
74
57
fmt .Println ("https://" + * target + "@" + * target + "@" + * attackerdomain + * path )
58
+
75
59
// unescaped dots in regexes /www.target.tld/ -> wwwxtarget.tld
76
60
if hasSubdomain (* target ) {
77
61
fmt .Println (* proto + strings .Replace (* target , "." , "x" , 1 ) + * path )
78
62
} else {
79
63
fmt .Println (* proto + "wwwx" + * target + * path )
80
64
}
65
+
66
+ for _ , domain := range hostnames {
67
+ //e.g. @attacker.tld
68
+ for _ , seperator := range seperators {
69
+ fmt .Println (seperator + domain + * path )
70
+ }
71
+ //e.g. &.attacker.tld
72
+ for _ , char := range subdomainchars {
73
+ fmt .Println (char + "." + domain + * path )
74
+ }
75
+ }
76
+
77
+ for _ , ip := range ips {
78
+ //e.g. @1.1
79
+ fmt .Println ("@" + ip )
80
+ }
81
+
82
+ //e.g. /\attacker.tld
83
+ for _ , protocol := range protocols {
84
+ for _ , domain := range hostnames {
85
+ fmt .Println (protocol + domain + * path )
86
+ }
87
+ for _ , ip := range ips {
88
+ fmt .Println (protocol + ip + * path )
89
+ }
90
+ }
91
+
81
92
82
93
for _ , seperator := range seperators {
83
- hosts = append (hosts , * target + seperator + * attackerdomain )
94
+ hostnames = append (hostnames , * target + seperator + * attackerdomain )
84
95
}
96
+
85
97
//e.g. https://attacker.tld#.target.tld
86
98
for _ , char := range endhostchars {
87
- hosts = append (hosts , * attackerdomain + char + "." + * target )
99
+ hostnames = append (hostnames , * attackerdomain + char + "." + * target )
88
100
//e.g. attacker.tld%EF%BC%8F.target.tld -> attacker.tld/.target.tld
89
101
for _ , sub := range unicodesubstitutions [[]rune (char )[0 ]] {
90
- hosts = append (hosts , * attackerdomain + string (sub )+ "." + * target )
102
+ hostnames = append (hostnames , * attackerdomain + string (sub )+ "." + * target )
91
103
}
92
104
}
105
+
93
106
//e.g. https://target.tld&.attacker.tld
94
107
for _ , char := range subdomainchars {
95
- hosts = append (hosts , * target + char + "." + * attackerdomain )
108
+ hostnames = append (hostnames , * target + char + "." + * attackerdomain )
96
109
}
97
- for _ , domain := range hosts {
110
+
111
+ //e.g. https://attacker.tld
112
+ for _ , domain := range hostnames {
98
113
fmt .Println (* proto + domain + * path )
99
114
}
115
+
116
+ //https://attacker.tld:target.tld this is more useful for ssrf
117
+ //fmt.Println(*proto + *attackerdomain + ":" + *target + *path)
100
118
}
101
119
102
120
func hasSubdomain (domain string ) bool {
0 commit comments