Andthen something different fluttered by: :3lph_!~3lph_@timmy.edu PRIVMSG dw0rf :sup punk :dw0rf!~dw0rf@genome.nx PRIVMSG 3lph_ :0wned that warez site last night :3lph_!~3lph_@timmy.edu
Trang 1Business as Usual?
Jane: “Sally, did you notice anything odd this morning on the voicemailintroduction.You know, right before you press 2 for your messages?”
Sally: “No, I didn’t I haven’t checked mine yet.”
Jane: “It said something about ‘My kung-fu is greater than yours.’ Doyou know what that means?”
Sally: “Nope It must be the guys in telecom goofing off again Ohwell Did you hear about the storm coming our way?”
Trang 3The hour was 3:00 A M Elena sat staring at her laptop.
It being the only light source in the room for the lastthree hours, her attempts at sleep were cut short by thelingering anti-flicker under her closed eyelids…
Chapter 9
211
Trang 4(She laughed at the thought—was this a bug, or an “undocumented feature”
in her occipital lobe?) Her eyes danced a frenetic, analog tango; saccades tering, as thought after thought evaded coalescence on the question, let aloneits answer Amidst a dozen windows, each filled with the textual detritus ofcommand-line repartee, there was one that caught her attention, draped innothing but a single character
skit-#
Root—complete access to whatever system one was so privileged tojoin.The kind of hash that script kiddies smoked If only absolute trust was
so easy to detect in the real world, or for that matter, that easy to acquire
“Do you accept this woman to be your lawfully wedded wife?”
in a 120-part, massively surround-sound symphony “Flight of the Valkries”—
of course, Apocalypse Now style, with helicopters swirling across every node—
had never sounded better, especially in the middle of a midterm
She might have gotten in some serious trouble, had it not been for thedeft suggestion that “Real-time Mixing of Massively Surround Sound within
a Hostile Network” might bring tenure to her (associate) professor Even hewas impressed that the system could seamlessly adapt to any particular hostdropping out of the ad-hoc orchestra, its fallen instruments or silenced con-ductor’s wand immediately resurrected on a nearby host (He was less
impressed by Elena’s use of Elmer’s Glue to lock the volume knob in place
By the time she had picked that lab clean, it looked like somebody hadmolted his skin into the garbage can.)
Trang 5Mirror, Mirror on the Wall
But history would not explain what was going on now Maybe it had thing to do with the kiddies? The shell was on a honeypot machine, set up
some-to specifically allow monisome-toring of “attackers in the wild” (Elena would notcompliment them by calling them hackers, nor insult herself by calling themcrackers.) Hmmm… what was bouncing around the honeynet, anyway? Shecould run a sniffer and see addresses bounce to and fro
Most people used tcpdump She usually preferred the vastly more elegantEthereal, in its tethereal text mode, no less (She had learned many a pro-tocol on the back of tethereal –V, which dumped multipage breakdowns ofevery last whisper on her network.) But on this occasion, a much moredirect order was required, made possible by a tool called Linkcat (lc)
Trang 6Cisco Internetwork Operating System Software
IOS (tm) C2900XL Software (C2900XL-H-M), Version 11.2(8)SA2, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-1998 by cisco Systems, Inc.
Compiled Fri 24-Apr-98 10:51 by rheaton
cisco WS-C2924C-XLv
GET / HTTP/1.0
Host: www.doxpara.com
Accept: text/html, text/plain, text/sgml, */*;q=0.01
Accept-Encoding: gzip, compress
Accept-Language: en
User-Agent: Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6 HTTP/1.1 200 OK
Date: Mon, 07 Apr 2003 13:53:30 GMT
Server: Apache/1.3.26 (Unix) DAV/1.0.3 PHP/4.3.1
Trang 7faes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-yourmom2 yourmom2 JlJmIhClBsr JlJmIhClBsr EJEDEFCACACACACACACACACACACACACA FHEPFCELEHFCEPFFFACACACACACACABO
\MAILSLOT\BROWSE JlJmIhClBsr JlJmIhClBsr g,QString,QString,QSZ ECFDEECACACACACACACACACACACACACA ECFDEECACACACACACACACACACACACACA
H ECFDEECACACACACACACACACACACACACA EBFCEBEDEIEOEBEEEPFICACACACACAAA
On and on it went, electronic whispers plucked en masse from theaether Protocols aren’t really anything more than ways for the disconnected
to connect to each other.They exist among people as much as they do tronically (It’s an open question which type of protocol—human or com-puter—is harder to support.) Most electronic protocols don’t stick to lettersand numbers that humans can read, making it pretty simple, given all thebytes off the wire, to read only that information written in the language ofpeople themselves Elena vegged to the half dozen protocols, stripped of theirparticular identity into only what she might have the sense to read
elec-A Cisco switch announced to the world that it, indeed, existed, thanks tothe heroic compilation of R Heaton A Web page was pulled down Someother device issued universal Plug and Play commands, seeking a neighbor toplay with (and potentially get plugged by, as the most serious Windows XPexploit showed) SSH2—secure shell, version 2—was rather chatty about itsplanned crypto exchange, not that such chattiness posed any particular threat
And then there was SMB
When Good Packets Go Bad
SMB, short for Server Message Block, was ultimately the protocol behindNBT (NetBIOS over TCP/IP), the prehistoric IBM LAN Manager, heir-apparent CIFS, and the most popular data-transfer system in the world short
Trang 8of e-mail and the Web: Windows file sharing SMB was an oxymoron—
powerful, flexible, fast, supported almost universally, and fucking hideous in every way shape and byte Elena laughed as chunkage like ECFDEECACACA-
CACACACACACACACACACA spewed across the display
Once upon a time, a particularly twisted IBM engineer decided that this
First Level Encoding might be a rational way to write the name BSD.
Humanly readable? Not unless you were the good Luke Kenneth CassonLeighton, co-author of the Samba UNIX implementation, whose ability tofully grok raw SMB from hex dumps was famed across the land, a post-modern incarnation of sword-swallowing
Quelle Horreur!
This wasn’t the only way to sniff Chris Lightfoot’s Driftnet ( parrot.com/~chris/driftnet) had achieved some popularity Inspired by theMac-only EtherPEG (http://www.etherpeg.org), it spewed not text, but
Trang 9http://www.ex-actual images and mp3s screaming through the network.This was great fun
at wireless Internet-enabled conferences.The weblogger types had christened
it the greatest method invented for tapping the collective attention span ofaudience members (As a cross between columnists, exhibitionists, and vigi-lante quality assurance, the webloggers were always keenly interested in WhoWas Hot and Who Was Not.)
But as particularly applies to reading minds, be careful what you wish for,
or you just might get it Elena wouldn’t launch Driftnet at gunpoint
Although she refused to talk about the circumstances of her phobia, it ably had something to do with that unfortunate multimedia misadventureinvolving Britney Spears and a goat One was the visual, and the other wasthe mp3, but damned if Elena would tell anyone which was which
prob-Driftnet
Paketto’s Linkcat was a hell of a lot safer
Trang 10Authorspeak: Paketto Borne
It was in November 2002 that I released the first version of the Paketto
Keiretsu (http://www.doxpara.com/paketto) It was “a collection of tools thatuse new and unusual strategies for manipulating TCP/IP networks.” At leastone authority had called them “Wild Ass,” but I was left with no small
amount of egg on my face after a wildly bombastic original posting on thatgeek Mecca, Slashdot.org A much more rational index had been posted onFreshmeat It read as followed:
The Paketto Keiretsu is a collection of tools that use new and unusual strategies for manipulating TCP/IP networks They tap functionality within existing infrastructure and stretch protocols beyond what they were originally intended for It includes Scanrand, an unusually fast network service and topology discovery system, Minewt, a user space NAT/MAT router, linkcat, which presents an Ethernet link to stdio, Paratrace, which traces network paths without spawning new
connections,and Phentropy, which uses OpenQVIS to render arbitrary amounts of entropy from data sources in three dimensional phase space.
Paketto was an experiment No, it was more than that It was a collection
of proof of concepts—an attempt to actually implement some of the
amusing possibilities I’d talked about at that perennial agglomeration of
hackers, hangers on, and Feds: DEF CON 10, with “Black Ops of TCP/IP.”
It was an entertaining experience and quite educational Apparently, a pack of Coronas beats a Windows laptop on auto-suspend, when the judgesare a 500-strong crowd of hackers, hax0rz, and all the Feds in between
12-And They Say We’re Social Creatures
Elena sighed She saw nothing, just the generic chatter of networks Andthen something different fluttered by:
:3lph_!~3lph_@timmy.edu PRIVMSG dw0rf :sup punk
:dw0rf!~dw0rf@genome.nx PRIVMSG 3lph_ :0wned that warez site last
night
:3lph_!~3lph_@timmy.edu PRIVMSG dw0rf :Big man taking out the WinME :dw0rf!~dw0rf@genome.nx PRIVMSG 3lph_ :WinME, ServU, GoodBI
Trang 11:3lph_!~3lph_@timmy.edu PRIVMSG dw0rf :Mommy mommy, it’s a dead horse, why won’t the big bad man stop beating it
:dw0rf!~dw0rf@genome.nx PRIVMSG 3lph_ :Dude don’t make me telnet in and 0wn j00
:3lph_!~3lph_@timmy.edu PRIVMSG dw0rf :TELNET?!?! Ahhaha :dw0rf!~dw0rf@genome.nx PRIVMSG 3lph_ :ARE YOU THREATENING ME??!!
:3lph_!~3lph_@timmy.edu PRIVMSG dw0rf :excuse me, you interrupted me
now, as I was saying, ahahhahahahahhahahahahahahahhahahahahhaha
Ah, the old school Internet Relay Chat—IRC! It was much more able under the Linkcat hack than Yahoo and AIM; there was no need forDug Song’s msgsnarfto demunge the traffic Elena laughed Apparently, one
read-of the (many) intruders on this network had actually set up an IRC serverfor himself and all of his friends to hang out in Oh well, that was the pur-pose of this honeynet: Find out what people are up to and get a heads-up onjust how dangerous the net really might be Rumors that Elena’s honeynethad anything to do with the constant stream of first-run movies andSimpsons episodes that magically appeared on its 250GB Maxtor withoutElena lifting a finger were completely unfounded
Elena peered back at the screen
:3lph_!~3lph_@timmy.edu PRIVMSG dw0rf :prove it!
:dw0rf!~dw0rf@genome.nx PRIVMSG 3lph_ :spar?
:3lph_!~3lph_@timmy.edu PRIVMSG dw0rf :spar!
:dw0rf!~dw0rf@genome.nx PRIVMSG 3lph_ :sure :-)
WTF? Elena threw on a chat filter and sat back to watch 3lph_ anddw0rf (Tolkien would be proud) fight over a remote connection to a com-mand prompt
Round One: Fight!!!
*dw0rf* i telnet in
*3lph_* i sniff your password
*dw0rf* i switch to OPIE one time passwords
*3lph_* i wait until you telnet in and hijack your connection using Ettercap
*dw0rf* i notice you kicked me off
*3lph_* i hijack your connection, but instead of kicking you off, i
Trang 12inject the commands of my choosing
*dw0rf* i take comfort in the fact that you can only do this while I’m logged in
*3lph_* i take comfort in the fact that i converted an entire rootkit to text form using uuencode, transferred it over the text link, uudecoded
it, and can now get in any time i want
*dw0rf* i switch to OpenSSH
*3lph_* i applaud your adoption of clue
*dw0rf* i set up public keys
*3lph_* i trojaned ssh-keygen to only generate prime numbers within a obscure but trivially crackable domain; all your RSA belongs to me
*dw0rf* i download a new build of OpenSSH
*3lph_* i hijack the download of your new build of OpenSSH and add a rootkit to the configure script inside the gzipped tarball
*dw0rf* i thought you might, so i ordered the CDs straight from Redhat
*3lph_* i cancelled your order and mailed you custom burned CDs myself, trojaned out-of-the-box for my owning pleasure
A port scan? There?
Trang 13Knock, Knock
Port-scanning is a curious construct A brute-force method of discoveringavailable network services, simply by asking for them and noting theresponse, it’s compared to an entire range of behaviors, legitimate and maybeless so: looking through a window, rattling a door handle, knocking ondoors, or taking a survey Elena didn’t pay too much attention to the legalrigmarole Whatever port-scanning was, it sure as hell wasn’t particularlystealthy At the end of the day, port-scanning involved dumping traffic on awire, screwing up (after all, if you already knew what was open, therewouldn’t be much of a point in sending out a probe), and, oh yeah, leaving areturn address for responses to come back to
Quirky packet tricks with names like XMAS and Stealth-SYN had longsince failed to hide anything.They were left-hand-blind-to-the-right-hand-style stunts that relied on the core kernel of the system doing somethingwhile not informing user software that anything was done—a sort of “silent-but-deadly” failure mode Disabused of the notion that the kernel could betrusted to recognize the harbingers of its own demise, user software nowsniffed the network directly to determine what was going on
That’s not to say people didn’t still try to sneak scans under the radar
One popular approach was to hide their identity, masking their requestsamong dozens of false decoys, creating plausible deniability at the expense ofvastly reduced network bandwidth
It turned out this didn’t work very well.The nmap tool—the Rolls Royce
of port-scanners, written by the “Gnuberhacker” Fyodor—would often bepressed into decoy mode, like so:
nmap –Dmicrosoft.com,yahoo.com,playboy.com you.are.so.0wned.com
That would scan you.are.so.0wned.com, while setting up apparent decoyscans from Microsoft, AOL, and Yahoo.This led to amusing multiple-choicequestions like:
83 You’ve just received a port-scan from four IPs.You suspect the fourscans are actually one scan with three decoys, due to the precise syn-chronization of the start-and-stop points of the scan After resolvingall four IPs back to their source, you determine that three of the IPs
Trang 14were decoys and one was legitimate Which of the four hosts ably sent the scan?
through logs, seeing who was breaking into what, the attacker might gettipped off (Checking whois records against ARIN, the IP allocation agency,was much safer, though potentially less accurate.) But DNS cuts both ways,and while name resolution isn’t critical to detecting an attack, it is oftenemployed to mount attacks
Unlike the Internet routes by name, addresses are immediately converted
to IP, and somebody needs to do that conversion While a couple attackersare able to run a DNS infrastructure, almost all defenders ultimately havecontrol over their name servers So of the four decoy IPs, the one that actu-ally resolved you.are.so from 0wned.comwas the attacker Duh
Of course, decoy-scanning could include decoy DNS requests, or possibly
even have the scanner able to manually bounce its requests off arbitrary DNSservers But it was, at best, a losing arms race
Who’s There?
At this point, Elena had many questions and precious few answers.Theheavily firewalled backup network—sadly, without the time-controlledincoming access mandated by the physical security playbook—had just sentout a distress signal of Elena’s creation Apparently, something was lookingaround Now, it could have been anything from a random engineer playingwith a new scanning tool to a Trojaned machine, to yet another departmentlooking to usurp network awareness responsibilities from their rightful placebehind her eyeballs She analyzed the network alert:
Router ARP Flood Detected (Possible Remote Portscan)
245 IP->MAC lookups on subnet of 254 IPs
Trang 15120 missing MAC->IP translations 10.10.8.0/24 (internal.backup)
Once Elena had learned about the “accidental” DNS traffic that a simplescan might spawn, it was only a matter of time before she looked for otherlayers that might leak useful information DNS transformed addresses fromthe long, human-readable names users saw in their applications (layer 7) tothe short, machine-routable addresses (layer 3) that wound their way aroundthe net It was necessary because the net, as a whole, didn’t grok names ButEthernet didn’t grok IP addresses either Ethernet needed to use theseslightly longer but globally unique addresses known as MACs
Whenever a packet was destined not for some faraway host, but instead,
to a neighbor on the local network, ARP—the Address ResolutionProtocol—would translate the machine-routable addresses (layer 3) to glob-ally unique addresses (layer 2) ARP would do so by broadcasting a request,and in doing so, it could be used to expose the behavior of an impatientinterloper Mass scans had unexpected side effects (another blade that cutboth ways, actually), one of which was causing a router to ARP for a largenumber of hosts simultaneously, all on broadcast.Therein lies the advantage:
The host on which Elena had installed an ARP monitor lived on a switchednetwork She couldn’t convince the nimrods at IT to install an inline IDS onwhat was obviously an important resource Without the inline IDS, and withthe network switching traffic so she might see only frames destined for hernetwork card, how could she detect her neighbors being scanned? She
couldn’t, but she could watch the router react to carrying the scans, because it
was broadcasting to anyone who would listen that it needed a huge number
of addresses resolved ASAP
That was the trigger—the oddity that demanded her interest.The nextcouple hours were consumed by the drudgery of examining the logs, fil-tering out the known, identifying the unknown, and tracing the attacker
This was the part of security work that paid the bills, the spiritual inverse ofdumpster diving But eventually, the problem was traced to a single IP:
10.10.250.89.That was the good news.The bad news was that Elena had to
find this host, fast, because it had apparently been used to install backdoors
on machines throughout the company Plus, all backdoored hosts needed to
be located and cleansed It was amusing that the kid was using port 31337
Luckily, he wasn’t the only one who could wield a scanner
Trang 16Scanrand was an experiment—a very simple, very successful experiment,with a cryptographic edge rare in this kind of network code, but an experi-ment nonetheless Port-scanning was historically implemented using oper-ating system resources.The operating system kernel would be asked toinitiate a connection to a given port, and after some amount of time, eitherthe connection would work or it wouldn’t work.Then you would moveonto the next host/port combination.This was very, very slow Some scan-ners would simultaneously ask the operating system to connect to multipleports, allowing it to try a couple different targets at once.This was merelyvery slow.The nmap tool was much better, but for all its mastery, it wasn’tperfect It still suffered massive delays as it tried to validate that any packet itsent would, at the end of the day, elicit a response if possible
The problem, at the end of the day, was phones Not the devices, whichstill rule, but the ideas surrounding how they worked, what they were lim-ited by, and what they could do Phones were deep.You would call relativelyfew people, and you would ideally talk at length, racking up charges Itwasn’t impossible to make the Internet simulate this, and more than a fewvoice-over-IP companies had made quite a bit of cash doing so But IP itselfwas quite unreliable; it did only what it could, and in return could be as
simple, fast, and powerful as you wanted it to be Phones were depth-oriented Good for them, but port-scanning was breadth-oriented—talk to everybody
and say almost nothing
IP couldn’t care less what you were trying to do with your packets.That’swhy it worked so well.The entire concept of IP could be summed up as,
“Send it to someone who cares.” But the interfaces were all so ented Scanrand wasn’t
phone-ori-The basic idea of Scanrand was pretty simple It split the act of scanninginto two parts: one would spew the necessary packets onto the network, andthe other would examine what came back Unlike previous implementations
of this idea (fping, notably), Scanrand looked not just for hosts that were up
or down, but also for actual services on those hosts Scanrand scanned TCP
services statelessly; that is, without keeping track of which hosts had and
hadn’t replied Given that TCP was an entirely stateful protocol, this wassomewhat of a feat And it worked well