Permalink
Browse files

Ensure we're attached to a Ruby process for trying to inject the payload

  • Loading branch information...
Ian Leitch
Ian Leitch committed Sep 17, 2009
1 parent fd6c8aa commit 6e65bf689f84f8ab9bb7e1019635ad47835e1ac2
Showing with 2 additions and 3 deletions.
  1. +0 −1 TODO
  2. +2 −2 lib/hijack/gdb.rb
View
1 TODO
@@ -1,6 +1,5 @@
* Use thread local stdout & stderr capture.
* assigning a variable doesn't work
* Improve startup experience
-* Check if attached process is in fact a ruby process
* Require actual remote script if possible so that if it defines any classes we can dump those too.
* Add a hijack_exec helper to execute a local .rb on the target
View
@@ -10,8 +10,7 @@ def initialize(pid)
end
def attached_to_ruby_process?
- # TODO: Implement me
- true
+ exec('bt').any? {|line| line =~ /ruby_run/}
end
def eval(cmd)
@@ -70,6 +69,7 @@ def wait
end
end
puts lines.map { |l| "> #{l}" } if @verbose
+ lines
end
end
end

0 comments on commit 6e65bf6

Please sign in to comment.