
CVE-2017-12945에 대한 익스플로잇.
Mersive Solstice Pods(무선 협업 및 프레젠테이션 플랫폼, Mersive Technologies Inc. 설계)에서 펌웨어 버전 2.8.4 미만을 실행하는 장치에 (원격) (인증된) (블라인드) OS 명령 주입 취약점이 존재합니다. 이는 공급업체 웹사이트에서 인정/보고되었으며, 아래 스크린샷을 참조하십시오. 그 결과, 인증된 공격자는 취약한 Mersive Solstice Pods에 조작된 HTTP 요청을 보내 임의의 명령(루트 권한)을 실행할 수 있습니다.

이 취약점은 서버 측 입력/매개변수 검증 부재로 인해 존재합니다. 사용자가 제어하는 일부 입력/매개변수가 루트 사용자 컨텍스트에서 OS 명령을 실행하도록 설계된 public static String runShellCommand(String command) 메서드에 직접 인수로 전달됩니다. 이와 같은 안전하지 않은 구성으로 인해 공격자가 취약한 장치를 완전히 손상시킬 수 있습니다.
Mitre CVE 참고:
공급업체 변경 로그:
https://documentation.mersive.com/content/pages/release-notes.htm
펌웨어 버전 2.8.4 미만을 실행하는 Mersive Solstice Pods.
com/mersive/solstice/server/EthernetInterface.java:static void SetPrefixLength(int prefixLength) {
int value = -1 << (32 - prefixLength);
try {
Log.d("Ethernet", "complete: " + ServerDisplay.runShellCommand("ifconfig eth0 netmask " + InetAddress.getByAddress(new byte[]{(byte) (value >>> 24), (byte) ((value >> 16) & 255), (byte) ((value >> 8) & 255), (byte) (value & 255)}).getHostAddress()));
} catch (Exception e) {
e.printStackTrace();
}
}
static void SetGateway(String gateway) {
if (!gateway.equals(GetGateway())) {
Log.d("Ethernet", "complete: " + ServerDisplay.runShellCommand("ip route del default"));
Log.d("Ethernet", "complete: " + ServerDisplay.runShellCommand("ip route add default via " + gateway + " dev " + ETH0));
}
}
static void SetStaticIP(String ipAddr) {
Log.d("Ethernet", "complete: " + ServerDisplay.runShellCommand("ifconfig eth0 " + ipAddr));
}
com/mersive/solstice/server/ServerDisplay.java:public static String runShellCommand(String command) {
return runShellCommand(command, true);
}
public static String runShellCommand(String command, boolean wait) {
Log.d("Shell Command", command);
try {
Process process = Runtime.getRuntime().exec("shell-tunnel --client");
DataOutputStream stdin = new DataOutputStream(process.getOutputStream());
InputStream is = process.getInputStream();
stdin.writeBytes(command + "\n");
stdin.flush();
stdin.writeBytes("exit\n");
stdin.flush();
if (wait) {
process.waitFor();
}
byte[] buffer = new byte[1024];
Arrays.fill(buffer, 0);
return new String(buffer, 0, is.read(buffer));
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
이 취약점을 익스플로잇하려면 인증된 공격자가 취약한 펌웨어 버전(2.8.4 미만)을 실행하는 장치에 특별히 조작된 요청을 보내야 합니다. 이 요청은 장치 웹 인터페이스(고정 IP 주소 설정 양식)에서 직접 보내거나, 또는 cURL과 같은 명령줄 유틸리티를 사용하여 보낼 수 있습니다.
두 경우 모두, 페이로드 앞에는 /bin/sh가 연속 명령을 실행하도록 지시하는 특수 문자(예: ; 또는 & 문자)가 있어야 하며, 원래/정당한 명령이 완료된 후 페이로드가 실행되도록 해야 합니다.
gateway 매개변수와 함께 여러 취약한 매개변수 중 하나인 staticIP 매개변수는 서버 측에서 검증되지 않고 대신 static void SetStaticIP(String ipAddr) 메서드에 인수로 직접 전달되며, 이 메서드는 다시 public static String runShellCommand(String command) 메서드에 인수로 전달합니다.
이러한 구성은 인증된 공격자가 취약한 장치에서 루트 사용자 컨텍스트로 임의의 명령을 실행할 수 있도록 허용합니다.
Copyright (C) 2019 Alexandre Teyar
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.