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

Code Execution from conf file #26

Closed
cavejay opened this issue Mar 25, 2018 · 0 comments
Closed

Code Execution from conf file #26

cavejay opened this issue Mar 25, 2018 · 0 comments
Assignees

Comments

@cavejay
Copy link
Owner

cavejay commented Mar 25, 2018

This should be addressed post-haste

An independent reviewer has shown that the conf lines that deal with SanitisedFileFirstLine and KeyListFirstLine can both be used to execute arbitrary code.

This is probably occurring due to some part of Strippy either invoking or executing the string to pull out it's 'final form'. This had been the MO for those configuration lines in previous versions of Strippy before I moved away from that design specifically to avoid this type of problem.

It appears I haven't scrubbed this behaviour from the code completely as the following conf line demonstrates a code execution vulnerability: ')";calc.exe;"This keylist was created at {0}.'

Probable Fix:

line 367: $out = Invoke-Expression "$($str -f $(get-date).ToString())"

Fix will be to do a manual replacement for /{\d}/ rather than using invoke-expression

@cavejay cavejay self-assigned this Mar 26, 2018
cavejay added a commit that referenced this issue Mar 27, 2018
Does manual processing of {\d} fills, replacing the awkward invoke-expression call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant