MCPcopy
hub / github.com/pingc0y/URLFinder / GetDomains

Function GetDomains

util/utils.go:270–280  ·  view source on GitHub ↗
(lis []mode.Link)

Source from the content-addressed store, hash-verified

268}
269
270func GetDomains(lis []mode.Link) []string {
271 var urls []string
272 for i := range lis {
273 re := regexp.MustCompile("([a-z0-9\\-]+\\.)*([a-z0-9\\-]+\\.[a-z0-9\\-]+)(:[0-9]+)?")
274 hosts := re.FindAllString(lis[i].Url, 1)
275 if len(hosts) > 0 {
276 urls = append(urls, hosts[0])
277 }
278 }
279 return UniqueArr(urls)
280}
281
282// 提取fuzz的目录结构
283func PathExtract(urls []string) ([]string, []string) {

Callers 4

OutFileCsvFunction · 0.92
OutFileJsonFunction · 0.92
OutFileHtmlFunction · 0.92
PrintFunction · 0.92

Calls 1

UniqueArrFunction · 0.85

Tested by

no test coverage detected