installing
bro how to install and how to use it?
Hi @clay-027, I'm not the author of the tool, but you can simply use this as a dependency in your own go project and call the parser to parse your domains.
package main
import (
"bufio"
"github.com/Cgboal/DomainParser"
"fmt"
"os"
"strings"
)
func main(){
parser := parser.NewDomainParser()
sc := bufio.NewScanner(os.Stdin)
for sc.Scan() {
line := sc.Text()
// domain := parser.GetDomain(line)
line = strings.ToLower(line)
fqdn := parser.GetFQDN(line)
fmt.Println(fqdn)
}
}
I have made my own seprate go project and just use this as a dependency. Then just build the project and you can run the tool
Hi @clay-027, I'm not the author of the tool, but you can simply use this as a dependency in your own go project and call the parser to parse your domains.
package main import ( "bufio" "github.com/Cgboal/DomainParser" "fmt" "os" "strings" ) func main(){ parser := parser.NewDomainParser() sc := bufio.NewScanner(os.Stdin) for sc.Scan() { line := sc.Text() // domain := parser.GetDomain(line) line = strings.ToLower(line) fqdn := parser.GetFQDN(line) fmt.Println(fqdn) } }I have made my own seprate go project and just use this as a dependency. Then just build the project and you can run the tool
go build main.go main.go:5:2: no required module provides package github.com/Cgboal/DomainParser: go.mod file not found in current directory or any parent directory; see 'go help modules'
still couldnt install , please help
after you copy the main.go contents,
you will need to make a go.mod file in the same directory
type go mod edit -module=github.com/yourName/example => this will create a go.mod file
then get the actual parser using go get github.com/Cgboal/DomainParser in the same directory => this will add the dependency to you go.mod file
Now if you try to do go builld main.go it will succeed => (this will create an executable as main)
to run the tool using this method, command:
cat [subdomainFileLocation] | go run main.go
OR
cat [subdomainFileLocation] | ./main (I assume that the build you do using go build will create an executable called "main")
another way would be to use the wrapper I wrote and directly install the executable using
go install github.com/NeelRanka/DomainParser@latest
usage : cat subdomainFileLocation | DomainParser => (assuming you have the executable dir set using GOROOT and GOPATH)
PS: Credits to the author