Attempt to index a nil value (local response)

Alo Yommist <[email protected]>
Newsgroups gmane.comp.security.nmap.devel
Message-ID <CAL59SMTA_uOEcJAZvoBFeB6nKnfRyLeQ+YGaYprWs0as9NB4HA@mail.gmail.com>
I kept getting this error in my script I don't know why but it's seems to
be complaining about some local response variable in my brute.lua library.
I don't know why the response value is nil. Here is the debug from my
script...

| HTTP/1.1
200 OK
Cache-Control: private
Content-Type: application/json
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: frame-ancestors 'self';
Connection: close
Content-Length: 192

jQuery191014485234646236567_1375786963488(
{"Fault":{"Code":{"Value":{"Name":"SenderFault"},"Subcode":{"Value":{"Name":"AuthenticationException"}}},"Reason":["Invalid
email or password."]}} );
NSE: TCP 192.168.103.80:45091 > 208.83.240.82:443 | CLOSE
NSOCK INFO [11.8250s] nsock_iod_delete(): nsock_iod_delete (IOD #3)
NSE: spmcourotine against api.peoplemedia.com (208.83.240.82:443) threw an
error!
/sdcard/opt/nmap-7.31/share/nmap/nselib/brute.lua:541: attempt to index a
nil value (local 'response')
stack traceback:
        /sdcard/opt/nmap-7.31/share/nmap/nselib/brute.lua:541: in function
</sdcard/opt/nmap-7.31/share/nmap/nselib/brute.lua:528>

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/
spmcourotine.txt (text/plain, 1.8 KB)
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.