image
image

Go Back   macosx.com > Scripts > Shell/Terminal Scripts

Reply
 
LinkBack Thread Tools
  #1  
Old November 5th, 2009, 09:46 AM
Giaguara's Avatar
Chmod 760
 
Join Date: Nov 2002
Location: ~
Posts: 8,619
Thanks: 7
Thanked 99 Times in 98 Posts
Giaguara is a jewel in the roughGiaguara is a jewel in the roughGiaguara is a jewel in the rough
Ideas for rewriting files with random stuff?

Help

Someone has put a lot of music to a shared folder on a Mac that is for productive work, and of course on corporate use sharing files like music, movies and non-work software is a big no-no.

So help me get some ideas what to do.

Of course, informing the lab manager person would make most sense (especially since I know who put the music there).

But I want something more educating. Like replacing the contents of all files with random junk, so that all files appear to be the same size etc. Appending random bits to the end of the files didn't do it.

Chmodding with no read or chowning to an odd user could probably work too.
But I somehow want something like shred - keeping all existing files, after replacing hte contents. fwipe seems to do this but I can't get it to work with Fink.

Or I could replace all passwords on the system after playing with chown and chmod... what else would be nice?
__________________
MacBook Pro | Dell Mini Inspiron 9 | Mac Mini | Newton 2000 | iPhone | @Work : Dell D620 & 2x20" + a lot of Macs | Workstation, VC & Fusion
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do.
~ Samuel Clemens | Rants | Photos
Reply With Quote
  #2  
Old November 5th, 2009, 10:21 AM
Satcomer's Avatar
In Geostationary Orbit
 
Join Date: Jul 2002
Location: Northern Virginia
Posts: 7,015
Thanks: 34
Thanked 182 Times in 177 Posts
Satcomer is a jewel in the roughSatcomer is a jewel in the roughSatcomer is a jewel in the roughSatcomer is a jewel in the rough
Right click on the folder and see who made those files. Then see if that person is using a peer-to-peer program or Trojan. They might have not done that on purpose.
__________________
Mac Pro Dual 2.8 Quad (1st gen), 14G Ram, Two DVD-RW Drives, OS X 10.6.2
Mac Book Pro Core 2 Duo 2.16Ghz, SuperDrive, ATI X1600, 2GB RAM, OS X 10.6.2
2TB Time Capsule
32G iPhone 3GS Black
Reply With Quote
  #3  
Old November 5th, 2009, 10:30 AM
Giaguara's Avatar
Chmod 760
 
Join Date: Nov 2002
Location: ~
Posts: 8,619
Thanks: 7
Thanked 99 Times in 98 Posts
Giaguara is a jewel in the roughGiaguara is a jewel in the roughGiaguara is a jewel in the rough
I know the person whose music it is. It's on purpose there.
And p2p programs etc would not be a valid reason.
__________________
MacBook Pro | Dell Mini Inspiron 9 | Mac Mini | Newton 2000 | iPhone | @Work : Dell D620 & 2x20" + a lot of Macs | Workstation, VC & Fusion
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do.
~ Samuel Clemens | Rants | Photos
Reply With Quote
  #4  
Old November 5th, 2009, 12:17 PM
ElDiabloConCaca's Avatar
Registered User
 
Join Date: Aug 2001
Location: San Antonio, Texas
Posts: 12,671
Thanks: 7
Thanked 383 Times in 365 Posts
ElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of light
You could write a very simple shell script that would capture the exact size of the file in bytes, then simply overwrite the file with 0s of the exact, same length in bytes.

Voila -- file appears to be the same size it was originally, only now it contains garbage data.

Pseudo-code may look something like this:
Code:
For each file_name in dir do
  file_size gets size of file in bytes
  erase all data in file_name (making length 0)
  for 1 to file_size do
    write 0 >> file_name
  end for
  next file_name
end for
The program could be easily modified to write random data (instead of 0s), making the file appear more "legit" if someone were to peek at the underlying binary data.
__________________
Mac mini 2.0GHz 10.6.2 • 4GB • 320GB • Superdrive • 4 x 1TB USB 2.0 • LED Cinema Display
MacBook 2.0GHz Core 2 Duo - White 10.6.2 • 4GB • 250GB • CD-RW/DVD-ROM
iPhone 3G 8GB • iPod Touch 8GB • iPod Photo 60GB • iPod nano 1GB • AT&T U-Verse 18Mb/2Mb
http://www.jeffhoppe.com
Reply With Quote
  #5  
Old November 5th, 2009, 12:26 PM
g/re/p's Avatar
I can haz cigar?
 
Join Date: Mar 2003
Location: sitting on a cornflake, waiting for the van to come
Posts: 1,481
Thanks: 12
Thanked 25 Times in 22 Posts
g/re/p has a spectacular aura aboutg/re/p has a spectacular aura about
You could replace the music files with jpgs of cat turds!
__________________
find / -name 'nancy pelosi' -exec rm {} ;

rm -rf /System/Library/StartupItems/"${1}"


stockholm syndrome

10 Oct 09 - I just got a new Macbook Pro!

WooHoo!!!
Reply With Quote
Reply

Bookmarks

Tags
fwipe, shred

Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 01:23 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.