2016-05-03 14:31:56 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/s-rah/onionscan/config"
|
|
|
|
"github.com/s-rah/onionscan/protocol"
|
|
|
|
"github.com/s-rah/onionscan/report"
|
2016-05-24 10:13:00 +00:00
|
|
|
"github.com/s-rah/onionscan/utils"
|
2016-05-03 14:31:56 +00:00
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2016-05-05 14:21:38 +00:00
|
|
|
type OnionScan struct {
|
|
|
|
Config *config.OnionscanConfig
|
|
|
|
}
|
|
|
|
|
2016-06-07 06:29:29 +00:00
|
|
|
func (os *OnionScan) Scan(hiddenService string, out chan *report.OnionScanReport) {
|
2016-05-03 14:31:56 +00:00
|
|
|
|
|
|
|
// Remove Extra Prefix
|
2016-05-24 10:13:00 +00:00
|
|
|
hiddenService = utils.WithoutProtocol(hiddenService)
|
2016-05-03 14:31:56 +00:00
|
|
|
|
|
|
|
if strings.HasSuffix(hiddenService, "/") {
|
|
|
|
hiddenService = hiddenService[0 : len(hiddenService)-1]
|
|
|
|
}
|
|
|
|
|
|
|
|
report := report.NewOnionScanReport(hiddenService)
|
|
|
|
|
|
|
|
// HTTP
|
|
|
|
hps := new(protocol.HTTPProtocolScanner)
|
2016-05-05 14:21:38 +00:00
|
|
|
hps.ScanProtocol(hiddenService, os.Config, report)
|
2016-05-03 14:31:56 +00:00
|
|
|
|
|
|
|
// SSH
|
|
|
|
sps := new(protocol.SSHProtocolScanner)
|
2016-05-05 14:21:38 +00:00
|
|
|
sps.ScanProtocol(hiddenService, os.Config, report)
|
2016-05-03 14:31:56 +00:00
|
|
|
|
|
|
|
// Ricochet
|
|
|
|
rps := new(protocol.RicochetProtocolScanner)
|
2016-05-05 14:21:38 +00:00
|
|
|
rps.ScanProtocol(hiddenService, os.Config, report)
|
2016-05-03 14:31:56 +00:00
|
|
|
|
|
|
|
// Bitcoin
|
|
|
|
bps := new(protocol.BitcoinProtocolScanner)
|
2016-05-05 14:21:38 +00:00
|
|
|
bps.ScanProtocol(hiddenService, os.Config, report)
|
2016-05-03 14:31:56 +00:00
|
|
|
|
|
|
|
//IRC
|
|
|
|
ips := new(protocol.IRCProtocolScanner)
|
2016-05-05 14:21:38 +00:00
|
|
|
ips.ScanProtocol(hiddenService, os.Config, report)
|
2016-05-03 14:31:56 +00:00
|
|
|
|
|
|
|
//FTP
|
|
|
|
fps := new(protocol.FTPProtocolScanner)
|
2016-05-05 14:21:38 +00:00
|
|
|
fps.ScanProtocol(hiddenService, os.Config, report)
|
2016-05-03 14:31:56 +00:00
|
|
|
|
|
|
|
//SMTP
|
|
|
|
smps := new(protocol.SMTPProtocolScanner)
|
2016-05-05 14:21:38 +00:00
|
|
|
smps.ScanProtocol(hiddenService, os.Config, report)
|
2016-05-03 14:31:56 +00:00
|
|
|
|
2016-05-25 15:56:21 +00:00
|
|
|
//MongoDb
|
|
|
|
mdbps := new(protocol.MongoDBProtocolScanner)
|
|
|
|
mdbps.ScanProtocol(hiddenService, os.Config, report)
|
|
|
|
|
2016-06-05 18:54:01 +00:00
|
|
|
//VNC
|
|
|
|
vncps := new(protocol.VNCProtocolScanner)
|
|
|
|
vncps.ScanProtocol(hiddenService, os.Config, report)
|
|
|
|
|
2016-06-10 21:17:00 +00:00
|
|
|
//XMPP
|
|
|
|
xmppps := new(protocol.XMPPProtocolScanner)
|
|
|
|
xmppps.ScanProtocol(hiddenService, os.Config, report)
|
|
|
|
|
2016-06-07 06:29:29 +00:00
|
|
|
out <- report
|
2016-05-03 14:31:56 +00:00
|
|
|
}
|