blacklanternsecurity / offensive-azure

Collection of offensive tools targeting Microsoft Azure
GNU General Public License v3.0
198 stars 42 forks source link

error when running against some domains #3

Open timlaw71 opened 1 year ago

timlaw71 commented 1 year ago

Traceback (most recent call last): File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn conn.connect() File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect self.sock = ssl_wrapsocket( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/util/ssl.py", line 449, in ssl_wrap_socket ssl_sock = _ssl_wrap_socketimpl( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/util/ssl.py", line 493, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket return self.sslsocket_class._create( File "/usr/lib/python3.10/ssl.py", line 1071, in _create self.do_handshake() File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake self._sslobj.do_handshake() TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/kali/.local/lib/python3.10/site-packages/requests/adapters.py", line 440, in send resp = conn.urlopen( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 785, in urlopen retries = retries.increment( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/home/kali/.local/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise raise value File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 389, in _make_request self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 340, in _raise_timeout raise ReadTimeoutError( urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Read timed out. (read timeout=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 474, in runner() File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 470, in runner prog.main() File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 411, in main user_realm_json = self.enumerate_login_info(args.Domain, user) File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 178, in enumerate_login_info user_realm_json4 = requests.post(endpoint4, headers=headers4, data=json_data).json() File "/home/kali/.local/lib/python3.10/site-packages/requests/api.py", line 117, in post return request('post', url, data=data, json=json, kwargs) File "/home/kali/.local/lib/python3.10/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/home/kali/.local/lib/python3.10/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, send_kwargs) File "/home/kali/.local/lib/python3.10/site-packages/requests/sessions.py", line 645, in send r = adapter.send(request, kwargs) File "/home/kali/.local/lib/python3.10/site-packages/requests/adapters.py", line 532, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Read timed out. (read timeout=None)

This is on my kali system

timlaw71 commented 1 year ago

I did an apt update and apt upgrade and got this running the same domain.

Traceback (most recent call last): File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 474, in runner() File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 470, in runner prog.main() File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 428, in main domain_info = self.enumerate_domain_info(domains_found, login_infos) File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 93, in enumerate_domain_info dns_response = dns.resolver.resolve(domain) File "/usr/lib/python3/dist-packages/dns/resolver.py", line 1193, in resolve return get_default_resolver().resolve(qname, rdtype, rdclass, tcp, source, File "/usr/lib/python3/dist-packages/dns/resolver.py", line 1063, in resolve (nameserver, port, tcp, backoff) = resolution.next_nameserver() File "/usr/lib/python3/dist-packages/dns/resolver.py", line 646, in next_nameserver raise NoNameservers(request=self.request, errors=self.errors) dns.resolver.NoNameservers: All nameservers failed to answer the query ex.takeda.co.jp. IN A: Server 10.0.0.1 UDP port 53 answered SERVFAIL

timlaw71 commented 1 year ago

Linux kali 5.19.0-kali2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.19.11-1kali2 (2022-10-10) x86_64 GNU/Linux

timlaw71 commented 1 year ago

I'm getting a few errors when running on a particular domain. I can run another domain and it works fine. I do know that running aadinternals in powershell works for this domain. Any insight here?

timlaw71 commented 1 year ago

Traceback (most recent call last): File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn conn.connect() File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect self.sock = ssl_wrapsocket( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/util/ssl.py", line 449, in ssl_wrap_socket ssl_sock = _ssl_wrap_socketimpl( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/util/ssl.py", line 493, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket return self.sslsocket_class._create( File "/usr/lib/python3.10/ssl.py", line 1071, in _create self.do_handshake() File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake self._sslobj.do_handshake() TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/kali/.local/lib/python3.10/site-packages/requests/adapters.py", line 440, in send resp = conn.urlopen( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 785, in urlopen retries = retries.increment( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/home/kali/.local/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise raise value File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 389, in _make_request self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) File "/home/kali/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 340, in _raise_timeout raise ReadTimeoutError( urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Read timed out. (read timeout=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 474, in runner() File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 470, in runner prog.main() File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 411, in main user_realm_json = self.enumerate_login_info(args.Domain, user) File "/home/kali/DR_Lite/tools/offensive-azure/offensive_azure/Outsider_Recon/outsider_recon.py", line 176, in enumerate_login_info user_realm_json2 = requests.get(endpoint2).json() File "/home/kali/.local/lib/python3.10/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/home/kali/.local/lib/python3.10/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/home/kali/.local/lib/python3.10/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, send_kwargs) File "/home/kali/.local/lib/python3.10/site-packages/requests/sessions.py", line 645, in send r = adapter.send(request, kwargs) File "/home/kali/.local/lib/python3.10/site-packages/requests/adapters.py", line 532, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Read timed out. (read timeout=None)

debifrank commented 1 year ago

Hey @timlaw71, thanks for the report.

It's hard to test on my end without a domain to fire against. Is the one being tested the ex.takeda.co.jp domain?

I'm not certain but this line makes me think the issue is a bad nameserver:

 dns.resolver.NoNameservers: All nameservers failed to answer the query ex.takeda.co.jp. IN A: Server 10.0.0.1 UDP port 53 answered SERVFAIL