rails_pwnerer 0.5.14 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +2 -0
- data/lib/pwnage/base/gems.rb +1 -1
- data/lib/pwnage/base/process.rb +37 -22
- data/rails_pwnerer.gemspec +3 -3
- metadata +2 -2
data/CHANGELOG
CHANGED
data/lib/pwnage/base/gems.rb
CHANGED
@@ -20,7 +20,7 @@ module RailsPwnage::Base
|
|
20
20
|
def gem_exists?(gem_name)
|
21
21
|
begin
|
22
22
|
output = `gem specification --local #{gem_name} 2> /dev/null`
|
23
|
-
return output =~
|
23
|
+
return output =~ /^\-\-\- \!ruby\/object\:Gem\:\:Specification/
|
24
24
|
rescue
|
25
25
|
# we get here if gem exits with an error code
|
26
26
|
return false
|
data/lib/pwnage/base/process.rb
CHANGED
@@ -2,37 +2,52 @@
|
|
2
2
|
|
3
3
|
begin
|
4
4
|
require 'sys/proctable'
|
5
|
-
|
6
|
-
|
5
|
+
rescue Exception
|
6
|
+
# the sys-proctable gem isn't available during scaffolding
|
7
|
+
# (or if the compilation breaks for some reason); mock it
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
info = Hash.new
|
11
|
-
Sys::ProcTable.ps.each do |process|
|
12
|
-
item = { :cmdline => process.cmdline, :pid => pid.to_s }
|
9
|
+
module Sys
|
10
|
+
end
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
module Sys::ProcTable
|
13
|
+
class ProcInfo
|
14
|
+
def initialize(pid, cmdline)
|
15
|
+
@pid = pid
|
16
|
+
@cmdline = cmdline
|
19
17
|
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
attr_reader :pid, :cmdline
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.ps
|
22
|
+
retval = []
|
23
|
+
ps_output = `ps ax`
|
24
|
+
ps_output.each_line do |pline|
|
25
|
+
pdata = pline.split(nil, 5)
|
26
|
+
pinfo = ProcInfo.new(pdata[0].strip, pdata[4].strip)
|
27
|
+
retval << pinfo
|
24
28
|
end
|
29
|
+
return retval
|
25
30
|
end
|
26
31
|
end
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
32
|
+
end
|
33
|
+
|
34
|
+
module RailsPwnage::Base
|
35
|
+
# returns information about a process
|
36
|
+
def process_info(pid = nil)
|
37
|
+
info = Hash.new
|
38
|
+
Sys::ProcTable.ps.each do |process|
|
39
|
+
item = { :cmdline => process.cmdline, :pid => process.pid.to_s }
|
40
|
+
|
31
41
|
if pid.nil?
|
32
|
-
|
42
|
+
info[process.pid.to_s] = item
|
33
43
|
else
|
34
|
-
return
|
44
|
+
return item if item.pid.to_s == pid.to_s
|
35
45
|
end
|
36
46
|
end
|
47
|
+
if pid.nil?
|
48
|
+
return info
|
49
|
+
else
|
50
|
+
return nil
|
51
|
+
end
|
37
52
|
end
|
38
53
|
end
|
data/rails_pwnerer.gemspec
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Rails_pwnerer-0.5.
|
2
|
+
# Gem::Specification for Rails_pwnerer-0.5.15
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
--- !ruby/object:Gem::Specification
|
6
6
|
name: rails_pwnerer
|
7
7
|
version: !ruby/object:Gem::Version
|
8
|
-
version: 0.5.
|
8
|
+
version: 0.5.15
|
9
9
|
platform: ruby
|
10
10
|
authors:
|
11
11
|
- Victor Costan
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
|
15
|
-
date: 2008-08-
|
15
|
+
date: 2008-08-24 00:00:00 -04:00
|
16
16
|
default_executable:
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_pwnerer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Costan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-08-
|
12
|
+
date: 2008-08-24 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|