Tuesday, 10 May 2011

Using Linux to clean a virus from Windows

Yeah this is a bit of a headache so here's some aspirin pre-requisites
Infected Windows drive:
A bootable linux system either fully installed or from USB
If not already installed install clamav and any dependences.
Install a debian type distro for easy package management

apt-get update && apt-get upgrade -y && apt-get install clamav-freshclam clamav-dbg clamav-base clamav

you may have to set up the proxy
export http_proxy='<ip-address>:3128/'
or authenticate
export http_proxy=http://username:password@proxy.thing.com:8080/

#!/bin/sh
And a sample command is:
sudo clamscan -r /COSA_CAZZO_SCANSIONARE
Well, Once the scanning, Remove infected files with this command:
sudo clamscan -r --remove /COSA_CAZZO_SCANSIONARE
To start the GUI, type:
sudo clamtk
Hello and good scan :)

cd /tmp
1st attempt to run clamavscan -r --repair /dev/sda1
complained cannot find clamav "No supported database files"
clamav stores virus signatures in dBs in /var/lib/clamav
results
----------- SCAN SUMMARY -----------
05 Known viruses: 0
06 Engine version: 0.95.1
07 Scanned directories: 0
08 Scanned files: 0
09 Infected files: 0
10 Data scanned: 0.00 MB
11 Data read: 0.00 MB (ratio 0.00:1)
12 Time: 0.001 sec (0 m 0 s)
It means that you have no virus signatures stored in database files.

so let's get some dB scan files
wget http://database.clamav.net/daily.cvd
wget http://database.clamav.net/main.cvd
mv main.cvd /var/lib/clamav/
mv daily.cvd /var/lib/clamav/
I mounted the drive before running the scan not sure if that is necessary so
mount the drive
first make the destination
mkdir /media/sda1
mount
mount /dev/sda1 /media/sda1
run av
after mounting I run clamavscan -r --repair /media/sda1
4 hrs later results

----------- SCAN SUMMARY -----------
Known viruses: 953056
Engine version: 0.97
Scanned directories: 25256
Scanned files: 197630
Infected files: 22583
Data scanned: 55633.72 MB
Data read: 41429.39 MB (ratio 1.34:1)
Time: 10775.542 sec (179 m 35 s)
root@ubuntu:/var/lib/clamav#

clamscan -r --remove /media/sda1/
:)

Thursday, 14 April 2011

Copy flv files from firefox 4

Disclaimer
Downloading copyrighted material is illegal in some places which could include where you live, so make sure you only use this technique to download videos which are legal for YOU to download this would include getting the author's permission or say you lost your user details for a video upload site like YouTube, and there is no facility to retrieve YOUR videos . OK?


That was the disclaimer stuff, well let's start. It would seem in versions > 10.x the flash plugin is actually playing an already deleted file so... lets track down that file.
1) Load the video in a browser, and check the output of the following command @terminal:
$ lsof | grep -i flash
Result:
single line:
plugin-co 25546 alvin 17u REG 8,2 31286337 787220 /tmp/FlashXXepl8fa (deleted)
The output of the cmd gives a file descriptor open to a “deleted” file, /tmp/FlashXXepl8fa so the flash plugin plays the file and immediately deletes the file thus normal nix tools will not be able to access the file in /tmp notice the 17u in your flv file location so here goes.

2) To confirm again type @terminal:
$ ls -l /proc/16864/fd/* | grep -i /tmp/Flash
Result:
single line:
lrwx------ al al 64 2011-04-14 14:08 /proc/16864/fd/17 -> /tmp/FlashXXTep18fa (deleted)

3) To get your freshly cooked flv file again type @terminal:
$ cat /proc/16864/fd/17 > <filenameofyourchoice>.flv
That's it copy the output of the proc file process to a filename and location of your choice.
Hope this helps and does not get anyone in trouble but out of trouble.

4) To speed things put it all in a script.
Idea of script: output the flv file type @terminal:
outflv.sh <yourfilename.flv>

Contents of outflv.sh:

#!/usr/bin/env bash

## syntax: outflv.sh $HOME/Videos/somefile.flv


for flashpid in $(pgrep -f flashplayer.so); do
cd "/proc/$flashpid/fd"
for video in $(file * | grep '/tmp/Flash' | sed 's/\(^[0-9]*\).*/\1/g'); do
cat /proc/$flashpid/fd/$video > $1
done
done

Tuesday, 12 April 2011

CUPs error client-error-not-possible fix

When I upgraded my Ubuntu to 10.10 also Debian to 6.0 I experienced this cups error so herre's the fix. - OK it would seem that there is a problem with the samba windows client, any attempt to add an smb unc path e.g
smb://<servername>\<printername>

for the printer, gives a system error or cups error message "client-error-not-possible" this I think is caused because the smb client is now samba4-client, when the system is looking for sambaclient all you need do is install the smbclient which will uninstall your samba4-clients and voila problem no more or should we say problem fixed so again apt-get install smbclient it will remove samba4-clients which is ok if you don't specifically use it. Hope this helps... ;)

Monday, 14 March 2011

Android TiPz

OS: Android 2.3.3
Hardware: HTC HD2
Tip
To improve the speed or reponse of your device try moving as many of your Applications as possible to your SD card rather than running them from your phone'a memory.
At the moment I am using Winmo and Android together because belive it or not I have a Winmo legacy application that I need to run so until someone can write an app on Android that allows you to run WinMo apps I kinda have to reboot to WinMo :(
But I am more than impressed with the functioning speed of Android 2.3.3 when you can physcially see the difference in speed as a result of an upgrade it is worth it.

OS: Android 2.3.3
Hardware: HTC HD2
Fix
Android Market NOT downloading!
After installing my shiny new Gingerbread 2.3.3 (Gingerbread's don't shine but...) I went to the Android market of course to re-install all my Apps I'm accustomed to, after a while of downloading from the Market it just would not download any more, to fix I went to:
->Settings
->Applications
->Manage Applications
->Downloaded
You will get a list of all your downloaded Applications if you select an App, Just below the Data information, you will see a button labeled "Move to SD card" if the application is not in use or in memeory (I think) it will allow you to move it to your SD storage once you begin to make some space on your phone's memory you will find you can continue to download Apps from the market again.
Yippee...

Disclaimer:
I have not tested this with all versions of Android or all or various bits of hardware with the Android OS. I take no reponsibility for any results expected or otherwise from YOU attempting the changes on this website. Attempt or implement at your own risk.

Saturday, 12 February 2011

Make Firefox Addons Compatible

Or should we say uhhhhHHH... Make FIREFOX ignore compatibility
--8<---Firefox Actions Begins--->8--

Type: http://about:config into Firefox's address bar
Then click the "I'll be careful, I promise!" button.
Right-click anywhere. Choose New>Boolean.
Make the name of your new config value extensions.checkCompatibility and set it to false.
Make another new boolean pair called extensions.checkUpdateSecurity and set the value to false.
Restart Firefox you're ready to rock uh surf.
Tested with Firefox Versions 3.x not tested with 4.x versions yet let me know how you get on with your comments.
--8<---Firefox Actions Ends--->8--