Giter Club home page Giter Club logo

mirage-mimic's Introduction

mimic

This unikernel mimics a host in another network by acquiring a local IP address, opening the same ports and then forwarding all traffic to the remote host through a SOCKS server.

Build

mirage configure --xen
make

Edit unikernel.xl to enable networking.

Set up SOCKS

To set up a SOCKS server with SSH:

ssh -D interface:port username@remote_host

Replace interface:port with where you want SSH to listen for SOCKS connections. Note that if you set the SOCKS server to listen to localhost in dom0 it will be unavailable to the unikernel.

Start mimic

Options are set as key=value pairs in the "extra" configuration parameter in Xen. The following options are available:

ip=[ip of unikernel on local network]
netmask=[unikernel netmask]
gw=[unikernel gateway]
socks_ip=[ip of socks server relative to unikernel]
socks_port=[port of socks server relative to unikernel]
dest_ip=[ip of remote host relative to other end of ssh tunnel]
dest_ports=[commma separated list of ports to forward/open]

The dest_ip and dest_ports parameters refer to a host and list of ports relative to the other end of the SSH tunnel. So if the unikernel should mimic a service running on the same host as you are connect to with SSH you can set dest_ip=127.0.0.1. Otherwise specify an IP on the remote network.

Example

The following example starts a unikernel that mimics a Squid proxy server in a remote network:

xl create unikernel.xl -c 'extra="socks_ip=192.168.56.1 socks_port=8888 dest_ip=127.0.0.1 dest_ports=3128,3127 ip=192.168.56.10 netmask=255.255.255.0 gw=192.168.56.1"'

The local SOCKS server in this example runs on 192.168.56.1:8888 (e.g. in dom0). The unikernel is assigned the IP 192.168.56.10 on the local network. Destination ports are 3128 and 3127, which are Squid web proxy ports. Data received by the unikernel on these ports is sent directly through the SOCKS server to IP specified by dest_ip. The IP in dest_ip is relative to the remote endpoint, so in this case Squid is running on localhost on the machine we have an SSH tunnel to.

mirage-mimic's People

Contributors

heidihoward avatar magnuss avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.