Item spying is accomplished with various 3rd party programs. The program works by intercepting and decoding some of the game information held by the Battle.net computers that host online games of Diablo II. The game (obviously) knows what each character in the game is wearing, and uses that information in all player interactions and calculations. Item Spy programs peek at and decode this information, and tell the person running the program what everyone else in the game is using for equipment.
This isn't much of a hack itself, though it's a way to cheat by gaining an unfair advantage when dueling or PKing. It becomes a hack when people attempt to combine item spying with some social engineering. Some of those methods are detailed below, in posts excerpted from the warnings archives.
November 22, 2002
This one has been around forever, scroll down to see our Warning about it from May, but since we're getting a lot of new questions about it, we'll post it again. The hack is a program that intercepts and decodes packets from the server, and lets the cheater see every item that every character in the game is wearing. The game has to know this to calculate your hps, mana, resistances, etc, so it's just a matter of catching the packet with that info and decrypting it.
There is nothing a cheater can do with this info to rip you off, it's just a way to be nosy, or get an advantage in a duel. Some cheaters will try to tell you they can steal your equipment and freak you out by saying exactly what you are wearing, but you can ignore them. This is also used in a social engineering scam where a person will pretend to be a friend and tell you what you're wearing, saying that you showed them the other day. Always be sure a person is who they say they are; and don't trust them just because they know your equipment.
Item Spy Hack
May 23, 2002
This one has been reported for the last month or so. There's a hack out there that lets players see exactly what you are wearing in a realm game. The information on your equipment is transferred to other players along with the appearance of it, and someone figured a way to make that info display for other players. This isn't of any practical use other than possibly in dueling, and most players are just using it to be nosy.
We've heard of some attempted scams, such as a stranger pretending to be a friend on another account and telling you your equipment so you'll trust them. Other players will pretend they can hack your account, or steal your equipment, and they'll tell you what the stats on your rare ring or amulet are to try and be scary. Squelch the troll, they can't do anything to you but talk. The only chance you have of being hacked is if you try to DL the item-spy hack yourself, when you'll probably get a backdoor or trojan in the process.