Skip to content

Instantly share code, notes, and snippets.

View jobec's full-sized avatar

Joris Beckers jobec

View GitHub Profile
@jobec
jobec / domain_fronting.py
Last active October 23, 2024 22:46
How to do domain fronting in Python with Requests. Send a request to an arbitrary IP address and force the SNI field and Host HTTP header to a certain value.
#
# How to do domain fronting in Python with Requests.
#
# Send a request to an arbitrary IP address and force the
# SNI field and Host HTTP header to a certain value.
#
import http.client
import requests
import urllib3
--- JUNOS 12.3R4.5 built 2018-04-27 20:41:48 UTC
Welcome to this lab device
{master:0}
user@device-1>
{master:0}
user@device-1>
2018-06-15 10:35:59,512 DEBUG read_channel:
2018-06-15 10:35:59,512 DEBUG read_channel:
2018-06-15 10:35:59,592 DEBUG read_channel:
2018-06-15 10:35:59,614 DEBUG read_channel:
2018-06-15 10:35:59,614 DEBUG read_channel:
2018-06-15 10:35:59,614 DEBUG In disable_paging
2018-06-15 10:35:59,614 DEBUG In disable_paging
2018-06-15 10:35:59,614 DEBUG Command: set cli screen-length 0
2018-06-15 10:35:59,614 DEBUG Command: set cli screen-length 0
@jobec
jobec / junos.py
Last active April 2, 2024 21:10
Junos config parsing with pyparsing
import textwrap
from collections import OrderedDict
import pyparsing as pp
class Statement(str):
def __str__(self):
return super().__str__() + ";"