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
Open
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
af40a65
Admin panels login - base (#249)
anna1492 Nov 30, 2023
580502a
Admin panels login -selenium base (#249)
anna1492 Dec 6, 2023
eaab344
Admin panels login - brute force logging in module (#249)
anna1492 Dec 8, 2023
6bcc377
Admin panels login - brute force logging in -tests (#249)
anna1492 Dec 8, 2023
e23da6d
.
kazet Dec 22, 2023
36a441b
merge
kazet Dec 22, 2023
aeff8b8
.
kazet Dec 22, 2023
ccfd1b9
.
kazet Dec 22, 2023
4d389bd
.
kazet Dec 22, 2023
60f605c
.
kazet Dec 22, 2023
de088a4
linteur
kazet Dec 22, 2023
0656dad
.
kazet Dec 22, 2023
9e505f9
.
kazet Dec 22, 2023
569e248
.
kazet Dec 22, 2023
5cf0327
lint
kazet Dec 22, 2023
9c8b22c
linteur
kazet Dec 22, 2023
9a51133
.
kazet Dec 22, 2023
107822e
.
kazet Dec 22, 2023
62549d5
.
kazet Dec 24, 2023
50caff6
no ports
kazet Dec 24, 2023
639b67f
simplify
kazet Dec 24, 2023
9821931
lint
kazet Dec 24, 2023
4b805ff
.
kazet Dec 24, 2023
c12e28d
.
kazet Dec 24, 2023
51c1afb
.
kazet Dec 24, 2023
6112675
.
kazet Dec 24, 2023
4d94cc9
.
kazet Dec 24, 2023
ee232b2
.
kazet Dec 24, 2023
c39299b
.
kazet Dec 24, 2023
2640a7d
.
kazet Dec 24, 2023
1f2be78
.
kazet Dec 24, 2023
32dd054
.
kazet Dec 24, 2023
865ac03
.
kazet Dec 24, 2023
dd4d515
.
kazet Dec 24, 2023
05da7ee
.
kazet Dec 24, 2023
1552196
sev
kazet Dec 24, 2023
1db7e9b
ports
kazet Dec 24, 2023
6e7dbf7
.
kazet Dec 24, 2023
0f59176
Merge branch 'main' into brute-force-tool-for-administration-panels
kazet Dec 28, 2023
eab1399
One more bad login messages
kazet Dec 28, 2023
43cf86f
Merge branch 'brute-force-tool-for-administration-panels' of github.c…
kazet Dec 28, 2023
ce26974
.
kazet Dec 28, 2023
d960043
.
kazet Dec 28, 2023
359c747
.
kazet Dec 28, 2023
78c6117
lint
kazet Dec 28, 2023
f2175fa
.
kazet Dec 28, 2023
cd8d6a9
more cases, lint
kazet Dec 28, 2023
0465532
.
kazet Dec 28, 2023
c694a77
.
kazet Dec 28, 2023
1e1e0c6
.
kazet Dec 28, 2023
aa8e57b
more heuristics
kazet Dec 28, 2023
298bb74
.
kazet Jan 3, 2024
d8d033d
More granular task taking lock
kazet Jan 4, 2024
73b7bd9
merge
kazet Jan 4, 2024
8e42a5f
Merge branch 'main' into brute-force-tool-for-administration-panels
kazet Jan 5, 2024
2f282b9
Merge branch 'main' into brute-force-tool-for-administration-panels
kazet Jan 8, 2024
8149e02
Merge branch 'main' into brute-force-tool-for-administration-panels
kazet Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
linteur
kazet committed Dec 22, 2023
commit de088a452046db7efabf38d3efa52d887d493aef
19 changes: 11 additions & 8 deletions artemis/modules/admin_panel_login_bruter.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.wait import WebDriverWait

from artemis.binds import TaskStatus, TaskType
from artemis.config import Config
@@ -88,12 +88,15 @@ def _brute(self, url: str) -> List[Tuple[str, str]]:
)
pass

try:
user_input, password_input = AdminPanelLoginBruter._find_form_inputs(url, driver)
except TypeError:
inputs = AdminPanelLoginBruter._find_form_inputs(url, driver)

if inputs:
user_input, password_input = inputs
else:
driver.close()
driver.quit()
break

driver.implicitly_wait(Config.Modules.AdminPanelLoginBruter.WAIT_TIME_SECONDS)
AdminPanelLoginBruter._send_credentials(
user_input=user_input,
@@ -122,9 +125,9 @@ def _get_webdriver() -> WebDriver:
service = Service(executable_path="/usr/bin/chromedriver")

chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--headless") # type: ignore
chrome_options.add_argument("--no-sandbox") # type: ignore
chrome_options.add_argument("--disable-dev-shm-usage") # type: ignore
return webdriver.Chrome(service=service, options=chrome_options)

@staticmethod
@@ -137,7 +140,7 @@ def _find_form_inputs(url: str, driver: WebDriver) -> Optional[tuple[WebElement,
else:
for field in inputs:
if field.get_attribute("type") == "text":
tag_values = driver.execute_script(
tag_values = driver.execute_script( # type: ignore
"var items = []; for (index = 0; index < arguments[0].attributes.length; ++index)"
"items.push(arguments[0].attributes[index].value); return items;",
field,