-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain2.py
32 lines (27 loc) · 963 Bytes
/
main2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import requests
from requests.adapters import HTTPAdapter
from urllib3.poolmanager import PoolManager
import ssl
class SslAdapter(HTTPAdapter):
"""Custom SSL Adapter to enforce TLS."""
def init_poolmanager(self, *args, **kwargs):
context = ssl.create_default_context()
kwargs['ssl_context'] = context
return super(SslAdapter, self).init_poolmanager(*args, **kwargs)
proxy = "http://127.0.0.1:8888" # Fiddler or Burp proxy
proxies = {
"http": proxy,
"https": proxy
}
session = requests.Session()
session.mount("https://", SslAdapter())
# Inspect HTTPS Traffic
try:
url = "https://example.com/feed" # Test URL
response = session.get(url, proxies=proxies, verify=False) # Skip verification for the proxy
if "feed" in response.text:
print("Keyword 'feed' detected in response!")
else:
print("No keyword found.")
except requests.exceptions.RequestException as e:
print(f"Error: {e}")