Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
B16f00t authored May 27, 2022
1 parent 5613389 commit 4d531b5
Show file tree
Hide file tree
Showing 17 changed files with 772 additions and 289 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Whatsapp Parser Toolset
====
Updated: July 2021
Updated: May 2022

WhatsApp Messenger Version 2.21.9.14

Expand All @@ -18,15 +18,15 @@ Whapa toolset is divided in five tools:

**Android**
======
* **Whapa** (Whatsapp Parser)
* **Whacipher** (Whatsapp Encryption/Decryption) *** NEW Crypt14 ***
* **Whapa** (Whatsapp Parser)(Only working with old database, Working in Progress...)
* **Whacipher** (Whatsapp Encryption/Decryption) *** Not support Crypt15 ***
* **Whagodri** (Whataspp Google Drive Extractor)
* **Whamerge** (Whatsapp Merger)
* **Whamerge** (Whatsapp Merger) (Only working with old database, Working in Progress...)
* **Whachat** (Whatsapp Chat Exporter)

**IPhone**
====
* **Whacloud** (Whatsapp ICloud Extractor) NEW BETA TOOL FOR IPHONE
* **Whacloud** (Whatsapp ICloud Extractor) (Not working)
* **Whachat** (Whatsapp Chat Exporter)


Expand Down Expand Up @@ -153,11 +153,7 @@ Edit only the values of the./cfg/settings.cfg file
# You can specify a list of celnumbr = BackupNumber1, BackupNumber2, ...
celnumbr =

* If you request it, log in to your browser and then click here. https://accounts.google.com/b/0/DisplayUnlockCaptcha


If you want to use 2FA (Two Factor Authentication), you will have to go to the URL: https://myaccount.google.com/apppasswords Then select Application: Other. Write down: Whapa, and a password will be display, then you must write the password in your settings.cfg.
(Thanks to YuriCosta)
* New Method: Now you will have to login in the browser, this method is not valid for accounts without a phone number or alternative email associated to the account.

WHACLOUD
=====
Expand Down
18 changes: 10 additions & 8 deletions cfg/settings.cfg
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
[report]
company =
record =
unit =
examiner =
notes =
company = ""
record = ""
unit = ""
examiner = ""
notes = ""

[google-auth]
gmail = [email protected]
# Optional. The account password or app password when using 2FA.
password =
password = yourpassword
# Optional. Login using the oauth cookie.
oauth = ""
# Optional. The result of "adb shell settings get secure android_id".
android_id = 0000000000000000
android_id = 0000000000000000
# Optional. Enter the backup country code + phonenumber be synchronized, otherwise it synchronizes all backups.
# You can specify a list of celnumbr = BackupNumber1, BackupNumber2, ...
celnumbr =
celnumbr = ""

[icloud-auth]
icloud = [email protected]
Expand Down
12 changes: 11 additions & 1 deletion doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ Changelog
====
All notable changes to this project will be documented in this file.

May 2022

[+] whapa-gui.py v1.58
[+] whacipher.py
[-] Fixed Decrypt crypt14 files.
[+] whagodri.py
[-] Fixed bug connecting with Google.
[-] Added No parallel downloads
[-] Added support for jpeg files with option "-si"

Nov 2021

[+] whapa-gui.py v1.56
Expand All @@ -11,7 +21,7 @@ Agu 2021

[+] whapa-gui.py v1.55
[+] whapa.py
[-] Fixed bug with setting file
[-] Fixed bug with settings file
[+] whachat.py
[-] New time formats
Expand Down
9 changes: 6 additions & 3 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
pycryptodome
requests
colorama
configparser
gpsoauth
requests==2.21.0
pyicloud
pandas
numpy
selenium
webdriver-manager
selenium-stealth
ConfigObj
pycryptodome
Binary file added libs/chromedriver.exe
Binary file not shown.
Binary file added libs/chromedriverLinux
Binary file not shown.
Binary file added libs/chromedriverM1
Binary file not shown.
Binary file added libs/chromedriverMac
Binary file not shown.
238 changes: 238 additions & 0 deletions libs/gpsoauth/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
"""A python client library for Google Play Services OAuth."""
from __future__ import annotations

from collections.abc import MutableMapping
from importlib.metadata import version
import ssl
from typing import Any, Iterable

import requests
from urllib3.poolmanager import PoolManager # type: ignore

from . import google

__version__ = version(__package__)

# The key is distirbuted with Google Play Services.
# This one is from version 7.3.29.
B64_KEY_7_3_29 = (
b"AAAAgMom/1a/v0lblO2Ubrt60J2gcuXSljGFQXgcyZWveWLEwo6prwgi3"
b"iJIZdodyhKZQrNWp5nKJ3srRXcUW+F1BD3baEVGcmEgqaLZUNBjm057pK"
b"RI16kB0YppeGx5qIQ5QjKzsR8ETQbKLNWgRY0QRNVz34kMJR3P/LgHax/"
b"6rmf5AAAAAwEAAQ=="
)

ANDROID_KEY_7_3_29 = google.key_from_b64(B64_KEY_7_3_29)

AUTH_URL = "https://android.clients.google.com/auth"
USER_AGENT = "gpsoauth/" + __version__

# Google is very picky about list of used ciphers. Changing this list most likely
# will cause BadAuthentication error.
CIPHERS = [
"ECDHE+AESGCM",
"ECDHE+CHACHA20",
"DHE+AESGCM",
"DHE+CHACHA20",
"ECDH+AES",
"DH+AES",
"RSA+AESGCM",
"RSA+AES",
"!aNULL",
"!eNULL",
"!MD5",
"!DSS",
]


class SSLContext(ssl.SSLContext):
"""SSLContext wrapper."""

def set_alpn_protocols(self, alpn_protocols: Iterable[str]) -> None:
"""
ALPN headers cause Google to return 403 Bad Authentication.
"""


class AuthHTTPAdapter(requests.adapters.HTTPAdapter):
"""HTTPAdapter wrapper."""

def init_poolmanager(self, *args: Any, **kwargs: Any) -> None:
"""
Secure settings from ssl.create_default_context(), but without
ssl.OP_NO_TICKET which causes Google to return 403 Bad
Authentication.
"""
context = SSLContext()
context.set_ciphers(":".join(CIPHERS))
context.options |= ssl.OP_NO_COMPRESSION
context.options |= ssl.OP_NO_SSLv2
context.options |= ssl.OP_NO_SSLv3
context.post_handshake_auth = True
context.verify_mode = ssl.CERT_REQUIRED
self.poolmanager = PoolManager(*args, ssl_context=context, **kwargs)


def _perform_auth_request(
data: dict[str, int | str | bytes], proxies: MutableMapping[str, str] | None = None
) -> dict[str, str]:
session = requests.session()
session.mount(AUTH_URL, AuthHTTPAdapter())
if proxies:
session.proxies = proxies

res = session.post(AUTH_URL, data, headers={"User-Agent": USER_AGENT})
return google.parse_auth_response(res.text)


def perform_master_login(
email: str,
password: str,
android_id: str,
service: str = "ac2dm",
device_country: str = "us",
operator_country: str = "us",
lang: str = "en",
sdk_version: int = 17,
proxy: MutableMapping[str, str] | None = None,
) -> dict[str, str]:
"""
Perform a master login, which is what Android does when you first add
a Google account.
Return a dict, eg::
{
'Auth': '...',
'Email': '[email protected]',
'GooglePlusUpgrade': '1',
'LSID': '...',
'PicasaUser': 'My Name',
'RopRevision': '1',
'RopText': ' ',
'SID': '...',
'Token': 'oauth2rt_1/...',
'firstName': 'My',
'lastName': 'Name',
'services': 'hist,mail,googleme,...'
}
"""

data: dict[str, int | str | bytes] = {
"accountType": "HOSTED_OR_GOOGLE",
"Email": email,
"has_permission": 1,
"add_account": 1,
"EncryptedPasswd": google.construct_signature(
email, password, ANDROID_KEY_7_3_29
),
"service": service,
"source": "android",
"androidId": android_id,
"device_country": device_country,
"operatorCountry": operator_country,
"lang": lang,
"sdk_version": sdk_version,
}

return _perform_auth_request(data, proxy)


def perform_master_login_oauth(
email: str,
oauth_token: str,
android_id: str,
service: str = "ac2dm",
device_country: str = "us",
operator_country: str = "us",
lang: str = "en",
sdk_version: int = 28,
proxy: MutableMapping[str, str] | None = None,
) -> dict[str, str]:
"""
Perform a master login, which is what Android does when you first add
a Google account.
Return a dict, eg::
{
'Auth': '...',
'Email': '[email protected]',
'GooglePlusUpgrade': '1',
'LSID': '...',
'PicasaUser': 'My Name',
'RopRevision': '1',
'RopText': ' ',
'SID': '...',
'Token': 'oauth2rt_1/...',
'firstName': 'My',
'lastName': 'Name',
'services': 'hist,mail,googleme,...'
}
"""

data: dict[str, int | str | bytes] = {
"lang": lang,
"google_play_services_version": 19629032,
"sdk_version": sdk_version,
"device_country": device_country,
"Email": email,
"service": service,
"get_accountid": 1,
"ACCESS_TOKEN": 1,
"callerPkg": "com.google.android.gms",
"add_account": 1,
"Token": oauth_token,
"callerSig": "38918a453d07199354f8b19af05ec6562ced5788",
}

return _perform_auth_request(data, proxy)


def perform_oauth(
email: str,
master_token: str,
android_id: str,
service: str,
app: str,
client_sig: str,
device_country: str = "us",
operator_country: str = "us",
lang: str = "en",
sdk_version: int = 17,
proxy: MutableMapping[str, str] | None = None,
) -> dict[str, str]:
"""
Use a master token from master_login to perform OAuth to a specific Google service.
Return a dict, eg::
{
'Auth': '...',
'LSID': '...',
'SID': '..',
'issueAdvice': 'auto',
'services': 'hist,mail,googleme,...'
}
To authenticate requests to this service, include a header
``Authorization: GoogleLogin auth=res['Auth']``.
"""

data: dict[str, int | str | bytes] = {
"accountType": "HOSTED_OR_GOOGLE",
"Email": email,
"has_permission": 1,
"EncryptedPasswd": master_token,
"service": service,
"source": "android",
"androidId": android_id,
"app": app,
"client_sig": client_sig,
"device_country": device_country,
"operatorCountry": operator_country,
"lang": lang,
"sdk_version": sdk_version,
}

return _perform_auth_request(data, proxy)
Loading

0 comments on commit 4d531b5

Please sign in to comment.