All Projects → Washi1337 → SpyGlass

Washi1337 / SpyGlass

Licence: MIT license
Remote process hooking library for .NET

Programming Languages

C#
18002 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to SpyGlass

es-cec-input
TV CEC remote control support for Emulation Station (ES in RetroPie)
Stars: ✭ 47 (-4.08%)
Mutual labels:  remote
ATtiny13-TinyRemoteXL
12-Button IR Remote Control
Stars: ✭ 33 (-32.65%)
Mutual labels:  remote
awesome-alicante-remote-work
Alicante awesome places to work remotely
Stars: ✭ 20 (-59.18%)
Mutual labels:  remote
remote-origin-url
Extract the git remote origin URL from your local git repository.
Stars: ✭ 15 (-69.39%)
Mutual labels:  remote
taiwan-remote-jobs
台灣採用部份遠端工作、完全遠端工作的科技業相關公司清單。
Stars: ✭ 34 (-30.61%)
Mutual labels:  remote
OSCE
Some exploits, which I’ve created during my OSCE preparation.
Stars: ✭ 74 (+51.02%)
Mutual labels:  remote
lemverse
The first-ever coworking metaverse
Stars: ✭ 91 (+85.71%)
Mutual labels:  remote
pace
Remote Access Tool for Windows.
Stars: ✭ 68 (+38.78%)
Mutual labels:  remote
terraform-remote-state
A Terraform module that configures an s3 bucket for use with Terraform's remote state feature
Stars: ✭ 21 (-57.14%)
Mutual labels:  remote
BOSCH-GLM-rangefinder
Python script to remote control a BOSCH GLM 100C rangefinder via its Bluetooth serial interface
Stars: ✭ 41 (-16.33%)
Mutual labels:  remote
portera
Remote logs
Stars: ✭ 22 (-55.1%)
Mutual labels:  remote
xboxpy
Python module to interface with original Xbox hard- and software
Stars: ✭ 23 (-53.06%)
Mutual labels:  remote
installer
remote.it command line installer tool
Stars: ✭ 21 (-57.14%)
Mutual labels:  remote
android-sdk
AppSpector is a debugging service for mobile apps
Stars: ✭ 39 (-20.41%)
Mutual labels:  remote
wormhole
A minimalistic Ansible-like tool for configuring remote servers via ssh
Stars: ✭ 22 (-55.1%)
Mutual labels:  remote
Backdoor
A backdoor that runs on Linux and Windows
Stars: ✭ 36 (-26.53%)
Mutual labels:  remote
Polygonization-by-Frame-Field-Learning
This repository contains the code for our fast polygonal building extraction from overhead images pipeline.
Stars: ✭ 161 (+228.57%)
Mutual labels:  remote
remotebear
Source code of Remotebear.
Stars: ✭ 55 (+12.24%)
Mutual labels:  remote
WinRAT
(Windows/Linux/Mac) Remote Administration Tool
Stars: ✭ 35 (-28.57%)
Mutual labels:  remote
configuration-service
Configuration Service is a distributed configuration provider for .NET Core.
Stars: ✭ 62 (+26.53%)
Mutual labels:  remote

SpyGlass

SpyGlass is a hooking library that allows for hooking inside remote processes. The API is an event driven framework, allowing .NET developers easily inspect and alter the behaviour of the target process without having to write lots of code.

Features

  • Hook anywhere in any process, even if the process is running on a different (virtual) machine.
    • Useful if the target application is malware and needs to be isolated from anything else.
  • View and edit register values in the callback.
  • View and edit memory in the callback.
  • Various convenience methods, such as:
    • Getting the address of a procedure in a remote process.

Showcase

Inspecting the arguments of a MessageBoxA call

Left: Master, Right: Slave

The image above showcases a simple hooking application (on the right) that monitors a remote process running inside a virtual machine (on the left) that calls MessageBoxA at some point. We can use SpyGlass to hook this function remotely, and inspect the arguments.

  • Check out the source code.
  • To reproduce, run the following command in the VM:
    SpyGlass.Bootstrapper.x86.exe SpyGlass.Injection.x86.dll MessageBoxTest.exe
    
    And on the master machine, run:
    MessageBoxHook.exe <ip-address> 12345
    

Changing stack values on the fly

Left: Master, Right: Slave

In this case, the function DummyMethod in the slave process takes three arguments, and simply adds them together. This function is originally called with three arguments: 0x1337, 0x1338 and 0x1339. However, the master process hooked this function, and modified the first parameter from 0x1337 to 0x1234 in the callback.

  • Check out the source code.
  • To reproduce, run the following command in the VM:
    SpyGlass.Bootstrapper.x86.exe SpyGlass.Injection.x86.dll SpyGlass.DummyTarget.exe
    
    And on the master machine, run:
    SpyGlass.Sample.x86.exe <ip-address> 12345
    

FAQ

How do I write my own hooks?

To write your own master process and/or bootstrapper, see the quick starters guide.

How does it work?

Here's a quick summary of how the library works internally:

How does the remoting part work?

  1. Target (slave) process is injected with a dynamically loaded library (dll).
  2. Library spawns a new thread.
  3. Thread opens a TCP connection with the master process and starts listening for commands.

How does the hooking process work?

  1. At the target address, we disassemble the instructions up to the point we have read at least 5 bytes of assembly code.
  2. Construct a trampoline that ...
    • ... makes sure all registers (including the stack and program counters) are put in a safe spot.
    • ... calls the callback in a __stdcall fashion.
    • ... executes the disassembled instructions in step 1.
    • ... jumps back to the instruction after the place of the hook.
  3. Insert a call to the trampoline at the position of the hook.
  4. Report to the master process on events.

For details go here.

Oh no I broke the library! What do I do now?

First thing you have to remember is that I don't write bugs, only interesting new features. Make sure you are not just misusing a feature. With great power comes great responsibility!

If you still believe you have found a bug, please go to the issue tracker.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].