Major bug fix to correctly handle httplib.BadStatusLine exception.

Minor improvement to set by default in all HTTP requests the standard HTTP headers (Accept, Accept-Encoding, etc.)
Updated user's manual.
This commit is contained in:
Bernardo Damele
2008-11-15 12:25:19 +00:00
parent 4bf1fcb8ec
commit 84cbc60659
5 changed files with 399 additions and 313 deletions

View File

@@ -24,6 +24,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import httplib
import md5
import re
import socket
@@ -182,6 +183,19 @@ class Connect:
warnMsg += " or proxy"
raise sqlmapConnectionException, warnMsg
except httplib.BadStatusLine, _:
warnMsg = "the target url responded with an unknown HTTP "
warnMsg += "status code, try to force the HTTP User-Agent "
warnMsg += "header with option --user-agent or -a"
if conf.googleDork:
warnMsg += ", skipping to next url"
logger.warn(warnMsg)
return None
else:
raise sqlmapConnectionException, warnMsg
parsePage(page)
responseMsg += "(%s - %d):\n" % (status, code)