Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix output on successful test (Not Vulnerable) #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions padcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"bufio"
"crypto/sha1"
"crypto/tls"
"errors"
"flag"
"fmt"
"net"
Expand Down Expand Up @@ -368,17 +367,16 @@ func scanHost(hostname, serverName string, cipherIndex int) error {
if *verboseLevel > 0 {
fmt.Printf("%s (%s) exhibited an oracle which did not appear on iteration %d. (Not exploitable)\n", serverName, hostname, iteration)
}
return errors.New("Oracle disappeared")
}
return nil
break
}

if lastErrorPrint != "" {
if lastErrorPrint != errorPrint {
if *verboseLevel > 0 {
fmt.Printf("%s (%s) has an inconsistent error oracle response. (Maybe exploitable)\n", serverName, hostname)
}
return errors.New("Inconsistent error responses")
break
}
} else {
lastErrorPrint = errorPrint
Expand All @@ -389,7 +387,7 @@ func scanHost(hostname, serverName string, cipherIndex int) error {
if *verboseLevel > 0 {
fmt.Printf("%s (%s) has an inconsistent response length profile\n (Maybe exploitable)", serverName, hostname)
}
return errors.New("Inconsistent length responses")
break
}
} else {
lastLengthPrint = lengthPrint
Expand Down Expand Up @@ -427,7 +425,7 @@ func scanHost(hostname, serverName string, cipherIndex int) error {
fmt.Printf("\tLength Hash:%v\n\tError Hash:%v\n", lengthPrint, errorPrint)
}
} else {
if *verboseLevel > 0 {
if *verboseLevel >= 1 {
fmt.Printf("%s (%s) behaves securely\n", serverName, hostname)
}
}
Expand Down Expand Up @@ -535,9 +533,6 @@ func main() {

if len(*hostsFile) > 0 {
hosts, err := os.Open(*hostsFile)
if *verboseLevel == 1 {
*verboseLevel = 0
}
if err != nil {
panic(err)
}
Expand Down