You're all here to see why I even call their putting a title like this on the screen. The other mic? This one, brother? Oh, yeah. There we go. Now I have this bad habit of wandering around and pointing at things, so remind me to talk into this. Okay. My name is Matthew Marsh, Chief Scientist at Nebraska CERT, President of Factonics, all sorts of weird shit like that. Basically, what I'm going to tell you about today is SNMPv3 and why I've been playing with SNMP itself since the late 80s. Basically, we're going to go through what SNMP is, if my PowerPoint on Linux works. Oh, great. This will be fun. There we go. We'll go over a very quick overview and history of SNMP, what it is, why, do you care. I'll give you a couple of quick definitions and terminologies. When I start tossing them out, you won't get too lost. The presentation that is on the CD is actually all full of information, references, RFC pointers, things like that. In the interest of showing you actual code running and how we play with it, I scrapped most of that, left it on the CD. This version of the presentation will also be available on the website, probably NebraskaCERT.org at least. Hopefully, I'll get a link out to DEF CON. I'll be able to tell them where all that is. The source code is available. I use NetSNMP for most of my stuff anymore because I can. We'll go into that a little bit. First, we're going to go through some of the highlights of v3, some of the NetSNMP extensions that we're talking about, what a MIB is and why I wrote the MIB I did, some of the source code, and then why did I even pick tripwire to pick on. Do you have an NMS? Don't you have an NMS? What do you want to do? I'll give you a demo of how this works in a lot of different details. The real summary of the whole thing is that SNMP is a message-passing protocol. That's pure and simple what it's designed for. It's designed for data transfers between managed devices. It's defined by a whole bunch of features. I'm sure you can read as well as I can. This slide is actually on the one on the CD as well. The things you really want to understand is that SNMP v1 has been bashed a lot. Given when it was invented in the late 80s, it's amazing that it lasted until the late 90s in any format whatsoever, and that it's even still in use. Contrary to popular belief, SNMP v1 did allow for authentication, authorization, and privacy. Those were never installed into it, and nothing was ever really done about that because, after all, you have a simple community. It's kind of like telling that you have a password, it's safe and secure, you're fine. Not a problem. The base at large for SNMP v1, and including all the way through v3, is read, write, and track. Track is a way for a managed agent to send a message back. Read and write are something that a manager does to an agent. So there's really two forces at work here. There's a manager piece, which is the piece that's doing the asking and the telling. And then there's an agent, which is the piece that's doing the, yeah, I got an answer, here you go. And let me know. Let me deal with it. It's first designed for UDP, as a lot of protocol transports were back then. V3 allows you to do TCP, and the extensions that we'll get into include just about any protocol you would like to run it over, including one of my personal favorites, IPX. SNMP v2 came with a bunch of different things, but there was a massive battle over as to whose was best, and who had the extensions that worked, and so on. And the ones that actually worked the best were all people. They were proprietary. Go figure. Definitions. Abstract syntax notation 1, which a lot of you have probably run into, ASN1. It's an ISO standard. It's a real cute way of using dotted numbers to say a bunch of things. If you're playing with LDAP, you're playing with SNMP, you're playing with a lot of other query engines, then you're going to run into ASN1. The real thing you need to care about is that it actually specifies where a location of a data point that you're interested in, is. In other words, if I give you a number like 136-141-9248-111, it actually specifies a data point that I have defined within the MIB structure that belongs to me. You can get your own MIB structure. In fact, I strongly suggest that if you want to, make sure you're at least on some list at IANA, that you go sign up for your own private MIB group. Realistically speaking, you don't need to know what a lot of these are. MIB 2 takes care of that. It takes care of about nine-tenths of everything you're going to want to do if you really want to manage a system. If you want to do private extensions, if you want to do some of the Cisco stuff they're talking about, if you want to do anything with a Wellfleet or whatever they call those routers now, or some of the other devices on the market, you have to go get their private MIBs if they've defined any. Private MIBs allow you to do things like change processor clock speeds on certain switches. And yes, those functions are embedded in there. In fact, you can do really weird things, like go out to network servers and change file times if you know which MIBs to do that with. There's a lot of that functionality built into these structures. You just have to go read the data and find out. The parts that would get kind of interesting is a MIB is a management information base. If you know what it is already, then I'm going to boil tears out of you by stating that it's a way to manage the data structure of what you're looking for. In other words, if I tell you I have a MIB, and you read it, you know what the data looks like or should look like. Now, recent extensions to the MIBs do allow you to do what's usually called a bulk or a blob in database circles where you have just a bunch of stuff you don't know what it is and you want to ram it down the pipe. You can now specify that. Historically, traditionally, and in the interest of portability, you want to limit your MIBs to integers, strings, things that are kind of normal. We're going to stay within that, and I'm actually going to show you at the end of this evening, a MIB definition file that you can import into your own Tivoli or your Unicenter or any network management you want, and it'll actually let you get all the hashes of any file in the system that you want to specify you want the hash of at the point that you specify it. You click go, it gives you the hash. Authorization and authentication. Obviously, most people confuse them a lot. For our purposes, we're going to confuse them even further because I'm going to give them the same thing. Basically, you're authorized if you authenticate. Now, there are things in SNPv3 that will extend that and split the functions out for right now. Just bear in mind that they actually have a way to encrypt using MD5 or SHA or your favorite hash the actual authentication structure. The tracks have changed between v1 and v3. I actually browsed through the CD that they have here, and the network management best practices PDF on there explains a lot of this in really good detail. Yes, it's Cisco-centric, so there's a few things you've got to take and go, yeah, nice marketing dribble, flick, but most of it is good data. It'll tell you a lot about how this stuff works. Version 3, the important parts. There's actual real authentication built into the structure now. You can have passphrases. They can include spaces. They must be longer than eight characters. Yada, yada, yada. There's a buttload of MIBs to read. There's a buttload of RFCs to read if you really want to know how this works. There's also privacy. Privacy equals encryption in this case. Basically, you can say, okay, I want to make sure that even though I'm getting data, I don't want you to read it if you're sniffing the wire. I can use a key to encrypt it. Right now, it's DES by default. But in the future, you can use any encryption you want. In fact, the spec of this, the code itself currently states that all different types of privacy encryption can be used by telling the system what to use and what key structure. It's all in there. You just tell the system, hey, I want to use AES-128. I want to use whatever. You name it, you can use it. The old-style traps. Most traps in the original systems were throw and play. We were using UDP. If we weren't reading and writing data, we said, okay, agent, you can tell me that there's a big problem right now. Wow. Almost stereo. At least one different side. Cool. All right. Now the other people don't have to feel shortchanged. Okay. Informed traps. The old-style traps, as I was starting to say, basically, we threw them and played. If I was an agent, and I needed to tell my manager that something's really badly wrong, I threw this trap out over UDP, and I prayed that it got there. Most of the time, eh, didn't get there. New-style traps. First of all, we can now do TCP. So I can send out a trap, and I can do it over TCP, and I can basically say, okay, I'm going to open a connection before I do the trap. Yes, there's overhead. Realistically, if you can get away with UDP, do it. You can actually specify per trap what you want to send. Even better. There's a trap style now called inform, which means I'm going to send you this trap over TCP, and I'm going to block. I'm going to wait until I receive a response from you, and I'm going to keep bugging you until you tell me you got it. Granted, if there's a network failure, SOL. But in a lot of those cases, you can guarantee most of the time, in the absence of a network failure, that the trap will get through. When you're talking about a trap that says, you know, I just lost all of my connectivity, to the rest of the world, and the user's going to be screaming a second, that's kind of important. Security structures. All user scope and ACL structures may have independent authentication and privilege structures. In other words, I can use a bunch of different users for a bunch of different purposes. General usage notes. If you don't play with this stuff, and by the way, Cisco's had it for quite a while now. I think 1999, they actually had an almost usable version, and by 2001, it worked well. It does require that you use the American version of the software if you want to do the real encryption, but you can apparently on the export version at least use the authentication structures. And by the way, the side note to that is if you have a version of IOS or CADOS that supports SMMPv3, it also supports SSH as well, because it's the same encryption engine. You always want to use one of these. Get user, because this is based on a quote unquote user, for each action. A get user, a set user, a trap user. You also want to use different authentication consequences for all of those people. Don't use the same one. Now, public and private, those died a long time ago, we hope. Well, it depends. If you're trying to get into something, you hope it didn't die. Okay, always use privacy. Authpriv is the way you specify it. One of the things that's interesting about this is you can't use privacy without using authentication. And it sounds like, oh gee, well, you know, I'd like to be able to use either or, but then when you think about it, it kind of makes a little more sense. Why are you going to bother encrypting it if you can't verify that you're the one asking the question? So usually, when you use privacy, you use authpriv. Now, privacy defaults to using the same passphrase that the authentication uses. It doesn't have to be so. In fact, in the spec, it even says you really should not do that. But it will default that way in case you only want to use one passphrase. All custom applications. If you're using your own custom applications, as I was saying earlier, the actual structure for SMPv3 allows you to use anything you want. You can say, hey, I want to use this kind of encryption. I want to use this kind of authentication. You don't have to use MB5 or SHA or DES. You just have to make sure the manager and the agent both understand that. Recently, and I'll get into this when I get into NetSMP a bit, Wes Hartiger, who's the lead programmer of that project, sent out this really cryptic message to net coders that basically showed an AES-128, I think it was, encryption structure working flawlessly under the NetSMP thing, which is kind of nice because if you're using just DES, which is what everybody defaults to now, you know how old the name of that is. The extensions. The extensions I play with here, actually I use the MHash libraries to do the hashing. Why? Because I can cut and paste that code easier than I could write my own. Realistically, what it does also allow me to do is use any other hashing function in the library simply by changing the way I define the function that's calling it. In fact, you could, and I haven't yet, but set up a mid that says, here's the function I want to use. Now I will switch to it and use it. Bear in mind, it's not just for authentication, but for the hashing structure of it. It's for the files themselves that we're going to look at. And you can easily extend that to use Encrypt, any library you want. You can even put in a static function. If you have your own super cool encryption algorithm that no one else uses, you know, on XOR 13 or something, hey, go for it. You can put it in there. The nice part about that is that if you define both sides of it, it makes it that much harder to figure out what's going on. Realistically, you always want to set up your initial security for all of this in a secure environment. You don't want to go throwing these things out there and then configuring them. Well, you could, but you probably don't want to. The reason I harp on SNMP as a message passing protocol is that's actually what I'm going to use it as in the rest of this talk. I'm going to use it in all of these demonstrations and all of the stuff following as a way to get a secure statement out to an agent and as a way to get the hash securely back to me. And as you'll see, when I go into a source code a bit, I can get anything I want. You want the listing of the disk? You want the processor utilization? What would you like? You can put it in there. Net SNMP. This is what I actually use. It's had V3 since 1998. It used to be the UC database, the UCD SNMP platform. There was a CMU and UCD. UCD kind of was continuously developed and continuously developed. CMU kind of fell by the wayside. Wes Hartaker actually came from UCD and continued it. And recently they renamed the project Net SNMP. You know, sadly to say, I don't really know the licensing. I think it's BSD. I know it's not GPL. I GPL my stuff and I know that's a different license than they use. I think it's BSD because I'm fairly certain parts of it are in W2K. It's originally based on those implementations. It's actually gone a lot further than that. It includes all the tools you could possibly want. You can have the agent, which is the part that actually runs and serves up data. It has all the tools to query and get information. The only thing it doesn't really have is a full NMS, which is basically a nice cute GUI or something similar that says, oh, let me click here and find out the data. Although they supposedly have a couple of projects that are related to them that can do that. The neat thing about Net SNMP, one of the things that made me start really playing with the new 5X code, which was released about a year ago. Is that it now divorced the transport, in other words the protocol, from the actual data structures themselves. In other words, if you've ever played with Nobel stuff way back when, you realize that they could do SNMP over IPX. And when you think about it, it makes perfect sense. Because SNMP does not say anything really and truly in any of the RFCs about IP. It just says, hey, here's the way I form a packet. Here's what I do. Here's how I talk to stuff. The nicest thing about this is it'll let you use all sorts of things. Including IPX on Linux. Being as my entire network is Linux, well, except for my network server, which is still running. I don't want to turn it off because it has my data on it. And it backs itself up, so I don't care. The IPX is very nice because now I can run a management structure across my entire network, including my internet connected parts. And you can't see it if you're coming in from the internet. It just ain't there. I can run an AOL5, which is kind of fun. It's very funky. Somebody apparently did get it to work over DECnet. Why? I don't know, but hey, if that's your thing, cool. The interesting part is if you go look in the NetSNMP code, all the transports are broken out now. IPv6 TCP, IPv6 UDP, regular TCP, regular UDP, IPX, AOL5, blah, blah, blah. And they even have one that's called sample.protocol. Guess what that is? You want to write your own protocol? You want to use a protocol that they don't have? Go for it. Do it. I haven't bothered because I've got bigger things to try, but it's there, and if someone wants to write it for some of those more obscure protocols, that would be a really good contribution. Okay. The real reason you're kind of sitting here and wondering why I'm doing some of this. First, let's go over the MIB and stuff, and then I'll discuss why I'm picking on poor tripwire. This is the MIB. This is actually pretty much the same thing as the MIB. I'm going to mark it as the MIB, but I'm going to define it as a package. You're going to have to make sure that, gosh, with the exception of some whitespace and some additional padding that you have to put in there, the entire MIB that we're going to use for all these definitions. First, we define our enterprise. Now, realistically, 9240 belongs to Packtronic systems. But, hey, I can make it belong to anybody I want if I define it in the MIB. As long as the agent leds it, what do I care? So for the purposes of this, and for the purposes of software on the CD, I defined it to pacdef.x. The pacdc is an OID that says this is an object identifier underneath that global reference. And under that, I'm going to have set files. This is where we're going to play games. There's two things under set files. The test file string, which is an actual string size 0 to 1024, and you can make it whatever you want. You can also change the types. But this makes it easy, and it'll load it into any mid-compiler out there. And it's a publicly-setable string. Basically, you set this string, and then you call pac test file hash. And what that does is it goes out, takes your string, and says, give me an md5 sum of this file on the agent system. I'm going to demo it on one box. The reality is, this is running manager and agent. The agent part could be running on anything I want, anywhere in my enterprise that I can get to, over the protocol that I'm using. In other words, when I set this string on a remote machine, I'm actually telling it, go look at this file on that machine over there, and give me that hash. The source code. There's a source code in there that's provided as a patch against NetSMMP. We'll take a quick look at the C file, because I want to show you the main functions. It's tested on all versions up to 502, as of a couple of days ago or so. The 502 pre-1 source code for NetSMMP is, I included on the CD, I also included mhash 0810, which is what I actually wrote the hash routine against, to make it a lot easier. So everything's there if you want to play with it. It'll compile on all major unices. Oh, and by the way, NetSMMP apparently will compile on Windows platforms. Don't ask me. I don't run them. I have no clue. If someone wants to tell me, I'll be more than happy to put the information out there. Don't do it myself. If you do apply the patch against 502, there's two rejects, because we changed the way some of the protections are done. In the TCP and UDP files, but you can ignore them. And then there's a configure file I put in there on purpose, because there's a whole bunch of options which wouldn't be real familiar. This configure file at least gets you up and running and lets you compile it so that you can run this code and see this code in operation. Edit it, look at it, figure out how everything works. If anything else fails, you can email me at whatever address you find for me that works. And then make install. You can run it from there if you set the LD library path appropriately. You can make it statically. It's not a big deal. And there are people out there who have made strip binaries for this for the purpose of embedded systems. They are really tiny and work really well. Don't have them with me, but they are out there. And then, of course, the most fun part is once it's installed, go ahead and play. Why did I pick on tripwire? Made you look. Reality is it was fairly simple, and it was one of those things. I've had this hashing thing for about a year now. Been kind of playing with it. Someone was talking to me one day, and I was telling him, oh, no, that's just a list of the hashes of the important files in one of my servers over at the ISP. And they went, oh, really? Are you running tripwire over SSH? I'm like, huh, no, I never thought of it that way. But, no, I'm running it over SNMPv3. Basically, when you look at something like tripwire or any kind of integrity program like that, you need to ensure the file integrity. What does that really mean? It means, did the file change? And if it changed, do you have an idea of when or how or where or why? Most common file integrity programs to do this, they use a hash and a database. Here's the file name. Here's the hash. Real difficult. Management systems, on the other hand, are these incredibly expensive, huge things, although OpenNMS is getting pretty good. Scotty is still a strong contender, and they're free. They're basically big databases with correlation engines attached to them. They do all sorts of neat things with graphical mode. They have extensive automation capabilities. If you've ever worked in a large enterprise, you'll see the network management people with the big displays of all of these routers and hubs and switches and servers and crap all over the place, and they can click on it and tell you exactly what's going on with pretty graphs that really impress management. That's an NMS system. Those things are designed to be extensible, automated, and to let you plug stuff into them. And what are we trying to do here? We're going to want to tell one of those things, hey, go check that server over there, read the hash of the following files, and store it. And do that every five minutes, or one minute, or ten minutes, or what timeframe works for you. And they can all be independent queries. The point is that you can then have literally a tracking record of the hashed stuff. You can structure those files. It's as though you're continuously running Tripwire or something similar on that system remotely all the time. And the nice part about that is most NMSs have these really neat automation capabilities that allow you to do alert structures and, oh, hey, something changed. Better page the tech on duty. Keeper time. Or you send out an email. Or do this. Or even better, one of the tricks I use with my own personal systems is I say, if that hash ever changes, you check it every five minutes, if that hash ever changes, you immediately do a diff using a different nib of that file and give me the difference. Because I have a nib that actually knows what the file should be as of the last hash read. And it'll do a diff for me and send me the diff. All over SMBv3. All security. Over IPX if I want to. The point is that with that kind of automation, you can set up all of these structures, and then you can import the nib, you can make it extensible, set up your escalation, set up your alarms. Basically, you can integrate a tripwire-type capability into the systems you already have managing the networks you have. Okay, so you don't have an NMS, because you don't have, what, 35 grand or so to toss around for kicks. I mean, I probably wouldn't buy an NMS with that, which is why I usually end up consulting for companies that have that kind of money and don't mind wasting it that way. You can do all sorts of things. You can script it. You can use Scottie. You can use a bunch of other applications out there. My personal favorite, although I'll be the first to tell you, I'm not a very good coder. In fact, my favorite form of coding is find something that's kind of close, cut and paste, and then mangle to fit using a debugger massively. So, okay, you understand the way I go. What most of SMMP gives you is it has a full library API. It also has binaries that come with it that'll do all sorts of ridiculous stuff. Set, get, rock. The whole nine words. Here's a little simple shell script, and this is actually one I have installed here, and I'll show you how this all works. What we do is we first go ahead and we have a file there, cat file list. And in that file list, we have a whole bunch of paths, and I'll show you all of this running. We then do an SMMP set of the line that we're talking about right then. So it could be, like, say, etsy password. So I'm going to set etsy password into 13614192481. That's 1110, which is the path file locator. Then I'm going to echo that without a line feed to a output file, and I'm going to go get the 1120 location, which is actually the hash of that file. And then I'm done. I'm going to loop through this file and end up with a list of file names and their hashes. And it's going to take a real long time. It takes almost, like, 10 seconds or so to run. And this assumes, of course, that you have the appropriate entries in your file dot list, and we looked at that. Additional scripting. Perl. One of the nice things they did recently in the 502 series, they actually incorporated Perl into the NetSMP agent itself, which is kind of wild. Before, they always had a Perl interface that you could query the libraries with, which is what you would do if you were writing a script for this. What's nice is that now you can actually write Perl code in the configuration file or in additional included files for the agent itself to execute. So if you have a Perl script that already gets you data you like, have the agent execute it. C programs are obviously the fastest, so if you want to do a whole bunch of stuff and a lot of multiple hosts, the C program goes against the same library. They both use the library calls. And if you take a look at the source, which we'll do in a second, you'll see that extending the code is ridiculously simple. Most of this is fairly simple. I'm going to call the library, get the hash function, hand it a file name and say, go hash this, okay? And then hand me back the result and we're out of here. The code runs on the system, on the marriage system, the agent. So this is the actual machine you're playing with. It's basically a wonderful messaging protocol. What do you want to do with it? So we'll go through this part in a second because what we really want to do is we'll play. If I can figure out what happened on the mouse. Actually, oh, thank you. This is so much fun. You can tell I use X a whole lot, can't you? In fact, let's do this and see if it still displays. If it doesn't, I'll have lots of fun. Is there anything up there at all that's readable? Nope, okay. Well, we'll do it for next then. You know how it is with these highfalutin systems. Okay, now let's see. Open up one of these and I think this is the command. Yep. And you can tell I have real informative names for my computers. Okay. Is that displaying? Good. Now, if you take a look in here and ignore all of the FooBard and other things while I was playing with my PowerPoint trying to get it to work, you'll notice that there's a C file and the H file, the header file, which does a few defines for you. There's also a Perl file that does just a quick get using the API just to show you how things work. And then two script files. All of this stuff I will upload to wherever I put the final presentation. So you can go play with it. But let's take a look real quick first at this script file. This is the same one I just had in that particular example on the slide. If you want to see what exactly file list looks like, basically I'm giving it full pass. Now, this file would reside on the manager. It's not on the agent or the managed system. It is on the manager, and it's going to tell the agent what to go look for. So if someone were actually on the agent system, they would know what files you're looking at or asking for because they can't see that. In fact, there is a way to lock down the agent in such a way that the agent machine itself cannot talk to the agent demon that's running. In other words, you can't find out information about the machine you're on. This particular one, all queries from the local host to local host are fully allowed. So what we'll do is we'll just, real quick, just try it out and take a look at the output. What it's going to do is it's telling me which file it's on at any particular instance. Whoops. What the heck? Where did I lose this time? Is it still up there? Okay, good. I lost this one. I can't see what the heck I'm doing. Let's try that. There. Now we can both see. That's good. Oh, good idea. Thank you. Okay, that'll make it a heck of a lot easier because then I can type with both hands. If we take a look now, we'll just take a look at the output file. There's all our hashes. Pretty simple, pretty easy. Now, if you take a look at the top one, what we'll do is we'll just real quickly copy this one to... that. And then I put in this change.me file on purpose. Gee, I wonder why. What we'll do is we'll just do something really, really interesting to it. We'll add a period to the end of it. I'm really modifying this file heavily right now, as you can tell. And then we'll just go ahead and rerun that script. Basically, what it'll do is it'll go out and when I run this script, each one of these files is written into the MIB and then the hash is read. Now, one thing you do have to bear in mind is I've made it so easy that essentially if you took a look at the MIB right now, what it is set to right now is sbinfdesk because that's the last thing that was written to it. You can save it to write to a config file, read from a config file, do whatever you would like. If you take a look at output now, the hash has changed. Real simple, real easy. So, how do I really do this? Let's take a look at the C file because that's the important one. The H file just has the definitions for NetSMP's purposes to make it easier to compile. A whole bunch of includes, blah, blah, blah, all sorts of wonderful stuff. We define where we're actually putting all of our variables and then we go ahead and we actually initialize this. We basically tell it, hey, look, I've got a MIB. Here's where I am. Here's what I'm doing. Go read it in if you're interested. And now we get to the fun part. We get to the actual routine to generate the sum. And it's fairly simple. If you actually went and checked mhash, you'd find this example about C program and you'd be really surprised at how closely it resembles this function. But the reality is, basically, I'm taking the cat of this file, which I've set into my MIB now. I'm reading it back and saying, okay, this is the file I'm interested in. And then I'm going through and I'm hashing it. There's debug messages that are there. If you actually want to, you can launch the agent with a dpacdefconx and watch the looping function build iteratively the hash function. It does slow it down a bit, but if you're actually trying to figure out why it doesn't work, it's a real good way to do it. And essentially, we take that, we send it back, and we send it into the actual structure that mhsmp uses to read and write all of these things. So you have this unsigned care bar, our dpacdefconx variable. This is a standard nsmp set get variable structure. And essentially, all it does is it says, okay, first I'm going to check my headers, make sure that the packet coming in is tolerable. This is all in the nsmp docs. And then I'm going to actually go down and do the value assignments. So in the case where we get the pacfile name in, which is that 1110, first I have a write method that I define. Which basically says, oh, I got a value. Copy it. And then I do a var len on it because I must return a length as part of the specification. And then I return pacfile name, which is that hash function you saw earlier. I basically call that, do the hash, and return the whole structure. If we want to just get the hash, we can call pack hash directly. And then of course, if we have an error, we spit out an error, and away we go. Here's the actual part that does the writing. Takes the value, writes it in. Real complicated. If it comes in and it's not the type you expected, throw it out. If it's too big, throw it out. Otherwise, it's just right, and all we do is we say, okay, cool, we copy it into pacfile name, stuff it into memory, we're done. This is all in memory. If you actually want to write it out, you have to do more things with the mir. We'll take a quick look at the curl file just to show you that that in and of itself, essentially you just use snmp, which comes with net snmp. You compile it as part of the package, install it. It allows you to define a session. If you notice, I've defined this session to localhost, version three, off, print. Now I do have the passwords and the privileged passwords in here. That is one of the current few drawbacks to using v3 is that the manager must know the passwords to everything. Has to know the authentication and the encryption password, passphrases. There is talk about trying to do some kind of escrow structure or certificate structure to extend these. I'm sure it'll be done at some point in time. Realistically, if your manager has been hacked, you're toast, because that thing usually has set rights to some serious equipment. Of course, it's a very nice thing to attack, too, so you can figure out which one's the manager. A lot of times, especially if they're running something like OpenView or NetView or Tivoli or Unicenter, they're fairly easy to crack Unix boxes, because last time I looked, for example, you're running NetView on AIX, you had to have Telnet available for certain things. Last time I looked at Unicenter, for one function, they needed arsh opened up. Not fun. Hopefully, they'll get wiser and they'll start locking those suckers down, because, as I just showed you with this, if you're on the manager and you're basically on that network and you can do anything you want to it at any point in time. Anyway, questions, commentary? I think you have a problem. Huh? I think you have a problem. Problem with? Since every five minutes or so, this thing is going to return with a full, you know, sheet worth of hashes, how often does the key rotate? Or can I just take a whole bunch of these messages, push them into a little stack, and pop out your passwords there? Yeah, that actually is something that is built in. The reason that specification for V3 originally built in the mechanisms for not only defining alternate encryptions and authentication mechanisms, they also built in methods of stating when one had changed an ability using a VACM or a USEM construction to change that on agents. So you can actually change it every so often if you want to. Realistically, you would depend on other methods to determine whether someone was doing that kind of a construct against you. Yes, it is open to gathering a whole bunch of them and beating on it like crazy. Yes. And that is one of the reasons that they put in the extensions and that there's a lot of work on trying to do the certificate structures and also the alternate structures. Because right now, today, that's a very valid attack against it. One of the things that they did put in from the get-go is the concept of an engine ID. So I can actually use additional functionality based on unique engine IDs for each of my agents and managers that would give me some protection against that kind of attack because it will use the engine ID to slightly change the way it does the encryption each time, as a salt, basically, and to rotate it through. To turn all that stuff on, you have to have some good CPU horsepower, though. So there are the drawbacks there. Additionally, the engine ID does prevent replay attacks as long as you do have the structure in full off-priv mode. A lot of that is covered in some of the late draft RFCs that are now starting to be specified for V3 because those are similar to the ones that are in V3. no matter which message passing protocol you're looking at. Any other questions? I'll be wandering around, so feel free to ask me. Like I said, most of the source code's available, and probably more extensive stuff as well as I start playing with it a little more. Check out the NetSMMP project because they have a lot of interesting information and source that you can play with yourself today. Otherwise, have a good one. Subtitles by the Amara.org community