Skip to content

Commit

Permalink
tls 1.0 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
praetorian-thendrickson committed Jan 18, 2023
1 parent b1c100a commit 588313c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/plugins/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ type ServiceHTTP struct {
Status string `json:"status"` // e.g. "200 OK"
StatusCode int `json:"statusCode"` // e.g. 200
ResponseHeaders http.Header `json:"responseHeaders"`
Technologies []string `json:"technologies"`
Technologies []string `json:"technologies,omitempty"`
}

func (e ServiceHTTP) Type() string { return ProtoHTTP }
Expand All @@ -274,7 +274,7 @@ type ServiceHTTPS struct {
Status string `json:"status"` // e.g. "200 OK"
StatusCode int `json:"statusCode"` // e.g. 200
ResponseHeaders http.Header `json:"responseHeaders"`
Technologies []string `json:"technologies"`
Technologies []string `json:"technologies,omitempty"`
}

func (e ServiceHTTPS) Type() string { return ProtoHTTPS }
Expand Down
16 changes: 15 additions & 1 deletion pkg/scan/simple_scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,22 @@ var dialer = &net.Dialer{
var sortedTCPPlugins = make([]plugins.Plugin, 0)
var sortedTCPTLSPlugins = make([]plugins.Plugin, 0)
var sortedUDPPlugins = make([]plugins.Plugin, 0)
var tlsConfig = tls.Config{} //nolint:gosec

func init() {
setupPlugins()
cipherSuites := make([]uint16, 0)

for _, suite := range tls.CipherSuites() {
cipherSuites = append(cipherSuites, suite.ID)
}

for _, suite := range tls.InsecureCipherSuites() {
cipherSuites = append(cipherSuites, suite.ID)
}
tlsConfig.InsecureSkipVerify = true //nolint:gosec
tlsConfig.CipherSuites = cipherSuites
tlsConfig.MinVersion = tls.VersionTLS10
}

func setupPlugins() {
Expand Down Expand Up @@ -195,7 +208,8 @@ func simplePluginRunner(

func DialTLS(ip string, port uint16) (net.Conn, error) {
addr := net.JoinHostPort(ip, fmt.Sprintf("%d", port))
conn, err := tls.DialWithDialer(dialer, "tcp", addr, &tls.Config{InsecureSkipVerify: true}) //nolint:gosec
conn, err := tls.DialWithDialer(dialer, "tcp", addr, &tlsConfig)

return conn, err
}

Expand Down

0 comments on commit 588313c

Please sign in to comment.