Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix Windows platform implementation ofsessions command#285

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Acters wants to merge2 commits intocalebstewart:master
base:master
Choose a base branch
Loading
fromActers:master
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
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
1 change: 1 addition & 0 deletionsCHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,7 @@ and simply didn't have the time to go back and retroactively create one.
### Fixed
- Fixed `shlex.join` use with non-str type objects (e.g. `RemotePath`)
- Fixed `set` command use with incorrect keys (e.g. `set invalid value`)
- Fixed `sessions` command for Windows platform with more robust variable type checks (e.g. `TypeError`)

### Added
- Added missed `PlatformError` for `upload` command (e.g. "no gtfobins writers available")
Expand Down
54 changes: 37 additions & 17 deletionspwncat/modules/windows/enumerate/user/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,25 +23,45 @@ def enumerate(self, session: "pwncat.manager.Session"):
except PowershellError as exc:
raise ModuleFailed(str(exc)) from exc

users = users[0]
#users = users[0] # This enforces to only display the first session in list

for user in users:
if type(users) == list: # Extra check to prevent accidentally enumerating a dict as if it is a list
for user in users:
yield WindowsUser(
source=self.name,
name=user["Name"],
uid=user["SID"],
account_expires=None,
description=user["Description"],
enabled=user["Enabled"],
full_name=user["FullName"],
password_changeable_date=None,
password_expires=None,
user_may_change_password=user["UserMayChangePassword"],
password_required=user["PasswordRequired"],
password_last_set=None,
last_logon=None,
principal_source=user["PrincipalSource"],
)
elif type(users) == dict: # Extra check to make sure users is actually a dict
yield WindowsUser(
source=self.name,
name=user["Name"],
uid=user["SID"],
account_expires=None,
description=user["Description"],
enabled=user["Enabled"],
full_name=user["FullName"],
password_changeable_date=None,
password_expires=None,
user_may_change_password=user["UserMayChangePassword"],
password_required=user["PasswordRequired"],
password_last_set=None,
last_logon=None,
principal_source=user["PrincipalSource"],
)
source=self.name,
name=user["Name"],
uid=user["SID"],
account_expires=None,
description=user["Description"],
enabled=user["Enabled"],
full_name=user["FullName"],
password_changeable_date=None,
password_expires=None,
user_may_change_password=user["UserMayChangePassword"],
password_required=user["PasswordRequired"],
password_last_set=None,
last_logon=None,
principal_source=user["PrincipalSource"],
)
else:
raise ModuleFailed("users from Get-Localuser is not a dict of one user, or a list of users!")

well_known = {
"S-1-0-0": "NULL AUTHORITY\\NOBODY",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp