Class: Unisec::CLI::Commands::Bidi::Spoof

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/unisec/cli/bidi.rb

Overview

Command ‘unisec bidi spoof`

Example:

“‘plaintext $ unisec bidi spoof noraj Target string: noraj Spoof payload (display) ⚠: ‮jaron‬Spoof string 🛈: jaron Spoof payload (hex): e280ae6a61726f6ee280ac Spoof payload (hex, escaped): xe2x80xaex6ax61x72x6fx6exe2x80xac Spoof payload (base64): 4oCuamFyb27igKw= Spoof payload (urlencode): %E2%80%AEjaron%E2%80%AC Spoof payload (code points): U+202E U+006A U+0061 U+0072 U+006F U+006E U+202C

⚠: for the spoof payload to display correctly, be sure your VTE has RTL support, e.g. see wiki.archlinux.org/title/Bidirectional_text#Terminal. 🛈: Does not contain the BiDi character (e.g. RtLO).

$ unisec bidi spoof ‘document_annexe.txt’ –prefix ” –suffix ” –infix-bidi $‘U202E’ –infix-pos 12 –light=true document_ann‮txt.exe “‘

Instance Method Summary collapse

Instance Method Details

#call(input: nil, **options) ⇒ Object

Craft a payload for BiDi attacks



51
52
53
54
55
56
57
58
# File 'lib/unisec/cli/bidi.rb', line 51

def call(input: nil, **options)
  to_bool = ->(str) { ['true', true].include?(str) }
  light = to_bool.call(options.fetch(:light))
  infix_pos = options[:infix_pos].to_i unless options[:infix_pos].nil?
  puts Unisec::Bidi::Spoof.new(input, prefix: options[:prefix], suffix: options[:suffix],
                                      infix_bidi: options[:infix_bidi],
                                      infix_pos: infix_pos).display(light: light)
end