diff --git a/protocol/bitcoin_scanner.go b/protocol/bitcoin_scanner.go index 1a48fad..fc2ff67 100644 --- a/protocol/bitcoin_scanner.go +++ b/protocol/bitcoin_scanner.go @@ -7,7 +7,6 @@ import ( ) type BitcoinProtocolScanner struct { - } func (rps *BitcoinProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) { diff --git a/protocol/ftp_scanner.go b/protocol/ftp_scanner.go index 87e7621..cd09564 100644 --- a/protocol/ftp_scanner.go +++ b/protocol/ftp_scanner.go @@ -7,7 +7,6 @@ import ( ) type FTPProtocolScanner struct { - } func (sps *FTPProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) { diff --git a/protocol/irc_scanner.go b/protocol/irc_scanner.go index 9d531bc..ae0e9f1 100644 --- a/protocol/irc_scanner.go +++ b/protocol/irc_scanner.go @@ -7,7 +7,6 @@ import ( ) type IRCProtocolScanner struct { - } func (rps *IRCProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) { diff --git a/protocol/ricochet_scanner.go b/protocol/ricochet_scanner.go index 7453410..d2f678b 100644 --- a/protocol/ricochet_scanner.go +++ b/protocol/ricochet_scanner.go @@ -7,7 +7,6 @@ import ( ) type RicochetProtocolScanner struct { - } func (rps *RicochetProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) { diff --git a/protocol/smtp_scanner.go b/protocol/smtp_scanner.go index fe071ec..9e5f25a 100644 --- a/protocol/smtp_scanner.go +++ b/protocol/smtp_scanner.go @@ -7,7 +7,6 @@ import ( ) type SMTPProtocolScanner struct { - } func (sps *SMTPProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) { diff --git a/protocol/ssh_scanner.go b/protocol/ssh_scanner.go index f99b89c..668a3d0 100644 --- a/protocol/ssh_scanner.go +++ b/protocol/ssh_scanner.go @@ -1,18 +1,17 @@ package protocol import ( + "crypto/md5" + "errors" + "fmt" "github.com/s-rah/onionscan/report" + "golang.org/x/crypto/ssh" "h12.me/socks" "log" - "golang.org/x/crypto/ssh" "net" - "errors" - "crypto/md5" - "fmt" ) type SSHProtocolScanner struct { - } func (sps *SSHProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) { @@ -24,14 +23,14 @@ func (sps *SSHProtocolScanner) ScanProtocol(hiddenService string, proxyAddress s } else { // TODO SSH Checking report.SSHDetected = true - - config := &ssh.ClientConfig { - HostKeyCallback : func (hostname string, addr net.Addr, key ssh.PublicKey) error { + + config := &ssh.ClientConfig{ + HostKeyCallback: func(hostname string, addr net.Addr, key ssh.PublicKey) error { h := md5.New() h.Write(key.Marshal()) - + fBytes := h.Sum(nil) - fingerprint := string("") + fingerprint := string("") for i := 0; i < len(fBytes); i++ { if i+1 != len(fBytes) { fingerprint = fmt.Sprintf("%s%0.2x:", fingerprint, fBytes[i]) @@ -45,7 +44,7 @@ func (sps *SSHProtocolScanner) ScanProtocol(hiddenService string, proxyAddress s return errors.New("error") }, } - ssh.NewClientConn(conn,hiddenService+":22",config) + ssh.NewClientConn(conn, hiddenService+":22", config) } diff --git a/report/onionscanreport.go b/report/onionscanreport.go index 4e2f348..0a52b67 100644 --- a/report/onionscanreport.go +++ b/report/onionscanreport.go @@ -2,9 +2,9 @@ package report import ( "encoding/json" + "fmt" "github.com/s-rah/onionscan/utils" "io/ioutil" - "fmt" ) type ExifTag struct { @@ -40,11 +40,11 @@ type OnionScanReport struct { InterestingFiles []string `json:"interestingFiles"` PageReferencedDirectories []string `json:"pageReferencedDirectories"` - Hashes []string `json:"hashes"` - SSHKey string `json:"sshKey"` - Snapshot string `json:"snapshot"` - PageTitle string `json:"pageTitle"` - ResponseHeaders []string `json:"responseHeaders"` + Hashes []string `json:"hashes"` + SSHKey string `json:"sshKey"` + Snapshot string `json:"snapshot"` + PageTitle string `json:"pageTitle"` + ResponseHeaders []string `json:"responseHeaders"` } func LoadReportFromFile(filename string) (OnionScanReport, error) { diff --git a/scans/check_directory_listing.go b/scans/check_directory_listing.go index 0ce6d53..60a530a 100644 --- a/scans/check_directory_listing.go +++ b/scans/check_directory_listing.go @@ -25,7 +25,7 @@ func CheckDirectoryListing(scan Scanner, dir string, status int, contents string for _, file := range interestingFiles { log.Printf("\t Found interesting file %s/%s\n", dir, file[1]) //TODO: We can do further analysis here, for now, just report them. - report.AddInterestingFile(dir+"/"+file[1]) + report.AddInterestingFile(dir + "/" + file[1]) } r = regexp.MustCompile(`href="([^/](.*?))/"`) @@ -33,7 +33,7 @@ func CheckDirectoryListing(scan Scanner, dir string, status int, contents string for _, file := range subDir { log.Printf("\t Found subdir %s/%s\n", dir, file[1]) //TODO: We can do further analysis here, for now, just report them. - scan.ScanPage(report.HiddenService, dir+"/"+file[1], report, CheckDirectoryListing) + scan.ScanPage(report.HiddenService, dir+"/"+file[1], report, CheckDirectoryListing) } } else { diff --git a/scans/check_exif.go b/scans/check_exif.go index 4e3a327..8a35812 100644 --- a/scans/check_exif.go +++ b/scans/check_exif.go @@ -3,7 +3,7 @@ package scans import ( "github.com/s-rah/onionscan/report" "github.com/xiam/exif" - "io" + "io" "log" "strings" ) diff --git a/scans/scanner.go b/scans/scanner.go index 03aecaf..61c7e48 100644 --- a/scans/scanner.go +++ b/scans/scanner.go @@ -5,5 +5,5 @@ import ( ) type Scanner interface { - ScanPage(string, string,*report.OnionScanReport, func(Scanner, string,int, string,*report.OnionScanReport)) + ScanPage(string, string, *report.OnionScanReport, func(Scanner, string, int, string, *report.OnionScanReport)) } diff --git a/scans/standard-page-scan.go b/scans/standard-page-scan.go index f6f8005..b5f16d4 100644 --- a/scans/standard-page-scan.go +++ b/scans/standard-page-scan.go @@ -25,7 +25,7 @@ func StandardPageScan(scan Scanner, page string, status int, contents string, re if isTitlePresent { var startIndex = strings.Index(contents, "") var endIndex = strings.Index(contents, "") - var pageTitle = contents[startIndex+len(""):endIndex] + var pageTitle = contents[startIndex+len("<title>") : endIndex] log.Printf("\tPage Title: %s\n", pageTitle) report.PageTitle = pageTitle }