<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HackDevDotCom &#187; Server</title>
	<atom:link href="http://hackdev.com/category/roll-your-own/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackdev.com</link>
	<description>Hacked Development</description>
	<lastBuildDate>Wed, 25 Jan 2012 23:58:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>New theme for a new server!</title>
		<link>http://hackdev.com/2010/10/new-theme-for-a-new-server/</link>
		<comments>http://hackdev.com/2010/10/new-theme-for-a-new-server/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 22:28:41 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Roll your own:]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=219</guid>
		<description><![CDATA[Howdy Folks, I have been working hard here in the background getting rid of all of my hosting accounts and consolidating everything into one (relatively) easy to manage VPS or Virtual Private Server which I got for cheap from the &#8230; <a href="http://hackdev.com/2010/10/new-theme-for-a-new-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Howdy Folks,</p>
<p>I have been working hard here in the background getting rid of all of my hosting accounts and consolidating everything into one (relatively) easy to manage VPS or Virtual Private Server which I got for cheap from the guys (and presumably girls) at <a title="ThrustVPS.com" href="https://clients.thrustvps.com/aff.php?aff=152">ThrustVPS</a> who seem to be running  tight ship, I don&#8217;t have any stats on uptime or that so far; but everything has gone smoothly. And when they say instant setup, they mean it.</p>
<p>Thats enough of plugging someone else&#8217;s company for now&#8230; not that I have my own to run&#8230; yet. I have managed so far to implement a custom firewall that suits my needs quite nicely, my own email system, the general webserver / mySQL server etc&#8230; and all seems to be running very smoothly for such a cheap box, I do intend however to document all of the install processes I have gone through to get this far, and if your really nice, I might even share my custom backup script with y&#8217;all.</p>
<p>Anyways, I just said I would pop on and give a quick update before I get to bed for work.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2010/10/new-theme-for-a-new-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Firewalls &#8211; Attack detection and response with iptables, PSAD, and FWSNORT.</title>
		<link>http://hackdev.com/2010/09/linux-firewalls-attack-detection-and-response-with-iptables-psad-and-fwsnort/</link>
		<comments>http://hackdev.com/2010/09/linux-firewalls-attack-detection-and-response-with-iptables-psad-and-fwsnort/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 02:13:49 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[Book Review]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=169</guid>
		<description><![CDATA[I seem to work best at night, it&#8217;s dark out, and generally quite dark inside too; there is more bandwidth because it is off peek, and in general there is nobody coming over or phoning and interrupting me. Incidentally, its &#8230; <a href="http://hackdev.com/2010/09/linux-firewalls-attack-detection-and-response-with-iptables-psad-and-fwsnort/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I seem to work best at night, it&#8217;s dark out, and generally quite dark inside too; there is more bandwidth because it is off peek, and in general there is nobody coming over or phoning and interrupting me. Incidentally, its also when I do the majority of my reading, at home; in bed, at night. Much more pleasant that way&#8230;<br />
PSAD<br />
Anyway, the latest book I have been reading is called &#8220;<a title="Linux Firewalls" href="http://www.amazon.com/gp/product/1593271417?ie=UTF8&amp;tag=hackdcom-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1593271417&quot;&gt;Linux Firewalls" target="_self">Linux Firewalls &#8211; Attack detection and response with iptables, PSAD and FWSNORT</a>&#8221; by Michael Rash who, incidentally runs CipherDyne.org &#8211; the site where <strong>PSAD</strong>, <strong>FWSNORT</strong> and a fair few other Linux and security tools are developed. Now, you may think that with a title like that your going to have to know a lot about Linux and Firewalls before you begin but that is simply not true, <a title="Linux Firewalls" href="http://www.amazon.com/gp/product/1593271417?ie=UTF8&amp;tag=hackdcom-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1593271417&quot;&gt;Linux Firewalls" target="_self">Linux Firewalls</a> takes you right from the very start of how <strong>iptables</strong> works to manually porting Snort rules over to <strong>iptables</strong> for detection, and in my humble opinion, it does a damn good job of it. In fact, it done such a good job of it, I have used the reference firewall scripts and <strong>PSAD</strong> configurations to install and configure <strong>iptables</strong> and <strong>PSAD</strong> on my new VPS, which I will hopefully be moving some of my sites to.</p>
<p>Some of the things you should probably have already if you want to get the best out of <a title="Linux Firewalls" href="http://www.amazon.com/gp/product/1593271417?ie=UTF8&amp;tag=hackdcom-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1593271417&quot;&gt;Linux Firewalls" target="_self">Linux Firewalls</a> is&#8230;</p>
<ul>
<li>A comfortable familiarity with the distribution of Linux you wish to use.</li>
<li>Basic understanding of how networks communicate.</li>
<li>Reasonable understanding of how TCP works (ie. the three way handshake)</li>
<li>Reasonable understanding of how UDP works</li>
<li>A system to test this stuff on, if you don&#8217;t have a system to test this stuff out on, you could always set up a few virtual machines using VirtualBox or VMWare.</li>
<li>A will to learn about this kind of stuff</li>
</ul>
<p>Missing any one of these things (except the will to learn, thats pretty important) probably isn&#8217;t going to be a huge deal, but if your missing a lot of them, you might struggle a bit with some of the concepts.</p>
<p>Here is a sample of one of the basic <a href="http://www.amazon.com/gp/product/1593271417?ie=UTF8&amp;tag=hackdcom-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1593271417" target="_self">Linux Firewall</a> scripts that I have adapted from the book&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Port and IP addresses changed to protect the innocent.</span>
&nbsp;
<span style="color: #007800;">IPTABLES</span>=<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables
<span style="color: #007800;">MODPROBE</span>=<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>modprobe
&nbsp;
<span style="color: #666666; font-style: italic;">### Flush existing rules and settings. Set to default drop.</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;[+] Flushing existing iptables rules...&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-F</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-X</span>
<span style="color: #666666; font-style: italic;">#$IPTABLES -t nat -F</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-P</span> INPUT DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-P</span> OUTPUT DROP
<span style="color: #666666; font-style: italic;">#$IPTABLES -P FORWARD DROP</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### Load the connection tracking modules. Not going to bother with NAT</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;[+] Loading conntrack support...&quot;</span>
<span style="color: #007800;">$MODPROBE</span> ip_conntrack
<span style="color: #007800;">$MODPROBE</span> ip_conntrack_ftp
&nbsp;
<span style="color: #666666; font-style: italic;">### Input Chain</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;[+] Setting up INPUT chain...&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> INVALID <span style="color: #660033;">-j</span> LOG <span style="color: #660033;">--log-prefix</span> <span style="color: #ff0000;">&quot;DROP INVALID &quot;</span> <span style="color: #660033;">--log-ip-options</span> <span style="color: #660033;">--log-tcp-options</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> INVALID <span style="color: #660033;">-j</span> DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> ESTABLISHED,RELATED <span style="color: #660033;">-j</span> ACCEPT
&nbsp;
<span style="color: #666666; font-style: italic;">### Allowing Broadcasts</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-d</span> 255.255.255.255 <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-d</span> x.x.x.x <span style="color: #660033;">-j</span> ACCEPT <span style="color: #666666; font-style: italic;">#Replace the x's with your network's broadcast address</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### Anti-spoofing measures</span>
<span style="color: #666666; font-style: italic;">#$IPTABLES -A INPUT -i eth0 -j LOG --log-prefix &quot;SPOOFED PKT &quot;</span>
<span style="color: #666666; font-style: italic;">#$IPTABLES -A INPUT -i eth0 -j DROP</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### Accept rules...</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> lo <span style="color: #660033;">-j</span> ACCEPT <span style="color: #666666; font-style: italic;">#All local connections</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">--syn</span> <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT <span style="color: #666666; font-style: italic;">#Webserver</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">22</span> <span style="color: #660033;">--syn</span> <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT <span style="color: #666666; font-style: italic;">#SSHd</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">1000</span> <span style="color: #660033;">--syn</span> <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT <span style="color: #666666; font-style: italic;">#Webmin</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> icmp <span style="color: #660033;">--icmp-type</span> echo-request <span style="color: #660033;">-j</span> ACCEPT <span style="color: #666666; font-style: italic;">#Accept Ping's</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### Output Chain</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;[+] Setting up OUTPUT chain - Allowing all!&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-j</span> ACCEPT
&nbsp;
<span style="color: #666666; font-style: italic;">### Forward Chain</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;[+] Setting up FORWARD chain - Nothing to do.&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-j</span> LOG <span style="color: #660033;">--log-prefix</span> <span style="color: #ff0000;">&quot;DROP FORWARD &quot;</span> <span style="color: #660033;">--log-ip-options</span> <span style="color: #660033;">--log-tcp-options</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-j</span> DROP</pre></div></div>

<p>I hope that this impromptu book review is of at least some help to you.</p>
<p>Side Note: The bold bits in the posting are for a little test that I  am doing on keyword density&#8230; I&#8217;ll let you all know how it goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2010/09/linux-firewalls-attack-detection-and-response-with-iptables-psad-and-fwsnort/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Teamspeak 3 server on Ubuntu</title>
		<link>http://hackdev.com/2009/12/teamspeak-3-server-on-ubuntu/</link>
		<comments>http://hackdev.com/2009/12/teamspeak-3-server-on-ubuntu/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 10:59:31 +0000</pubDate>
		<dc:creator>Gues7</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Roll your own:]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://hackdev.com/?p=100</guid>
		<description><![CDATA[Well, Teamspeak have finally released their new server platform for a public BETA test, although supposedly in this state the code is not meant to be stable, it appears to be working quite well on my Ubuntu server here at &#8230; <a href="http://hackdev.com/2009/12/teamspeak-3-server-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Well, Teamspeak have finally released their new server platform for a public BETA test, although supposedly in this state the code is not meant to be stable, it appears to be working quite well on my Ubuntu server here at home. This is what I done to get it up and running &#8211; as a service from init.d no less.  Before doing any of the following steps, please be aware that this <strong>IS</strong> BETA code and <strong>WILL</strong> contain bugs that may introduce security issues.  The first step is to create a user that the Teamspeak executable can run as, this user should have a complex password for security reasons. This user will also not require a shell account.</p>
<blockquote><p>sudo adduser teamspeak</p></blockquote>
<p>Fill in the questions presented by the adduser application.</p>
<blockquote><p>sudo usermod -s /bin/false teamspeak</p></blockquote>
<p>The above command will change the users shell to be /bin/false ie. no shell.  Now it is time to go and get Teamspeak&#8230; visit http://www.goteamspeak.com and find the correct package for the architecture you wish to use ie. Teamspeak_3.0.0-Beta5-32bit&#8230;</p>
<blockquote><p>wget http://ftp.4players.de/pub/hosted/ts3/releases/beta-5/teamspeak3-server_linux-x86-3.0.0-beta5.tar.gz tar -zxvf teamspeak3-server_linux-x86-3.0.0-beta5.tar.gz</p></blockquote>
<p>Now its time to move the new TS3 directory to its new home&#8230;</p>
<blockquote><p>sudo mv ./teamspeak3-server_linux-x86-3.0.0-beta5 /opt/TS3 sudo chown -R teamspeak /opt/TS3</p></blockquote>
<p>The above will place TS3 in /opt/TS3 and give ownership of the contents to the user teamspeak.  It is now possible to run Teamspeak, however as veteran Teamspeak users will know, the first time you run the Teamspeak server you are presented with a username/password combo that cannot be recovered without resetting the server. In TS3 you will also be presented with a `token` (all of this is described in the Teamspeak documentation). So for the first run, the following command will allow you to gather these details, they should be noted carefully for future reference.</p>
<blockquote><p>sudo start-stop-daemon &#8211;chuid teamspeak &#8211;chdir /opt/TS3 &#8211;start &#8211;exec /opt/TS3/ts3server_linux_x86</p></blockquote>
<p>From this, you should see the serveradmin user and password. You can now ^C that and be returned to the normal shell, if you cat /opt/TS3/logs/* you will be presented with the token you require to obtain server-admin status on the new server. The last part is to create a script for /etc/init.d/ to launch Teamspeak each time the system is booted to the correct runlevel. /etc/init.d/skeleton provides a suitable framework for this, here is the script I am using, just about&#8230; <strong>NOTE:</strong> WordPress does not want to format this correctly for me, as such, here is a link to the file in a tar archive. If you follow these instructions and are running a 32bit server, the following file will work out of the box. <a href="http://hackdev.com/wp-content/uploads/2009/12/teamspeak.gz">/etc/init.d/teamspeak</a> This file must then be made executable with</p>
<blockquote><p>sudo chmod +x /etc/init.d/teamspeak</p></blockquote>
<p>And finally, the init file must be symlinked to each of the runlevel start dirs using the following&#8230;</p>
<blockquote><p>sudo ln -s ../init.d/teamspeak /etc/rc0.d/K21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc1.d/K21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc2.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc3.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc4.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc5.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc6.d/K21teamspeak</p></blockquote>
<p>Viola, you should now have a working Teamspeak 3 server.</p>
<p>BOOTNOTE:</p>
<blockquote><p>For my initial install, and for the basis of the majority of <a href="http://ubuntuforums.org/showthread.php?t=236834" target="_blank">this</a>, I used this as a reference.  Items listed in <strong>bold</strong> with <strong>**</strong> are most likely not the correct file names for the command, I am not close to my server or an available shell to pull the correct parameters at present, but I will update ASAP.  As an additional side note, my first impressions of TS3 are very good&#8230; It has tons of new features, looks good and the voice quality is very good indeed. My only concern is however the permissions system is very bulky, difficult to understand, and unless you are reasonably familiar with administering a Teamspeak server already, the documentation is not as straight forward as people believe. Still, however, a great job. Well done Teamspeak 3 development team!</p></blockquote>
<p><em><strong>UPDATE:</strong></em> Fixed formatting issue, kinda&#8230; provided link to pastebin.</p>
<p><strong>UPDATE:</strong> Fixed information regarding server executable. Added /etc/init.d/teamspeak file, available for download <a href="http://hackdev.com/wp-content/uploads/2009/12/teamspeak.gz">here</a>, removed pastebin link.</p>
<blockquote>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 744px; width: 1px; height: 1px;">
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 498px; text-align: left;" dir="ltr">#! /bin/sh
### BEGIN INIT INFO
# Provides:          teamspeak
# Required-Start:    networking
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: TeamSpeak Server Daemon
# Description:       Starts/Stops/Restarts the TeamSpeak Server Daemon
### END INIT INFO

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="TeamSpeak Server"
NAME=teamspeak
USER=teamspeak
DIR=/opt/tss2_rc2
DAEMON=$DIR/server_linux
#PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

d_start() {
        start-stop-daemon --start --quiet \
                --chuid $USER \
                --chdir $DIR \
                --exec $DAEMON \
                &gt; /dev/null \
                || echo -n " already running"
}

d_stop() {
        start-stop-daemon --stop --quiet \
                --chuid $USER \
                --chdir $DIR \
                --exec $DAEMON \
                || echo -n " not running"
}

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        d_start
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        d_stop
        echo "."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: $NAME"
        d_stop
        sleep 15
        d_start
        echo "."
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" &gt;&amp;2
        exit 3
        ;;
esac

exit 0</pre>
</div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://hackdev.com/2009/12/teamspeak-3-server-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

