def _send_request(self, server, domain, username, password, port,<EOL>ntlm_compatibility, legacy=True):
<EOL>try:<EOL><INDENT>from requests.packages.urllib3.exceptions importInsecurePlatformWarning<EOL>warnings.simplefilter('<STR_LIT:ignore>', category=InsecurePlatformWarning)<EOL><DEDENT>except ImportError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>from requests.packages.urllib3.exceptions import SNIMissingWarning<EOL>warnings.simplefilter('<STR_LIT:ignore>', category=SNIMissingWarning)<EOL><DEDENT>except ImportError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>from urllib3.exceptions import InsecureRequestWarning<EOL>warnings.simplefilter('<STR_LIT:ignore>', category=InsecureRequestWarning)<EOL><DEDENT>except ImportError:<EOL><INDENT>pass<EOL><DEDENT>url = "<STR_LIT>"% ('<STR_LIT:http>' if str(port).startswith('<STR_LIT>') else '<STR_LIT>',<EOL>server, port)<EOL>session = requests.Session()<EOL>session.verify = False<EOL>session.auth = NtlmAuth(domain, username, password, ntlm_compatibility,<EOL>legacy)<EOL>request = requests.Request('<STR_LIT:GET>', url)<EOL>prepared_request = session.prepare_request(request)<EOL>response = session.send(prepared_request)<EOL>return response<EOL>
Sends a request to the url with the credentials specified. Returns the
final response