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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
Imperva_gzip_bypass — CVE-2021-45468에 대한 익스플로잇, Imperva WAF 우회 | Kitploit
도구/GitHubGitHub/0xhaggis/imperva_gzip_bypass
Vulnerability AnalysisExploitationIDS/IPS EvasionWeb Application ExploitationWAF BypassPenetration Testing
GitHub0xhaggis/imperva_gzip_bypass

Imperva_gzip_bypass

CVE-2021-45468에 대한 익스플로잇, Imperva WAF 우회

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

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

Imperva 웹 애플리케이션 방화벽(WAF) POST 요청 우회

Imperva Cloud WAF는 악성 HTTP POST 페이로드(log4j 익스플로잇, SQL 인젝션, 명령 실행, 디렉토리 트래버설, XXE 등)를 전송할 때 공격자가 WAF 규칙을 우회할 수 있는 취약점이 있었습니다.

해결 방법

Imperva 팀은 보고를 받은 즉시 이를 매우 진지하게 받아들였으며, 단 며칠 만에 글로벌 수정을 완료했습니다. Kudos. Cloud WAF의 모든 고객은 2021년 12월 22일 기준으로 자동 패치되었습니다. Imperva는 협력하기 좋은 팀이었으며, 분명히 성숙하고 숙련된 보안 팀을 보유하고 있습니다.

익스플로잇 방법

HTTP POST 요청에 Content-Encoding: gzip 헤더를 추가합니다. POST 데이터는 그대로 둡니다. 인코딩하지 마세요. Content-Encoding 헤더의 처음 4바이트가 gzip인 한, POST 요청에 WAF 규칙이 적용되지 않습니다.

Burp에서 프록시의 Match & Replace 기능을 사용하여 이를 수행할 수 있습니다:

다음과 같이 새 헤더를 추가합니다:

이게 전부입니다. 이제 사용하시면 됩니다.

테스트 스크립트 실행

다음과 같이 POST 요청을 지원하는 URL에 대해 imperva_gzip.py를 실행합니다:

Syntax: ./imperva_gzip.py [[-t] | [-r]] URL

주어진 URL에 대한 WAF 유형 추측:

root@kitploit:~
$ ./imperva_gzip.py -t https://www.vulnerable.com/search
Imperva Incapsula
$ ./imperva_gzip.py -t https://www.wordpress-user.com/login
WordFence
$ ./imperva_gzip.py -t https://www.cloudflare-customer.com
Cloudflare

WAF가 gzip 우회에 취약한지 확인:

root@kitploit:~
$ ./imperva_gzip.py https://www.vulnerable.com/search
[+] Can we make POST requests to https://www.vulnerable.com/search?
[+] Checking for Imperva WAF...
[+] Attempting gzip bypass for UNIX trigger...
[+] Vulnerable! HTTP response code: 200
[+] Attempting gzip bypass for Windows trigger...
[+] Vulnerable! HTTP response code: 200

다음 오류가 발생하는 경우:

root@kitploit:~
$ ./imperva_gzip.py https://www.vulnerable.com/search
[+] Can we make POST requests to https://www.vulnerable.com/search?
[!] Can't POST to https://www.vulnerable.com/search. Try -r if 30x redirects are allowed. HTTP response code: 302

명령줄에 -r을 전달하여 완화 모드를 활성화해 보세요. 완화 모드는 기본적으로 꺼져 있으며, 이는 POST 요청이 서버로부터 HTTP 200 응답을 받을 것으로 예상함을 의미합니다. -r은 허용되는 응답을 HTTP 2xx, 3xx로 확장합니다.

스크립팅

imperva_gzip.py의 종료 코드는 다음과 같습니다:

root@kitploit:~
0: Returned after getting WAF type.
1: Command-line was invalid.
2: There was an error connecting. Could be DNS error, timeout, etc.
3: No WAF was detected; malicious UNIX/Windows payloads weren't blocked.
4: A WAF was detected, but it wasn't Imperva.
5: The server responded to a test POST request with something other than HTTP 200.
128: There is an Imperva WAF, but it is not vulnerable to the gzip bypass.
129: The bypass was effective for the UNIX payload, but not the Windows one.
130: The bypass was effective for the Windows payload, but not the UNIX one.
131: The bypass was effective against both Windows and UNIX payloads.

수동 취약점 테스트 절차

세 개의 POST 요청을 전송합니다:

  1. 유효하지만 무해한 POST 요청으로 기준 POST 요청/응답을 설정합니다.
  2. 동일한 POST 요청을 사용하지만 본문에 &test=../../../../../../../etc/shadow와 같은 추가 '악성' 데이터를 포함시켜 Imperva가 차단하는지 확인합니다.
  3. 동일한 악성 요청에 Content-Encoding: gzip 헤더를 추가하고 Imperva가 차단하지 않는지 확인합니다.

기타 인코딩

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding에 따르면 Content-Encoding 헤더에는 네 가지 유효한 값이 있습니다:

  • compress
  • deflate
  • gzip
  • br

테스트 결과, gzip만 우회에 성공했습니다.

영향을 받는 버전

Imperva Cloud WAF

Cloud WAF는 Imperva에서 관리합니다. 결과적으로 Cloud WAF에 대한 업데이트는 거의 모든 고객에게 거의 동시에 적용됩니다. 2021년 12월 22일 기준으로 모든 고객에게 패치가 적용되었습니다.

SecureSphere

gzip 우회 버그는 SecureSphere라는 별도의 Imperva 제품에서 수정되었습니다. SecureSphere v12.6 릴리스 노트에는 다음 문단이 포함되어 있습니다:

SPHR-58185: When SecureSphere failed to decompress POST body in requests with "Content-Encoding: gzip/deflate" header, it issued no alert and let the request through.

이것이 동일한 버그이며 아마도 Cloud WAF와 동일한 코드 계보를 가질 것이라고 확신합니다... 두 제품에 존재하기에는 매우 특정한 버그입니다. 이 문제는 2021년 2월에 SecureSphere에서 해결되었으나, 언제 도입되었는지는 알 수 없습니다. 취약점이 수년간 존재했을 가능성이 있습니다!

연락처

Bishop Fox

  • Author: @carllivitt @bishopfox
  • Offensive Security: Bishop Fox
  • Continuous Offensive Security: Bishop Fox Cosmos
  • Mad Scientists: Bishop Fox Labs

Imperva

Imperva Customer Support: https://www.imperva.com/support/technical-support/

참고 자료

  • Imperva Cloud WAF
  • Imperva SecureSphere 12.6 release notes
  • Content-Encoding HTTP header
도구 다운로드