| skipped 5 lines |
6 | 6 | | "github.com/j3ssie/metabigor/core" |
7 | 7 | | jsoniter "github.com/json-iterator/go" |
8 | 8 | | "github.com/thoas/go-funk" |
| 9 | + | "net/url" |
9 | 10 | | "strings" |
10 | 11 | | ) |
11 | 12 | | |
12 | | - | // CrtSH get IPInfo from https://www.onyphe.io |
| 13 | + | // CrtSHOrg get IPInfo from https://crt.sh |
13 | 14 | | func CrtSHOrg(org string, options core.Options) []string { |
14 | | - | url := fmt.Sprintf(`https://crt.sh/?O=%v`, org) |
| 15 | + | crtURL := fmt.Sprintf(`https://crt.sh/?O=%v`, url.QueryEscape(org)) |
15 | 16 | | var result []string |
16 | | - | core.InforF("Get data from: %v", url) |
17 | | - | content := core.BigResponseReq(url, options) |
18 | | - | //fmt.Println( content) |
| 17 | + | core.InforF("Get data from: %v", crtURL) |
| 18 | + | content := core.BigResponseReq(crtURL, options) |
19 | 19 | | if content == "" { |
20 | | - | core.ErrorF("Error sending request to: %v", url) |
| 20 | + | core.ErrorF("Error sending request to: %v", crtURL) |
21 | 21 | | return result |
22 | 22 | | } |
23 | 23 | | |
24 | 24 | | infos := ParseCertSH(content, options) |
25 | | - | |
26 | 25 | | for _, info := range infos { |
27 | 26 | | var data string |
28 | 27 | | if options.JsonOutput { |
| skipped 11 lines |
40 | 39 | | } else { |
41 | 40 | | data = info.Domain |
42 | 41 | | } |
43 | | - | //fmt.Println(data) |
44 | 42 | | result = append(result, data) |
45 | 43 | | } |
46 | 44 | | result = funk.UniqString(result) |
| skipped 51 lines |