Tyojong
[SQLI] DB 종류 별 System Table 본문
MYSQL
스키마 정보
mysql> select TABLE_SCHEMA from information_schema.tables group by TABLE_SCHEMA;테이블 정보
mysql> select TABLE_SCHEMA, TABLE_NAME from information_schema.TABLES;컬럼 정보
mysql> select TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME from information_schema.COLUMNS;실시간 실행 쿼리 정보
mysql> select * from information_schema.PROCESSLIST;mysql> select user,current_statement from sys.session;DBMS 계정 정보
mysql> select GRANTEE,PRIVILEGE_TYPE,IS_GRANTABLE from information_schema.USER_PRIVILEGES;mysql> select User, authentication_string from mysql.user;MSSQL
데이터베이스 정보
SELECT name FROM master..sysdatabases;SELECT DB_NAME(0);테이블 정보
SELECT name FROM dreamhack..sysobjects WHERE xtype = 'U';
# xtype='U' 는 이용자 정의 테이블을 의미.SELECT table_name FROM dreamhack.information_schema.tables;컬럼 정보
SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name = 'users');SELECT table_name, column_name FROM dreamhack.information_schema.columns;DBMS 계정 정보
SELECT name, password_hash FROM master.sys.sql_logins;SELECT * FROM master..syslogins;PostgreSQL
스키마(카탈로그) 정보
주요 정보를 담고 있는 테이블을 포함한 스키마는 pg_catalog, information_schema가 있다.
postgres=$ select nspname from pg_catalog.pg_namespace;테이블 정보
postgres=$ select table_name from information_schema.tables where table_schema='pg_catalog';postgres=$ select table_name from information_schema.tables where table_schema='information_schema';postgres=$ select table_schema, table_name from information_schema.tables;컬럼 정보
postgres=$ select table_schema, table_name, column_name from information_schema.columns;DBMS 계정 정보
postgres=$ select usename, passwd from pg_catalog.pg_shadow;DBMS 설정 정보
postgres=$ select name, setting from pg_catalog.pg_settings;실시간 실행 쿼리 정보
postgres=$ select usename, query from pg_catalog.pg_stat_activity;Oracle
데이터베이스 정보
SELECT DISTINCT owner FROM all_tablesSELECT owner, table_name FROM all_tables컬럼 정보
SELECT column_name FROM all_tab_columns WHERE table_name = 'users'DBMS 계정 정보
SELECT * FROM all_usersSQLite
시스템 테이블
sqlite> .header on
-- 콘솔에서 실행 시 컬럼 헤더를 출력하기 위해 설정
sqlite> open dreamhack.db
-- 데이터베이스를 연결
sqlite> select * from sqlite_master;'web > basic knowledge' 카테고리의 다른 글
| [XSS] 필터링 우회 (0) | 2025.07.24 | 
|---|---|
| [SQLI] DBMS 버전 정보 (0) | 2025.07.21 | 
