Nmap Development mailing list archives

Re: Get value in IncompleteRead exception


From: nnposter <nnposter () users sourceforge net>
Date: Sun, 12 Mar 2017 11:38:53 -0600

On 3/12/17 1:09 AM, Vinamra Bhatia wrote:
Greetings everyone,
I was trying to write a new vulnerability script but was unable to find
a function like httplib.IncompleteRead as in Python.
Basically, I want to call the IncompleteRead exception when the
http.post response is unable to fetch a response and want the check the
values returned by the exception. 
I tried checking the values of response i got from http.post and the
response doesnt contain the data that is fetched by IncompleteRead
exception in Python

Thanks and regards
Vinamra Bhatia
CS Sophomore
BITS Pilani

Here is a quick and dirty patch that might work for you. You can use it
as follows:

req = http.get(host, port, path)
if not req and req.partial then
  stdnse.debug1("Partial response is %d bytes long", #req.partial)
end

There are some issues that would need to be taken care of first, before
this patch could be included in the trunk.

Cheers,
nnposter

Attachment: http-partial.patch
Description:

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: