sqlmap
- Capabilities
- Initial access
- Platforms
- Linux
sqlmap is an open-source penetration-testing tool that automates exploitation of SQL injection vulnerabilities in database-backed applications. It is legitimate dual-use software rather than an inherently malicious malware family and is available in Kali Linux. Adversaries use it to exploit vulnerable public-facing applications and obtain unauthorized access to application databases and administrative functionality.
Magic Hound has obtained and used sqlmap alongside other publicly available penetration-testing tools. In a documented intrusion against a Thai government administrative system, attackers used sqlmap to exploit SQL injection and gain administration-panel access. The attackers subsequently deployed a separate web shell for persistent command execution. These follow-on actions are distinct from sqlmap itself; its presence does not establish that it provides persistence or the capabilities of subsequently deployed malware.
Associated threat actors
2 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Magic Hound has obtained and used open-source penetration testing tools like Havij, sqlmap, Metasploit, and Mimikatz.
We suspect they are likely using tools like "sqlmap" to carry out these attacks against their targets.
Techniques & procedures
24 distinct techniques documented for this family, organized by ATT&CK tactic.
Reconnaissance
2 techniques
Reconnaissance
ERA Security Scanner ... nmap, nikto, subfinder, subdomain enumeration, IP reputation, DNS, and mail security analysis ... security-tools-mcp ... nmap, nuclei, sqlmap, nikto, dirsearch, httpx, trivy ... NmapService nmapScan
Earth Krahang also conducts vulnerability scanning with tools like sqlmap, nuclei, xray, vscan, pocsuite, and wordpressscan to find web server vulnerabilities
Resource Development
3 techniques
Resource Development
The platform's core offering is XSS payload management: create payloads, deploy them, monitor when they fire... The platform includes a suite of offensive tools... The SQLMap Command Generator... provides a web-based interface for building SQLMap commands.
Adversaries may buy, steal, or download software tools that can be used during targeting. Tools can be open or closed source, free or commercial.
Resource Development - утилита скармливает данные модели, получает приоритизированные векторы с обоснованием и командами. Artificial Intelligence (T1588.007, Resource Development).
Initial Access
2 techniques
Initial Access
Once cracked, we can log into the website. If someone cracks an admin’s hash, they can cause real damage to the website.
«эксплуатация SQL-инъекций соответствует технике Exploit Public-Facing Application ... (T1190, Initial Access)»
Execution
1 technique
Execution
This command provides us with a virtual shell, allowing us to execute single commands... <?php system($_GET['cmd']); ?>
Persistence
4 techniques
Persistence
Once cracked, we can log into the website. If someone cracks an admin’s hash, they can cause real damage to the website.
Thailand Government administrative application nodes SQLMap-driven data dump of employee national ID records; GIF-polyglot webshell deployment for persistence.
Havij is used to automate SQL injection. sqlmap can be used to automate exploitation of SQL injection vulnerabilities.
Asking how sqlmap would be used to upload a potential web shell to a target server.
Privilege Escalation
1 technique
Privilege Escalation
Once cracked, we can log into the website. If someone cracks an admin’s hash, they can cause real damage to the website.
Stealth
2 techniques
Stealth
Risk 3 - запросы с OR в контексте UPDATE / DELETE , которые способны модифицировать или удалить данные.
Once cracked, we can log into the website. If someone cracks an admin’s hash, they can cause real damage to the website.
Defense Impairment
1 technique
Defense Impairment
It’s protected by a WAF that filters suspicious requests. For this reason we will use tampers... It randomizes the casing of your payload, which can help bypass WAFs.
Credential Access
4 techniques
Credential Access
Using Sqlmap, it was also possible to read password hashes of user accounts. These are MD5 hashes of the passwords without any further salt value.
Credential Access - Brute Force (T1110): встроенный брутфорс извлечённых хешей паролей по словарям
...если есть PHPSESSID , значит PHP-сессии, значит - MySQL/SQLite, значит — SQLi в параметрах входа.
With SQL Injection, among the available techniques, the most common consists of extracting the users and their password hash. ... Now that we have recovered the users and the hashes we need to find the password in clear text. We will not go into the details of this step here and simply use hashcat with a wordlist to recover the password in plain text.
Discovery
1 technique
Discovery
The files include offensive security tooling (sqlmap, masscan, nmap, hping, tcpdump, ngrok, gost, microsocks, frpc/frps, impacket)...
Collection
2 techniques
Collection
A post presented SQL database files and identified the target as Pakistan Railways... Another post claimed a breach of a Pakistan Government SQL Server... Additional material referenced the Pakistan Military Accounts Department, including a claimed 88-page PDF containing stolen data.
Collection - Databases (T1213.006): перечисление схем, извлечение данных из таблиц, полный дамп содержимого
Command and Control
3 techniques
Command and Control
Using Alien’s built-in SOCKS5 proxy, external tools such as sqlmap can access internal web applications through the compromised server.
Using Alien’s built-in SOCKS5 proxy, external tools such as sqlmap can access internal web applications through the compromised server.
After gaining access to the server, the attackers installed the tools they needed at different times. Specifically, the following commands for third-party installations were identified on one of the servers: apt install traceroute apt-get install nmap apt-get install screen git clone https://github.com/sqlmapproject/sqlmap.git
Impact
1 technique
Impact
SQL injections may result in information modification, sensitive data leakage and unauthorized command executions in underlying database systems.
Observables
1 indicator attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
9 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.