mirror of
https://github.com/cubixle/assetfinder.git
synced 2026-04-24 19:54:45 +01:00
updates readme, removes commented code, make sure status is not added to file output if turned off
This commit is contained in:
19
README.md
19
README.md
@@ -1,3 +1,20 @@
|
|||||||
# Assetfinder
|
# Assetfinder
|
||||||
|
|
||||||
Domain recon tool
|
Domain recon tool
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ go get -u github.com/cubixle/assetfinder/cmd/assetfinder
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ assetfinder -h
|
||||||
|
Usage of assetfinder:
|
||||||
|
-https
|
||||||
|
Enable/Disable the checking of status of https on a domain. (default true)
|
||||||
|
-output string
|
||||||
|
Where to save results to.
|
||||||
|
-status
|
||||||
|
Enable/Disable checking the status code for each sub domain found.
|
||||||
|
-verbose
|
||||||
|
Turns on verbose logging. Mainly used for debugging development.
|
||||||
|
```
|
||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// subsOnly := flag.Bool("subs-only", false, "Only search for subdomains.")
|
|
||||||
disableStatusCheck := flag.Bool("status", false, "Enable/Disable checking the status code for each sub domain found.")
|
disableStatusCheck := flag.Bool("status", false, "Enable/Disable checking the status code for each sub domain found.")
|
||||||
checkHTTPS := flag.Bool("https", true, "Enable/Disable the checking of status of https on a domain.")
|
checkHTTPS := flag.Bool("https", true, "Enable/Disable the checking of status of https on a domain.")
|
||||||
outfile := flag.String("output", "", "Where to save results to.")
|
outfile := flag.String("output", "", "Where to save results to.")
|
||||||
|
|||||||
10
scanner.go
10
scanner.go
@@ -54,16 +54,20 @@ func Scanner(verboseLogging, checkHTTPS, disableStatusCheck bool, outputFile, do
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return writeFile(outputFile, ress)
|
return writeFile(outputFile, ress, disableStatusCheck)
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeFile(outputFile string, res []Result) error {
|
func writeFile(outputFile string, res []Result, disableStatusCheck bool) error {
|
||||||
resBytes := []byte("domain, status code")
|
resBytes := []byte("domain, status code")
|
||||||
for _, r := range res {
|
for _, r := range res {
|
||||||
if r.StatusCode == 0 || r.Error != nil {
|
if r.StatusCode == 0 || r.Error != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
resBytes = append(resBytes, []byte(fmt.Sprintf("%s, %d\n", r.Domain, r.StatusCode))...)
|
if disableStatusCheck {
|
||||||
|
resBytes = append(resBytes, []byte(fmt.Sprintf("%s\n", r.Domain))...)
|
||||||
|
} else {
|
||||||
|
resBytes = append(resBytes, []byte(fmt.Sprintf("%s, %d\n", r.Domain, r.StatusCode))...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err := ioutil.WriteFile(outputFile, resBytes, 0775)
|
err := ioutil.WriteFile(outputFile, resBytes, 0775)
|
||||||
|
|||||||
Reference in New Issue
Block a user