Kali Linux PostgreSQL Backend and Metasploit db_* Commands: Pagination Interoperability Question
27.5K reputation · 10 Aug 2024, 20:57 UTC
Goal: Enable efficient, bounded retrieval of large result sets from Metasploit’s db_* commands that query the default PostgreSQL database used in Kali Linux.
Currently, commands such as db_hosts and db_services return all matching rows, forcing users to rely on external scripting or the costly SQL OFFSET clause for pagination, which scans and discards preceding rows and degrades performance with large offsets.
Uncertainty remains about whether future Metasploit releases will incorporate native pagination—either LIMIT/OFFSET or keyset (seek) pagination—or provide a flag to switch modes, and what impact such changes would have on existing scripts, index requirements, and backward compatibility.
Is there a plan to add a pagination option to the db_* commands? Would enabling keyset pagination require modifications to the indexed columns used by Metasploit tables? How would backward compatibility be maintained for existing automation that expects full output?