diff --git a/onionscan/onionscan.go b/onionscan/onionscan.go index 9b03451..496e9f8 100644 --- a/onionscan/onionscan.go +++ b/onionscan/onionscan.go @@ -20,6 +20,7 @@ func (os *OnionScan) GetAllActions() []string { "tls", "ssh", "irc", + "rdp", "ricochet", "ftp", "smtp", @@ -47,6 +48,9 @@ func (os *OnionScan) PerformNextAction(report *report.OnionScanReport, nextActio case "irc": ips := new(protocol.IRCProtocolScanner) ips.ScanProtocol(report.HiddenService, os.Config, report) + case "rdp": + rdps := new(protocol.RDPProtocolScanner) + rdps.ScanProtocol(report.HiddenService, os.Config, report) case "ricochet": rps := new(protocol.RicochetProtocolScanner) rps.ScanProtocol(report.HiddenService, os.Config, report) diff --git a/protocol/http_scanner.go b/protocol/http_scanner.go index fac29f0..1eb6a41 100644 --- a/protocol/http_scanner.go +++ b/protocol/http_scanner.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/s-rah/onionscan/config" "github.com/s-rah/onionscan/report" - "github.com/s-rah/onionscan/spider" "github.com/s-rah/onionscan/utils" "net/http" diff --git a/protocol/rdp_scanner.go b/protocol/rdp_scanner.go new file mode 100644 index 0000000..98e8719 --- /dev/null +++ b/protocol/rdp_scanner.go @@ -0,0 +1,28 @@ +package protocol + +import ( + "fmt" + "github.com/s-rah/onionscan/config" + "github.com/s-rah/onionscan/report" + "github.com/s-rah/onionscan/utils" +) + +type RDPProtocolScanner struct { +} + +func (rdps *RDPProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport) { + // RDP + osc.LogInfo(fmt.Sprintf("Checking %s RDP(3389)\n", hiddenService)) + conn, err := utils.GetNetworkConnection(hiddenService, 3389, osc.TorProxyAddress, osc.Timeout) + if err != nil { + osc.LogInfo("Failed to connect to service on port 3389\n") + report.RDPDetected = false + } else { + osc.LogInfo("Detected possible RDP instance\n") + // TODO: Actual Analysis + report.RDPDetected = true + } + if conn != nil { + conn.Close() + } +} diff --git a/report/onionscanreport.go b/report/onionscanreport.go index 9b30065..79540ee 100644 --- a/report/onionscanreport.go +++ b/report/onionscanreport.go @@ -31,6 +31,7 @@ type OnionScanReport struct { TLSDetected bool `json:"tlsDetected"` SSHDetected bool `json:"sshDetected"` RicochetDetected bool `json:"ricochetDetected"` + RDPDetected bool `json:"rdpDetected"` IRCDetected bool `json:"ircDetected"` FTPDetected bool `json:"ftpDetected"` SMTPDetected bool `json:"smtpDetected"`