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
alhazred
committed
Dec 27, 2011
1 parent
22fe88e
commit 701f209
Showing
9 changed files
with
120 additions
and
15 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,13 @@ | ||
require 'msf/scripts/meta_ssh/common' | ||
require 'msf/scripts/meta_ssh/file' | ||
require 'msf/scripts/meta_ssh/accounts' | ||
|
||
module Msf | ||
module Scripts | ||
module MetaSSH | ||
|
||
|
||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'msf/core/post/linux/system' | ||
require 'msf/core/post/linux/priv' | ||
|
||
module Msf | ||
module Scripts | ||
module MetaSSH | ||
module Common | ||
|
||
include ::Msf::Post::Linux::System | ||
include ::Msf::Post::Linux::Priv | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
module Msf | ||
module Scripts | ||
module MetaSSH | ||
module Common | ||
|
||
def cmd_exec(cmd,opts=nil,timeout=15) | ||
::Timeout::timeout(timeout) { | ||
return session.sys.execute(cmd,opts) | ||
} | ||
end | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require 'msf/core/post/file' | ||
|
||
module Msf | ||
module Scripts | ||
module MetaSSH | ||
module Common | ||
|
||
include ::Msf::Post::File | ||
|
||
def write_file(file_name, data) | ||
fd = session.fs.file.new(file_name, "wb") | ||
fd.write(data) | ||
fd.close | ||
return true | ||
end | ||
|
||
def append_file(file_name, data) | ||
fd = session.fs.file.new(file_name, "wab") | ||
fd.write(data) | ||
fd.close | ||
return true | ||
end | ||
|
||
def read_file(file_name) | ||
fd = session.fs.file.new(file_name, "rb") | ||
data = '' | ||
begin | ||
until fd.eof? | ||
data << fd.read | ||
end | ||
ensure | ||
fd.close | ||
end | ||
data | ||
end | ||
|
||
|
||
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 |
---|---|---|
|
@@ -42,6 +42,8 @@ def exec(cmd,args=[]) | |
return out | ||
end | ||
|
||
alias :execute :exec | ||
|
||
protected | ||
|
||
attr_accessor :client # :nodoc: | ||
|
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,15 @@ | ||
|
||
module Rex | ||
module Script | ||
class MetaSSH < Base | ||
|
||
begin | ||
require 'msf/scripts/meta_ssh' | ||
include Msf::Scripts::MetaSSH::Common | ||
rescue ::LoadError | ||
end | ||
|
||
end | ||
end | ||
end | ||
|