New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

Dealing with ad ware on Macs


Post Reply New Thread Subscribe

 
Thread Tools
Stefan

 
Stefan's Avatar
 
Member Since: May 09, 2007
Location: UK
Posts: 116
Stefan is on a distinguished road
Mac Specs: 2.16Ghz Mac Book Pro

Stefan is offline
We're all well aware of the Mac's security when it comes to viruses but what about ad ware, trackers and all those other nasties that come with browsing the net? I use Ad-Aware SE on my PC which searches for things like tracking cookies, ad ware etc. Are Macs vulnerable to these as well. If so can anyone recommend any software for dealing with it? I did a quick scan on my PC last night and found 103 nasty little cookies and trackers - i certainly dont want these on my nice MBP.

"Id rather have a bottle in front of me than a frontal lobotomy"
QUOTE Thanks
mac57

 
mac57's Avatar
 
Member Since: Apr 29, 2006
Location: St. Somewhere
Posts: 4,560
mac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant future
Mac Specs: iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM

mac57 is offline
Tracking cookies and the like are an ongoing nuisance that Mac OS X can't protect you from. The only answer that I am aware of is to diligently clean up your cookies on a regular basis.

For myself, being Linux friendly, and thus Terminal.app friendly, I have written a small Terminal script that does this for me. What I did was manually clean up my cookies until there were just the ones there that I wanted to preserve long term (things like my Mac Forums cookie, certain bank site cookies and so on). Then I went into my Firefox directory (I use Firefox pretty exclusively these days) and made a copy of my cookies.txt file (where Firefox keeps the cookies) called cookies.persist.txt. Then I wrote a small Terminal script called "clean" which basically reverses this process - it copies cookies.persist.txt to cookies.txt, thus wiping out the daily accumulation of cookies with just the ones I want to keep permanently.

I take care to run this "clean" script at last once daily, and frequently more often than that. I could automate the running of it via cron, but I am in and out of Terminal so much that this step has never seemed necessary for me.

I have enhanced this "clean" script over time so that it cleans up all sorts of accumulating rubbish - thumbnail caches, recently used file lists, bash history and so on. Keeps everything slim and running quickly.

BTW, this same approach can be used for Safari, except that instead of cookies.txt in a Firefox dir, you make a copy of Cookies.plist in your home folder's Library/Cookies folder.

My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
I was on the Mac-Forums honor roll for September 2007
QUOTE Thanks
knightlie

 
knightlie's Avatar
 
Member Since: Mar 22, 2007
Location: UK
Posts: 1,463
knightlie is just really niceknightlie is just really niceknightlie is just really niceknightlie is just really nice
Mac Specs: Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen

knightlie is offline
Could you post that script?

[URL="http://beadia.net"]Beadia[/URL - Jewelry Business Management Software]
I judge you when you use poor grammar.
QUOTE Thanks
cwa107

 
cwa107's Avatar
 
Member Since: Dec 20, 2006
Location: Middletown, Pennsylvania
Posts: 26,632
cwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond repute
Mac Specs: 15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 SSD

cwa107 is offline
I too would be interested in that script, if you wouldn't mind posting it, Mac57.

Also, just wanted to add that to date, there is no executable spyware/grayware/adware for OS X.

Liquid and computers don't mix. It might seem simple, but we see an incredible amount of people post here about spills. Keep drinks and other liquids away from your expensive electronics!
QUOTE Thanks
baggss

 
baggss's Avatar
 
Member Since: Oct 10, 2004
Location: Margaritaville
Posts: 10,308
baggss has a reputation beyond reputebaggss has a reputation beyond reputebaggss has a reputation beyond reputebaggss has a reputation beyond reputebaggss has a reputation beyond reputebaggss has a reputation beyond reputebaggss has a reputation beyond reputebaggss has a reputation beyond reputebaggss has a reputation beyond reputebaggss has a reputation beyond reputebaggss has a reputation beyond repute
Mac Specs: 27" 3.4 Ghz i7 iMac-13" C2D Macbook-OSX 18.8.2-64Gb iPad 2-32 Gb iPhone 5-ATV 2-14Tb of Storage

baggss is offline
I suppose if you are really paranoid about cookies, you could just turn them off in the browser prefs.


QUOTE Thanks
mac57

 
mac57's Avatar
 
Member Since: Apr 29, 2006
Location: St. Somewhere
Posts: 4,560
mac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant future
Mac Specs: iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM

mac57 is offline
Hi All, as requested, here is the script:

Code:
# Script to clean up cached data items that tend to accumulate over
# time on the computer. Cleans several things:

# 1. Clean up cached thumbnails

# 2. Clean up the .bash_history file

# 3. Clean up "recently used" accumulators, playlist histories, etc.

# 4. One step clean up of Firefox cookies, histories, etc.

# 5. One step cleanup of Safari cookies, histories, etc. 

# 1. Thumbnails

rm -f /Users/mac57/.thumbnails/large/*
rm -f /Users/mac57/.thumbnails/normal/*

# 2. Bash History

rm -f /Users/mac57/.bash_history

# 3. Various "Recently Used" trackers, playlist histories, etc.

rm -rf /Users/mac57/.recently-used
rm -rf /Users/mac57/.gqview/history
rm -rf /Users/mac57/.gqview/thumbnails
cp -f  /Users/mac57/.gimp-2.2/documents.persist /Users/mac57/.gimp-2.2/documents

cd /Users/mac57/Library/Preferences
cp "Windows Media Player Prefs-default.txt" "Windows Media Player Prefs"
cd

# 4. Firefox cookies, downloads, history - one step cleanup

cd /Users/mac57/Library/Application\ Support/Firefox/Profiles/sy0jbj2k.default
cp cookies.persist.txt  cookies.txt
cp downloads.clear.rdf  downloads.rdf
cp history.clear.dat    history.dat

# 5. Safari cookies, downloads, history, cache - one step cleanup

cd /Users/mac57/Library/Cookies
cp cookies.persist.plist cookies.plist
cd /Users/mac57/Library/Safari
cp Downloads.plist.persist Downloads.plist
cp History.plist.persist History.plist
cd /Users/mac57/Library/Caches
rm -rf Safari
mkdir Safari

# Display the result

echo " "

echo "Caches Cleared - Disk Utilization:"
echo "Filesystem                Size   Used  Avail Capacity  Mounted on"
df -h | grep -i disk

echo " "
Note that you will need to change the references to "mac57" to your userid, and you will also need to change the name of the Firefox sub directory where it keeps all the cookies etc. to match your system.

Also note that I have taken the same approach to Firefox/Safari history and download lists as I have to cookies, saving off a standard minimal one (always named like "something.persist.txt") and then overwriting the existing one with it. In order for this script to work "as is" for you, you will need to do the same.

Also, I have GIMP loaded on my machine, and have included it's documents list in the clean up too. If you don't have GIMP on your machine, just delete that part of the script.


To use this script, copy and paste it into a simple text file, and save that file in your home folder as filename "clean" (or whatever name you like). If you are an advanced user and have your own personal bin folder, place it there. If you are not, your home directory is just fine, and is what is assumed in the below.

Now open a Terminal.app session. Type in "ls" and Enter and you should see your script file there in the list of files. Type the following to make the script executable:

Code:
chmod +x clean
Thats it - all ready to use.

From now on, when you want to clean out your Firefox, Safari, etc. caches, just startup Terminal.app and type:

Code:
./clean
As a useful data point, this script prints out your disk usage at the end. You likely won't see it change as a result of this script running, but when I first put the script together, I thought I might, and I have liked to see the result ever since, so I leave it there.

Enjoy! ...and let me know if you have any questions.

My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
I was on the Mac-Forums honor roll for September 2007
QUOTE Thanks
cwa107

 
cwa107's Avatar
 
Member Since: Dec 20, 2006
Location: Middletown, Pennsylvania
Posts: 26,632
cwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond repute
Mac Specs: 15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 SSD

cwa107 is offline
Quote:
Originally Posted by mac57 View Post
Hi All, here is the script:
Ugh... virtual rep to you, sir - need to spread it around. Thanks a lot.

Liquid and computers don't mix. It might seem simple, but we see an incredible amount of people post here about spills. Keep drinks and other liquids away from your expensive electronics!
QUOTE Thanks
knightlie

 
knightlie's Avatar
 
Member Since: Mar 22, 2007
Location: UK
Posts: 1,463
knightlie is just really niceknightlie is just really niceknightlie is just really niceknightlie is just really nice
Mac Specs: Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen

knightlie is offline
Quote:
Originally Posted by cwa107 View Post
Ugh... virtual rep to you, sir - need to spread it around. Thanks a lot.
Same here. That's a great help, mac57. Does the ~ thing for your home folder work in terminal scripts?

[URL="http://beadia.net"]Beadia[/URL - Jewelry Business Management Software]
I judge you when you use poor grammar.
QUOTE Thanks
CArmstrong

 
CArmstrong's Avatar
 
Member Since: Feb 25, 2007
Location: Pittsburgh, PA, USA
Posts: 116
CArmstrong is on a distinguished road
Mac Specs: PowerBook G4 15" 1GHz 768MB 60GB

CArmstrong is offline
Excellent script! And knightlie, ~ should indeed reference your home directory.

"Excuse me, does this effectively hide my thunder?" - Tobias Fünke, Arrested Development
QUOTE Thanks

Post Reply New Thread Subscribe


« Using Bonjour with a Imac and Win xp box for printing | Problems using HTML with Entourage »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 05:29 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?