Who's Listening To Your Shared iTunes Music?

With iTunes, it's really easy to make your music and video libraries available so that you can view them from another machine. For whatever reason, though, the good folks at Apple didn't add an option to track who is viewing your library or see what they are listening to.
Last month, I mentioned the *nix lsof command, which allows you to get a listing of all open file handles on a system, including open socket connections. You can use this command line utility to quickly figure out if anyone is connected to your iTunes library and see what mp3 files are being read. Here's how:
Who's connected:
Go to your command prompt and type:
lsof |grep iTunes |grep TCP
You'll see something like this:
iTunes 338 name 16u IPv4 0x37fc710 0t0 TCP *:daap (LISTEN)
iTunes 338 name 17u IPv4 0x2efb920 0t0 TCP 192.168.0.3:daap->192.168.0.8:50565 (ESTABLISHED)
The first line is just your iTunes application listening for incoming connections. The second is another machine with IP address 192.168.0.8 that is connected and browsing the music library. If nobody were connected, you'd just see that first line.
Who's listening?
When another machines iTunes client connects to your library, it first opens up a TCP connection for browsing your music library. When the client chooses to play a file, a second TCP connection is made to transmit that file's data. When you search for TCP connections and someone is actually downloading music, you'll see something like this:
iTunes 338 name 16u IPv4 0x37fc710 0t0 TCP *:daap (LISTEN)
iTunes 338 name 17u IPv4 0x2efb920 0t0 TCP 192.168.0.3:daap->192.168.0.8:50565 (ESTABLISHED)
iTunes 338 name 18u IPv4 0x2dae920 0t0 TCP 192.168.0.3:daap->192.168.0.8:50573 (ESTABLISHED)
Because there are two connections from 192.168.0.8 in this scenario, we know that the remote iTunes client is transferring file data, and not just browsing.
What's being listened to?
Back at the command prompt, run another lsof and look for files that are open in your music library. This assumes that your files are stored in the default iTunes Music directory.
lsof |grep "iTunes Music"
You should see something like this:
iTunes 338 name 17r REG 14,2 5657237 965155 /Users/name/Music/iTunes/iTunes Music/Compilations/Xen Cuts (Disc 3)/3-07 Drunk Trumpet 1.mp3
Now keep in mind, this will list every file that is opened by your iTunes application, whether it's being transmitted over the network or you are listening to it locally. Unfortunately, I don't know of a way to associate a particular file with a particular downloader, but it's not too difficult to figure out unless there are several people connected. If it's just a single user, just look for any files you aren't currently listening to yourself. If you know of an easy way to figure out exactly who is downloading what, please share it in the comments.
Posted by Jason Striegel |
Mar 28, 2007 09:27 PM
iTunes |
Permalink
| Comments (3)
Recent Entries
- Poromenos' hello world curve
- USB CapsLocker and Sun keyboard simulation
- Robosapien has a coil gun
- Faster Windows shutdown
- Assign USB drives to a folder
- Little drummer bot
- CSS ad blocking for Firefox and Safari
- Design Coding: web standards rap
- Shredz64: Guitar Hero for C64
- BATMAN: adhoc mesh routing
Comments
Newest comments listed first.
| Posted by: on December 6, 2007 at 8:02 AM |
i know this is a bit old... but em.. Yeh the command line doesn't work for me! i have vista installed.. ah well!
| Posted by: anonymous on January 5, 2008 at 11:07 PM |
it's a linux command. not for windows. check out window's Process Explorer
| Posted by: anon on February 6, 2008 at 7:16 PM |
it's not a linux command - it's unix for the Mac OS X terminal.
Bloggers
Welcome to the Hacks Blog!
Categories
- Ajax
- Amazon
- AppleTV
- Astronomy
- BlackBerry
- Blogging
- Body
- Cars
- Cryptography
- Data
- Education
- Electronics
- Energy
- Events
- Excel
- Excerpts
- Firefox
- Flash
- Flickr
- Flying Things
- Food
- Gaming
- Gmail
- Google Earth
- Google Maps
- Government
- Greasemonkey
- Hacks Series
- Hackszine Podcast
- Halo
- Hardware
- Home
- Home Theater
- iPhone
- iPod
- IRC
- iTunes
- Java
- Kindle
- Knoppix
- Language
- LEGO
- Life
- Lifehacker
- Linux
- Linux Desktop
- Linux Multimedia
- Linux Server
- Mac
- Mapping
- Math
- Microsoft Office
- Mind
- Mind Performance
- Mobile Phones
- Music
- MySpace
- MySQL
- NetFlix
- Network Security
- olpc
- OpenOffice
- Outdoor
- Parenting
- PDAs
- Perl
- Philosophy
- Photography
- PHP
- Pleo
- Podcast
- Podcasting
- Productivity
- PSP
- Retro Computing
- Retro Gaming
- Science
- Screencasts
- Shopping
- Skype
- Smart Home
- Software Engineering
- Sports
- SQL
- Statistics
- Survival
- TiVo
- Transportation
- Travel
- Ubuntu
- Video
- Virtualization
- Visual Studio
- VoIP
- Web
- Web Site Measurement
- Windows
- Windows Server
- Wireless
- Word
- World
- Xbox
- Yahoo!
- YouTube
Archives
Recent Posts
- Poromenos' hello world curve
- USB CapsLocker and Sun keyboard simulation
- Robosapien has a coil gun
- Faster Windows shutdown
- Assign USB drives to a folder
- Little drummer bot
- CSS ad blocking for Firefox and Safari
- Design Coding: web standards rap
- Shredz64: Guitar Hero for C64
- BATMAN: adhoc mesh routing
www.flickr.com
|





Leave a comment