Skip to content

Commit 96811bb

Browse files
authored
Merge pull request #292 from edoardottt/devel
v0.3.0 (#291)
2 parents c2082b4 + 26786e5 commit 96811bb

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

pkg/csprecon/net.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func DomainOk(input string, domains []string) bool {
3030
}
3131

3232
for _, domain := range domains {
33-
if len(domain) >= len(input) && domain[len(domain)-len(input):] == input {
33+
if len(input) >= len(domain) && input[len(input)-len(domain):] == domain {
3434
return true
3535
}
3636
}

pkg/csprecon/net_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,22 @@ func TestDomainOk(t *testing.T) {
101101
},
102102
{
103103
name: "subdomain ok",
104-
input: "google.com",
105-
domains: []string{"ciao.com", "google.com", "dc.google.com"},
104+
input: "dc.google.com",
105+
domains: []string{"ciao.com", "google.com"},
106106
want: true,
107107
},
108-
109108
{
110109
name: "subdomain ok 2",
111-
input: "google.com",
112-
domains: []string{"ciao.com", "google.com", "dc.*.google.com"},
110+
input: "dc.*.google.com",
111+
domains: []string{"ciao.com", "google.com"},
113112
want: true,
114113
},
114+
{
115+
name: "subdomain not ok 1",
116+
input: "dc.*.google.com",
117+
domains: []string{"ciao.com", "goooooooogle.com"},
118+
want: false,
119+
},
115120
}
116121
for _, tt := range tests {
117122
t.Run(tt.name, func(t *testing.T) {

pkg/output/banner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import "github.com/projectdiscovery/gologger"
1212
var printed = false
1313

1414
const (
15-
Version = "v0.2.1"
15+
Version = "v0.3.0"
1616
banner = ` ______________ ________ _________ ____
1717
/ ___/ ___/ __ \/ ___/ _ \/ ___/ __ \/ __ \
1818
/ /__(__ ) /_/ / / / __/ /__/ /_/ / / / /

snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ summary: Discover new target domains using Content Security Policy
33
description: |
44
Take as input target URLs and probe them to retrieve their CSP (either from Head or Header)
55
and get new target domains.
6-
version: 0.2.1
6+
version: 0.3.0
77
grade: stable
88
base: core20
99

0 commit comments

Comments
 (0)