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