<?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>Zod.hu &#187; Linux</title>
	<atom:link href="http://zod.hu/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://zod.hu</link>
	<description>Phase one: Linux, phase two: , phase three: profit!</description>
	<lastBuildDate>Wed, 11 Nov 2009 04:16:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Connecting Samba servers through OpenVPN</title>
		<link>http://zod.hu/2009/04/connecting-samba-servers-through-openvpn.html</link>
		<comments>http://zod.hu/2009/04/connecting-samba-servers-through-openvpn.html#comments</comments>
		<pubDate>Thu, 23 Apr 2009 11:26:03 +0000</pubDate>
		<dc:creator>Zod</dc:creator>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[multiple subnets]]></category>
		<category><![CDATA[openvpn]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[windows networking]]></category>

		<guid isPermaLink="false">http://zod.hu/?p=42</guid>
		<description><![CDATA[Connecting two different subnets on different locations with linux firewalls is easy. I did it with OpenVPN because it&#8217;s easy to setup, secure and &#8220;just works&#8221;. Everything worked fine. Email server on one subnet was reachable from the other, the samba server was available with \\ip style address. I thought that was all, work done&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Connecting two different subnets on different locations with linux firewalls is easy. I did it with OpenVPN because it&#8217;s easy to setup, secure and &#8220;just works&#8221;.</p>
<p>Everything worked fine. Email server on one subnet was reachable from the other, the samba server was available with \\ip style address. I thought that was all, work done&#8230;</p>
<p>Not quite.<br />
<span id="more-42"></span><br />
Well we had domain logons with roaming profiles before the subnet split and we wanted it to stay the same. </p>
<p>Before I go into detail about the problems and solutions lets take a look at our simplified network.<br />
The two firewalls are connected with adsl through ppp0.<br />
Subnet1 has an internal network with 192.168.1.0/24 with the server ip 192.168.1.254 and a tun0 interface with 10.8.0.1.<br />
Subnet2 has 192.168.2.0/24 (ip 192.168.2.254) with tun0 10.8.0.6.<br />
Because we have limited number of servers both firewalls are also the samba servers. (However the setup is the same if you have internal samba servers, just change the ip addresses).</p>
<p>Subnet2 has the domain controller for DOMAIN1.</p>
<p>Server on Subnet1 is called SERVER2 on Subnet2 it&#8217;s SERVER, sorry for this we have a switched setup and I don&#8217;t want to tamper with the included logs.</p>
<p><b>Configuration</b></p>
<p>We need a WINS server on our network. Let SERVER (192.168.2.254) be it:</p>
<p>smb.conf on SERVER:</p>
<pre>
netbios name = SERVER
workgroup = DOMAIN1
os level = 128
preferred master = Yes
domain master = Yes
local master = Yes

wins support = Yes
wins proxy = Yes

# If you want domain logons just turn on the relevant options
</pre>
<p>smb.conf on SERVER2</p>
<pre>
netbios name = SERVER2
workgroup = DOMAIN1
os level = 64
preferred master = Yes
domain master = No
local master = Yes

wins support = No
wins proxy = No
wins server = 192.168.2.254
</pre>
<p>It is important to switch on wins support = Yes on only one server per workgroup!</p>
<p>Ok now we have name resolution for NetBIOS names set up.</p>
<p>If you have dhcp for your subnets put option netbios-name-servers 192.168.2.254; in dhcpd.conf so your clients will know about our WINS server (you can also put option netbios-node-type 8; this will change the clients NetBIOS name resolution to WINS server and network broadcast in this order)</p>
<p><b>Problem 1</b></p>
<p>This one is quite important and hard to notice.<br />
If you have </p>
<pre>
interfaces = 127.0.0.0/8 eth1 ...
bind interfaces only = yes
</pre>
<p>Comment it out now! The problem is with this setup is no matter how hard you try to add tun0 (or tun0 ip range) to this config samba will refuse to use this interface because it has no broadcast capability. And the traffic between the two servers will go through the tunnel and use the tun0 ip for source, and in turn samba will refuse inter samba communication from this source.</p>
<p>The relevant log file entries are not too informative:</p>
<p>On the WINS server:</p>
<pre>
[2009/04/22 16:53:16,  3, pid=26633, effective(0, 0), real(0, 0)] nmbd/nmbd_winsserver.c:wins_multihomed_register_query_fail(1491)
  wins_multihomed_register_query_fail: Registering machine at IP 192.168.1.254 failed to answer query successfully for name SERVER2&lt;20&gt;.
</pre>
<p>On the other server:</p>
<pre>
[2009/04/22 16:53:26, 0, pid=30630, effective(0, 0), real(0, 0)] nmbd/nmbd_namelistdb.c:standard_fail_register(305)
  standard_fail_register: Failed to register/refresh name SERVER2&lt;03&gt; on subnet UNICAST_SUBNET
[2009/04/22 16:53:26, 0, pid=30630, effective(0, 0), real(0, 0)] nmbd/nmbd_nameregister.c:register_name_response(130)
  register_name_response: WINS server at IP 192.168.2.254 rejected our name registration of SERVER2&lt;00&gt; IP 192.168.1.254 with error code 5.
</pre>
<p><b>Problem 2</b></p>
<p>On each subnet only the host which reside on the same subnet are visible to the clients. We have to force our other server(s) to sync its browse list with the WINS server. This can be done by adding the following to the config of the WINS server.</p>
<pre>
# This forces samba to announce itself to 192.168.1.254 (our local master browser on the other subnet)
# and also on the broadcast address, just to be sure it reaches the clients.
remote announce = 192.168.1.254 192.168.1.255

# This forces the lmb 192.168.1.254 to sync its browse list with us.
remote browse sync = 192.168.1.254
</pre>
<p><b>Problem 3</b></p>
<p>As I said before we have domain logons enabled. Without the above changes joining the domain was easy (just like with a single subnet) however the clients were unable to log in to the domain. The error was at login time after selecting the domain to log on and entering user/pass information and it said something like &#8220;Domain DOMAIN1 not available&#8221;. No details, no errors. Sometimes I was able to log in but the client machine was unable to mount the network drives from the server. After digging into the problem it boiled down to NetBIOS name resolution. So the changes above seems to solve this issue as well.</p>
<p>Now we are done :)</p>
<p><b>Final thoughts</b></p>
<p>MS networking is complicated and unreliable. I really hate it. Broadcasting, elections, resolution order changes&#8230;<br />
So do not ever trust it! Browsing the network was never easy either and I don&#8217;t think it ever will be. </p>
<p>Oh and also as of samba 3.2.3 XP clients don&#8217;t seem to need the signorseal registry hack, however in local policy/security setting you should disable &#8220;&#8230;signing and encrypting (always)&#8221;. </p>
]]></content:encoded>
			<wfw:commentRss>http://zod.hu/2009/04/connecting-samba-servers-through-openvpn.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux against spyware</title>
		<link>http://zod.hu/2009/02/linux-against-spyware.html</link>
		<comments>http://zod.hu/2009/02/linux-against-spyware.html#comments</comments>
		<pubDate>Mon, 23 Feb 2009 13:12:53 +0000</pubDate>
		<dc:creator>Zod</dc:creator>
				<category><![CDATA[Virus/Spyware]]></category>
		<category><![CDATA[antispyware]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[livecd]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://zod.hu/?p=5</guid>
		<description><![CDATA[I wanted to write about a bit of spyware history and evolution here, but I think we all know a lot about the problem already. Spywares are annoying, widespread and dangerous. And hard to get rid of. Today spyware writers are becoming quite good at hiding spyware activity and making sure that an infected computer [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to write about a bit of spyware history and evolution here, but I think we all know a lot about the problem already. Spywares are annoying, widespread and dangerous.</p>
<p>And hard to get rid of. Today spyware writers are becoming quite good at hiding spyware activity and making sure that an infected computer remains infected. A common approach is to change the winlogon notify registry key to run malware code on every single user login. Yes, even if you start windows in safe mode you have to log in, and if a program is loaded you cannot easily remove it from the computer.</p>
<p><span id="more-5"></span></p>
<p>This is an everyday problem for most IT professionals. Cleaning a system that&#8217;s already running is almost impossible.</p>
<p>So linux for the rescue:</p>
<p>My solution for the problem is a linux live cd with an antivirus removal tool.</p>
<p>The easy part was the live cd. <a href="http://www.ubuntu.com" target="_blank">Ubuntu</a> has a nice live system which is easy to <a href="https://help.ubuntu.com/community/LiveCDCustomization" target="_blank">customize</a>, supports almost every available hardware, and also has mature NTFS support.</p>
<p>I got rid of openoffice.org packages because they took up a lot of space, which I needed for the antivirus software.</p>
<p>The harder part was finding the ideal virus removal tool for the job. I really like <a href="http://www.clamav.net/" target="_blank">clamav</a> (we use it to scan our email traffic for obvious viruses) however as of today it knows 472153 viruses. Don&#8217;t get me wrong it IS a great tool for slowly evolving or fixed viruses, like mass mailing viruses and older ones, but currently not fast enough for the spyware war. On my first attempts with the live antivir solution it missed a lot newer threats and variants.</p>
<p>So I started to look for another solution. Well &#8220;linux and viruses&#8221; wasn&#8217;t the best search term, but in the end I found a very promising site: <a href="http://www.viruspool.net/antivirus.cms">Viruspool.net</a>. This site is exactly what I&#8217;ve been looking for. It lists unix command line scanners with a percentage of accuracy, ease of install, price and such information. Although it is a bit outdated, but still a good reference point.</p>
<p>Obviously I aimed at the highest accuracy, but because I wanted only to testdrive the products simple availability was important too.</p>
<p>To make a long story short I ended up with the <a href="http://www.bitdefender.com/" target="_blank">BitDefender</a> product (evaluation version is available after filling a simple form) and they currently run a beta test program for the unix version. They sent me an email about it, so I think I can include the link here http://download.bitdefender.com/SMB/Workstation_Security_and_Management/BitDefender_Antivirus_Scanner_for_Unices/Unix/Beta/</p>
<p>Today it has 2 336 009 signatures, and a lot of it is malware related.</p>
<p>So after creating the live cd I booted the machine with it and simply did this:</p>
<pre>#Update the definitions
bdscan --update
# Mounted the windows partition (in read only mode at first)
mount -o ro /dev/sda1 /mnt
cd /mnt
bdscan --no-list path/to/check</pre>
<p>This gave me the list of infected files, but did not change anything on the machine in question.<br />
(On this particular machine, a lot of expected dll-s and .tmp files and an unexpected trojan infection in userinit.exe [this caused the owner to ask for help, because it made the desktop disappear on boot... badly written trojan...]).</p>
<p>This was enough for me. Remounted the drive in rw mode, removed the infections by hand and replaced userinit.exe with a clean copy.</p>
<p>But bdscan can also remove/quarantine/repair(!) infections automaticaly. See <code>bdscan --help</code> for details.</p>
<p>Now I&#8217;m quite satisfied with the result.</p>
<p>If I&#8217;ll have a bit free time I&#8217;ll check more of the products even if it&#8217;s a bit harder to get them.<br />
The more engines I try the more spyware I&#8217;ll catch, and I currently have quite a few machines to check for malware&#8230;</p>
<p>After creating the live cd you can remove /opt/BitDefender-scanner/var/bddt.dat this will keep the software in trial mode, but must be run as root to be able to recreate the file.</p>
<p>I hope this helps a bit, and of course every comment is welcome :)</p>
]]></content:encoded>
			<wfw:commentRss>http://zod.hu/2009/02/linux-against-spyware.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

