Ir al contenido

Ataque XSS

Guía técnica y documentación práctica sobre Ataque XSS: arquitectura, comandos operativos y procedimientos verificados.

0lecturas
Ventana de terminal
┌──(kali㉿portelcore-station)-[~/git_loot]
└─$ tree -h
[4.0K] .
├── [3.3K] arcade.css
├── [4.0K] Backend
│   ├── [1.6K] guardar_puntuacion.php
│   ├── [4.0K] Juegos
│   │   ├── [4.0K] Buscaminas
│   │   │   ├── [ 761] classes.js
│   │   │   ├── [ 545] index.css
│   │   │   ├── [ 953] index.html
│   │   │   └── [6.6K] main.js
│   │   └── [4.0K] juego_naves
│   ├── [5.9K] perfil.php
│   ├── [4.2K] plataforma.php
│   └── [2.5K] ranking.php
├── [1.3K] conexion_backup.php
├── [1.2K] conexion.php
├── [4.0K] img
│   ├── [4.7K] default_avatar.png
│   └── [ 60K] orb.png
├── [2.4K] index.php
├── [ 91K] log.txt
├── [3.3K] registre.php
└── [4.0K] uploads
├── [341K] 1_1761058444.png
├── [341K] 1_1761058544.png
├── [339K] 2_1761060893.png
├── [341K] 3_1761058178.png
├── [ 81K] 3_1761058204.png
├── [339K] 5_1761061807.png
└── [8.5K] 7_1762272938.jpg
7 directories, 23 files
┌──(kali㉿portelcore-station)-[~/git_loot]
└─$ grep -rnEi "(\\\$_GET|\\\$_POST|\\\$_REQUEST)" .
./registre.php:10:if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./registre.php:12: $usuario = $_POST['usuario'];
./registre.php:13: $password = $_POST['password'];
./registre.php:14: $password_confirm = $_POST['password_confirm'];
./log.txt:671:@@ -22,15 +22,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['login'])) {
./log.txt:687:@@ -40,12 +34,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['login'])) {
./log.txt:707: if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./log.txt:711: $usuario = $_POST['usuario'];
./log.txt:712: $password = $_POST['password'];
./log.txt:713: $password_confirm = $_POST['password_confirm'];
./log.txt:714:@@ -20,7 +19,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./log.txt:723:@@ -30,12 +29,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./log.txt:1570:@@ -17,13 +17,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['login'])) {
./log.txt:1592:@@ -33,6 +40,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['login'])) {
./log.txt:1605:@@ -43,13 +56,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['login'])) {
./log.txt:1636: if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./log.txt:1637:- $usuario = trim($_POST['usuario']);
./log.txt:1640:+ $usuario = $_POST['usuario'];
./log.txt:1641: $password = $_POST['password'];
./log.txt:1642: $password_confirm = $_POST['password_confirm'];
./log.txt:1644:@@ -16,7 +20,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./log.txt:1653:@@ -25,17 +29,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./log.txt:1680:@@ -51,7 +59,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./log.txt:1689:@@ -69,7 +77,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./log.txt:2203:+if (isset($_POST['logout'])) {
./log.txt:2356:@@ -30,7 +30,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['login'])) {
./log.txt:2586:+if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['login'])) {
./log.txt:2587:+ $usuario = trim($_POST['usuario']);
./log.txt:2588:+ $password = $_POST['password'];
./log.txt:2663:+if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {
./log.txt:2664:+ $usuario = trim($_POST['usuario']);
./log.txt:2665:+ $password = $_POST['password'];
./log.txt:2666:+ $password_confirm = $_POST['password_confirm'];
./index.php:13:if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['login'])) {
./index.php:14: $usuario = trim($_POST['usuario']);
./index.php:15: $password = $_POST['password'];
./Backend/plataforma.php:15:if (isset($_POST['logout'])) {
┌──(kali㉿portelcore-station)-[~/git_loot]
└─$
Ventana de terminal
┌──(kali㉿portelcore-station)-[~/git_loot]
└─$ python3 xss_injection.sh
[*] INICIANDO ESCANEO DE ARTEFACTOS EN: /home/kali/git_loot
[*] Buscando vectores XSS en archivos ['.php']...
------------------------------------------------------------
[+] ARCHIVO OBJETIVO: ./registre.php
└── [MEDIUM] Línea 10: Potential Input Vector (Source)
Code: if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registro'])) {...
└── [MEDIUM] Línea 12: Potential Input Vector (Source)
Code: $usuario = $_POST['usuario'];...
└── [MEDIUM] Línea 13: Potential Input Vector (Source)
Code: $password = $_POST['password'];...
└── [MEDIUM] Línea 14: Potential Input Vector (Source)
Code: $password_confirm = $_POST['password_confirm'];...
[+] ARCHIVO OBJETIVO: ./index.php
└── [MEDIUM] Línea 13: Potential Input Vector (Source)
Code: if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['login'])) {...
└── [MEDIUM] Línea 14: Potential Input Vector (Source)
Code: $usuario = trim($_POST['usuario']);...
└── [MEDIUM] Línea 15: Potential Input Vector (Source)
Code: $password = $_POST['password'];...
[+] ARCHIVO OBJETIVO: ./Backend/perfil.php
└── [MEDIUM] Línea 39: Potential Input Vector (Source)
Code: if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['foto_perfil'])) {...
└── [MEDIUM] Línea 40: Potential Input Vector (Source)
Code: $archivo = $_FILES['foto_perfil'];...
[+] ARCHIVO OBJETIVO: ./Backend/plataforma.php
└── [MEDIUM] Línea 15: Potential Input Vector (Source)
Code: if (isset($_POST['logout'])) {...
------------------------------------------------------------
[*] ESCANEO COMPLETADO. Vectores potenciales identificados: 10
[*] RECOMENDACIÓN: Revisa manualmente los hallazgos 'HIGH' primero.
┌──(kali㉿portelcore-station)-[~/git_loot]
└─$

image.png