Infrastructure Installation and Configuration Guide: (U) Hive
Infrastructure Installation and Configuration Guide: (U) Hive
(U) Hive
Infrastructure Installation
and
Configuration Guide
SECRET//NOFORN
SECRET//NOFORN
Hive Infrastructure Configuration Guide
1 (U) Overview...........................................................................................................................................1
2 (S//NF) Cover Server...............................................................................................................................2
2.1 (U//FOUO) Install and Configure Apache web server.....................................................................2
2.2 (U) Secure Apache Web Server........................................................................................................2
3 (S//NF) Honeycomb Tool Handler..........................................................................................................3
4 (S//NF) Blot Proxy...................................................................................................................................4
4.1 (U) Network Interfaces.....................................................................................................................4
4.2 (S//NF) Blot Proxy............................................................................................................................4
4.2.1 (U) Software Installation............................................................................................................4
4.2.2 (U) Configuration.......................................................................................................................4
4.3 (S//NF) OpenVPN.............................................................................................................................6
4.3.1 (U) Software Installation............................................................................................................6
4.3.2 (S//NF) Key Generation.............................................................................................................7
4.3.3 (S//NF) Blot-Side Configuration................................................................................................7
5 (S//NF) VPS Redirector...........................................................................................................................9
5.1 (S/NF) IPv6 Security.........................................................................................................................9
5.2 (S//NF) Install and Configure Redirection Script.............................................................................9
5.3 (S//NF) OpenVPN Configuration...................................................................................................10
5.4 (S//NF) Add Redirection and Logging (Optional)..........................................................................10
5.5 (U) Configure Routing....................................................................................................................10
6 (U) Test and Troubleshooting................................................................................................................11
6.1 Unresponsive Cover Server............................................................................................................11
6.2 Lost Beacons...................................................................................................................................11
1 (U) Overview
(S//NF) Pictured below is an example of the Hive operating environment.
(S//NF) Beacons from an implanted host enter a commercial VPS server that has been configured as a
redirector for the given domain (domainA.com or domainB.com). Traffic for these domains is redirected
into a VPN tunnel to a Blot proxy. Each VPS redirector modifies the destination port number to one that
corresponds to the domain that it is servicing. So, for example, beacons and other web traffic entering
the VPS redirector servicing domain A would have port 80 traffic changed to port 8001 before being sent
on to the Blot proxy. The Blot proxy looks at the redirected traffic and, if it finds a valid beacon,
forwards it to the tool handler (Honeycomb in this case); all other traffic is forwarded to the cover
server. The cover server uses the destination port number to determine what web pages it will display,
domain A or domain B.
(S//NF) Each section below covers the installation and configuration of the key components making up
this infrastructure, starting with the cover server and working out to the VPS redirectors. All servers are
assumed to be running a CentOS distribution of Linux.
Listen 172.16.64.10:8001
<VirtualHost 172.16.64.10:8001>
DocumentRoot /var/www/html/vhosts/vhost1/docroot
ServerName vhost1.edb.devlan.net
ServerAlias 10.6.5.191
ErrorLog /var/log/www/vhosts/vhost1/error.log
TransferLog /var/log/www/vhosts/vhost1/access.log
<Directory /var/www/html/vhosts/vhost1/docroot>
Options Indexes FollowSymLinks Multiviews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Virtual host address – the real (internal address) used for internal routing
ServerAlias – is the address that is seen in the public address space
• /etc/httpd/vhosts.d/vhost2.conf
•
<th name="honeycomb">
<ip>10.2.4.119</ip>
<port>4098</port>
</th>
<log>
<path>/var/log/blot</path>
<encryption>
<session-algorithm>NONE</session-algorithm>
<entry-algorithm>NONE</entry-algorithm>
<key>xV8JjUEooa0H9RxdSki8CcYcIywFbU3C3BHyx0rnCwaVs8H8/hnSjlwseloF+eHJUfZJ9Wrqieebi9Br/
pIpNAXq39MrreH1RJ4onxn+2d1VOtF8TZrWHhUg8A0jEEucCIi4zqEqoLLX0uKPjAYQFcimsJsYfHd2klt4R3i
pdQJ70Kv72j7WILT2fcynwEqbBGT5iqhWhSAOq+BIKqQRMNuN9D1Es8eQmPBjh0qzjMPSDH9xRkS3EDszNVbn9
h40mYPiWj9gtRbnbJE8ED85Gb5uFWkVbD6Lh6hdgJam+r8F3lLqsQBBbcilQdnDWfQkCyNOmllRTBv+45uoKrN
4kQ==</key>
</encryption>
</log>
</beastbox>
(S//NF) NOTE: Beastbox is very sensitive to the configuration file. A syntax error, the use of the wrong
version number and other such anomalies will cause the Beastbox proxy to die silently without any
output to the console or log file. Here are key items to note.
yum install openvpn
(S//NF) Setup OpenVPN so that it will start after booting by using chkconfig.
chkconfig --add openvpn
$ . ./vars
$ ./clean-all
$ ./build-ca
$ ./build-key-server server
$ ./build-key client1
$ ./build-key client2
.
.
$ ./build-dh
(S//NF) Distribute the keys to the /etc/openvpn directory on the appropriate hosts.
(S//NF) Use ip6tables-save to save these into /etc/sysconfig/ip6tables and then review the settings in the
ip6tables-config file.
(S//NF) Copy the redirection configuration file, redirect.conf to the /etc/openvpn directory and edit it to
conform to the desired configuration. It looks similar to this:
outside_interface=eth0
inside_interface=eth1
tunnel_interface=tun0
PUBLIC_IP=10.6.5.191 # Public-facing IP
PRIVATE_IP=10.177.77.1 # IP of next hop
(S//NF) Use chkconfig to set redirection to start and stop on system startup and shutdown.
chkconfig add redirection
(S//NF) Set the system configuration to perform IP forwarding by editing /etc/sysctl.conf as follows.
net.ipv4.ip_forward = 1
(S//NF) To start redirection after first installing the script use:
service redirection start
(S//NF) To stop redirection, but maintain the tunnel and administrative access through ssh, use:
service redirection stop
service redirection status
kern.warn /var/log/iptables
(S//NF) To control the size and number of these log files, add a logrotate configuration for iptables under
/etc/logrotate.d with the following contents:
/var/log/iptables {
missingok
notifempty
size 5M
compress
rotate 5
create 0600 root root
}
example:
ip route add 172.16.63.101 via 172.16.60.1
• (S//NF) Use ifconfig on the VPS redirector and the Blot proxy to verify that a tunnel interface
(e.g. tun0) is present. If not, then openvpn is not operational. Recheck the configuration and
restart openvpn using the command: service openvpn restart. Look for problems in
the openvpn log file /var/log/openvpn.log.
• (S//NF) On the VPS redirector, verify that the iptables redirection script was executed by issuing
the command:
service redirection status
or
watch service redirection status
(S//NF) This will display the current firewall rules. By reissuing this command and comparing
the packet/byte counts displayed (or using the watch command to see it updated continually), it is
possible to get an idea of the packet flows when a web page is requested. The PREROUTING
chain in the nat table should increase for each web page requested, along with the related rules in
the FORWARD chain of the filter table.
• (S//NF) If there seems to be problems in establishing the tunnel between the VPS redirector and
the Blot proxy, verify the communications between them. Check the routing. While the default
route will likely be to the public-facing gateway, there must also be a route to get to the Blot
proxy.