Skip to content

Instantly share code, notes, and snippets.

@1umpus
Last active February 18, 2019 04:46
Show Gist options
  • Save 1umpus/aa87b876d32adc32ba22c8d6c72217bd to your computer and use it in GitHub Desktop.
Save 1umpus/aa87b876d32adc32ba22c8d6c72217bd to your computer and use it in GitHub Desktop.
tor hiddenserver simulation via shadow
<shadow stoptime="4000" preload="~/.shadow/lib/libshadow-interpose.so" environment="OPENSSL_ia32cap=~0x200000200000000;EVENT_NOSELECT=1;EVENT_NOPOLL=1;EVENT_NOKQUEUE=1;EVENT_NODEVPOLL=1;EVENT_NOEVPORT=1;EVENT_NOWIN32=1">
<!-- our network. the xml data here could instead be specified in a separate topology.xml file and given here as:
<topology path="/path/to/topology.xml" />
-->
<topology>
<![CDATA[<?xml version="1.0" encoding="utf-8"?><graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key attr.name="packetloss" attr.type="double" for="edge" id="d9" />
<key attr.name="jitter" attr.type="double" for="edge" id="d8" />
<key attr.name="latency" attr.type="double" for="edge" id="d7" />
<key attr.name="type" attr.type="string" for="node" id="d5" />
<key attr.name="bandwidthup" attr.type="int" for="node" id="d4" />
<key attr.name="bandwidthdown" attr.type="int" for="node" id="d3" />
<key attrname="countrycode" attr.type="string" for="node" id="d2" />
<key attr.name="ip" attr.type="string" for="node" id="d1" />
<key attr.name="packetloss" attr.type="double" for="node" id="d0" />
<graph edgedefault="undirected">
<node id="poi-1">
<data key="d0">0.0</data>
<data key="d1">0.0.0.0</data>
<data key="d2">US</data>
<data key="d3">10240</data>
<data key="d4">10240</data>
<data key="d5">net</data>
</node>
<node id="poi-2">
<data key="d0">0.25</data>
<data key="d1">0.0.0.0</data>
<data key="d2">CA</data>
<data key="d3">1024</data>
<data key="d4">512</data>
</node>
<edge source="poi-1" target="poi-1">
<data key="d7">50.0</data>
<data key="d8">10.0</data>
<data key="d9">0.0</data>
</edge>
<edge source="poi-2" target="poi-2">
<data key="d7">50.0</data>
<data key="d8">10.0</data>
<data key="d9">0.0</data>
</edge>
<edge source="poi-1" target="poi-2">
<data key="d7">50.0</data>
<data key="d8">10.0</data>
<data key="d9">0.0</data>
</edge>
</graph>
</graphml>]]>
</topology>
<!-- the plug-ins we will be using -->
<plugin id="tgen" path="~/.shadow/lib/libshadow-plugin-tgen.so" />
<plugin id="tor" path="~/.shadow/lib/libshadow-plugin-tor.so" />
<plugin id="tor-preload" path="~/.shadow/lib/libshadow-preload-tor.so" />
<plugin id="torctl" path="~/.shadow/lib/libshadow-plugin-torctl.so" />
<plugin id="echoplugin" path="/home/user/tormb/build/echo/libshadow-plugin-echo.so" />
<!-- our nodes and the applications they run -->
<host id="hiddenserver" bandwidthdown="102400" bandwidthup="102400" >
<process plugin="tor" preload="tor-preload" starttime="900" arguments="--Address ${NODEID} --Nickname ${NODEID} --DataDirectory shadow.data/hosts/${NODEID} --GeoIPFile ~/.shadow/share/geoip --defaults-torrc conf/tor.common.torrc -f conf/tor.hiddenserver.torrc --BandwidthRate 1024000 --BandwidthBurst 1024000" />
<process plugin="torctl" starttime="901" arguments="localhost 9051 STREAM,CIRC,CIRC_MINOR,ORCONN,BW,STREAM_BW,CIRC_BW,CONN_BW,BUILDTIMEOUT_SET,CLIENTS_SEEN,GUARD,CELL_STATS,TB_EMPTY,HS_DESC,HS_DESC_CONTENT"/>
<process plugin="echoplugin" time="2000" arguments="tcp server" />
</host>
<!-- our Tor network infrastructure -->
<host id="4uthority" bandwidthdown="10240" bandwidthup="10240" iphint="100.0.0.1" >
<process plugin="tor" preload="tor-preload" starttime="1" arguments="--Address ${NODEID} --Nickname ${NODEID} --DataDirectory shadow.data/hosts/${NODEID} --GeoIPFile ~/.shadow/share/geoip --defaults-torrc conf/tor.common.torrc -f conf/tor.authority.torrc --BandwidthRate 1024000 --BandwidthBurst 1024000" />
<process plugin="torctl" starttime="2" arguments="localhost 9051 STREAM,CIRC,CIRC_MINOR,ORCONN,BW,STREAM_BW,CIRC_BW,CONN_BW,BUILDTIMEOUT_SET,CLIENTS_SEEN,GUARD,CELL_STATS,TB_EMPTY,HS_DESC,HS_DESC_CONTENT"/>
</host>
<host id="exit" quantity="2" bandwidthdown="10240" bandwidthup="10240">
<process plugin="tor" preload="tor-preload" starttime="60" arguments="--Address ${NODEID} --Nickname ${NODEID} --DataDirectory shadow.data/hosts/${NODEID} --GeoIPFile ~/.shadow/share/geoip --defaults-torrc conf/tor.common.torrc -f conf/tor.exit.torrc --BandwidthRate 1024000 --BandwidthBurst 1024000" />
<process plugin="torctl" starttime="61" arguments="localhost 9051 STREAM,CIRC,CIRC_MINOR,ORCONN,BW,STREAM_BW,CIRC_BW,CONN_BW,BUILDTIMEOUT_SET,CLIENTS_SEEN,GUARD,CELL_STATS,TB_EMPTY,HS_DESC,HS_DESC_CONTENT"/>
</host>
<host id="relay" quantity="2" bandwidthdown="10240" bandwidthup="10240">
<process plugin="tor" preload="tor-preload" starttime="60" arguments="--Address ${NODEID} --Nickname ${NODEID} --DataDirectory shadow.data/hosts/${NODEID} --GeoIPFile ~/.shadow/share/geoip --defaults-torrc conf/tor.common.torrc -f conf/tor.relay.torrc --BandwidthRate 1024000 --BandwidthBurst 1024000" />
<process plugin="torctl" starttime="61" arguments="localhost 9051 STREAM,CIRC,CIRC_MINOR,ORCONN,BW,STREAM_BW,CIRC_BW,CONN_BW,BUILDTIMEOUT_SET,CLIENTS_SEEN,GUARD,CELL_STATS,TB_EMPTY,HS_DESC,HS_DESC_CONTENT"/>
</host>
<host id="bridge" iphint="100.0.0.1" bandwidthdown="10240" bandwidthup="10240">
<process plugin="tor" preload="tor-preload" starttime="60" arguments="--Address ${NODEID} --Nickname ${NODEID} --DataDirectory shadow.data/hosts/${NODEID} --GeoIPFile ~/.shadow/share/geoip --defaults-torrc conf/tor.common.torrc -f conf/tor.relay.torrc --BandwidthRate 1024000 --BandwidthBurst 1024000 --BridgeRelay 1" />
<process plugin="torctl" starttime="61" arguments="localhost 9051 STREAM,CIRC,CIRC_MINOR,ORCONN,BW,STREAM_BW,CIRC_BW,CONN_BW,BUILDTIMEOUT_SET,CLIENTS_SEEN,GUARD,CELL_STATS,TB_EMPTY,HS_DESC,HS_DESC_CONTENT"/>
</host>
<host id="torclient" >
<process plugin="tor" preload="tor-preload" starttime="900" arguments="--Address ${NODEID} --Nickname ${NODEID} --DataDirectory shadow.data/hosts/${NODEID} --GeoIPFile ~/.shadow/share/geoip --defaults-torrc conf/tor.common.torrc -f conf/tor.client.torrc --BandwidthRate 1024000 --BandwidthBurst 1024000" />
<process plugin="torctl" starttime="901" arguments="localhost 9051 STREAM,CIRC,CIRC_MINOR,ORCONN,BW,STREAM_BW,CIRC_BW,CONN_BW,BUILDTIMEOUT_SET,CLIENTS_SEEN,GUARD,CELL_STATS,TB_EMPTY,HS_DESC,HS_DESC_CONTENT"/>
</host>
<host id="torhiddenclient" >
<process plugin="tor" preload="tor-preload" starttime="900" arguments="--Address ${NODEID} --Nickname ${NODEID} --DataDirectory shadow.data/hosts/${NODEID} --GeoIPFile ~/.shadow/share/geoip --defaults-torrc conf/tor.common.torrc -f conf/tor.client.torrc --BandwidthRate 1024000 --BandwidthBurst 1024000" />
<process plugin="torctl" starttime="901" arguments="localhost 9051 STREAM,CIRC,CIRC_MINOR,ORCONN,BW,STREAM_BW,CIRC_BW,CONN_BW,BUILDTIMEOUT_SET,CLIENTS_SEEN,GUARD,CELL_STATS,TB_EMPTY,HS_DESC,HS_DESC_CONTENT"/>
<process plugin="echoplugin" time="2500" arguments="tcp client hiddenserver" />
</host>
<host id="torbridgeclient" >
<process plugin="tor" preload="tor-preload" starttime="900" arguments="--Address ${NODEID} --Nickname ${NODEID} --DataDirectory shadow.data/hosts/${NODEID} --GeoIPFile ~/.shadow/share/geoip --defaults-torrc conf/tor.common.torrc -f conf/tor.client.torrc --BandwidthRate 1024000 --BandwidthBurst 1024000 --UseBridges 1 --Bridge 100.0.0.1:9111" />
<process plugin="torctl" starttime="901" arguments="localhost 9051 STREAM,CIRC,CIRC_MINOR,ORCONN,BW,STREAM_BW,CIRC_BW,CONN_BW,BUILDTIMEOUT_SET,CLIENTS_SEEN,GUARD,CELL_STATS,TB_EMPTY,HS_DESC,HS_DESC_CONTENT"/>
</host>
</shadow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment