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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
squarephish — 고급 피싱 도구로, OAuth Device Code 인증 흐름과 QR 코드를 결합하여 MFA 업데이트 명목을 통해 Microsoft 인증 토큰을 수집합니다 | Kitploit
도구/GitHubGitHub/secureworks/squarephish
Phishing ToolsImpersonation ToolsPhishingSocial EngineeringAuthenticationRed Teaming
GitHubsecureworks/squarephish

squarephish

고급 피싱 도구로, OAuth Device Code 인증 흐름과 QR 코드를 결합하여 MFA 업데이트 명목을 통해 Microsoft 인증 토큰을 수집합니다

저장소 보기
346533년 전Kitploit 검토 완료

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

SquarePhish

SquarePhish는 OAuth Device Code 인증 흐름과 QR 코드를 결합한 기술을 사용하는 고급 피싱 도구입니다.

피싱 공격에 OAuth Device Code 흐름을 사용하는 방법에 대한 자세한 내용은 PhishInSuits를 참조하세요.

root@kitploit:~

   _____                            _____  _     _     _     
  / ____|                          |  __ \| |   (_)   | |    
 | (___   __ _ _   _  __ _ _ __ ___| |__) | |__  _ ___| |__  
  \___ \ / _` | | | |/ _` | '__/ _ \  ___/| '_ \| / __| '_ \ 
  ____) | (_| | |_| | (_| | | |  __/ |    | | | | \__ \ | | |
 |_____/ \__, |\__,_|\__,_|_|  \___|_|    |_| |_|_|___/_| |_|
            | |                                              
            |_|                                            
                     _________
                    |         | /(
                    | O       |/ (
                    |>        |\ (  v0.1.0
                    |_________| \(

usage: squish.py [-h] {email,server} ...

SquarePhish -- v0.1.0

optional arguments:
  -h, --help      show this help message and exit

modules:
  {email,server}
    email         send a malicious QR Code email to a provided victim
    server        host a malicious server QR Codes generated via the 'email' module will 
                  point to that will activate the malicious OAuth Device Code flow

공격 단계

공격자는 SquarePhish의 email 모듈을 사용하여 악성 QR 코드 이메일을 피해자에게 보낼 수 있습니다. 기본 사전 텍스트는 피해자가 모바일 이메일을 계속 사용하려면 Microsoft MFA 인증을 업데이트해야 한다는 내용입니다. 현재 사용 중인 클라이언트 ID는 Microsoft Authenticator 앱입니다.

QR 코드를 먼저 보내면 공격자는 15분 동안만 지속되는 OAuth Device Code 흐름을 조기에 시작하는 것을 피할 수 있습니다.

그러면 피해자는 이메일 본문에 있는 QR 코드를 모바일 기기로 스캔합니다. QR 코드는 피해자를 공격자가 제어하는 서버(SquarePhish의 server 모듈 실행 중)로 안내하며, URL 매개변수에 피해자의 이메일 주소가 포함됩니다.

피해자가 악성 SquarePhish 서버를 방문하면, 백그라운드 프로세스가 트리거되어 OAuth Device Code 인증 흐름을 시작하고, 생성된 Device Code를 피해자에게 이메일로 보냅니다. 피해자는 이 코드를 합법적인 Microsoft Device Code 웹사이트에 입력해야 합니다(이로 인해 OAuth Device Code 흐름의 15분 타이머가 시작됩니다).

그러면 SquarePhish 서버는 백그라운드에서 계속 인증을 폴링합니다.

root@kitploit:~
[2022-04-08 14:31:51,962] [info] [[email protected]] Polling for user authentication...
[2022-04-08 14:31:57,185] [info] [[email protected]] Polling for user authentication...
[2022-04-08 14:32:02,372] [info] [[email protected]] Polling for user authentication...
[2022-04-08 14:32:07,516] [info] [[email protected]] Polling for user authentication...
[2022-04-08 14:32:12,847] [info] [[email protected]] Polling for user authentication...
[2022-04-08 14:32:17,993] [info] [[email protected]] Polling for user authentication...
[2022-04-08 14:32:23,169] [info] [[email protected]] Polling for user authentication...
[2022-04-08 14:32:28,492] [info] [[email protected]] Polling for user authentication...

그러면 피해자는 이메일에 제공된 링크를 통해 또는 모바일 기기에서 SquarePhish URL을 방문한 후 리디렉션을 통해 Microsoft Device Code 인증 사이트를 방문합니다.

피해자는 제공된 Device Code를 입력하고 동의를 요청받습니다.

피해자가 인증하고 동의하면 인증 토큰이 로컬에 저장되며, 공격자는 요청 애플리케이션의 정의된 범위를 통해 액세스 권한을 얻습니다.

root@kitploit:~
[2022-04-08 14:32:28,796] [info] [[email protected]] Token info saved to [email protected]

현재 범위 정의:

root@kitploit:~
"scope": ".default offline_access profile openid"

사용법

!중요: 모듈을 사용하기 전에 settings.config 파일에서 Required로 표시된 필수 정보를 업데이트하세요.

이메일 모듈

대상 피해자에게 OAuth Device Code 흐름을 트리거하는 생성된 QR 코드를 보냅니다.

root@kitploit:~
usage: squish.py email [-h] [-c CONFIG] [--debug] [-e EMAIL]

optional arguments:
  -h, --help            show this help message and exit

  -c CONFIG, --config CONFIG
                        squarephish config file [Default: settings.config]

  --debug               enable server debugging

  -e EMAIL, --email EMAIL
                        victim email address to send initial QR code email to

  -u URL, --url URL     force a url to use, this will override the default
                        and will not work with default device flow or
                        pretext but can be useful if using squarephish to
                        send lures directing targets to other servers

서버 모듈

생성된 QR 코드가 가리킬 서버를 호스팅하며, 요청 시 OAuth Device Code 흐름을 트리거합니다.

root@kitploit:~
usage: squish.py server [-h] [-c CONFIG] [--debug]

optional arguments:
  -h, --help            show this help message and exit

  -c CONFIG, --config CONFIG
                        squarephish config file [Default: settings.config]

  --debug               enable server debugging

설정

실행에 필요한 모든 설정은 settings.config 파일에서 찾아 수정할 수 있습니다. 기본값이 없는 여러 필수 정보(SMTP_EMAIL, SMTP_PASSWORD, SQUAREPHISH_SERVER(이메일 모듈 실행 시에만))는 사용자가 반드시 입력해야 합니다. 모든 구성 옵션은 설정 파일 내 인라인 주석을 통해 문서화되어 있습니다.

참고: 구성의 'EMAIL' 섹션에 있는 SQUAREPHISH_ 값은 SquarePhish 서버 실행 시 설정된 값과 일치해야 합니다.

root@kitploit:~
[DEFAULT]
SMTP_PORT            = 465                                                                      # SMTP port, defaulted to 465
SMTP_SERVER          = "smtp.gmail.com"                                                         # SMTP server, defaulted to GMail
SMTP_PROTO           = "ssl"                                                                    # SMTP protocol: {ssl, tls, None (leave empty)}
SMTP_EMAIL           = ""                                                                       # Provide authenticating email address here
SMTP_PASSWORD        = ""                                                                       # Provide authenticating password here

[EMAIL]
SQUAREPHISH_SERVER   = ""                                                                       # Required: Provide IP address/domain name of hosted SquarePhish server
SQUAREPHISH_PORT     = 8443                                                                     # Hosted SquarePhish server port, defaulted to 8443 (this should match the below server value)
SQUAREPHISH_ENDPOINT = "/mfa"                                                                   # Hosted SquarePhish endpoint to trigger OAuth Device Code flow, defaulted to an MFA pretext (this should match the below server value)
FROM_EMAIL           = "[email protected]"                                                     # Default FROM address when sending an email
SUBJECT              = "ACTION REQUIRED: Multi-Factor Authentication (MFA) Update"              # Default SUBJECT when sending an email, defauled to an MFA pretext
EMAIL_TEMPLATE       = "pretexts/mfa/qrcode_email.html"                                         # Email body template for QR code email to victim

[SERVER]
PORT                 = 8443
FROM_EMAIL           = "[email protected]"                                                     # Default FROM address when sending an email
SUBJECT              = "ACTION REQUIRED: Multi-Factor Authentication (MFA) Update"              # Default SUBJECT when sending an email, defauled to an MFA pretext
CLIENT_ID            = "4813382a-8fa7-425e-ab75-3b753aab3abb"                                   # Authenticating client ID, defaulted to Microsoft Authenticator App
ENDPOINT             = "/mfa"                                                                   # Hosted endpoint to trigger OAuth Device Code flow, defaulted to an MFA pretext
CERT_CRT             = ""                                                                       # Server SSL certificate .crt file
CERT_KEY             = ""                                                                       # Server SSL certificate .key file
EMAIL_TEMPLATE       = "pretexts/mfa/devicecode_email.html"                                     # Email body template for device code email to victim
PERMISSION_SCOPE     = ".default offline_access profile openid"                                 # OAuth permission scope - https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent

사용자 정의 사전 텍스트

현재 사전 정의된 사전 텍스트는 pretexts 폴더에서 찾을 수 있습니다.

사용자 정의 사전 텍스트를 작성하려면 pretexts/iphone/ 폴더의 기존 템플릿을 사용하세요. 초기 QR 코드 이메일과 후속 장치 코드 이메일 모두에 대해 이메일 템플릿이 필요합니다.

중요: 사용자 정의 사전 텍스트를 작성할 때, 두 사전 텍스트 템플릿에 %s가 존재한다는 점에 유의하세요. 이는 SquarePhish가 이메일 생성 시 올바른 데이터(QR 코드 데이터 및/또는 장치 코드 값)를 채우도록 하기 위한 것입니다.

OPSEC

utils.py 파일에 정의된 여러 HTTP 응답 헤더가 있습니다. 이러한 헤더는 기존 Flask 응답 헤더 값을 재정의하고 서버에서 보다 '합법적인' 응답을 제공하기 위해 정의되었습니다. 이 헤더 값은 수정하거나 제거할 수 있으며, 더 나은 OPSEC을 위해 추가 헤더를 포함할 수도 있습니다.

root@kitploit:~
{
    "vary": "Accept-Encoding",
    "server": "Microsoft-IIS/10.0",
    "tls_version": "tls1.3",
    "content-type": "text/html; charset=utf-8",
    "x-appversion": "1.0.8125.42964",
    "x-frame-options": "SAMEORIGIN",
    "x-ua-compatible": "IE=Edge;chrome=1",
    "x-xss-protection": "1; mode=block",
    "x-content-type-options": "nosniff",
    "strict-transport-security": "max-age=31536000",
}
도구 다운로드