librex 0.0.71 → 0.0.999
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/README.markdown +15 -5
- data/examples/smb_example.rb +35 -0
- data/lib/rex/ole/samples/create_ole.rb +0 -0
- data/lib/rex/ole/samples/dir.rb +0 -0
- data/lib/rex/ole/samples/dump_stream.rb +0 -0
- data/lib/rex/ole/samples/ole_info.rb +0 -0
- data/lib/rex/zip/samples/comment.rb +0 -0
- data/lib/rex/zip/samples/mkwar.rb +0 -0
- data/lib/rex/zip/samples/mkzip.rb +0 -0
- data/lib/rex/zip/samples/recursive.rb +0 -0
- data/rex.gemspec +20 -0
- metadata +8 -8
- data/Rakefile +0 -105
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
Yjk1Y2QxMDRkMzNkMDUzNGY2M2MwZWFhYTY5ZmMxYzZiZDQxMmJhNQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MGFlZjhiNmVkMjMwMGI5OGY2ZjQ5NzRlMjc1Y2FmY2IzMGNmMjE5MA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OGM3MmRlN2YzMWFjOTQwYmQ4MjA3M2U3YTA2OTlmZWE1MTZiOTg4ZDI2NmIz
|
10
|
+
MDIzMjBkZWRjNmUyNjFjNjY3NjBmNGYxZmU1MDFiYjZiZDIyOTk3MGVhMzJj
|
11
|
+
NjEwZWQxNTQ2OWNhMmI4Y2UxOGJiMGU1NzVlZTc5MzM1OWIxN2M=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
N2U2YWFmN2FkYmIxYjk0ZGM0NjFiNzMwY2UwNDlkYjUzY2E2ZWI1M2U2ZDUz
|
14
|
+
ODE1NGYyNjIyMjI2YzRlMTY4NTBlMWZjYjdiZDZlOGQyMjY2NDM2ZTFkNTQ4
|
15
|
+
MjYxMTJjMDI2NWQ0MWY4M2RhZWJjMmE1NjFjNjk1MWJjYTc5NWU=
|
data/README.markdown
CHANGED
@@ -2,11 +2,21 @@
|
|
2
2
|
|
3
3
|
An re-packaging of the Rex library included in the Metasploit Framework for use by non-Metasploit applications. Originally created by Jacob Hammack and made official by the Rapid7 development team. The upstream of this package is the rex subdirectory of https://github.com/rapid7/metasploit-framework
|
4
4
|
|
5
|
-
|
5
|
+
Note that prior to version 2.0.0, the 'rex' gem was an unrelated library developed by Aaron Paterson (@tenderlove).
|
6
6
|
|
7
|
+
For users of the prior library (a lexical scanner generator), set your Gemfile to something like the following:
|
8
|
+
```
|
9
|
+
gem 'rex', '< 2.0.0'
|
10
|
+
```
|
11
|
+
|
12
|
+
This package replaces the librex gem.
|
13
|
+
|
14
|
+
```
|
15
|
+
$ gem install rex
|
16
|
+
```
|
7
17
|
|
8
|
-
$ gem install librex
|
9
18
|
# Credits
|
10
|
-
|
11
|
-
|
12
|
-
|
19
|
+
|
20
|
+
* The Metasploit Community
|
21
|
+
* Jacob Hammack <https://github.com/hammackj>
|
22
|
+
* Rapid7 <http://www.rapid7.com/>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#Jacob Hammack
|
4
|
+
#Jacob.Hammack@hammackj.com
|
5
|
+
#An Example for connecting to a Windows Share.
|
6
|
+
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rex'
|
9
|
+
|
10
|
+
host = ARGV[0]
|
11
|
+
username = ARGV[1]
|
12
|
+
password = ARGV[2]
|
13
|
+
#hostname is interesting, new windows require the actual hostname of the box
|
14
|
+
#to connect so this may not work on 7
|
15
|
+
hostname = "*SMBSERVER"
|
16
|
+
domain = ""
|
17
|
+
|
18
|
+
begin
|
19
|
+
sock = Rex::Socket::Tcp.create('PeerHost' => host, 'PeerPort' => 139)
|
20
|
+
smb = Rex::Proto::SMB::SimpleClient.new(sock)
|
21
|
+
|
22
|
+
puts "[*] Logging in to #{host}"
|
23
|
+
smb.login(hostname, username, password, domain)
|
24
|
+
smb.connect("Admin$")
|
25
|
+
|
26
|
+
if smb.client.auth_user
|
27
|
+
puts "[*] Connected to Admin$"
|
28
|
+
else
|
29
|
+
puts "[!] Unable to Connect to Admin$"
|
30
|
+
end
|
31
|
+
|
32
|
+
sock.close
|
33
|
+
rescue Exception => e
|
34
|
+
puts "#{e.message}\n#{e.backtrace}\n\n"
|
35
|
+
end
|
File without changes
|
data/lib/rex/ole/samples/dir.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/rex.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
APP_NAME = "rex"
|
4
|
+
VERSION = "2.0.2"
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = APP_NAME
|
8
|
+
s.version = VERSION
|
9
|
+
s.homepage = "https://github.com/rapid7/rex/"
|
10
|
+
s.summary = "Ruby Exploitation Library"
|
11
|
+
s.description = "Rex provides a variety of classes useful for security testing and exploit development."
|
12
|
+
s.license = "BSD"
|
13
|
+
s.authors = ["HD Moore", "Jacob Hammack"]
|
14
|
+
s.email = ["hd_moore@rapid7.com", "jacob.hammack@hammackj.com"]
|
15
|
+
s.files = Dir['rex.gemspec'] + Dir['examples/**'] + Dir['lib/rex.rb'] + Dir['lib/**/*']
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.extra_rdoc_files = ["README.markdown"]
|
18
|
+
s.platform = "ruby"
|
19
|
+
s.required_ruby_version = ">= 1.9.3"
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.999
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HD Moore
|
@@ -9,10 +9,9 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
15
|
-
development. Updated on 2014-07-15
|
14
|
+
description: This has been replaced by the 'rex' gem (~> 2.0.2)
|
16
15
|
email:
|
17
16
|
- hd_moore@rapid7.com
|
18
17
|
- jacob.hammack@hammackj.com
|
@@ -22,7 +21,7 @@ extra_rdoc_files:
|
|
22
21
|
- README.markdown
|
23
22
|
files:
|
24
23
|
- README.markdown
|
25
|
-
-
|
24
|
+
- examples/smb_example.rb
|
26
25
|
- lib/rex.rb
|
27
26
|
- lib/rex/LICENSE
|
28
27
|
- lib/rex/arch.rb
|
@@ -510,6 +509,7 @@ files:
|
|
510
509
|
- lib/rex/zip/samples/mkwar.rb
|
511
510
|
- lib/rex/zip/samples/mkzip.rb
|
512
511
|
- lib/rex/zip/samples/recursive.rb
|
512
|
+
- rex.gemspec
|
513
513
|
homepage: https://github.com/rapid7/rex/
|
514
514
|
licenses:
|
515
515
|
- BSD
|
@@ -520,12 +520,12 @@ require_paths:
|
|
520
520
|
- lib
|
521
521
|
required_ruby_version: !ruby/object:Gem::Requirement
|
522
522
|
requirements:
|
523
|
-
- -
|
523
|
+
- - ! '>='
|
524
524
|
- !ruby/object:Gem::Version
|
525
525
|
version: 1.9.3
|
526
526
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
527
527
|
requirements:
|
528
|
-
- -
|
528
|
+
- - ! '>='
|
529
529
|
- !ruby/object:Gem::Version
|
530
530
|
version: '0'
|
531
531
|
requirements: []
|
@@ -533,6 +533,6 @@ rubyforge_project:
|
|
533
533
|
rubygems_version: 2.2.2
|
534
534
|
signing_key:
|
535
535
|
specification_version: 4
|
536
|
-
summary: Ruby Exploitation Library
|
536
|
+
summary: Ruby Exploitation Library (deprecated gem)
|
537
537
|
test_files: []
|
538
538
|
has_rdoc:
|
data/Rakefile
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'fileutils'
|
4
|
-
|
5
|
-
task :build => :update do
|
6
|
-
Rake::Task['clean'].execute
|
7
|
-
puts "[*] Building librex.gemspec"
|
8
|
-
system "gem build librex.gemspec &> /dev/null"
|
9
|
-
end
|
10
|
-
|
11
|
-
task :release => :build do
|
12
|
-
puts "[*] Pushing librex to rubygems.org"
|
13
|
-
system "gem push librex-*.gem &> /dev/null"
|
14
|
-
Rake::Task['clean'].execute
|
15
|
-
end
|
16
|
-
|
17
|
-
task :clean do
|
18
|
-
system "rm *.gem &> /dev/null"
|
19
|
-
end
|
20
|
-
|
21
|
-
task :update do
|
22
|
-
puts "[*] Removing old Rex code..."
|
23
|
-
system "git rm -rf lib/ >/dev/null 2>&1"
|
24
|
-
::FileUtils.rm_rf("lib")
|
25
|
-
::FileUtils.mkdir("lib")
|
26
|
-
|
27
|
-
|
28
|
-
tdir = "src" + rand(0x100000000).to_s + rand(0x100000000).to_s
|
29
|
-
tdir2 = "dst" + rand(0x100000000).to_s + rand(0x100000000).to_s
|
30
|
-
|
31
|
-
begin
|
32
|
-
|
33
|
-
puts "[*] Checking out Metasploit trunk..."
|
34
|
-
results = `git clone git://github.com/rapid7/metasploit-framework.git #{tdir2}; mkdir -p #{tdir}/lib; cp #{tdir2}/lib/rex.rb #{tdir}/lib/rex.rb; mv #{tdir2}/lib/rex #{tdir}/lib/rex`
|
35
|
-
|
36
|
-
|
37
|
-
puts "[*] Copying new files..."
|
38
|
-
::FileUtils.cp( ::File.join(tdir, "lib", "rex.rb"), "lib")
|
39
|
-
::FileUtils.cp_r( ::File.join(tdir, "lib", "rex"), ::File.join("lib", "rex") )
|
40
|
-
|
41
|
-
|
42
|
-
system "git add lib/ --force"
|
43
|
-
|
44
|
-
puts "[*] Cleaning up tmp files..."
|
45
|
-
::FileUtils.rm_rf(tdir)
|
46
|
-
::FileUtils.rm_rf(tdir2)
|
47
|
-
|
48
|
-
version = ""
|
49
|
-
|
50
|
-
print "[*] Updating librex.gemspec"
|
51
|
-
File.open("librex.gemspec.1", "w+") do |output|
|
52
|
-
File.open("librex.gemspec", "r") do |input|
|
53
|
-
while (line = input.gets)
|
54
|
-
|
55
|
-
if line =~ /^VERSION = (.*)$/
|
56
|
-
version = $1.chop.gsub("\"",'').split(".")
|
57
|
-
version[2] = version[2].to_i + 1
|
58
|
-
version = version.join(".")
|
59
|
-
|
60
|
-
print "#{version}\n"
|
61
|
-
|
62
|
-
line = "VERSION = \"#{version}\"\n"
|
63
|
-
elsif line =~ /^REVISION = (.*)$/
|
64
|
-
line = "REVISION = \"#{Time.now.strftime("%Y%m%d%H%M%S")}\"\n"
|
65
|
-
else
|
66
|
-
line = line
|
67
|
-
end
|
68
|
-
|
69
|
-
output.write line
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
system "mv librex.gemspec.1 librex.gemspec"
|
75
|
-
|
76
|
-
puts "[*] Updating README.markdown with new updated date"
|
77
|
-
File.open("README.markdown.1", "w+") do |output|
|
78
|
-
File.open("README.markdown", "r") do |input|
|
79
|
-
while (line = input.gets)
|
80
|
-
if line =~ /^BUILD_DATE=(.*)$/
|
81
|
-
line = "BUILD_DATE='#{Time.now.strftime("%Y-%m-%d")}'\n"
|
82
|
-
else
|
83
|
-
line = line
|
84
|
-
end
|
85
|
-
|
86
|
-
output.write line
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
system "mv README.markdown.1 README.markdown &> /dev/null"
|
92
|
-
|
93
|
-
system "git commit -a -m \"Updated at #{Time.now.strftime("%Y-%m-%d")}\" &> /dev/null"
|
94
|
-
puts "[*] Commiting and pushing updates"
|
95
|
-
system "git push origin master"
|
96
|
-
|
97
|
-
rescue ::Exception
|
98
|
-
$stderr.puts "[-] Error: #{$!.class} #{$!} #{$!.backtrace}"
|
99
|
-
ensure
|
100
|
-
::FileUtils.rm_rf(tdir)
|
101
|
-
end
|
102
|
-
|
103
|
-
# Twitter tweet for the update, I am that lazy yes
|
104
|
-
puts "[*] Updated librex to v#{version} based on the latest Metasploit rex library. Available in rubygems."
|
105
|
-
end
|