From 9ea2b1f1c17207598e0c73093f9a6bc784a1aaa3 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Mon, 18 Apr 2005 02:41:13 +0000 Subject: [PATCH] demo stuff git-svn-id: file:///home/svn/incoming/trunk@2414 4d416f70-5f16-0410-b530-b9f4589650da --- dev/meterpreter/DemoClient.rb | 19 +++++++++++++++++++ dev/meterpreter/demo1.html | 5 +++++ dev/meterpreter/demo_site.rb | 13 +++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 dev/meterpreter/DemoClient.rb create mode 100644 dev/meterpreter/demo1.html create mode 100755 dev/meterpreter/demo_site.rb diff --git a/dev/meterpreter/DemoClient.rb b/dev/meterpreter/DemoClient.rb new file mode 100644 index 0000000000..1614b34fa8 --- /dev/null +++ b/dev/meterpreter/DemoClient.rb @@ -0,0 +1,19 @@ +#!/usr/bin/ruby -I../../lib + +require 'Rex/Post' + +class DemoClient + + def initialize(host, port) + self.sock = TCPSocket.new(host, port) + self.client = Rex::Post::Meterpreter::Client.new(sock) + + self.client.core.use('Module' => 'Stdapi') + end + + attr_reader :client +protected + attr_accessor :sock + attr_writer :client + +end diff --git a/dev/meterpreter/demo1.html b/dev/meterpreter/demo1.html new file mode 100644 index 0000000000..ae5ba885be --- /dev/null +++ b/dev/meterpreter/demo1.html @@ -0,0 +1,5 @@ + +
+

Metasploit Post-Exploitation Demo

+
+ diff --git a/dev/meterpreter/demo_site.rb b/dev/meterpreter/demo_site.rb new file mode 100755 index 0000000000..329437f0dd --- /dev/null +++ b/dev/meterpreter/demo_site.rb @@ -0,0 +1,13 @@ +#!/usr/bin/ruby -I. -I../../lib + +require 'DemoClient' + +HTML_FILE = "demo1.html" + +host = ARGV[1] || '127.0.0.1' +port = ARGV[2] || '12345' +client = DemoClient.new(host, port).client + +client.fs.file.upload('%TEMP%', HTML_FILE) + +client.sys.process.execute('cmd /C "explorer %TEMP%\demo1.html"')