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:
17
README.md
17
README.md
@@ -1,3 +1,20 @@
|
||||
# Assetfinder
|
||||
|
||||
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() {
|
||||
// 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.")
|
||||
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.")
|
||||
|
||||
@@ -54,17 +54,21 @@ func Scanner(verboseLogging, checkHTTPS, disableStatusCheck bool, outputFile, do
|
||||
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")
|
||||
for _, r := range res {
|
||||
if r.StatusCode == 0 || r.Error != nil {
|
||||
continue
|
||||
}
|
||||
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)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user