mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-11-04 18:07:46 +03:00 
			
		
		
		
	Added proxy support for websocket
This commit is contained in:
		
							parent
							
								
									387020ece8
								
							
						
					
					
						commit
						a93c7f6ef1
					
				| 
						 | 
				
			
			@ -506,9 +506,23 @@ class Connect(object):
 | 
			
		|||
                url = getBytes(url)  # Note: Python3 requires text while Python2 has problems when mixing text with binary POST
 | 
			
		||||
 | 
			
		||||
            if webSocket:
 | 
			
		||||
                ws_proxy_port = None
 | 
			
		||||
                ws_proxy_host = None
 | 
			
		||||
                ws_proxy_auth = None
 | 
			
		||||
                
 | 
			
		||||
                if conf.proxy:
 | 
			
		||||
                    ws_proxy_uri = _urllib.parse.urlsplit(conf.proxy)
 | 
			
		||||
                    ws_proxy_port = ws_proxy_uri.port
 | 
			
		||||
                    ws_proxy_host = ws_proxy_uri.netloc.split(":")[0]
 | 
			
		||||
 | 
			
		||||
                if conf.proxyCred:
 | 
			
		||||
                    ws_proxy_auth = conf.proxyCred.split(":")
 | 
			
		||||
 | 
			
		||||
                ws = websocket.WebSocket()
 | 
			
		||||
                ws.settimeout(WEBSOCKET_INITIAL_TIMEOUT if kb.webSocketRecvCount is None else timeout)
 | 
			
		||||
                ws.connect(url, header=("%s: %s" % _ for _ in headers.items() if _[0] not in ("Host",)), cookie=cookie)  # WebSocket will add Host field of headers automatically
 | 
			
		||||
                ws.connect(url, header=("%s: %s" % _ for _ in headers.items() if _[0] not in ("Host",)), cookie=cookie, 
 | 
			
		||||
                            http_proxy_host=ws_proxy_host, http_proxy_port=ws_proxy_port, 
 | 
			
		||||
                            http_proxy_auth=ws_proxy_auth)  # WebSocket will add Host field of headers automatically
 | 
			
		||||
                ws.send(urldecode(post or ""))
 | 
			
		||||
 | 
			
		||||
                _page = []
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user