Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brute force tool for administration panels #668

Open
wants to merge 57 commits into
base: main
Choose a base branch
from

Conversation

anna1492
Copy link
Contributor

@anna1492 anna1492 commented Dec 7, 2023

No description provided.

@kazet kazet marked this pull request as ready for review December 24, 2023 12:36
)
return

if "admin" in url and not url.endswith("/admin") and "admin" in task.get_payload("found_urls"):
Copy link
Collaborator

@bulkowy bulkowy Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get this check and task result reason doesn't give clear indication what it is about, can you give context what it is for?

def _get_logging_in_result(driver: WebDriver, login_failure_msgs: list[str]) -> Optional[list[str]]:
try:
web_content = driver.find_element(By.XPATH, "html/body").text
print(web_content)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(web_content)

passwords.append(site_name + "123")
passwords.append(site_name + "1")
for year_relative in [0, -1, -2, -3]:
passwords.append(site_name + str(datetime.datetime.now().year + year_relative))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not [0, 1, 2, 3] and - year_relative, seems more intuitive for me

# Ignore alerts
driver.execute_script("window.alert = function() {};") # type: ignore
driver.implicitly_wait(Config.Modules.AdminPanelLoginBruter.WAIT_TIME_SECONDS)
self._sleep_after_performing_requests(driver)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are waiting and sleeping in the same time? I think that waiting would be sufficient

working_credentials = []
for username in self.USERNAMES:
for password in get_passwords_for_url(url):
driver = AdminPanelLoginBruter._get_webdriver()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not it be better to get only one webdriver for whole _brute function and just drop old cookies every
credential? Now it will be resource consuming

# block logins after a given number of tries.
"123456",
"admin",
"admin1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary entry, as get_passwords_for_url appends 1

url_parsed = urllib.parse.urlparse(url)
url_parsed_dict = url_parsed._asdict()
if url_parsed.scheme == "http" and url_parsed.port == 80:
url_parsed_dict["netloc"] = url_parsed_dict["netloc"].split(":")[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to note: sometimes URL might have credentials (ik, 99.999% won't but), so it might be better to change it to [-1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants