MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / getPage

Method getPage

lib/request/connect.py:271–1025  ·  view source on GitHub ↗

This method connects to the target URL or proxy and returns the target URL page content

(**kwargs)

Source from the content-addressed store, hash-verified

269
270 @staticmethod
271 def getPage(**kwargs):
272 """
273 This method connects to the target URL or proxy and returns
274 the target URL page content
275 """
276
277 if conf.offline:
278 return None, None, None
279
280 url = kwargs.get("url", None) or conf.url
281 get = kwargs.get("get", None)
282 post = kwargs.get("post", None)
283 method = kwargs.get("method", None)
284 cookie = kwargs.get("cookie", None)
285 ua = kwargs.get("ua", None) or conf.agent
286 referer = kwargs.get("referer", None) or conf.referer
287 direct_ = kwargs.get("direct", False)
288 multipart = kwargs.get("multipart", None)
289 silent = kwargs.get("silent", False)
290 raise404 = kwargs.get("raise404", True)
291 timeout = kwargs.get("timeout", None) or conf.timeout
292 auxHeaders = kwargs.get("auxHeaders", None)
293 response = kwargs.get("response", False)
294 ignoreTimeout = kwargs.get("ignoreTimeout", False) or kb.ignoreTimeout or conf.ignoreTimeouts
295 refreshing = kwargs.get("refreshing", False)
296 retrying = kwargs.get("retrying", False)
297 crawling = kwargs.get("crawling", False)
298 checking = kwargs.get("checking", False)
299 skipRead = kwargs.get("skipRead", False)
300 finalCode = kwargs.get("finalCode", False)
301 chunked = kwargs.get("chunked", False) or conf.chunked
302
303 if isinstance(conf.delay, (int, float)) and conf.delay > 0:
304 time.sleep(conf.delay)
305
306 start = time.time()
307
308 threadData = getCurrentThreadData()
309 with kb.locks.request:
310 kb.requestCounter += 1
311 threadData.lastRequestUID = kb.requestCounter
312
313 if conf.proxyFreq:
314 if kb.requestCounter % conf.proxyFreq == 0:
315 conf.proxy = None
316
317 warnMsg = "changing proxy"
318 logger.warning(warnMsg)
319
320 setHTTPHandlers()
321
322 if conf.dummy or conf.murphyRate and randomInt() % conf.murphyRate == 0:
323 if conf.murphyRate:
324 time.sleep(randomInt() % (MAX_MURPHY_SLEEP_TIME + 1))
325
326 page, headers, code = randomStr(int(randomInt()), alphabet=[_unichr(_) for _ in xrange(256)]), None, None if not conf.murphyRate else randomInt(3)
327
328 threadData.lastPage = page

Callers 11

crawlThreadFunction · 0.80
checkNullConnectionFunction · 0.80
checkInternetFunction · 0.80
_getPageProxyMethod · 0.80
queryPageMethod · 0.80
_findPageFormsFunction · 0.80
_checkTorFunction · 0.80
parseSitemapFunction · 0.80
webBackdoorRunCmdMethod · 0.80
_webFileStreamUploadMethod · 0.80
webInitMethod · 0.80

Calls 15

randomIntFunction · 0.90
randomStrFunction · 0.90
checkFileFunction · 0.90
dataToStdoutFunction · 0.90
openFileFunction · 0.90
chunkSplitPostDataFunction · 0.90
checkSameHostFunction · 0.90
getUnicodeFunction · 0.90
asciifyUrlFunction · 0.90
urlencodeFunction · 0.90
forgeHeadersFunction · 0.90

Tested by

no test coverage detected