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