Skip to content

Instantly share code, notes, and snippets.

@0xallie
Last active January 7, 2023 18:40
Show Gist options
  • Save 0xallie/8b70a5aeda804777f8e7e6f3badd3726 to your computer and use it in GitHub Desktop.
Save 0xallie/8b70a5aeda804777f8e7e6f3badd3726 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import random
import uuid
from datetime import date, datetime
import requests
from faker import Faker
faker = Faker()
session = requests.Session()
firefox_version = random.randint(50, 90)
firefox_date = faker.date_between_dates(date_start=date(2008, 1, 1), date_end=datetime.now()).strftime("%Y%m%d")
r = session.post(
url="https://www.microsoft.com/en-US/api/controls/contentinclude/html",
params={
"pageId": "6e2a1789-ef16-4f27-a296-74ef7ef5d96b",
"host": "www.microsoft.com",
"segments": "software-download,windows11",
"query": "",
"action": "getskuinformationbyproductedition",
"sessionId": str(uuid.uuid4()).upper(),
"productEditionId": "0",
"sdVersion": "2",
},
headers={
"Referer": "https://www.microsoft.com/software-download/windows11",
"User-Agent": f"Mozilla/5.0 (X11; Linux i586; rv:{firefox_version}.0) Gecko/{firefox_date} Firefox/{firefox_version}.0",
},
)
print(r, r.url)
print(r.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment