• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..29-Jan-2021-

ecb/H29-Jan-2021-6050

fte/H29-Jan-2021-1,141805

mar/H29-Jan-2021-2,0311,586

plugins/H29-Jan-2021-1,7531,413

regex2dfa/H29-Jan-2021-256192

third_party/H03-May-2022-170,648128,170

BrowserDemo.mdH A D29-Jan-20212.5 KiB8454

DockerfileH A D29-Jan-20211.3 KiB3527

Gopkg.lockH A D29-Jan-20211.6 KiB7059

Gopkg.tomlH A D29-Jan-2021145 86

LICENSEH A D29-Jan-202111.1 KiB203169

README.mdH A D29-Jan-20213.4 KiB162105

StandaloneBinary.mdH A D29-Jan-20212.8 KiB7553

build_third_party.shH A D29-Jan-20211.1 KiB2616

cell.goH A D29-Jan-20214.3 KiB168118

client_proxy.goH A D29-Jan-20211.9 KiB8966

conn.goH A D29-Jan-20214.9 KiB208145

dialer.goH A D29-Jan-20212.6 KiB11585

fsm.goH A D29-Jan-202113.6 KiB506326

listener.goH A D29-Jan-20215 KiB210155

marionette.goH A D29-Jan-20211.8 KiB7651

server_proxy.goH A D29-Jan-20211.9 KiB9367

stream.goH A D29-Jan-202112.6 KiB489326

stream_set.goH A D29-Jan-20216.7 KiB286201

README.md

1marionette
2==========
3
4This is a Go port of the [marionette][] programmable networy proxy.
5
6## WebBrowser Demonstration
7
8Please install Marionette as described below, and then go to the web browser
9demonstration page [here](./BrowserDemo.md)
10
11
12## Development
13
14Marionette requires several dependencies to be installed first. Two of them
15are in the `third_party` directory and the third one can be downloaded from
16the web.
17
18You can use the `./build_third_party.sh` script in the root of this repository
19to build the third party libraries or follow the instructions below to manually
20build them or install them system wide.
21
22### Installing on CentOS
23
24Ensure you have a C/C++ compiler installed:
25
26```sh
27$ yum group install -y "Development Tools"
28```
29
30### Installing OpenFST
31
32You must use the included `third_party/openfst` implementation. Also note that
33static builds must be enabled via the `--enable-static` flag.
34
35```sh
36$ cd third_party/openfst
37$ ./configure --enable-static=yes
38$ make
39$ sudo make install
40```
41
42
43### Installing re2
44
45You must use the included `third_party/re2` implementation:
46
47```sh
48$ cd third_party/re2
49$ make
50$ sudo make install
51```
52
53
54### GMP
55
56Download the latest version of [GMP][], unpack the
57archive and run:
58
59```sh
60$ wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
61$ tar -xvjf gmp-6.1.2.tar.bz2
62$ cd gmp-6.1.2
63
64$ ./configure --enable-cxx
65$ make
66$ sudo make install
67$ make check
68```
69
70
71
72### Building the Marionette Binary
73
74First, make sure you have installed Go from [https://golang.org/][go]. Next,
75install `dep` using [these instructions][dep].
76
77Finally, retrieve the source, update project dependencies, and install the
78`marionette` binary:
79
80```sh
81$ go get github.com/redjack/marionette
82$ cd $GOPATH/src/github.com/redjack/marionette
83$ dep ensure
84$ go install ./cmd/marionette
85```
86
87The `marionette` binary is now installed in your `$GOPATH/bin` folder.
88
89
90[marionette]: https://github.com/marionette-tg/marionette
91[GMP]: https://gmplib.org
92[go]: https://golang.org/
93[dep]: https://github.com/golang/dep#installation
94
95
96## Installing new build-in formats
97
98When adding new formats, you'll need to first install `go-bindata`:
99
100```sh
101$ go get -u github.com/jteeuwen/go-bindata/...
102```
103
104Then you can use `go generate` to convert the asset files to Go files:
105
106```sh
107$ go generate ./...
108```
109
110To install the original [marionette][] library for comparing tests, download
111the latest version, unpack the archive and run:
112
113
114## Testing
115
116Use the built-in go testing command to run the unit tests:
117
118```sh
119$ go test ./...
120```
121
122If you have the original Python marionette installed then you can run tests
123of the ports using the `python` tag:
124
125```sh
126$ go test -tags python ./regex2dfa
127$ go test -tags python ./fte
128```
129
130
131## Demo
132
133### HTTP-over-FTP
134
135In this example, we'll mask our HTTP traffic as FTP packets.
136
137First, follow the installation instructions above on your client & server machines.
138
139Start the server proxy on your server machine and forward traffic to a server
140such as `google.com`.
141
142```sh
143$ marionette server -format ftp_simple_blocking -proxy google.com:80
144listening on [::]:2121, proxying to google.com:80
145```
146
147Start the client proxy on your client machine and connect to your server proxy.
148Replace `$SERVER_IP` with the IP address of your server.
149
150```sh
151$ marionette client -format ftp_simple_blocking -server $SERVER_IP
152listening on 127.0.0.1:8079, connected to <SERVER_IP>
153```
154
155Finally, send a `curl` to `127.0.0.1:8079` and you should see a response from
156`google.com`:
157
158```sh
159$ curl 127.0.0.1:8079
160```
161
162