You are here

[HOW-TO] Auto-scan downloaded files with ClamWin Portable

24 posts / 0 new
Last post
m-p-3
m-p-3's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 2006-06-17 21:25
[HOW-TO] Auto-scan downloaded files with ClamWin Portable

Hello everyone,

I am a daily user of the PortableApps platform, and I was wondering if it was possible to somehow use ClamWin Portable to scan downloaded files from Mozilla Firefox Portable.

I know there is no possibility to do so in a vanilla Mozilla Firefox installation, but there is an extension called "Download Statusbar" which has an anti-virus command-line capability after each download.

I was wondering
- if I enter a path to the ClamWinPortable executable (absolute path), will the Mozilla Firefox Portable launcher modify the drive letter in case it change, like the download folder path ?
- what would be the command-line parameter I would have to pass to ClamWinPortable to do such an action ?

Thanks for you assistance, fellow PortableApps users,

Regards,
m-p{3}

=============
SOLUTION

Finally, I managed to get it to work.

In Download Statusbar, select the ClamWinPortable.exe executable on your drive, and enter the following command-line parameter

--mode=scanner --path=%1 --close (Thanks goes to Tim for the close parameter)

I know the executable path seems to be absolute (ie: F:\PortableApps\ClamWinPortable\ClamWinPortable.exe), but I changed the drive letter on my USB key (H: drive), relaunched Mozilla Firefox portable and the path was corrected to H:\PortableApps\ClamWinPortable\ClanWinPortable.exe. It seems the FirefoxPortable.exe launcher is modifying the absolute path on each launch.

USBman
Offline
Last seen: 2 years 7 months ago
Joined: 2006-10-11 17:43
Read up

Please make sure to read the forums first, before posting. For example, I just posted this a couple of days ago: https://portableapps.com/node/13929

...and yes, I'm a bit peeved, as you directly ripped me off! Smile

m-p-3
m-p-3's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 2006-06-17 21:25
That's wierd as I did a

That's wierd as I did a search on the forum and I didn't found anything on that matter. Thanks for the link, I appreciate it.

m-p-3
m-p-3's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 2006-06-17 21:25
Finally, I managed to get it

Finally, I managed to get it to work.

In Download Statusbar, select the ClamWinPortable.exe executable on your drive, and enter the following command-line parameter

--mode=scanner --path=%1

I know the executable path seems to be absolute (ie: F:\PortableApps\ClamWinPortable\ClamWinPortable.exe), but I changed the drive letter on my USB key (H: drive), relaunched Mozilla Firefox portable and the path was corrected to H:\PortableApps\ClamWinPortable\ClanWinPortable.exe. It seems the FirefoxPortable.exe launcher modify the path on each launch.

USBman
Offline
Last seen: 2 years 7 months ago
Joined: 2006-10-11 17:43
That's good news!

Woo hoo!! That's great news. Nice work!

What do you think about including the bit about auto-updating? Any luck with that? ...I've just been toying around with the idea, and haven't yet tried fully deploying it.

P.S. - having re-read my original posting, I can see that the wording might be a bit confusing. Sorry about that. ..I guess you have to just read it slowly! Smile

USBman
Offline
Last seen: 2 years 7 months ago
Joined: 2006-10-11 17:43
not just Firefox 3

Also, it just occurred to me that using this technique, you could accomplish this virus scanning with any version of Firefox that can use the Download Statusbar extension - not just Firefox 3 (as had been my idea in my original posting).

...by the way, when this becomes popular, I want credit, darn it!! Smile

gmbudwrench
gmbudwrench's picture
Offline
Last seen: 9 months 2 weeks ago
Joined: 2007-06-25 05:00
Thanks

for this tip you guys! I just installed the extension and configured it like you posted and it works great!

Tim Clark
Tim Clark's picture
Offline
Last seen: 13 years 8 months ago
Joined: 2006-06-18 13:55
Thank you Mathew and J.V.

Thank you Mathew and J.V. for finding this.

I have often wondered about the correct parameters for using the Download Statusbar Add-on / extention
https://addons.mozilla.org/en-US/firefox/addon/26
by Devon Jensen
in Firefox Portable (FFP) and ClamWin Portable (CWP).

I am now using:
--mode=scanner --path=%1
as the arguments

in the Virus Scan tab of Download Status bar
to Manually Scan completed downloads

with the path to Anti-Virus program location set to:
c:\YourPath\PortableApps\ClamWinPortable\ClamWinPortable.exe

In addition to thanking you I want to provide here words for future searches to find this.

Gratefully,

Tim

Also, if you want ClamWinPortable to close automatically if no virus / malware is found the parameters would be:
--mode=scanner --path=%1 --close

More info about this and the use of other anti virus/malware scanners can be found at:
http://dlstatusbar.proboards43.com/index.cgi?board=dlscan

Things have got to get better, they can't get worse, or can they?

m-p-3
m-p-3's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 2006-06-17 21:25
You can thanks USBMan too, he

You can thanks USBMan too, he gave me severals hints into finding this solution.

USBman
Offline
Last seen: 2 years 7 months ago
Joined: 2006-10-11 17:43
Next

OK. Time to try and take it to the next step: auto-updating before scanning (again, see my original post: https://portableapps.com/node/13929)

So far I can only think of two ideas:

1) adding a command in the Download Statusbar arguments section; something along the lines of --mode=update .... I've had success doing this type of thing when using ClamWin Portable normally, using a batch file. However, I'm not yet sure of how to actually make this technique work using Download Statusbar. ...I'm thinking its actually not possible. But, please, prove me wrong - really!

2) passing some commands along, using the ClamWinPortable.ini file. Specifically, the "AdditionalParameters=" line. Maybe try something like "--mode=update" again???

I've tried messing with this stuff, but can't yet get it to work. I think that if we could all put our heads together, we might be able to outsmart it though. This is a worthwhile goal: auto-updating before auto-scanning!!! There are some other ideas that have already floated around (a simple example: http://lifehacker.com/software/featured-firefox-extension/scan-files-for...), but I want THIS! ...let's kick some butt here, everyone!

Tim Clark
Tim Clark's picture
Offline
Last seen: 13 years 8 months ago
Joined: 2006-06-18 13:55
I don't think this would be such a good idea

I don't think this would be such a good idea myself Sad

Do you really want CWP to check for updates everytime it is launched by Download StatusBar?

I can tell you I download many things during a browsing session at times. Depending on what I'm doing I might download 15 items in a hour. I don't think I would want CWP to check for updates each time I get a new download.

I would think you should pursue the update checking separately from the download scanning, just my thought.

Tim

Things have got to get better, they can't get worse, or can they?

USBman
Offline
Last seen: 2 years 7 months ago
Joined: 2006-10-11 17:43
Yes, I do

Yes, I absolutely do think it is a good idea.

What's the point of scanning ANYTHING, if you're AV definitions are not up to date? ...and besides, letting it update only takes a few moments! ...and what's more, if you haven't updated in a long while, then you should definitely update!

Additionally, it's worth noting that letting it update (or even not) and scan the downloaded file happens in the outside of Firefox, and doesn't affect your browsing in any way! Besides, on any decent connection the update should be over before you know it!

Really though, I'd say the main point is that scanning a file with out of date AV definitions is naive and dangerous, as it lulls a person into a false security.

Tim Clark
Tim Clark's picture
Offline
Last seen: 13 years 8 months ago
Joined: 2006-06-18 13:55
Not my problem, I update

Not my problem, I update ClamWin at least 3 times a day, morning, noon, and night.

besides, letting it update only takes a few moments!
Very often not true. Search the recent posts, Clam has a tendency to hang on updates. If you happen to get it in a particularly bad loop it will download the full daily.cvd [currently 2.2MB]

happens in the outside of Firefox, and doesn't affect your browsing in any way!
Again, not true,
While it is updating the database it is slowing down firefox because of bandwidth usage

on any decent connection the update should be over before you know it
And what about those of us with an indecent connection, i.e. the modem.

And finally, trust me the folks at ClamAV don't want you checking for updates 15 times an hour, and yes, I have downloaded 15 files in an hour.

How often should I update the ClamAV virus definitions database?
Normally once or twice a day will be more than enough.
Updating more often only puts unnecessary load on the update servers and doesn't give you any major benefit.
In fact if you set freshclam to update too often, your IP may even be blacklisted by the update servers.
http://osx.topicdesk.com/content/view/77/84/

I believe I read somewhere that checking More than Once an Hour is considered bad but I can't recall where I read it.

scanning a file with out of date AV definitions is naive and dangerous
Of course, who said otherwise, I just don't think it should check for updates with every download.

Tim

Things have got to get better, they can't get worse, or can they?

m-p-3
m-p-3's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 2006-06-17 21:25
Personally, I update

Personally, I update ClamWinPortable at the beginning of the day, so I am sure that everything that is scanned will use an up-to-date virus definition database. This is a daily operation, no need to do it several times a day. After that, I do one memory scan to make sure the computer I am using is safe.

For the rest, I leave it to Download Statusbar and ClamWinPortable to make sure my downloaded files are secure.

I agree with you that an outdated virus definition database is dangerous, but there is no need to verify 10 times a day the update server. (Imagine if everybody would do that, their update servers would be in a world of pain).

I can try to figure out something to automatically update the virus definition once a day.

EDIT: If you want ClamWinPortable to auto-update on launch, you can copy the ClamWinPortable.ini file from %USB%\PortableApps\ClamWinPortable\Other\Source\ClamWinPortable.ini to %USB%\PortableApps\ClamWinPortable\ClamWinPortable.ini, and modify the following line:
AdditionalParameters=--mode=update --close

This will change the startup behavior of ClamWinPortable to auto-update on each launch. However, you won't have the main screen, so you won't be able to access other options like the memory scanner, or file scanner. It's only useful if you plan to keep ClamWinPortable updated quickly, and rely on Download Statusbar scanning feature.

USBman
Offline
Last seen: 2 years 7 months ago
Joined: 2006-10-11 17:43
Point taken

OK - yes, I agree with many of the points that have been brought to my attention.

My concern, obviously, was that having outdated definitions is problematic. My thought was that this could be an an elegant solution to have it auto-update, and remove that concern from the equation.

...and yes, you're right - slamming their servings that frequently would, of course, be a problem. I was running on the assumption that the user would be using this concept with Firefox Portable, that is to say, not their daily use browser, and therefore there wasn't any concern about slamming their servers. ...I, for one, don't use my portable setup everyday, and certainly not that extensively, for what it's worth.

dragonmage
Offline
Last seen: 1 year 11 months ago
Joined: 2007-01-15 02:25
If you happened to know

If you happened to know anyone who wrote firefox extensions, you might get them to make one that would update clamwinportable on ffp launch...

m-p-3
m-p-3's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 2006-06-17 21:25
I actually use several

I actually use several PortableApps applications daily, namely Mozilla Firefox, PuTTY, ClamWin, InfraRecorder.

Being a network administrator in a closed environment, I find them pretty useful to open up a bit the usability of the system, without breaking application compatibility and conformity of the computer.

Patrick Patience
Offline
Last seen: 4 years 11 months ago
DeveloperModerator
Joined: 2007-02-20 19:26
Hidden As Possible?

This is a really great technique, thanks to everyone who contributed to this idea.

I'm trying to make this process as silent as possible. So far I've done simple things like disabling the ClamWin Portable splash screen, and switching Download Statusbar to mini mode. However, does anyone know how to make Clamscan scan the file silently, and then pop up the ClamWin window after scanning? Also, what about passing off all download scans to the currently running ClamWin process?

Sorry if I missed some ideas like this through this thread. Thanks.

m-p-3
m-p-3's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 2006-06-17 21:25
I don't know how to

I don't know how to completely have it silently running. The only thing I use is the --close parameter, so it silently close the scan report if nothing is found.

nicolleen
Offline
Last seen: 4 months 5 days ago
Joined: 2007-03-22 20:09
path

this works all right for me, but only if the drive letter is the same. On my work computer my usb drive has another drive letter, and it does not get corrected. I just get the window that the virus scan was not found.

also, Patrick Patience wrote:
> So far I've done simple things like disabling the ClamWin Portable splash screen, and switching Download Statusbar to mini mode.

How did you get rid of this annoying splash screen with every download?

thanks

Patrick Patience
Offline
Last seen: 4 years 11 months ago
DeveloperModerator
Joined: 2007-02-20 19:26
Simple

As for all apps, go to ClamWinPortable\Other\Source and grab the ClamWinPortable.ini and place it in the same directory as ClamWinPortable.exe (2 directories up). Edit the file setting DisplaySplashScreen to False

nicolleen
Offline
Last seen: 4 months 5 days ago
Joined: 2007-03-22 20:09
yay, cool! I never knew I had

yay, cool! I never knew I had to look for an ini-file in the source folder.
thanks a lot for the quick reply!

m-p-3
m-p-3's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 2006-06-17 21:25
For the path problem, it's

For the path problem, it's actually a bit wierd as mine does get corrected when it change of drive letter.

Other than that, the splash screen issue seems to be resolved from the previous post.

nicolleen
Offline
Last seen: 4 months 5 days ago
Joined: 2007-03-22 20:09
maybe it has to do with

maybe it has to do with vista? my work computer runs on vista and my home one on xp sp3.

Log in or register to post comments