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