Skip to content

Instantly share code, notes, and snippets.

@sundowndev
Created September 15, 2022 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sundowndev/1ccaeb168ebf5149081e0778968ece4e to your computer and use it in GitHub Desktop.
Save sundowndev/1ccaeb168ebf5149081e0778968ece4e to your computer and use it in GitHub Desktop.
POC for Orange Phone API
import requests
import datetime as dt
# OPSEC Warning: change simId and appInstallId
# This script run well over Tor or VPN (but you may encounter rate limitation)
class OrangePhoneAPI:
def __init__(self) -> None:
self.simId = "12345678912345678912"
self.appInstallId = "f8de172f-1315-43ab-a733-7b186879c5de"
self.session = requests.Session()
self.url = "https://prod.odial.net/api"
def query(self, numbers):
payload = {
"cmd": "getSpamStatus",
"numbers": numbers,
"timestamp": int(dt.datetime.now().timestamp() * 100),
"token": "Zet4dSze%T!z",
"simId": self.simId,
"simMccMnc": "20801",
"networkMccMnc": "20801",
"appInstallId": self.appInstallId,
"appName": "dialler",
"appVersion": "4.4.7.4471",
"osNameVersion": "android 12"
}
req = self.session.post(self.url, json=payload, timeout=30)
req.raise_for_status()
data = req.json()
if data['status'] != "OK":
raise Exception(data['message'])
return data['result']
api = OrangePhoneAPI()
print(api.query(["+33674262591"]))
# {"status":"OK","result":{"+33674262591":{"isSpam":true,"positive":47,"negative":1,"positive33700":0,"positiveTopappelant":0,"positiveStopsecret":0,"mainSpamType":"TELEMARKETING","spamTypesRepartition":[{"category":"TELEMARKETING","ratio":1}],"infosva":{}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment