go fmt
This commit is contained in:
parent
d83d10bd93
commit
44cc375066
|
@ -7,7 +7,6 @@ import (
|
|||
)
|
||||
|
||||
type BitcoinProtocolScanner struct {
|
||||
|
||||
}
|
||||
|
||||
func (rps *BitcoinProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) {
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
)
|
||||
|
||||
type FTPProtocolScanner struct {
|
||||
|
||||
}
|
||||
|
||||
func (sps *FTPProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) {
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
)
|
||||
|
||||
type IRCProtocolScanner struct {
|
||||
|
||||
}
|
||||
|
||||
func (rps *IRCProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) {
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
)
|
||||
|
||||
type RicochetProtocolScanner struct {
|
||||
|
||||
}
|
||||
|
||||
func (rps *RicochetProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) {
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
)
|
||||
|
||||
type SMTPProtocolScanner struct {
|
||||
|
||||
}
|
||||
|
||||
func (sps *SMTPProtocolScanner) ScanProtocol(hiddenService string, proxyAddress string, report *report.OnionScanReport) {
|
||||
|
|
|
@ -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)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -3,7 +3,7 @@ package scans
|
|||
import (
|
||||
"github.com/s-rah/onionscan/report"
|
||||
"github.com/xiam/exif"
|
||||
"io"
|
||||
"io"
|
||||
"log"
|
||||
"strings"
|
||||
)
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ func StandardPageScan(scan Scanner, page string, status int, contents string, re
|
|||
if isTitlePresent {
|
||||
var startIndex = strings.Index(contents, "<title>")
|
||||
var endIndex = strings.Index(contents, "</title>")
|
||||
var pageTitle = contents[startIndex+len("<title>"):endIndex]
|
||||
var pageTitle = contents[startIndex+len("<title>") : endIndex]
|
||||
log.Printf("\tPage Title: %s\n", pageTitle)
|
||||
report.PageTitle = pageTitle
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue