
자체 개발된 측면 이동/코드 실행 도구
이 저장소는 기존의 MiscTool을 기반으로 만들어졌습니다. rasta-mouse에게 큰 감사를 전하며, 이 도구들을 공개해주고 작업할 동기를 주셨습니다.
명령 실행 / PsExec와 유사한 기능을 통한 측면 이동. 권한이 있는 사용자 컨텍스트에서 실행되어야 합니다. 이 도구는 rasta-mouse의 CsExec를 기반으로 하지만, 서비스 생성에 대한 추가 제어를 허용하도록 설계되었습니다. 구체적으로:
CheeseExec.exe <targetMachine> <serviceName> <binPath> <action>
TikiService도 참조하세요.
CheesePS는 명령 실행 / 측면 이동 프레임워크입니다. System.Management.Automation.PowerShell을 사용하여 PowerShell을 통해 임의의 코드를 로드하고 실행합니다.
이 도구는 로컬 또는 원격 대상에서 PowerShell runspace를 생성 및 사용하여 일반적인 제한을 우회할 수 있는 고유 기능을 가지고 있습니다.
PowerShell Remoting을 사용하는 경우 권한이 있는 사용자 컨텍스트에서 실행되어야 합니다.
이 도구는 원래 rasta_mouse의 CsPosh를 향상시키기 위해 만들어졌지만, 자체 프레임워크로 성장하여 이제 일반 PowerShell 인젝터로 사용할 수 있습니다.
이 도구의 아이디어는 다음 글에 요약되어 있습니다:
구현된 주요 기능은 다음과 같습니다:
다음 스크린샷은 도구의 워크플로를 설명하는 상당히 정확한 스키마입니다:

Usage:
-t, --target=VALUE Target machine
-c, --code=VALUE Code to execute
-e, --encoded Indicates that provided code is base64 encoded
-a, --am-si-bypass=VALUE Uses the given PowerShell script to bypass A-M-S-
I (fs, smb o http[s])
--aX, --encrypted-am-si
Indicates that provided A.M.S.I. bypass is
encrypted
-i, --import=VALUE Imports additional PowerShell modules (fs, smb o
http[s])
--iX, --encrypted-imports
Indicates that provided PowerShell modules are
encrypted
-o, --outstring Append Out-String to code
-r, --redirect Redirect stderr to stdout
-d, --domain=VALUE Domain for alternate credentials
-u, --username=VALUE Username for alternate credentials
-p, --password=VALUE Password for alternate credentials
-X, --encrypt=VALUE Encrypt a script with an hardcoded key
-D, --decrypt=VALUE Test decryption of a script with an hardcoded key
-n, --skip-bypass=VALUE Skip A.M.S.I (A), WLDP (W) or ALL (*) Bypass
techniques
-l, --lockdown-escape Try to enable PowerShell FullLanguage mode using
REGINI
-w, --wldp-bypass=VALUE Uses the given PowerShell script to bypass WLDP
(fs, smb o http[s])
--wX, --encrypted-wldp Indicates that provided WLDP bypass is encrypted
-x, --executable=VALUE [Download and] Execute given executable
--xX, --encrypted-executable
Indicates that provided Exe/DLL is encrypted
--xCS, --executable-csharp
Indicates that the executable provided is C# -
(.NET)
-R, --reflective-injection Uses Invoke-ReflectivePEInjection to load the
assmebly from memory (requires Invoke-
ReflectivePEInjection to be imported!)
-P, --powershell-decrypt Force use of PowerShell-based decryption
-k, --encryption-key=VALUE Uses the provided key for encryption/decryption
--ssl Force use of SSL
-h, -?, --help Show Help
참고: 대상 없이 실행하면 스크립트는 로컬 시스템에서 실행됩니다.
AmsiBypass도 참조하세요.
DCOM을 통한 명령 실행 / 측면 이동. 권한이 있는 사용자 컨텍스트에서 실행되어야 합니다. 이 도구는 rasta-mouse의 CsDCOM을 기반으로 하지만, Philip Tsukerman의 새로운 연구에 적응하여 추가 메서드를 추가하도록 개선되었습니다. dcomcfg를 통해 영향을 받는 DCOM 개체를 비활성화하려는 시도를 '수정'하는 실험적 메서드도 있지만, 제대로 작동하려면 몇 가지 전제 조건이 필요합니다.
이 도구의 아이디어는 다음 글에 요약되어 있습니다:
현재 메서드: MMC20.Application, ShellWindows, ShellBrowserWindow, ExcelDDE, VisioAddonEx,
OutlookShellEx, ExcelXLL, VisioExecLine, OfficeMacro.
Usage:
-t, --target=VALUE Target Machine
-b, --binary=VALUE Binary: powershell.exe
-a, --args=VALUE Arguments: -enc <blah>
-m, --method=VALUE Methods: MMC20Application, ShellWindows,
ShellBrowserWindow, ExcelDDE, VisioAddonEx,
OutlookShellEx, ExcelXLL, VisioExecLine,
OfficeMacro
-r, --reg, --registry Enable registry manipulation
-h, -?, --help Show Help
참고: -t .로 실행하면 스크립트는 로컬 시스템에서 실행됩니다.
Lateral Movement Using DCOM Objects and C#도 참조하세요.
RDI(리플렉티브 DLL 인젝션)를 통한 RDP 자격 증명 도용. 권한이 있는 사용자 또는 SeImpersonatePrivilege가 있는 사용자 컨텍스트에서 실행되어야 합니다.
이 도구는 MDSec의 RdpThief를 기반으로 하지만, .NET Reflection(Assembly.Load 및 유사)을 통해 실행할 수 있도록 단일 C#으로 완전히 래핑되었습니다. 이렇게 하면 대상 시스템에 DLL을 업로드하는 번거로움 없이 Covenant를 통해 실행할 수 있습니다.
Usage:
CheeseRDP [actions]
Actions:
wait: keep listening for any new mstsc.exe process indefinitely (stop with ctrl-C)
clean: delete the credentials dump file if present
dump: dump the content of the file if present, parsing the credentials in a compact format
참고: 옵션 없이 실행하면 프로그램은 활성 mstsc.exe 프로세스에 주입을 시도합니다(기본 대기 시간은 10초).
MSSQL 신뢰를 통한 명령 실행 / 측면 이동. 이 도구는 주로 MSSQL 가장에 관한 esc와 같은 기존 도구의 일부 한계를 극복하기 위해 개발되었습니다. 또한 CheeseSQL은 Covenant에서 실행되도록(리플렉티브 로딩을 통해) 특별히 수정되었으며, MSSQL 신뢰 남용의 가장 중요한 단계를 자동화합니다. 특히 재미있는 것은 CLR 남용 구현으로, 사용자가 Roslyn을 통해 즉시 MSSQL 확장을 컴파일하고 업로드하여 명령 실행을 달성할 수 있습니다. 아래에 아주 작은 데모가 있으며, 실행된 명령은 인코딩된 PowerShell Covenant 다운로더입니다):

"공로가 있을 때는 항상 인정하라"는 나의 규칙에 따라, 이 도구는 Jb05s의 기존 프로젝트인 SharpSQL에서 시작하여 개발되었습니다. Jeremy의 작업에 큰 감사를 전합니다.
또한 NetSPI의 MSSQL 감사 및 익스플로잇 관련 모든 도구를 살펴보길 적극 권장합니다. 정말 훌륭합니다:
[*] List of available commands:
- findspn : Find MSSQL Instances, using Domain SPNs
- listdb : List available Databases on the server
- gethash : Send Service Account Net-NTLM Hash to an Arbitrary IP
- getlogin : Retrieve SQL Logins Available for Impersonation
- getdbuser : Retrieve Information on the SQL Login, Currently Mapped User, and Available User Roles
- getlinked : Retrieve Information about Linked Servers
- getserverinfo : Retrieve current values of 'xp_cmdshell', 'ole automation procedures' and 'clr enabled'
- xp : Execute Encoded PowerShell Command via 'xp_cmdshell'
- ole : Execute Encoded PowerShell Command via 'sp_OACreate' and 'sp_OAMethod'
- clr : Execute Encoded PowerShell Command via custom .NET assemblies
- rpc : Configure Linked SQL Server to Allow RPC connections
- linkedquery : Execute Encoded PowerShell Command on Linked SQL Server via 'OPENQUERY'
- openquery : Execute an arbitrary query using 'OPENQUERY'
[*] For detailed usage, type:
- CheeseSQL <command> /help