From 8d45cd43cf470bf309509ad83f1c2802e6f9b631 Mon Sep 17 00:00:00 2001 From: Scott Ainslie Date: Fri, 10 Jun 2016 16:17:51 -0400 Subject: [PATCH] Extensible Messaging and Presence Protocol --- protocol/xmpp_scanner.go | 36 ++++++++++++++++++++++++++++++++++++ report/onionscanreport.go | 1 + 2 files changed, 37 insertions(+) create mode 100644 protocol/xmpp_scanner.go diff --git a/protocol/xmpp_scanner.go b/protocol/xmpp_scanner.go new file mode 100644 index 0000000..5c1d2c4 --- /dev/null +++ b/protocol/xmpp_scanner.go @@ -0,0 +1,36 @@ +package protocol + +import ( + "github.com/s-rah/onionscan/config" + "github.com/s-rah/onionscan/report" + "github.com/s-rah/onionscan/utils" + "log" +) + +type XMPPProtocolScanner struct { +} + +func (rps *XMPPProtocolScanner) ScanProtocol(hiddenService string, onionscanConfig *config.OnionscanConfig, report *report.OnionScanReport) { + // XMPP + log.Printf("Checking %s XMPP(5222)\n", hiddenService) + _, err := utils.GetNetworkConnection(hiddenService, 5222, onionscanConfig.TorProxyAddress, onionscanConfig.Timeout) + if err != nil { + log.Printf("Failed to connect to service on port 5222\n") + report.XMPPDetected = false + } else { + log.Printf("Detected possible XMPP instance\n") + // TODO: Actual Analysis + report.XMPPDetected = true + } + + // XMPP + log.Printf("Checking %s XMPP(5223)\n", hiddenService) + _, err = utils.GetNetworkConnection(hiddenService, 5223, onionscanConfig.TorProxyAddress, onionscanConfig.Timeout) + if err != nil { + log.Printf("Failed to connect to service on port 5223\n") + } else { + log.Printf("Detected possible XMPP (secure) instance\n") + // TODO: Actual Analysis + report.XMPPDetected = true + } +} diff --git a/report/onionscanreport.go b/report/onionscanreport.go index 6ae5430..ee90faf 100644 --- a/report/onionscanreport.go +++ b/report/onionscanreport.go @@ -35,6 +35,7 @@ type OnionScanReport struct { BitcoinDetected bool `json:"bitcoinDetected"` MongoDBDetected bool `json:"mongodbDetected"` VNCDetected bool `json:"vncDetected"` + XMPPDetected bool `json:"xmppDetected"` // Web Specific ServerPoweredBy string `json:"serverPoweredBy"`