xp_cmdshell is a Microsoft SQL Server feature that lets a database session run operating-system commands on the underlying host. In effect, it bridges the database layer and the command line, so a user who can invoke it may be able to list files, start processes, download tools, or launch scripts from inside SQL Server.
This matters because it can turn a database compromise into broader host compromise. Attackers often look for xp_cmdshell during post-exploitation to collect data, deploy payloads, or prepare pivot paths. Defenders usually keep it disabled unless it is truly needed, restrict who can enable or use it, and monitor SQL Server logs for suspicious command execution. If it is left exposed or misconfigured, it becomes a powerful shortcut from SQL access to system access.


