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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
octoscan — Octoscan은 GitHub Actions 워크플로우를 위한 정적 취약점 스캐너입니다. | Kitploit
도구/GitHubGitHub/synacktiv/octoscan
Static AnalysisVulnerability ScannersCode AnalysisConfiguration AuditingDevSecOpsSecret DetectionSupply Chain SecurityMisconfiguration
GitHubsynacktiv/octoscan

octoscan

Octoscan은 GitHub Actions 워크플로우를 위한 정적 취약점 스캐너입니다.

저장소 보기
2732185개월 전Kitploit 검토 완료

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유
:octocat:

octoscan

Octoscan은 GitHub Action 워크플로우를 위한 정적 취약점 스캐너입니다.


목차

  • 목차
  • 설치
  • 사용법
    • 원격 워크플로우 다운로드
    • 분석
    • GitHub Action
  • 규칙
    • dangerous-checkout
    • dangerous-action
    • dangerous-write
    • expression-injection
    • runner-label
    • repo-jacking
    • unsecure-commands
    • bot-check
    • known-vulnerability
    • dangerous-artefact
    • credentials
    • shellcheck
    • local-action
    • oidc-action
  • 크레딧
  • 리소스

설치

root@kitploit:~
$ go mod tidy
$ go build

또는 docker로:

root@kitploit:~
$ docker pull ghcr.io/synacktiv/octoscan:latest

사용법

원격 워크플로우 다운로드

Octoscan은 로컬 git 저장소를 대상으로 실행하거나 dl 액션으로 모든 워크플로우를 다운로드할 수 있습니다:

root@kitploit:~
$ octoscan dl -h  
Octoscan.

Usage:
	octoscan dl [options] --org <org> [--repo <repo> --token <pat> --default-branch --max-branches <num> --path <path> --output-dir <dir> --include-archives]

Options:
	-h, --help  						Show help
	-d, --debug  						Debug output
	--verbose  						Verbose output
	--org <org>  						Organizations to target
	--repo <repo>  						Repository to target
	--token <pat>  						GHP to authenticate to GitHub
	--default-branch  					Only download workflows from the default branch
	--max-branches <num>  					Limit the number of branches to download
	--path <path>  						GitHub file path to download [default: .github/workflows]
	--output-dir <dir>  					Output dir where to download files [default: octoscan-output]
	--include-archives  					Also download archived repositories
root@kitploit:~
./octoscan dl --token ghp_<token> --org apache --repo incubator-answer

분석

무엇을 실행해야 할지 모르겠다면 그냥 다음을 실행하세요:

root@kitploit:~
./octoscan scan path/to/repos/ --disable-rules shellcheck,local-action --filter-triggers external

이러면 오탐(false positive)이 줄어들고 가장 흥미로운 결과를 얻을 수 있습니다.

dl 명령으로 워크플로우를 다운로드한 경우, 기본적으로 octoscan은 모든 브랜치의 모든 워크플로우를 다운로드하므로 중복된 워크플로우가 생길 수 있습니다. 중복된 워크플로우를 삭제하고 분석 속도를 높이려면 분석을 실행하기 전에 fdupes 명령을 사용할 수 있습니다:

root@kitploit:~
fdupes -n -r -N -d path/to/repo
root@kitploit:~
$ octoscan scan -h
octoscan

Usage:
	octoscan scan [options] --list-rules
	octoscan scan [options] <target>
	octoscan scan [options] <target> [--debug-rules --filter-triggers=<triggers> --filter-run --ignore=<pattern> ((--disable-rules | --enable-rules ) <rules>) --config-file <config>]

Options:
	-h, --help
	-v, --version
	-d, --debug
	--verbose
	--format <format>  				Output format, json, sarif or custom template to format error messages in Go template syntax. See https://github.com/rhysd/actionlint/tree/main/docs/usage.md#format
	--oneline 					Use one line per one error. Useful for reading error messages from programs

Args:
	<target>					Target File or directory to scan
	--filter-triggers <triggers>			Scan workflows with specific triggers (comma separated list: "push,pull_request_target" or pre-configured: external/allnopr)
	--filter-run					Search for expression injection only in run shell scripts.
	--ignore <pattern>				Regular expression matching to error messages you want to ignore.
	--disable-rules <rules>				Disable specific rules. Split on ","
	--enable-rules <rules>				Enable specific rules, this will disable all other rules. Split on ","
	--debug-rules					Enable debug rules.
	--config-file <config>				Config file.

Examples:
	$ octoscan scan ci.yml --disable-rules shellcheck,local-action --filter-triggers external

GitHub Action

이 도구는 GitHub Action으로 직접 사용하여 push/pull_request 이벤트에서 저장소를 스캔할 수도 있습니다. 자세한 내용은 이 저장소를 확인하세요.

규칙

전체 규칙 목록은 다음 명령으로 확인할 수 있습니다:

root@kitploit:~
$ octoscan scan --list-rules  
2024/08/07 16:50:48 [INFO] Available rules
- shellcheck
	Checks for shell script sources in "run:" using shellcheck
- credentials
	Checks for credentials in "services:" configuration
- dangerous-action
	Check for dangerous actions.
- dangerous-checkout
	Check for dangerous checkout.
- expression-injection
	Check for expression injection.
- dangerous-write
	Check for dangerous write operation on $GITHUB_OUTPUT or $GITHUB_ENV.
- local-action
	Check for local actions.
- runner-label
	Checks for GitHub-hosted and preset self-hosted runner labels in "runs-on:"
- unsecure-commands
	Check 'ACTIONS_ALLOW_UNSECURE_COMMANDS' env variable.
- known-vulnerability
	Check for known vulnerabilities.
- bot-check
	Check for if statements that are based on a bot identity.
- dangerous-artefact
	Check for workflow that upload artefacts containing sensitive files.
- debug-external-trigger
	Check for workflow that can be externally triggered.
- debug-artefacts
	Check for workflow that upload artefacts.
- debug-js-exec
	Check for workflow that execute system commands in JS scripts.
- debug-oidc-action
	Check for OIDC actions.
- repo-jacking
	Verify that external actions are pointing to a valid GitHub user or organization.

dangerous-checkout

workflow_run 또는 pull_request_target 같은 트리거는 비밀(secret)에 대한 읽기 권한과 대상 저장소에 대한 잠재적 쓰기 권한을 가지므로 권한 있는 컨텍스트에서 실행됩니다. 이러한 컨텍스트에서 신뢰할 수 없는 코드를 명시적으로 체크아웃하면 공격자 코드가 다운로드되는 결과가 발생합니다.

excalidraw

예시

  • FreeRDP
  • Excalidraw
  • AutoGPT
  • Cypress
  • Apache Doris
  • Angular

dangerous-action

이 규칙은 위험한 액션이 사용될 경우 사용자에게 경고합니다. 주로 신뢰할 수 없는 아티팩트(artifact)에 초점을 맞춥니다.

서로 다른 워크플로우 간에 데이터를 전달하기 위해 아티팩트를 사용하는 것은 일반적인 관행입니다. 이는 트리거링 워크플로우가 일부 데이터를 준비한 다음 트리거된 워크플로우로 보내는 workflow_run 트리거에서 자주 발견됩니다. 이 아티팩트 데이터는 신뢰할 수 없는 특성을 가지므로 주의를 기울여 처리하고 잠재적 위협으로 인식하는 것이 중요합니다. 취약점은 악의적인 행위자와 같은 외부 개체가 아티팩트 데이터의 콘텐츠에 영향을 미칠 수 있다는 사실에서 발생합니다.

ant-design

예시

  • ant-design
  • Swagger-editor
  • Firebase
  • Firebase
  • Rust

dangerous-write

GitHub은 워크플로우의 모든 단계에서 사용할 수 있는 기본 환경 변수를 생성합니다. GITHUB_ENV 및 GITHUB_OUTPUT 변수는 특히 흥미롭습니다. 한 단계에서 환경 변수를 정의하고 다른 단계에서 이 변수를 사용할 수 있습니다. 이는 연결된 변수에 값을 작성하여 수행할 수 있습니다. 사용자가 설정되는 변수의 콘텐츠를 제어할 수 있다면 이는 임의 코드 실행으로 이어질 수 있습니다.

swagger

예시

  • Swagger-editor
  • dgraph-io/badger
  • Firebase
  • microsoft/vscode-github-triage-actions

expression-injection

각 워크플로우 트리거에는 해당 이벤트를 시작한 이벤트에 대한 포괄적인 정보를 제공하는 관련 GitHub 컨텍스트가 함께 제공됩니다. 여기에는 이벤트를 트리거한 사용자, 브랜치 이름 및 기타 관련 컨텍스트 정보에 대한 세부 정보가 포함됩니다. 기본 저장소 이름이나 풀 리퀘스트 번호와 같은 이벤트 데이터의 특정 구성 요소는 이벤트를 시작한 사용자(예: 풀 리퀘스트의 경우)가 조작하거나 주입에 악용할 수 없습니다. 이를 통해 워크플로우 실행 중 GitHub 컨텍스트가 제공하는 정보에 대한 통제와 보안 수준이 보장됩니다.

그러나 일부 요소는 공격자가 제어할 수 있으므로 사용하기 전에 삭제(sanitize)되어야 합니다. 해당 요소의 목록은 다음과 같습니다:

  • github.event.issue.title
  • github.event.issue.body
  • github.event.pull_request.title
  • github.event.pull_request.body
  • github.event.comment.body
  • github.event.review.body
  • github.event.pages.*.page_name
  • github.event.commits.*.message
  • github.event.head_commit.message
  • github.event.head_commit.author.email
  • github.event.head_commit.author.name
  • github.event.commits.*.author.email
  • github.event.commits.*.author.name
  • github.event.pull_request.head.ref
  • github.event.pull_request.head.label
  • github.event.pull_request.head.repo.default_branch
  • github.head_ref
  • env.*
  • steps.*.outputs.*
  • needs.*.outputs.*

autogpt

예시

  • AutoGPT
  • microsoft/generative-ai-for-beginners

runner-label

GitHub은 자체 러너를 호스팅하고 워크플로우에서 작업(job)을 실행하는 데 사용되는 환경을 사용자 지정할 수 있는 기능을 제공합니다. 이러한 러너를 자체 호스팅(self-hosted) 러너라고 합니다.

자체 호스팅 러너에는 임시(ephemeral) 러너와 비임시(non-ephemeral) 러너의 두 가지 유형이 있습니다. 기본적으로 러너는 비임시 방식이므로 작업이 완료된 후에도 러너가 사용하는 환경이 정리되지 않습니다. 공격자가 비임시 러너에서 코드를 실행하는 데 성공하면 백그라운드에서 프로세스를 추가하여 백도어를 설치하고 민감한 비밀을 탈취할 수 있습니다. 따라서 이러한 종류의 러너는 매우 민감합니다.

excalidraw

비임시 러너는 실행 로그를 확인하여 식별할 수 있습니다. gato라는 도구를 사용하여 이 프로세스를 자동화할 수 있습니다.

예시

  • Haskell
  • lovell/Sharp
  • WasmEdge
  • Scroll
  • Akash Network
  • actions/runner-images
  • tensorflow
  • pytorch

repo-jacking

저장소 재킹(repo jacking) 취약점은 DEFCON 31에서 Asi Greenholts가 발표했습니다. 이 취약점은 GitHub 액션이 존재하지 않는 GitHub 조직 또는 사용자의 액션을 참조할 때 발생합니다.

AcalaNetwork

이 규칙은 공격 가능 여부를 확인하기 위해 인터넷이 필요합니다. 다른 모든 검사는 오프라인으로 수행됩니다.

예시

  • Azure/bicep-registry-modules
  • HangfireIO/Hangfire

unsecure-commands

액션은 러너 머신과 상호 작용할 수 있는 기능을 보유하여 환경 변수 설정, 다른 액션이 사용할 출력 값 정의, 출력 로그에 디버그 메시지 포함, 기타 다양한 작업 수행이 가능합니다. 그러나 2020년 이전에는 다음과 같이 STDOUT에 데이터를 작성하여 환경 변수를 제어할 수 있었습니다:

root@kitploit:~
run: |
   echo "##[set-env name=ENV_NAME;]value"
   # or
   echo "echo "::set-env name=ENV_NAME::value"

구현된 워크플로우 명령은 STDOUT에 로깅하는 일반적인 관행으로 인해 본질적으로 안전하지 않았습니다. 이 취약점은 잠재적 공격의 통로를 열어 악성 페이로드를 쉽게 주입하고 set-env 명령을 트리거할 수 있게 했습니다. 환경 변수를 수정할 수 있는 기능은 여러 가지 원격 코드 실행 경로를 도입했으며, 특히 앞서 시연한 페이로드가 가장 명확한 예입니다. 이 취약점은 처음에 Project Zero의 보안 연구원이 보고했습니다.

set-env 명령은 더 이상 사용되지 않으며 기본적으로 사용할 수 없지만, 개발자가 워크플로우에서 ACTIONS_ALLOW_UNSECURE_COMMANDS 환경 변수를 설정하면 set-env 명령을 사용할 수 있게 됩니다:

alibaba

예시

  • alibaba/nacos

bot-check

다음 검사를 우회할 수 있습니다:

root@kitploit:~
jobs:
  merge-dependabot-pr:
    runs-on: ubuntu-latest
    if: github.actor == 'dependabot[bot]'
    steps:
		...

공격의 핵심은 포크된 저장소에서 Dependabot을 트리거하여 포크된 저장소에 Dependabot이 만든 PR을 생성하고, 그 다음 Dependabot 브랜치의 PR을 취약한 저장소에 연 다음, 마지막으로 Dependabot을 다시 트리거하여 취약한 워크플로우를 실행하도록 하는 것입니다.

dependabot

모든 악용 세부 정보는 여기에서 확인할 수 있습니다: https://www.synacktiv.com/publications/github-actions-exploitation-dependabot

예시

  • spring-projects/spring-security
  • spring-projects/spring-session
  • trpc/trpc

known-vulnerability

osv.dev를 기반으로 알려진 취약한 액션을 검색합니다.

dangerous-artefact

.git/config와 같은 민감한 파일을 포함하는 아티팩트를 업로드하는 워크플로우를 확인합니다. 이 규칙은 이 문서를 기반으로 합니다.

credentials

services: 구성에서 자격 증명(credential)을 확인합니다. 이 규칙은 actionlint에서 비롯되었습니다.

test

shellcheck

모든 bash 작업에서 shellcheck를 실행합니다. 이 규칙은 actionlint에서 비롯되었습니다.

local-action

로컬 GitHub 액션이 사용되면 경고를 발생시킵니다. 현재 이 도구는 로컬 액션 파일을 파싱할 수 없으므로, 로컬 액션도 취약점을 포함할 수 있기 때문에 경고가 발생합니다.

oidc-action

OIDC 액션을 감지합니다. OIDC 액션을 사용하는 워크플로우는 일부 클라우드 공급자에 접근하기 위한 좋은 표적이 될 수 있습니다. 이 규칙과 관련된 취약점은 없지만, 이 도구가 찾지 못한 취약점이 있는 경우 이 액션을 자세히 살펴보는 것이 흥미로울 수 있습니다.

💡 이 규칙은 이제 디버그 규칙이므로, 이 규칙을 검색하려면 --debug-rules를 추가해야 합니다.

크레딧

이 도구는 actionlint 없이는 개발될 수 없었습니다. @rhysd님께 감사드립니다.

리소스

  • GitHub Actions 악용: 소개
  • GitHub Actions 악용: 신뢰할 수 없는 입력
  • GitHub Actions 악용: 저장소 재킹 및 환경 조작
  • GitHub Actions 악용: 자체 호스팅 러너
  • GitHub Actions 악용: Dependabot
  • https://0xn3va.gitbook.io/cheat-sheets/ci-cd/github/actions
  • https://cloud.hacktricks.xyz/pentesting-ci-cd/github-security
  • https://unit42.paloaltonetworks.com/github-repo-artifacts-leak-tokens
도구 다운로드