Nefaria.com

How to upgrade ClamAV on Ubuntu (Intrepid)

by musashi on Oct.08, 2009, under I.T.

On October 5th, the Clam Antivirus team announced that ClamAV 0.94.x is now entering its end-of-life phase. What’s worse, versions of ClamAV earlier than 0.95 will no longer be able to receive CVD updates; basically rendering any older versions of ClamAV nearly worthless. This is all supposed to happen by April 2010—soon. You can read more about it here.

Good news though, the upgrade process on Ubuntu is pretty easy:

If you haven’t already done so, enable the ‘backports‘ repo by editing your /etc/apt/sources.list file and uncommenting (or, inserting) the following two lines:

deb http://us.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse

Then, resynchronize the package index files with the following command:

sudo apt-get update

Next, upgrade ClamAV:

sudo apt-get install clamav-daemon

This command will [sometimes] install apparmor as well; I don’t use apparmor so I uninstall it afterwards:

/etc/init.d/apparmor stop
update-rc.d -f apparmor remove
apt-get remove apparmor apparmor-utils

That’s all there is to it!

root@localhost:~# clamd -V
ClamAV 0.95.2/9874/Thu Oct  8 06:24:12 2009
Leave a Comment :, , , more...

Adding “Trusted Sites” to Internet Explorer, via the registry

by musashi on Oct.01, 2009, under I.T.

A while ago I needed to add a list of websites to the Internet Explorer’s “Trusted Sites” zone for multiple users, scattered across multiple terminal servers. IE’s “Enhanced Security Configuration” (ESC) is configured by default on windows terminal services and it’s normally a good idea to leave it intact.

However, this can have unintended consequences for users who require the use of websites that employ ActiveX, javascript, etc. because, by default, ESC does not allow those items to run. Sometimes, this means that the site in question will only be partially non-functioning. Other times, the entire site will be completely unusable. Furthermore, most users on terminal services have only a limited ability to actually modify the settings for an entire zone. Normally the best thing they can do is add the site to their trusted sites zone, if in fact the site is legitimate (i.e., “trusted”).

Originally, I explained to the users the steps involved in adding a site to their trusted sites, however many of the users used many of the same websites that other users were using. Also, new users needed to be trained on how to do this as well. Needless to say, it got very repetitive, very fast; so I came up with a “global” list of sites that can be trusted, and imported them to the registry on each terminal server. The list consisted of about 40+ sites, and I was able to generate the list mostly by exporting the following registry key:

HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains

…from a few user accounts who had already added most of the sites to their trusted sites zone. After grepping out the duplicates (among other things), I had my list.

Now, I’m going to cover two ways of making this list of domains “globally trusted”—both of them involve writing to the following registry key:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains

Pay attention! This is not the same key as previously mentioned. This key resides in the ‘HKEY_LOCAL_MACHINE’ hive, whereas the previous key resides in the ‘HKEY_CURRENT_USER’ hive.

The first way is via the following visual basic script:

Option Explicit

Dim DomainArray(5), strComputer, strHTTP, strHTTPS
Dim dwordZone, regPath, objReg, counter, subkeyPath
Dim subkeyValue
Const HKEY_LOCAL_MACHINE = &H80000002

DomainArray(0) = "testdomain0.com"
DomainArray(1) = "testdomain1.com"
DomainArray(2) = "testdomain2.com"
DomainArray(3) = "testdomain3.com"
DomainArray(4) = "testdomain4.com"

strComputer = "."
strHTTP = "http"
strHTTPS = "https"
dwordZone = "2"
regPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" &_
	"\ZoneMap\EscDomains\"
Set objReg = GetObject("winmgmts:{impersonationLevel = impersonate}!\\" & _
	strComputer & "\root\default:StdRegProv")

For counter = 0 to 4
	subkeyPath = regPath & DomainArray(counter)
	objReg.CreateKey HKEY_LOCAL_MACHINE,subkeyPath
	objReg.SetDWORDValue HKEY_LOCAL_MACHINE,subkeyPath,strHTTP,dwordZone
	objReg.SetDWORDValue HKEY_LOCAL_MACHINE,subkeyPath,strHTTPS,dwordZone
Next

This script will insert ‘testdomain0.com’, ‘testdomain1.com’, [...] into IE’s trusted sites zone when run on any machine. It must be run by an Administrator (or another user who has access to write to the HKEY_LOCAL_MACHINE registry hive), and the changes are global (to the machine).

The next way involves creating a “registry entries” (.reg) file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\testdomain0.com]
"http"=dword:00000002
"https"=dword:00000002

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\testdomain1.com]
"http"=dword:00000002
"https"=dword:00000002

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\testdomain2.com]
"http"=dword:00000002
"https"=dword:00000002

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\testdomain3.com]
"http"=dword:00000002
"https"=dword:00000002

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\testdomain4.com]
"http"=dword:00000002
"https"=dword:00000002

Just like the previous script, this must also be run by a user with Administrator privileges and any changes will be global to all users on the machine.

(Of course, you would want to customize these snippets of code to suit your needs.)

For more information, please visit the following sites:

Internet Explorer Enhanced Security Configuration changes the browsing experience
Enhanced Security Configuration for Internet Explorer
Internet Explorer security zones registry entries for advanced users

Leave a Comment :, , more...

Alternate SMTP port with iptables

by musashi on Sep.29, 2009, under I.T.

Nowadays, more and more ISPs are blocking outbound port 25 (SMTP) for spam prevention or reduction purposes. This should be of concern to sysadmins who have users scattered across multiple ISPs (such as webhosting services) or corporate sysadmins who maintain e-mail for mobile users, for example. The workaround is to use the mail submission agent (MSA) port, 587. Most ISPs do not block outbound traffic for this port. On GNU/Linux, we can use iptables for this task. With a single command, we can configure any inbound traffic, destined for port 587 traffic to be redirected to port 25:

iptables -t nat -I PREROUTING -p tcp –dport 587 -j REDIRECT –to-port 25
Leave a Comment :, , , more...

Glenn Beck doesn’t understand the Internet… (if he does, then he’s making a big deal about this simply so he can have something to yap about)

by musashi on Aug.02, 2009, under I.T., Rants

First, watch the following video:

http://www.dailykostv.com/w/002008/

Just a point of order before I get too far into this; throughout this post, I’ll use the terms “warning banner”, “warning message”, “logon banner”, “network banner” and “privacy statement” interchangeably… they all refer to just about the same thing and serve the same purpose.

Now if you are to take Beck at his word, this is scary shit right? Wrong. First of all, don’t take beck at his word [ever], he’ll give you brain herpes. Here’s the deal, that disclaimer that he’s taking such a big issue with? Yeah, it’s a pretty standard warning message actually. Take the U.S. Army’s website for example (warning, you’ll have to confirm a security certificate exception); one of the “scary issues” that Beck has with the warning on the cars.gov website is that it’s too broad (never mind the fact that it has to be… we’ll get to that in a second). If you read the security warning on the Army’s site, it too is broad and so is their terms of service. Moreover, all this bullshit about “America, do not try this at home.” is just silly fucking nonsense, meant only to scare people who do not know any better. This security message that Beck is all up in arms about is what is known as a “warning banner”. Warning banners are common on just about all corporate and government computers that are accessible from the Internet (…and have been common for a looooong time). Even some private computers, such as someone who runs a web, e-mail, ftp, etc. server from their home for personal use will have warning banners. In addition to those, it’s also common to see similar, broadly worded messages at the bottom of some e-mails (pursuant to the “e-mail” policy of some organizations). Their purpose is to cast a wide legal net so that in the event that someone abuses the system in question, legal action can be taken. The basic purpose of any warning banner should be to make the following point: If you attempt to circumvent the security measures employed by this system, succeed in doing so, and/or abuse this system in any way, legal action will be taken against you. Not to belabor the point, but here’s what the DOJ has to say about warning banners:

Network banners are electronic messages that provide notice of legal rights to users of computer networks. From a legal standpoint, banners have four primary functions. First, banners may be used to generate consent to real-time monitoring under Title III. Second, banners may be used to generate consent to the retrieval of stored files and records pursuant to ECPA. Third, in the case of government networks, banners may eliminate any Fourth Amendment “reasonable expectation of privacy” that government employees or other users might otherwise retain in their use of the government’s network under O’Connor v. Ortega, 480 U.S. 709 (1987). Fourth, in the case of a non-government network, banners may establish a system administrator’s “common authority” to consent to a law enforcement search pursuant to United States v. Matlock, 415 U.S. 164 (1974).

If my name were Glenn Beck, I’d be throwing a tantrum upon reading eliminate any Fourth Amendment “reasonable expectation of privacy” … and I wouldn’t read the rest before running to the camera with a story about how the Communist-terrorist Obama administration wants to eliminate our Fourth Amendment rights (never mind the fact that the referenced DOJ website was in existence well before Obama took office)… but I digress.

Warning banners, such as the one Beck is holding up as an example of “scary shit that the Obama administration is doing” shouldn’t frighten anyone except for those who plan on doing exactly what the warning message tells them not to do. Warning banners are passive security measures; they need to be broad in order to apply to any/all possible cases of abuse. They don’t actually make the computer/network/website/etc. more secure (with the exception of causing would-be “crackers” to think twice before trying anything). Their real power comes from the fact that they can be used in court to show that the defendant had been warned in advance and knew full and well they were doing something that they shouldn’t have been doing.

In regard to this particular warning banner, I went to the cars.gov website to see what I could find out about it… it turns out, that the only way you’ll ever see the message that Beck is ranting about is if you are a car dealer participating in the CARS program. Given the potential for fraud on behalf of unscrupulous car dealers, I’d say that the strong wording of the warning banner/privacy message (whichever you choose to call it) is entirely appropriate. Meanwhile, ordinary citizens looking for information about the CARS program only consent to have their IP address tracked (which is something that all webservers do by default anyway).

This is just another example of fearmongering on behalf of a fanatic who cannot reconcile his world-view with reality.

### Update! Here’s some more information about this from Daily Kos, enjoy.

1 Comment :, , more...

Windows XP allows a user to login and then it immediately logs out

by musashi on Jul.21, 2009, under I.T.

Quite an odd thing happened today… I encountered the same very specific error twice on two completely unrelated computers (two different clients). In _both_ cases, clamwin had unnecessarily quarantined the following file:

C:\WINDOWS\system32\userinit.exe

On both machines, this occurred during a scheduled scan. The symptoms of this problem are that windows will allow the user to login, but it immediately logs out after a second or two. Here’s how I fixed it in both cases:

  1. Boot into the recovery console using a Windows XP install disk
  2. Select the windows installation experiencing the problem and type the Administrator password when asked
  3. Run the following command (assuming that your CD-ROM is D:\ and your hard drive is C:\):
    expand D:\I386\USERINIT.EX_ C:\WINDOWS\system32
  4. Remove the CD from the drive then type ‘exit’ and hit ‘enter’ to reboot.

Once the computer boots properly (and allows you to stay logged in), use Malwarebytes, Spybot, HijackThis, etc. to scan your computer for viruses and/or spyware.

Update, 5 August 2009:

Just an additional note; you’ll want to be sure that the version of the file you copy from the installation disk is compatible with the service pack installed (it’s likely not). Symptoms of this incompatibility include things like explorer freezing when you try to shutdown or restart the computer. Uninstalling then Reinstalling the service pack should fix this issue. Alternatively, (and if ClamWin was the culprit) you could restore the old userinit.exe file from ClamWin’s quarantine directory… be sure to scan the file before doing this or else you could end up restoring an infected copy. So far, on every computer I’ve had to fix because of this (five and counting), ClamWin had falsely identified the userinit.exe file as a virus.

Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...