πŸ‘¨β€πŸ’»
Jawad's Notes
  • πŸ‘¨β€πŸ«INFOSEC
    • πŸ•ΈοΈWeb
      • Burp Suite: Setting Foxyproxy
      • XSS
      • Wappalyzer
      • Directory Traversal
      • LFI
        • PHP Wrappers
        • RFI
      • Reverse Shell
        • Command Injection Quick Tips
      • File Upload
      • WPScan
      • SQL Injection
        • Schemas
        • SQLmap
        • MSSQL
        • MySQL
        • PostgreSQL
    • πŸ”§Tools
      • Whois
      • DNSRecon
      • DNSenum
      • nslookup
      • Netcat
        • Powercat
      • Nmap
        • Nmap Scripting Engine
        • Test-NetConnection
        • Grep
      • Server Message Block (SMB)
      • SNMP
      • SMTP
      • ExifTool
      • Search Engine Hacking
      • Source Control Hacking
      • Nessus
      • Canarytokens
      • Qualys SSL Server Test
      • Security Headers
      • theHarvester
      • Shodan
      • Gobuster
        • Dirb
      • Searchsploit
      • Password Cracking
        • Hashcat
        • John The Ripper
        • Hydra
        • hashID
        • CPU vs GPU
    • 🐧Linux
      • Symbols
      • cat
      • curl
      • openvpn
      • tcpdump
      • Remote Desktop
      • SmbShare
      • Tmux
      • Convert Windows-style line endings (CRLF) to Unix-style (LF)
      • SSH
    • πŸ–₯️Macros in Office
    • 🍎Enhancing Your MacOS Terminal Experience
    • 🚩CTF
      • SQL Injection
        • WHERE clause allowing retrieval of hidden data
        • Allowing login bypass
        • UNION attack, determining the number of columns returned by the query
        • UNION attack, finding a column containing text
        • UNION attack, retrieving data from other tables
        • UNION attack, retrieving multiple values in a single column
        • Querying the database type and version on Oracle
Powered by GitBook
On this page
  1. INFOSEC
  2. Web
  3. SQL Injection

Schemas

Understanding the tables and schemas in different databases involves querying the system catalog or information schema, which provides metadata about the database's structure. Here’s a brief overview for a few common database systems:

SQL Server

  • Query System Catalog:

    SELECT * FROM INFORMATION_SCHEMA.TABLES;

    This command lists all tables including their table schema in the database.

MySQL

  • Show Tables and Schemas:

    SHOW TABLES;

    This command displays all tables in the current database. To find out which database you are currently using:

    SELECT DATABASE();

    To list all schemas (databases):

    SHOW DATABASES;

PostgreSQL

  • Query Information Schema:

    SELECT table_schema, table_name FROM information_schema.tables
    WHERE table_schema NOT IN ('information_schema', 'pg_catalog');

    This command filters out system tables and shows user-defined tables and their schemas.

Oracle

  • List Tables:

    SELECT table_name FROM user_tables;

    This command shows all tables owned by the current user. To see tables across all schemas you can query:

    SELECT owner, table_name FROM all_tables;

Each database system has its own set of system tables or information schema views that can be queried to understand the database structure, such as schemas, tables, columns, and relationships. These tools are crucial for database management and schema exploration.

PreviousSQL InjectionNextSQLmap

Last updated 1 year ago

πŸ‘¨β€πŸ«
πŸ•ΈοΈ