[SHEHZADE//ABDULLAH ANSARI]
Red Team Consultant @ Google | MS in Cybersecurity @ NYU
● Notice //GitHub (@shehzade) is temporarily suspended pending an automated false-positive review. All tools are hosted on this Code Mirror and available on request (contact); GitHub links will return once reinstated.
PUBLIC MIRRORGo v1.0
Multi-protocol network egress assessment and DLP verification framework featuring automated L4 sweeps, corporate proxy traversal, and covert protocol smuggling across 20+ channels.
$
git clone https://shehzade.io/repos/contraband.git
Copy
Source ZIP (1.93 MB)
29 lines · 636 B
| 1 | package proxy |
| 2 | |
| 3 | import ( |
| 4 | "bufio" |
| 5 | "io" |
| 6 | "net" |
| 7 | ) |
| 8 | |
| 9 | // bufferedConn wraps net.Conn with a buffered reader using io.MultiReader |
| 10 | // so that any bytes read ahead by bufio.Reader during HTTP header parsing |
| 11 | // are preserved and returned before reading directly from the underlying connection. |
| 12 | type bufferedConn struct { |
| 13 | net.Conn |
| 14 | r io.Reader |
| 15 | } |
| 16 | |
| 17 | func newBufferedConn(c net.Conn, br *bufio.Reader) net.Conn { |
| 18 | if br == nil || br.Buffered() == 0 { |
| 19 | return c |
| 20 | } |
| 21 | return &bufferedConn{ |
| 22 | Conn: c, |
| 23 | r: io.MultiReader(io.LimitReader(br, int64(br.Buffered())), c), |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func (b *bufferedConn) Read(p []byte) (int, error) { |
| 28 | return b.r.Read(p) |
| 29 | } |