Skip to content

Commit

Permalink
Add option to skip ssl cert verification
Browse files Browse the repository at this point in the history
  • Loading branch information
liamg committed Dec 17, 2019
1 parent 1feda3f commit efad9d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions cmd/scout/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ var noColours = false
var wordlistPath string
var debug bool
var filename string
var skipSSLVerification bool

func main() {

Expand All @@ -168,6 +169,7 @@ func main() {
rootCmd.Flags().StringVarP(&wordlistPath, "wordlist", "w", wordlistPath, "Path to wordlist file. If this is not specified an internal wordlist will be used.")
rootCmd.Flags().BoolVarP(&debug, "debug", "d", debug, "Enable debug logging.")
rootCmd.Flags().StringVarP(&filename, "filename", "f", filename, "Filename to seek in the directory being searched. Useful when all directories report 404 status.")
rootCmd.Flags().BoolVarP(&skipSSLVerification, "skip-ssl-verify", "k", skipSSLVerification, "Skip SSL certificate verification.")

if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
Expand Down
1 change: 1 addition & 0 deletions pkg/scan/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Options struct {
Wordlist wordlist.Wordlist
Extensions []string
Filename string
SkipSSLVerification bool
}

type Result struct {
Expand Down
13 changes: 10 additions & 3 deletions pkg/scan/scanner.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package scan

import (
"crypto/tls"
"io"
"io/ioutil"
"net/http"
Expand All @@ -24,11 +25,17 @@ func NewScanner(opt *Options) *Scanner {

opt.Inherit()

client := &http.Client{
Timeout: opt.Timeout,
}

if opt.SkipSSLVerification {
client.Transport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
}

return &Scanner{
options: opt,
client: &http.Client{
Timeout: opt.Timeout,
},
client: client,
}
}

Expand Down

0 comments on commit efad9d7

Please sign in to comment.