Johnermac
  • About me
  • Active Directory
    • PowerShell
      • Customize
      • Notes
      • ETW
      • AMSI Bypass
      • Obfuscation
    • Enumeration
      • Domain
      • GPO
      • ACL
      • Domain Trusts
      • Forest
      • Extra
      • BloodHound
      • BloodHound CE
  • Tunneling
    • Tools
      • Udp2Raw
      • Fraud Bridge
      • Chisel
      • SSF
      • Egress-Assess
      • Ligolo-ng
      • Sshutle
      • Rpivot
      • Tunna
      • reGeorg
      • Neo-reGeorg
      • PivotSuite
  • Post-Exploitation
    • Data Exfiltration
      • HTTP
        • Cancel
        • wget
        • bash
        • busybox
        • IRB
        • PHP
        • Ruby
      • ICMP
        • XXD
        • Ruby
        • Python
      • UDP
        • Netcat
      • TCP
        • Netcat
        • KSH
        • whois
        • Finger
      • HTTPS
        • Python
        • OpenSSL
  • BLOG
    • Articles
      • Pivoting for Red Teaming
Powered by GitBook
On this page
  • Basic Usage
  • How to extract files using Python
  1. Post-Exploitation
  2. Data Exfiltration
  3. HTTPS

Python

Python is a versatile, high-level programming language known for its readability and simplicity

PreviousHTTPSNextOpenSSL

Last updated 2 years ago

Basic Usage

name = "John"
print("Hello, " + name + "!")

How to extract files using Python

import http.server
import ssl

port = 8443

httpd = http.server.HTTPServer(('0.0.0.0', port), http.server.SimpleHTTPRequestHandler)

httpd.socket = ssl.wrap_socket(httpd.socket, 
                               certfile='/opt/cert.pem', 
                               keyfile='/opt/key.pem', 
                               server_side=True)

print(f"Serving on https://0.0.0.0:{port}")
httpd.serve_forever()
Generate a private key with openssl
Execute the script
Download the file with wget
Wireshark Results