Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whatsapi working again with help from yowsup and googlevoice. #238

Open
jonnywilliamson opened this issue Dec 27, 2012 · 60 comments
Open

Whatsapi working again with help from yowsup and googlevoice. #238

jonnywilliamson opened this issue Dec 27, 2012 · 60 comments

Comments

@jonnywilliamson
Copy link
Contributor

Ok firstly there's going to be a bit of a rant at the start before I give you my results.

It just seems incredible to me how many people take the time to find this repository, find the issues section and then without even taking 2 secs to look at the other threads in here - create a brand new issue and ask the same question as 400 other people immediate below them. I'm tired of getting dozens of emails that are all CRAP.

Come on people SMARTEN UP. You are not ALL stupid.

Also can we just clear up some issues once and for all.

  1. If you're using v1 of the authentication proceedure (ie everything up until the changes a few weeks ago) and things are still working for you, you are living on borrowed time. Sooner or later you will find that you cannot connect. You will know this by the error message "incorrect password". Do not come here and tell us about it, we know.

  2. It seems fairly clear now. WHATSAPP NOW ASSIGN A PASSWORD to each user account, THERE IS NO WAY TO GENERATE IT ANYMORE. You must discover what your new password is, there's no more generating it from your phones IMEI or MAC address.

  3. To those people who have been sending more than 10,000 messages a day and complained about being blocked - I call shenanigans. You are spammers. I HATE spammers, I'm delighted your accounts have been blocked.

So as we continue what am I showing you?

I have finally found away to (easily) get the password for a particular whatsapp account, and I have modified the code in whatsapi to use this password to allow me to send messages again. This solution will NOT help everyone.

A lot of you will want to use the SAME account as your phone (in my case iphone), THIS IS NOT POSSIBLE USING MY SOLUTION AT THE MOMENT.

I have been unable to find a way to extract the password from my phone, therefore I used yowsup and my googlevoice number to create a new account and capture the password from there before using it in WHATSAPI.

HOWEVER when someone finds a way to read the password file stored on the iphone etc we will be able to use the rest of my solution below.

Here's what I did.

a) Download YOWSUP from https://github.com/tgalal/yowsup . This is a python implementation of whatsapp and will allow us to register and capture our new account password. You will need a server that has python installed to be able to use this. Move all the YOWSUP files to your server.

b) Edit the config.example file in the yowsup directory. Place your googlevoice number in the config file. It should look like this:

phone=12225556666
d=
password=

c) run the yowsup-cli file with the following parameters:

 python ./yowsup-cli -c config.example -d --requestcode voice

You will see the connection being made to whatsapp and after a few secs whatsapp will make a voicecall to your googlevoice number with the confirmation code.

In my case I let googlevoicemail pick up the call and record the message. I was then able to play the message back and hear my confirmation code. I didn't check to see if googlevoice would receive a sms message from whatsapp. If you would like to try this method, then run this command:

 python ./yowsup-cli -c config.example -d --requestcode sms

d) Now we need to finish the registration by sending the confirmation code back. Run this command:

 python ./yowsup-cli -c config.example -d -R 123456

Where 123456 is your 6 digit confirmation code. If success full you will see something like this:

status: ok
kind: free
pw: YOURPASSWORDISHERE
price: $0.99
price_expiration: 1359720290
currency: USD
cost: 0.99
expiration: 1388155832
login:
type: new

e) Now take/copy your password, if you like you are now finished with yowsup.

f) The password you have is a base64 encoded string containing your password. We have to now add a way for WHATSAPI to be able to use it. There's 2 code changes we have to make to the current code to get this to work.

open whatsprot.class.php find

    protected $_whatsAppVer = "2.8.4";

change to

    protected $_whatsAppVer = "2.8.7";

find

    public function encryptPassword()
    {
        if(stripos($this->_imei, ":") !== false){
            $this->_imei = strtoupper($this->_imei);
            return md5($this->_imei.$this->_imei);
        }
        else {
            return md5(strrev($this->_imei));
        }
    }

and replace with

    public function encryptPassword()
    {
        return base64_decode($this->_imei);
    }

Now you are good to go! To use a very quick proof, create this php file and enter your details, then run the file, you should receive a message after a second.

<?php
    require "whatsprot.class.php";

    $fromMobNumber = "12225556666"; //ENTER YOUR GOOGLEVOICENUMBER HERE
    $toMobNumber = "09876543210"; //ENTER YOUR OWN NUMBER HERE
    $id = "<YOUR NEW PASSWORD>";  //ENTER THE PASSWORD YOU COPIED EARLIER HERE
    $nick = "YourNick";

    $w = new WhatsProt($fromMobNumber, $id, $nick);
    $w->Connect();
    $w->Login();
    $w->sendNickname($nick);
    $w->Message($toMobNumber , "Testing123");
    sleep (2);

?>
@brittson
Copy link

@jonnywilliamson great. thanks man

@kingk110
Copy link

@jonnywilliamson @adasmalakar
did u check that it is working ?
because I am trying to do the same in the .net api but getting wrong password

@brittson
Copy link

@kingk110 yes its working on php

@jonnywilliamson
Copy link
Contributor Author

Oh course I checked it was working @kingk110 - do you think I'd type all that out just to pass an hour in the afternoon?

@guidomgs
Copy link

Nice!!! thanks that is really good!

I added one more line on the code to get a confirmation message:

#!/usr/bin/php

Connect(); $w->Login(); $w->sendNickname($nick); $w->Message($toMobNumber , "hello"); //<----This is the message line :) sleep (1); exit(0); ``` ?>

@jonnywilliamson
Copy link
Contributor Author

@guidomgs Thanks. I missed that when copying and pasting. Added to original post.

@cluber22
Copy link

Am I right in saying that with this method, when you go back onto your phone you need to re-register and verify on your phone.

@guidomgs
Copy link

Is not google voice exclusive, I registered with yowsup a spear sim card, also you can register with yowsup a land line phone.

@jonnywilliamson
Copy link
Contributor Author

@cluber22 As per my post:

A lot of you will want to use the SAME account as your phone (in my case iphone), THIS IS NOT POSSIBLE USING MY SOLUTION AT THE MOMENT.

@cluber22
Copy link

@jonnywilliamson I did read that but was looking for some clarification regarding the reverifying. Thanks.

@g0g0l
Copy link

g0g0l commented Dec 28, 2012

@kingk110 you need to do something like this in .net
public static string base64Decode(string imei)
{
byte[] binary_hash = Convert.FromBaseString(imei);
return Encoding.Default.GetString(binary_hash);
}
It is done in php using base64_decode() function. The method given here is really helpful, thanks @jonnywilliamson

@kingk110
Copy link

I tried too much but always getting wrong answer @g0g0l
what about the md5 encryption
if u debug the .net you will notice that there is an md5 encryption while calling the function ExistsAndDelete!
is there an md5 encryption of the decoded string in the php before using it as a token?

@horaceho
Copy link

@jonnywilliamson Thanks for the great information and detail instructions. It works like a charm.

@g0g0l
Copy link

g0g0l commented Dec 28, 2012

The md5(reversed imei) was the password in older protocol, I don't think md5 encryption is required any longer, at least it is not required in php

@g0g0l
Copy link

g0g0l commented Dec 28, 2012

@cluber22 the phone,hash combination gets deactivated when you try to use same number in phone, because the rule of WhatsApp is: "You can only register one number in only one device". When you register a number using yowsup, WhatsApp considers it as a device and same number cannot be used in phone or tablet.

@kingk110
Copy link

there is also rc4 encryption while using the login function do you have any idea about it @g0g0l ?
I tired to skip the ExistsAndDelete and debug but my mind was lost while calling too many functions to encrypt data !!!
I don't know why there is so many encryption while using a request ??

If you know .net and can help to solve it I'll thank you a lot because nobody is giving it any important in the .net repository

@jonnywilliamson
Copy link
Contributor Author

@kingk110 I'm sorry but you are obviously completely out of your depth. You are mistaking what we are doing here, using WHATSAPI with a new password, with the actual code needed in behind the scenes to make a signed/encrypted request with the whatsapp servers. Not only that but your problems are related to code in another language to what is being discussed here!

I appreciate you just want help, but you're in the wrong place.

Please start a new topic with your issues and stop using this one.

@olpo
Copy link

olpo commented Dec 28, 2012

stop telling this spammer how to do it . everyone who is not dumb as fuck already figured it out.

@kingk110
Copy link

thanks for you guys

@ruriimasu
Copy link

Did any of you guys ever get an error Old_version when input SMS code? But no problem if I re-register the phone number with latest whatsapp client.

The said phone number was used in an old version of Whatsapp and I'm trying to re-register in the new password format.

@Currito
Copy link

Currito commented Jan 4, 2013

@jonnywilliamson Great work!

@stoyicker
Copy link

Thank you very much. This was not valid for me, since I live in Spain where Google Voice isn't supported. However the method has anyway worked. I've used the sms verification and, for the phone, just my country code and my mobile phone number, e. g., 34123456789, where 123456789 is my phone number, registered in Spain (country code 34). I've received the SMS within seconds.

Thank you very much again @jonnywilliamson

@lahmacuns
Copy link

What is this Problem ?

python ./yowsup-cli -c config.example -d --requestcode voice
File "./yowsup-cli", line 191
password = identity or password if args["v1"] else base64.b64decode(password)
^
SyntaxError: invalid syntax

@shirioko
Copy link
Contributor

shirioko commented Jan 7, 2013

That is line 222, not 191
https://github.com/tgalal/yowsup/blob/master/src/yowsup-cli
perhaps you have accidentally deleted some lines? Try downloading it again.

@jandrito80
Copy link

Is it possible to migrate yowsup from python to php?
I use php to send and receive messages, and would like to register a new number from php.
I can't understand python code. Is there any way to register a new number with php code?
Thank you

@shirioko
Copy link
Contributor

You can call python from php and then parse the output. Just use both.

@jandrito80
Copy link

The script works fine on my computer (I have python 2.7.2), but the server does not work online.
I've tried a basic script:

test.py

print "Hello World"

and php
exec ("python test.py", $ output);
This works correctly.
but
exec ("python yowsup/yowsup-cli -c config.example -d --requestcode voice", $ output);
not work.
Do I have to do some extra configuration?
Do I have to open a special port?

@shirioko
Copy link
Contributor

Go to yowsup's repository and verify that you have all the dependencies installed (python version, libraries etc.). It's in the readme file.

@shirioko
Copy link
Contributor

Well yes you have to open that port. I believe it's 5222.
On Jan 14, 2013 2:35 AM, "Will.C" notifications@github.com wrote:

hmmm.. anyway to to bypass that firewall and connect outbound
connections? been cracking head for few days. Thanks.


Reply to this email directly or view it on GitHub.

@beldar
Copy link
Contributor

beldar commented Jan 15, 2013

@jonnywilliamson Thank you for making my life easy.

@codename12
Copy link

@jonnywilliamson I extracted my password, the same one my phone is using, of course its not the best way but, its a start... I downloaded charles proxy on my laptop, I set the iphone to use a proxy (which is my laptop) and spoofed the registration process of my whatsapp account..

The next step is to know how this password I got, get encrypteds to the pw.dat file saved in the iphone!

p.s: I havent tried yet to sign in using the password i got, I just had it..

@rayxelloss
Copy link

which version of python shall i use for this ?

@shirioko
Copy link
Contributor

It's in yowsup's readme file. Go read it.

@muslimsg
Copy link

question 1) - how to change the profile pic with yowsup?

question 2) - I registered my number with yowsup. Now if I put the sim card into a mobile phone and login will the password change? If not can I set the profile pic via mobile phone?

@shirioko
Copy link
Contributor

Answer 1 & 2: this is not yowsup. Done. No more. Only questions related to
this project.
On Jan 19, 2013 10:50 AM, "muslimsg" notifications@github.com wrote:

question 1) - how to change the profile pic with yowsup?

question 2) - I registered my number with yowsup. Now if I put the sim
card into a mobile phone and login will the password change? If not can I
set the profile pic via mobile phone?


Reply to this email directly or view it on GitHubhttps://github.com//issues/238#issuecomment-12452750.

@rayxelloss
Copy link

thanks for the previous question. I installed all the Requirements in read me, when i tried to run the python by command (python ./yowsup-cli -c config.example -d --requestcode voice), i got "ImportError: No module named 'ConnectionIO' "

@shirioko
Copy link
Contributor

And how is this related to WhatsAPI?

@OrangeTux
Copy link

Thanks for the code and for this tutorial.

@guidomgs
Copy link

Hi its me again! I was working fine with this method, but now its failing at login time. Some one else was having the same issue?
on yowsup is working fine (but i dont like so much that one)

@serweb
Copy link

serweb commented Mar 7, 2013

Existe algun pequeño instructivo para ejecutar el whatsapi en php? o py? una vez descubierto el password de una cuenta como se prosigue?

@beldar
Copy link
Contributor

beldar commented Mar 7, 2013

@serweb ves a mirar el archivo testprotocol.php ahí hay ejemplos, pero te
recomiendo que cojas el codigo de mi fork de WhatsAPI, ya que la version de
aqui no esta preparada para el nuevo sistema de passwords.

El dijous 7 de març de 2013, serweb ha escrit:

Existe algun pequeño instructivo para ejecutar el whatsapi en php? o py?
una vez descubierto el password de una cuenta como se prosigue?


Reply to this email directly or view it on GitHubhttps://github.com//issues/238#issuecomment-14543858
.

Martí

@serweb
Copy link

serweb commented Mar 9, 2013

Perdon necesito un empujon, como arranco? donde pongo ese archivo y como lo ejecuto? o sea una breve explicacion desde cero y luego me la rebusco, pero necesito arrancar. Conozco un poco de shell scripts en linux pero php nunca lo utilice.

@shirioko
Copy link
Contributor

shirioko commented Mar 9, 2013

No hablo espagnol.

Asking your questions in a different language won't make them less stupid. As said before, this is an issue tracker and not a tutorial. If you don't know the programming language you're screwed.

@shirioko shirioko mentioned this issue Apr 17, 2013
@krish-kapadia
Copy link

I tried getting the registration code via voice and sms but I got none of them. It said sent but I didn't get code via SMS or voice. Does it stop working???

@shirioko
Copy link
Contributor

shirioko commented Jun 4, 2013

If only people would read...

@krish-kapadia
Copy link

Here is the output

D:\Python33>python ./yowsup-cli -c config.example -d --requestcode sms
GET
{'User-Agent': 'WhatsApp/2.4.22 S40Version/14.26 Device/Nokia302', 'Accept': 'te
xt/json'}
cc=91&in=9978843611&lc=IN&lg=en&mcc=000&mnc=000&method=sms&id=19de191ef2f16489d8
0f011828b4026f&token=c21475793368afbec851f087c8986da0
Opening connection to v.whatsapp.net
Requesting /v2/code?cc=91&in=9978843611&lc=IN&lg=en&mcc=000&mnc=000&method=sms&i
d=19de191ef2f16489d80f011828b4026f&token=c21475793368afbec851f087c8986da0
WACodeRequest: b'{"status":"sent","length":6,"method":"sms","retry_after":25205
}\n'
retry_after: 25205
length: 6
status: sent
method: sms

Config File

cc=91
phone=919978843611
id=358904045415131
password=

Plz tell me if I'm doing something wrong...Still I didn't get the SMS.

@shirioko
Copy link
Contributor

shirioko commented Jun 4, 2013

We already know the output and we already know it's broken.
It's been broken for weeks if not months now, and if people would read the other issues we would not have comments about it each day.

@patelsagar
Copy link

Dear All Friends,

Whatsapp Message Send using php Not Working

        $nickname = "Bhavesh Lakum"; // Your nickname
        $sender = "****************"; // Number with country code
        $imei = "359301057212815"; // Not used
        $password = sha1("******"); // Password you received from WhatsApp (Using WART, WhatsAPI...)
        $dst = "***************"; // Number with country code (target to send a message)
        $wa = new WhatsProt($sender, $imei, $nickname, TRUE);
        $wa->connect();
        $wa->loginWithPassword($password);
        $wa->sendMessage($dst, "You have sent a message correctly, so you've connected to WhatsApp");

Error Display :-

tx stream:features
tx
tx <groups_v2></groups_v2>
tx
tx
tx /stream:features

tx

rx

rx stream:features/stream:features

rx on©›ôø\µžµ¢’SUw÷j�23

tx –”½¼ñ´™?SÖI(ı™fM�l·­M‹ôâÍjˆÿ='1ð%�q

Fatal error: Uncaught exception 'Exception' with message 'Login Failure' in /opt/lampp/htdocs/WhatsAPI-Official-master/src/whatsprot.class.php:2014 Stack trace: #0 /opt/lampp/htdocs/WhatsAPI-Official-master/src/whatsprot.class.php(526): WhatsProt->doLogin() #1 /opt/lampp/htdocs/WhatsAPI-Official-master/example.php(55): WhatsProt->loginWithPassword('7c5c7deef3e7ef1...') #2 {main} thrown in /opt/lampp/htdocs/WhatsAPI-Official-master/src/whatsprot.class.php on line 2014

Plz Solution Me

@OrangeTux
Copy link

@sagar551993 Maybe you should remove phone numbers and and password.

@patelsagar
Copy link

@OrangeTux
Thank You

@mgp25
Copy link
Contributor

mgp25 commented Oct 29, 2014

@sagar551993 your number have been blocked, try resetting password if not working you will need a new number. As i said you before in this repository is no longer being supported. We are giving support + latest updates here: https://github.com/mgp25/WhatsAPI-Official

@patelsagar
Copy link

@mgp25
Plz help Me
Not number Block
script use :https://github.com/mgp25/WhatsAPI-Official
Login Failure Error Display

@mgp25
Copy link
Contributor

mgp25 commented Oct 29, 2014

What script are you using? If its one of your own post the code here, if its any example, send link, be sure to ask the future doubts in the new repository.

If you are using latest code from WhatsAPI Official then your number is blocked, resetting your password with WART or WhatsAPI depends what did you use to register the number

@morethanequal
Copy link

@mgp25
Hi mgp25 can you please help me...
i'm using https://github.com/mgp25/WhatsAPI-Official repository
& following code
require_once 'whatsprot.class.php';
echo "ok";
$username = "49xxxxxxxxxxxxxxxx"; //Mobile Phone prefixed with country code so for india it will be 91xxxxxxxx
$password = "xxxxxxxxxxxxxxxxxxxxxx";
$debug = false;
$nickname = "xxxxx";

$w = new WhatsProt($username, $identity, $nickname, false);
$w->connect();
$w->loginWithPassword($password);

$target = '49xxxxxxxxxxxxx'; //Target Phone,reciever phone
$message = 'Test Message';

$w->SendPresenceSubscription($target); //Let us first send presence to user
$w->sendMessage($target,$message ); // Send Message

i'm not getting any error message or anything...

I generated new password using WART.. never ever used that number anywhere else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests