ricardojoserf / adfsbrute

A script to test credentials against Active Directory Federation Services (ADFS), allowing password spraying or bruteforce attacks.
https://ricardojoserf.github.io/Adfsbrute/
167 stars 34 forks source link

Error message -> seems to be related to change IP functionality #4

Open TH3xACE opened 2 years ago

TH3xACE commented 2 years ago

Expected vs Actual Behavior

No error :)

Specifications

## Steps to Reproduce the Problem python3 adfsbrute.py -t domain.com -U users.txt -p Password123 -tp Pass123 -n 5

[+] Changing IP address Traceback (most recent call last): File "/opt/tools/misc/adfsbrute/adfsbrute.py", line 253, in main() File "/opt/tools/misc/adfsbrute/adfsbrute.py", line 204, in main new_ip = change_tor_ip(controller, debug) UnboundLocalError: local variable 'controller' referenced before assignment

ricardojoserf commented 2 years ago

Hi @TH3xACE ! The variable "controller" does not exist because there was a problem with the try-catch statement in lines 196-202 of the code. Could you tell me if tor was running in port 9050 when you tried this? Also, in the file /etc/tor/torrc, do you have the line "ControlPort 9051"? If you add this line, please restart tor with "sudo /etc/init.d/tor restart"

Regards,

Ricardo

TH3xACE commented 2 years ago

Thanks for your reply.... The issue was to do with conflicting port... I set it in the config file and everything working fine except the below error lol :)

+] Changing IP address [+] New IP address: Error_Getting_Ip [+] Organization uses a customized sign-in page Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 600, in urlopen httplib_response = self._make_request(conn, method, url, File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 387, in _make_request six.raise_from(e, None) File "", line 2, in raise_from File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 383, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.9/http/client.py", line 1377, in getresponse response.begin() File "/usr/lib/python3.9/http/client.py", line 320, in begin version, status, reason = self._read_status() File "/usr/lib/python3.9/http/client.py", line 281, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/usr/lib/python3.9/socket.py", line 704, in readinto return self._sock.recv_into(b) File "/usr/local/lib/python3.9/dist-packages/urllib3/contrib/pyopenssl.py", line 309, in recv_into raise SocketError(str(e)) OSError: (104, 'ECONNRESET')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 640, in urlopen retries = retries.increment(method, url, error=e, _pool=self, File "/usr/local/lib/python3.9/dist-packages/urllib3/util/retry.py", line 368, in increment raise six.reraise(type(error), error, _stacktrace) File "/usr/local/lib/python3.9/dist-packages/urllib3/packages/six.py", line 685, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 600, in urlopen httplib_response = self._make_request(conn, method, url, File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 387, in _make_request six.raise_from(e, None) File "", line 2, in raise_from File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 383, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.9/http/client.py", line 1377, in getresponse response.begin() File "/usr/lib/python3.9/http/client.py", line 320, in begin version, status, reason = self._read_status() File "/usr/lib/python3.9/http/client.py", line 281, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/usr/lib/python3.9/socket.py", line 704, in readinto return self._sock.recv_into(b) File "/usr/local/lib/python3.9/dist-packages/urllib3/contrib/pyopenssl.py", line 309, in recv_into raise SocketError(str(e)) urllib3.exceptions.ProtocolError: ('Connection aborted.', OSError("(104, 'ECONNRESET')"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/RedTeam/tools/misc/adfsbrute/./adfsbrute.py", line 253, in main() File "/opt/RedTeam/tools/misc/adfsbrute/./adfsbrute.py", line 207, in main dafs_url = calculate_values(args.target) File "/opt/RedTeam/tools/misc/adfsbrute/./adfsbrute.py", line 121, in calculate_values dafs_url = s.get(json_data['AuthURL']).url #json_data['AuthURL'] File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 546, in get return self.request('GET', url, kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 498, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', OSError("(104, 'ECONNRESET')"))