Skip to content

Commit

Permalink
Merge pull request #293 from edoardottt/devel
Browse files Browse the repository at this point in the history
v0.3.1 (#291)
  • Loading branch information
edoardottt authored Aug 26, 2024
2 parents 96811bb + 5e96ad0 commit 127a1f0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pkg/csprecon/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ func DomainOk(input string, domains []string) bool {
}

for _, domain := range domains {
if len(input) >= len(domain) && input[len(input)-len(domain):] == domain {
if input == domain {
return true
}

if len(input)-len(domain) >= 2 && input[len(input)-len(domain)-1:] == "."+domain {
return true
}
}
Expand Down
12 changes: 12 additions & 0 deletions pkg/csprecon/net_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ func TestDomainOk(t *testing.T) {
domains: []string{"ciao.com", "goooooooogle.com"},
want: false,
},
{
name: "subdomain not ok 2",
input: "dc.*.agoogle.com",
domains: []string{"ciao.com", "google.com"},
want: false,
},
{
name: "subdomain not ok 3",
input: "agoogle.com",
domains: []string{"ciao.com", "aaagoogle.com"},
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/output/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import "github.com/projectdiscovery/gologger"
var printed = false

const (
Version = "v0.3.0"
Version = "v0.3.1"
banner = ` ______________ ________ _________ ____
/ ___/ ___/ __ \/ ___/ _ \/ ___/ __ \/ __ \
/ /__(__ ) /_/ / / / __/ /__/ /_/ / / / /
Expand Down
2 changes: 1 addition & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ summary: Discover new target domains using Content Security Policy
description: |
Take as input target URLs and probe them to retrieve their CSP (either from Head or Header)
and get new target domains.
version: 0.3.0
version: 0.3.1
grade: stable
base: core20

Expand Down

0 comments on commit 127a1f0

Please sign in to comment.