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

Powershell History Module Loses Capitalization #550

Open
dmlino opened this issue Jan 26, 2025 · 2 comments
Open

Powershell History Module Loses Capitalization #550

dmlino opened this issue Jan 26, 2025 · 2 comments

Comments

@dmlino
Copy link

dmlino commented Jan 26, 2025

Describe the bug
I was testing the powershell_history module and I noticed that the stings lose the capitalization, leading to incorrect passwords, for example:

cat .\ConsoleHost_history.txt $passwd = ConvertTo-SecureString ""?SeCretPassWord!"" -AsPlainText -Force $creds = New-Object System.Management.Automation.PSCredential (""domain.local\Administrator"", $passwd)
Becomes:

$passwd = convertto-securestring ""?secretpassword!"" -asplaintext -force $creds = new-object system.management.automation.pscredential (""domain.local\administrator"", $passwd)

This also affects the exported file.

To Reproduce
Steps to reproduce the behavior i.e.:
Command: netexec smb -u username -p password -M powershell_history

Expected behavior
The output should contain the same capilatizaion as the original file in windows.

NetExec info

  • OS: Kali
  • Version of nxc: v1.3.0
  • Installed from: Github
@termanix
Copy link
Contributor

Thank you for the bug! I will look at it soon.

@Dfte
Copy link
Contributor

Dfte commented Jan 26, 2025

Is because of these:

file_content = buf.read().decode("utf-8", errors="ignore").lower()                
keywords = [keyword.upper() for keyword in self.sensitive_keywords if keyword in file_content]

I used these to match string without storing a copy of the file's content as it is. Making a temp variable that will be stored in the export will fix it :)

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

No branches or pull requests

3 participants