Interacting with Web Listeners using Python
Post

Interacting with Web Listeners using Python

HTTP Request

The following script will issue an HTTP request:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import requests
from colorama import Fore, Back, Style

proxies = {'http':'http://127.0.0.1:8080','https':'http://127.0.0.1:8080'}

requests.packages.urllib3.\
disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)
def format_text(title,item):
  cr = '\r\n'
  section_break = cr +  "*" * 20 + cr
  item = str(item)
  text = Style.BRIGHT + Fore.RED + title + Fore.RESET + section_break + item + section_break
  return text

r = requests.get('https://manageengine:8443/',verify=False, proxies=proxies)
print(format_text('r.status_code is: ',r.status_code))
print(format_text('r.headers is: ',r.headers))
print(format_text('r.cookies is: ',r.cookies))
print(format_text('r.text is: ',r.text))