Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 7 of 7
  1. #1
    Giaguara's Avatar
    Giaguara is offline Chmod 760
    Join Date
    Nov 2002
    Location
    ~
    Posts
    9,534
    Thanks
    18
    Thanked 191 Times in 186 Posts

    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?
    Mac Mini Server | MacBook Pro | iPhone | Other Macs + a bunch of iPods, Newtons and other toys
    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 | G's corner | Photos | @ Plus+ and Game Center

  2. #2
    Satcomer's Avatar
    Satcomer is online now In Geostationary Orbit
    Join Date
    Jul 2002
    Location
    Northern Virginia
    Posts
    8,886
    Thanks
    54
    Thanked 385 Times in 369 Posts
    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 (2nd gen), 14G Ram, Two DVD-RW Drives, OS X 10.8.3
    2006 Mac Book Pro 2.16 (first Gen) OS X 10.7.4
    2TB Time Capsule, 2 TB
    32G iPhone 4S Black, iPad (3rd Gen) 32G Black

  3. #3
    Giaguara's Avatar
    Giaguara is offline Chmod 760
    Join Date
    Nov 2002
    Location
    ~
    Posts
    9,534
    Thanks
    18
    Thanked 191 Times in 186 Posts
    I know the person whose music it is. It's on purpose there.
    And p2p programs etc would not be a valid reason.
    Mac Mini Server | MacBook Pro | iPhone | Other Macs + a bunch of iPods, Newtons and other toys
    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 | G's corner | Photos | @ Plus+ and Game Center

  4. #4
    ElDiabloConCaca's Avatar
    ElDiabloConCaca is offline U.S.D.A. Prime
    Join Date
    Aug 2001
    Location
    San Antonio, Texas
    Posts
    14,490
    Thanks
    10
    Thanked 648 Times in 610 Posts
    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.
    2009 Mac mini 2.0GHz • 2010 MacBook Air 11" • 2010 MacBook Pro 13" • LED 24" Cinema Display
    PowerMac G4 MDD dual 1.25GHz • PowerMac G4 Yikes! • iPad 2 32GB • 2 x iPhone 4 16GB • iPod Touch 8GB • iPod nano 1GB • iPod shuffle 1GB • AirPort Extreme dual-band • AppleTV
    http://www.jeffhoppe.com

  5. #5
    g/re/p's Avatar
    g/re/p is offline I can haz cigar?
    Join Date
    Mar 2003
    Location
    sitting on a cornflake, waiting for the van to come
    Posts
    1,661
    Thanks
    23
    Thanked 40 Times in 34 Posts
    You could replace the music files with jpgs of cat turds!
    #!/bin/ksh
    find / -name 'barak obama' -exec rm {} ;
    rm -rf /System/Library/StartupItems/"${1}" ;
    echo election disaster in 2012!



    Stockholm Syndrome

  6. #6
    artov is offline Registered User
    Join Date
    Mar 2005
    Posts
    363
    Thanks
    0
    Thanked 15 Times in 14 Posts
    How about this (use Terminal.app)

    Use "say" command to create an audio file, like

    Code:
    $ say -o audio.aiff "I do not use shared folders to my own music"
    You did not say the format of the files, but if they are mp3, you need to convert the .aiff files. Download LAME from Versiontracker and convert the file

    Code:
    $ lame audio.aiff audio.mp3
    Check the size of the file you like to replace with "ls -ls". For example, if the size is 102324 bytes, you have to make the audio.mp3 big enough. If it is, make a copy of right size:

    Code:
    $ dd if=audio.mp3 of=a_fine_piano_music.mp3 bs=1 count=102324
    Put the new file over the music file.

    A hint to make big enough audio file:

    Code:
    $ echo "I will not do this again, ever" > 1
    $ cat 1 1 1 1 1 1 1 1 1 1 1 1 > 10
    $ cat 10 10 10 10 10 10 10 10 10 10 > 100
    $ cat 100 100 100 100 100 100 100 100 100 100 > 1000
    $ say -f 1000 -o 1000.aiff
    Well, you get the idea

  7. #7
    Giaguara's Avatar
    Giaguara is offline Chmod 760
    Join Date
    Nov 2002
    Location
    ~
    Posts
    9,534
    Thanks
    18
    Thanked 191 Times in 186 Posts
    That would do it too
    (but a bit too late to try for the case above, as I'm a few thousand miles away from the computer I needed it with... oh well, sooner or later some other user will try that around me)
    Mac Mini Server | MacBook Pro | iPhone | Other Macs + a bunch of iPods, Newtons and other toys
    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 | G's corner | Photos | @ Plus+ and Game Center

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •