2016-06-10 22:17:51 +02:00
|
|
|
package protocol
|
|
|
|
|
|
|
|
import (
|
2016-07-31 02:00:42 +02:00
|
|
|
"fmt"
|
2016-06-10 22:17:51 +02:00
|
|
|
"github.com/s-rah/onionscan/config"
|
|
|
|
"github.com/s-rah/onionscan/report"
|
|
|
|
"github.com/s-rah/onionscan/utils"
|
|
|
|
)
|
|
|
|
|
|
|
|
type XMPPProtocolScanner struct {
|
|
|
|
}
|
|
|
|
|
2016-07-31 02:00:42 +02:00
|
|
|
func (rps *XMPPProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionscanConfig, report *report.OnionScanReport) {
|
2016-06-10 22:17:51 +02:00
|
|
|
// XMPP
|
2016-07-31 02:00:42 +02:00
|
|
|
osc.LogInfo(fmt.Sprintf("Checking %s XMPP(5222)\n", hiddenService))
|
|
|
|
conn, err := utils.GetNetworkConnection(hiddenService, 5222, osc.TorProxyAddress, osc.Timeout)
|
2016-06-10 22:17:51 +02:00
|
|
|
if err != nil {
|
2016-07-31 02:00:42 +02:00
|
|
|
osc.LogInfo("Failed to connect to service on port 5222\n")
|
2016-06-10 22:17:51 +02:00
|
|
|
report.XMPPDetected = false
|
|
|
|
} else {
|
2016-07-31 02:00:42 +02:00
|
|
|
osc.LogInfo("Detected possible XMPP instance\n")
|
2016-06-10 22:17:51 +02:00
|
|
|
// TODO: Actual Analysis
|
|
|
|
report.XMPPDetected = true
|
|
|
|
}
|
2016-07-31 21:05:42 +02:00
|
|
|
if conn != nil {
|
|
|
|
conn.Close()
|
|
|
|
}
|
2016-06-10 22:17:51 +02:00
|
|
|
// XMPP
|
2016-07-31 02:00:42 +02:00
|
|
|
osc.LogInfo(fmt.Sprintf("Checking %s XMPP(5223)\n", hiddenService))
|
|
|
|
conn, err = utils.GetNetworkConnection(hiddenService, 5223, osc.TorProxyAddress, osc.Timeout)
|
2016-06-10 22:17:51 +02:00
|
|
|
if err != nil {
|
2016-07-31 02:00:42 +02:00
|
|
|
osc.LogInfo("Failed to connect to service on port 5223\n")
|
2016-06-10 22:17:51 +02:00
|
|
|
} else {
|
2016-07-31 02:00:42 +02:00
|
|
|
osc.LogInfo("Detected possible XMPP (secure) instance\n")
|
2016-06-10 22:17:51 +02:00
|
|
|
// TODO: Actual Analysis
|
|
|
|
report.XMPPDetected = true
|
|
|
|
}
|
2016-07-31 21:05:42 +02:00
|
|
|
if conn != nil {
|
|
|
|
conn.Close()
|
|
|
|
}
|
2016-06-10 22:17:51 +02:00
|
|
|
}
|