Skip to content
KitploitKITPLOIT
도구익스플로잇블로그
Log in
제출
도구익스플로잇블로그
제출

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

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

피드문의개인정보© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
shiro-cve-2022-32532 — 최소한의 Java 웹 애플리케이션으로, URL의 개행 문자를 통한 Apache Shiro RegExPatternMatcher 인증 우회 취약점인 CVE-2022-32532를 재현합니다. | Kitploit
도구/GitHubGitHub/my0113/shiro-cve-2022-32532
Authentication & AuthorizationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & Education
GitHubmy0113/shiro-cve-2022-32532

shiro-cve-2022-32532

최소한의 Java 웹 애플리케이션으로, URL의 개행 문자를 통한 Apache Shiro RegExPatternMatcher 인증 우회 취약점인 CVE-2022-32532를 재현합니다.

저장소 보기
341년 전아직 검토되지 않음
공유

Apache Shiro CVE-2022-32532 재현 환경

CVE-2022-32532(Apache Shiro RegExPatternMatcher 인증 우회)를 재현하기 위한 최소한의 Web 애플리케이션입니다.

취약점 설명

  • CVE: CVE-2022-32532
  • 영향 버전: Shiro < 1.9.1
  • 원인: RegExPatternMatcher가 정규식을 올바르게 앵커링하지 않아 경로 우회가 발생할 수 있습니다. 구체적으로 Java의 기본 정규식 매칭 로직을 사용하면 정규식에서 . 기호를 만날 때 \r(%0d), \n(%0a) 같은 특수 문자를 무시합니다. \r, \n 문자를 올바르게 처리하려면 PATTERN.DOTALL 모드 기반의 정규식 매칭 규칙을 명시적으로 사용해야 합니다. 그런데 shiro-1.9.1 미만 버전은 모두 기본 정규식 매칭 로직을 사용하므로 \r, \n을 올바르게 처리하지 못해 인증 우회가 발생합니다.

재현 방법

  1. 애플리케이션 시작

    启动ShiroCve202232532Application
    
    
  2. Shiro 정상 인증을 통과하면 access denied를 반환하는 URL은 다음과 같습니다.
    http://localhost:8080/permit/xxx, 맨 마지막의 xxx는 임의의 문자로 바꿀 수 있습니다.

  3. Shiro 인증을 우회하면 success를 반환하는 URL은 다음과 같습니다.
    http://localhost:8080/permit/xxx, 즉 맨 마지막의 xxx에 줄 바꿈 문자 \n(%0a), 캐리지 리턴 문자 \r(%0d)를 삽입하면 됩니다.

  4. 해결 방법

    1. https://github.com/apache/shiro/blob/shiro-root-1.9.1/core/src/main/java/org/apache/shiro/util/ 에서 RegExPatternMatcher.java와 PatternMatcher.java의 전체 내용을 복사합니다.
    2. jdk11을 사용하여 이 두 java 파일을 RegExPatternMatcher.class와 PatternMatcher.class로 컴파일합니다.
    3. WinRAR을 사용하여 이 2개의 class 파일을 shiro-core-1.6.0.jar의 org/apache/shiro/util/ 아래에 넣습니다.
    4. 수정 테스트는 shiro-core-1.9.1의 RegExPatternMatcher.java 코드를 본 사례에 복사하여 RegExPatternMatcher191.java로 변경한 다음, MyFilter 15행과 MyShiroFilterFactoryBean 29행의 new RegExPatternMatcher()를 new RegExPatternMatcher191()로 바꾸면 됩니다.
    5. shiro-core-1.9.1의 RegExPatternMatcher 구현 로직은 다음과 같습니다:
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */
package org.apache.shiro.util;

import java.util.regex.Pattern;
import java.util.regex.Matcher;

/**
 * {@code PatternMatcher} implementation that uses standard {@link java.util.regex} objects.
 *
 * @see Pattern
 * @since 1.0
 */
public class RegExPatternMatcher implements PatternMatcher {

   private static final int DEFAULT = Pattern.DOTALL;

   private static final int CASE_INSENSITIVE = DEFAULT | Pattern.CASE_INSENSITIVE;

   private boolean caseInsensitive = false;

   /**
    * Simple implementation that merely uses the default pattern comparison logic provided by the
    * JDK.
    * <p/>This implementation essentially executes the following:
    * <pre>
    * Pattern p = Pattern.compile(pattern, Pattern.DOTALL);
    * Matcher m = p.matcher(source);
    * return m.matches();</pre>
    * @param pattern the pattern to match against
    * @param source  the source to match
    * @return {@code true} if the source matches the required pattern, {@code false} otherwise.
    */
   public boolean matches(String pattern, String source) {
      if (pattern == null) {
         throw new IllegalArgumentException("pattern argument cannot be null.");
      }
      Pattern p = Pattern.compile(pattern, caseInsensitive ? CASE_INSENSITIVE : DEFAULT);
      Matcher m = p.matcher(source);
      return m.matches();
   }

   /**
    * Returns true if regex match should be case-insensitive.
    * @return true if regex match should be case-insensitive.
    */
   public boolean isCaseInsensitive() {
      return caseInsensitive;
   }

   /**
    * Adds the Pattern.CASE_INSENSITIVE flag when compiling patterns.
    * @param caseInsensitive true if patterns should match case-insensitive.
    */
   public void setCaseInsensitive(boolean caseInsensitive) {
      this.caseInsensitive = caseInsensitive;
   }
}
도구 다운로드

인기

모두 보기 →

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

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 궁극의 OSINT 툴킷: 조사 그래프, 신뢰도 점수 산정, 별칭 패밀리, 지도, 타임라인 및 보고서. 49개 모듈, 400개 이상 사이트, API 키 불필요.

    755
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # GhostLock 원탭 실행 앱 (CVE-2026-43499)

    510
  • 3

    ARTEX

    baarai/artex

    LLM 멀티 에이전트 자율 침투 테스트 플랫폼으로, 플래너/워커 에이전트, 자산 및 탐색 그래프, MITM 트래픽 기록, 취약점 재테스트 기능을 제공합니다.

    415
  • 4

    redforge

    cybersecurity91/redforge

    브라우저 측 레드 팀 툴킷으로, 정찰, 페이로드 생성, 자격 증명 공격, 암호화, 인코딩 및 참여 보고를 위한 102개의 오프라인 도구를 제공합니다.

    343
  • 5

    antifox

    antifox-ai/antifox

    정찰, 공격 표면 탐색, 익스플로잇 검증, 증거 기반 보고서 전달을 수행하는 AI 멀티 에이전트 자율 침투 테스트 플랫폼입니다.

    259
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI 네이티브 사이버보안을 위한 행동 체계—의도가 통제된 실행이 되고, 증거가 운영 메모리가 되며, 모든 운영이 다음 운영을 개선하는 곳.

    258

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →