Method: Msf::Sessions::Meterpreter#binary_suffix

Defined in:
lib/msf/base/sessions/meterpreter.rb

#binary_suffixObject

Generate a binary suffix based on arch

[View source] [View on GitHub]

657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
# File 'lib/msf/base/sessions/meterpreter.rb', line 657

def binary_suffix
  # generate a file/binary suffix based on the current arch and platform.
  # Platform-agnostic archs go first
  case self.arch
  when 'java'
    ['jar']
  when 'php'
    ['php']
  when 'python'
    ['py']
  else
    # otherwise we fall back to the platform
    case self.platform
    when 'windows'
      ["#{self.arch}.dll"]
    when 'linux' , 'aix' , 'hpux' , 'irix' , 'unix'
      ['bin', 'elf']
    when 'osx'
      ['elf']
    when 'android', 'java'
      ['jar']
    when 'php'
      ['php']
    when 'python'
      ['py']
    else
      nil
    end
  end
end