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

Problem: T1218.005, the term 'invoke-athhtmlapplication' is not recognized as the name of a cmdlet, function, script file, or operable program. check the spelling of the name, or if a path was included, verify that the path is correct and try again. #3022

Open
dreambegins opened this issue Dec 31, 2024 · 1 comment

Comments

@dreambegins
Copy link

dreambegins commented Dec 31, 2024

What did you do?

Invoke-AtomicTest T1218.005 -Session $session

What happened instead?

the term 'invoke-athhtmlapplication' is not recognized as the name of a cmdlet, function, script file, or operable program. check the spelling of the name, or if a path was included, verify that the path is correct and try again.

  • & {Invoke-ATHHTMLApplication -HTAFilePath C:\Test.hta -ScriptEngine J ...
  • 
    

Your Environment

  • Which specific operating system are you running (e.g. Windows 7 SP1 32-bit)? windows 10 64 bit
  • Did you run the test from an elevated or root prompt? yes
  • If relevant, which atomic test is this specific to?
  • If relevant, which execution harness are you attempting to use?
@dreambegins
Copy link
Author

Hi, I have already found where the problem is.
"the term 'invoke-athhtmlapplication' is not recognized as the name of a cmdlet..." is because that the remote host didn't install, import the "AtomicTestHarnesses" module.
I don't know why, but it seems like that the source code

get_prereq_command: |
#Install-Module -Name AtomicTestHarnesses -Scope CurrentUser -Force

didn't be executed.

In order to sovle this problem, I modify the source code like this"

executor:
command: |
Install-Module -Name AtomicTestHarnesses -Scope CurrentUser -Force
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
Import-Module AtomicTestHarnesses -Force
Invoke-ATHHTMLApplication -HTAFilePath #{hta_file_path} -ScriptEngine #{script_engine} -AsLocalUNCPath -SimulateLateralMovement -MSHTAFilePath #{mshta_file_path}
name: powershell

Then, the T1218.005 can be executed correctly.

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

1 participant