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

Atomic Test #7 - System Owner/User Discovery Using Command Prompt #2657

Merged
merged 9 commits into from
Jan 20, 2024

Conversation

prashanthpulisetti
Copy link
Contributor

Details:
This atomic test is designed to identify the system owner or current user on a Windows machine using native command prompt utilities. The test executes a series of commands that extract user information and output it to a temporary file. This approach is beneficial for environments where PowerShell usage is restricted or closely monitored, providing an alternative method for gathering user details.

Testing:
The test was conducted on various Windows environments, including Windows 10 and Windows Server 2019. The following steps were performed:

  1. Execution of the test commands via the Windows command prompt.
  2. Verification of the output file creation in the specified directory.
  3. Confirmation that the file contains the correct information about the system owner or user.
  4. Execution of cleanup commands and verification of the removal of temporary files.

Automated testing was also conducted using a local script execution framework to ensure the test's compatibility and reliability across different systems and configurations.

Associated Issues:
There are currently no known issues associated with this pull request. It is designed to enhance the capability of the testing framework by providing additional methods for user discovery. Continuous monitoring and feedback will be essential to address any future issues that may arise.

… Prompt

Identify the system owner or current user using native Windows command prompt utilities.
adjusted - "del %output_path%\\user_info_*.tmp"
adjusted output_path with Temp
@prashanthpulisetti
Copy link
Contributor Author

Hi @clr2of8 or @MHaggis can you check this error once? in my code there is no where mentioned about output_path but the error says so. the following one is my code

executor:
  name: "command_prompt"
  elevation_required: false
  command: |
    set file=%TEMP%\user_info_%random%.tmp
    echo Username: %USERNAME% > %file%
    echo User Domain: %USERDOMAIN% >> %file%
    net users >> %file%
    query user >> %file%

@prashanthpulisetti
Copy link
Contributor Author

Hi All, I found the issue and covered it up now. Thank you !!

Copy link
Collaborator

@clr2of8 clr2of8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@clr2of8 clr2of8 merged commit b6fa885 into redcanaryco:master Jan 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants