Karma + MSF 3 = I’m never using Wireless again!

Posted by Eric | General | Thursday 27 March 2008 9:48 am

<meta name="GENERATOR" content="OpenOffice.org 2.0 (Linux)" /><meta name="CREATED" content="20080327;8323700" /><meta name="CHANGED" content="16010101;0" /><br /> <style> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style> <p style="margin-bottom: 0in">Last night I went up to Austin for the AHA! Meeting that is held the last Wednesday of every month. There were only three talks, but it was good stuff none the less. HDM Went first and gave a little demo of what he’s been working on lately. Recently he picked up one of the new<a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16834220266"> eeepc’s</a> from new egg for his wireless en devours and has been playing with it. It’s pretty small and light weight so I’m actually considering purchasing one and using it solely for wireless pen testing.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Lately HD has been working with the creator of <a href="http://www.theta44.org/karma/index.html">KARMA</a> the wireless tool. The Creator wanted to integrate it with an exploit framework and MSF came to mind. HD Did a few demo’s of Karma’s integration with MSF. As clients probe for a wireless access point Karma will respond saying I’m here. At that point, MSF will set up a ruby based SMB server, POP3, IMAP, HTTP, HTTPS, all your essential protocols. The client will get an ip address, and once they start trying to browse the web, or goto a share, or open up email MSF and Karma will start handling every request. He said it was still going to be about a month or two before it’s released. Future plans include auto discovery of what Client side vulns apply to a client, as well as the automatic exploitation of discovered client sides. All in all that was a pretty cool demo.</p> <p> <!-- Begin Google Adsense code --> <script type="text/javascript"><!-- google_ad_client = "pub-9774791470740882"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- End Google Adsense code --> </p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=55#comments" title="Comment on Karma + MSF 3 = I’m never using Wireless again!">Comments (2)</a> </div> </div> <div class="post"> <h2 id="post-54"><a href="http://hamsterswheel.com/techblog/?p=54" rel="bookmark">Python Uniq</a></h2> <div class="meta">Posted by Eric | <a href="http://hamsterswheel.com/techblog/?cat=5" title="View all posts in Code" rel="category">Code</a>, <a href="http://hamsterswheel.com/techblog/?cat=16" title="View all posts in Python" rel="category">Python</a> | Wednesday 26 March 2008 1:49 pm </div> <div class="storycontent"> <p><meta content="text/html; charset=utf-8" http-equiv="CONTENT-TYPE" /><title /><meta content="OpenOffice.org 2.0 (Linux)" name="GENERATOR" /><meta content="20080326;12392200" name="CREATED" /><meta content="16010101;0" name="CHANGED" /><br /> <style> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style> <p style="margin-bottom: 0in">Python doesn’t have a Uniq for lists, or anything. My problem was, I had a huge text file that I was going through and my regular expression was picking up multiple instances of the same thing. What was happening was I would get 80+ items in a list, which were for the most part nothing but repetitive. I found an example of making your own unique in the python cookbook, but it didn’t work out right for me. When I ran it through the unique function it would either 1) spit back out an empty list, or 2) would spit back out the same think I put in, minus one item. I ended up writing up the following code, which is largely inefficient, but it ended up working. It will throw exceptions based on IndexError and ValueError so I had to place it in a try block. It will also repeat the first item usually. But hey, I can deal with having the first two elements in the returns array being the same, I no longer have 80 elements coming back that are exactly the same!</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">I’d love feedback if anyone has a better solution, Always looking for code optimization <img src='http://hamsterswheel.com/techblog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p> <p style="margin-bottom: 0in"> <blockquote> <p style="margin-bottom: 0in">def unique(self,values):<br /> #pass in a list()<br /> if len(values) == 0:<br /> print “something wrong in dixieland”<br /> sys.exit()<br /> else:<br /> t = values<br /> t.sort()<br /> u = list()</p> <p>i = 0</p> <p>try:<br /> ret = cmp(t[0], t[1])<br /> if ( ret == 0):<br /> u.append(t[0])<br /> while 1:<br /> ret = cmp(t[i], t[i+1])<br /> if ret !=0:<br /> u.append(t[i])<br /> else:<br /> pass<br /> i+=1<br /> except ValueError:<br /> pass</p> <p>except IndexError:<br /> pass</p> <p>return u</p></blockquote> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=54#comments" title="Comment on Python Uniq">Comments (5)</a> </div> </div> <div class="post"> <h2 id="post-53"><a href="http://hamsterswheel.com/techblog/?p=53" rel="bookmark">Sulley Auth, Data Gen, Imap CRASH BANG!</a></h2> <div class="meta">Posted by Eric | <a href="http://hamsterswheel.com/techblog/?cat=5" title="View all posts in Code" rel="category">Code</a>, <a href="http://hamsterswheel.com/techblog/?cat=15" title="View all posts in Fuzzing" rel="category">Fuzzing</a> | Friday 21 March 2008 11:37 am </div> <div class="storycontent"> <p class="MsoNormal">There sure have been quite a few IMAP Vulnerabilities published the last few weeks. It’s interesting, a certain protocol will be attacked; go away for a while, then someone will hit a whole bunch of applications. With that I figured I’d get my sulley request for IMAP working.</p> <p class="MsoNormal"> <p class="MsoNormal">First, Something I found while browsing around for POST Authentication guidance on the internet. If for some reason or another you have the desire to view the exact strings Sulley is creating to Fuzz your protocol with, you can do this pretty easily.</p> <p class="MsoNormal"> <p class="MsoNormal">Simply create a new python script just as you would if you were creating a fuzz script. Instead of creating a target, and starting a session and all that you can simply create a for loop and call s_render() like so:</p> <p class="MsoNormal"><code /></p> <p class="MsoNormal"> <p class="MsoNormal"> <p class="MsoNormal"><code /></p> <blockquote> <p class="MsoNormal">bleh = s_get("imap_simple")</p> <p class="MsoNormal">for i in range(bleh.names["blockname"].num_mutations()):</p> <p class="MsoNormal">print "%i" %i</p> <p class="MsoNormal">print(s_render())</p> <p class="MsoNormal">s_mutate()</p> </blockquote> <p class="MsoNormal"> <p class="MsoNormal"> <p class="MsoNormal"> <p class="MsoNormal">The reason I have a print “%i” % I in there is because I have actually been fuzzing embedded devices lately. Unless you have a JTAG debugger, or there is some type of integrated debugger on the device It’s hard to tell what’s going on. When you run Sulley without defining the vm_control, the proc_mon, or net_mon Sulley may crap out at some point, and it will state something along the lines of “Cannot connect, no vmcontrol waiting 5 minutes.” You can actually take the last number that Sulley Transmitted and start working from there.</p> <p class="MsoNormal"> <p class="MsoNormal">So, with IMAP you need to authentic to the IMAP server in order to get some of the latest Vulns being published (LSUB, FETCH, LIST). This means we are back into the same boat about authentication as I was last week. Well, I think I actually figured out how to take care of it. It’s an integration of some stuff that Tebo sent me, and some stuff from my LPR Request from Gray Hat Hacking SE which uses dependencies.</p> <p class="MsoNormal"> <p class="MsoNormal">What I did was really half assed, but it seemed to work and it got me some exceptions. What I basically did was from the LPR stuff I used the s_group() to create a list of commands, the thing was it only has one actual command, which is a long string to take care of the authentication sequence. It seemed to work though:</p> <p class="MsoNormal"><code /></p> <blockquote> <p class="MsoNormal">s_group('command', values=['0001 LOGIN bleh BLEH',])</p> </blockquote> <p class="MsoNormal"> <p class="MsoNormal">From there on out, when you define a new block you tell the block to be dependent on the command group. (I should probably change the name of that)</p> <p class="MsoNormal"> <p class="MsoNormal"><code /></p> <blockquote> <p class="MsoNormal">if s_block_start("list", dep="command"):</p> <p class="MsoNormal">s_string("a003")</p> <p class="MsoNormal">s_delim(" ")</p> <p class="MsoNormal">s_string("LIST \"")</p> <p class="MsoNormal">s_delim("")</p> <p class="MsoNormal">s_string("\" ")</p> <p class="MsoNormal">s_string("*")</p> <p class="MsoNormal">s_static("\r\n")</p> <p class="MsoNormal">s_block_end()</p> </blockquote> <p class="MsoNormal"> <p class="MsoNormal"> <p class="MsoNormal">I also ran into something that pissed me off. With both IMAP and FTP Requests they can be rather large. Since in some cases I’m re writing the spk files from Dave Aitels SPIKE, they are really long. I ran into an instance where Python was generating the Fuzz Strings for my requests before running but there actually so many string declarations that it would result in a Memory error and crap out. What I ended up doing was cutting my Imap request down from every block for every command, to about 4 blocks or 4 commands at a time. A few blocks required additional editing which I wasn’t happy about because there was certain field’s I wanted to play with. Oh well, Imap <a href="http://www.hamsterswheel.com/code/sulley/imap.py">Request here</a>.</p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=53#comments" title="Comment on Sulley Auth, Data Gen, Imap CRASH BANG!">Comments (3)</a> </div> </div> <div class="post"> <h2 id="post-52"><a href="http://hamsterswheel.com/techblog/?p=52" rel="bookmark">The mindset</a></h2> <div class="meta">Posted by Eric | <a href="http://hamsterswheel.com/techblog/?cat=1" title="View all posts in General" rel="category">General</a> | Thursday 20 March 2008 9:13 am </div> <div class="storycontent"> <p><meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8" /><title /><meta name="GENERATOR" content="OpenOffice.org 2.0 (Linux)" /><meta name="CREATED" content="20080320;7394500" /><meta name="CHANGED" content="16010101;0" /><br /> <style> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style> <p style="margin-bottom: 0in">What is the mindset of a Security Professional? What is the mindset of a great hacker? Having been around the professional security scene for about 5 years I’ve come to witness the varying types of individual in the field. There are those motivated by money, these are the ones who go home and watch football every night. I’ve run into a few like this that do some type of I.T work during the day, yet they don’t even own a computer! Then you have the guy’s who are new to the field, they came from something else and realized after school that their degree just wasn’t going to work. In my experience this can go one of two way’s. They will obtain some type of certification and be content, occasionally turn the computer on at home and read a few articles about I.T, or They will be the best damn that you’ve ever found. It’s interesting because there are a few people who do I.T Security as a hobby who are far better than many who do it as a profession. Then you have the people who wake up in the morning (or in some cases the afternoon) and they hit the computer all day long at work, get off work and go home to a sometimes even more impressive lab and start all over again.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">This morning my RSS feed picked up <a href="http://seclists.org/isn/2008/Mar/0081.html">a story</a> on the infosec RSS feed from seclists about the mindset of a hacker. It was definitely an interesting read and I just couldn’t refrain from writing about it. I was talking with a few guys in Vegas last year at the LSO meet up about how our minds think. A few of us at the time were doing similar Red Team activities but for different companies, in different locals. It was interesting sharing stories with each other about how our mind’s think about things. Most people would walk into a bank and see an RJ 45 jack in a waiting area and wonder what the hell is that? When I see that, I’m wondering if it’s attached to the banks network, whether or not it’s hot, and how long I could sit there plugged in without anyone noticing.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">I’ve always had this mindset, When I was in High school there was a system in place for classroom attendance, If you didn’t show up to a class it was considered an absence, if you were checked in for the day, it was a “cut”. However, any other teacher could excuse you from another class. Since I was in really good with the technology director it was easy for me to use the system to my advantage.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Another system in high school I exploited was the lunch system. Grades 9-10 were not permitted to leave campus for lunch, however 11-12 with decent grades were. A Parent or guardian could sign a student out of school, but was not required to be present. A simple phone call or written note would suffice. I recall many times having girl friends call the attendance office to have me signed out, and I would reciprocate. We enjoys many lunches that way!</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">The military was no different from High School. A few more rules, and a few things you must accomplish. That is, unless you know the system. In Technical school for the Air Force there is a phase program (at least there was when I went through.) At the squadron I attended we had fellow airman taking care of certain office work. Part of this office work was collecting papers with your name on it for the fitness exams, inspections, et cetera. These people were human, and fell to bribery and friendship just as most people would when your far from home, and have few friends. It wasn’t long before I was attending everything, without attending it at all.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">I’ve found many people with similar mindsets in this field. The people who walk into a store and immediately know 2 exits, and what angles the security camera’s cover. Now a day’s it takes place subconsciously, I walk into a place and automatically start testing their security and coming up with a plan in my head. I take mental snapshots of hallways. Two weeks ago we took my son to a day care down the road, and I noticed they had a keypad to get into the second door. A digital code was required in order to open the door, this was a good security measure as it helps keep out unwanted people. The problem was, while we were talking to the lady at the front desk, I got about 4 different codes. There was no mechanism in place to safeguard the numbers being entered. This was a factor I weighed when we decided not to put my son in that day care. This is the type of thinking you want from your Pen testers, and from your Red Team guy’s. This, type thinking goes a long way! Just look at the MIT Blackjack team, same thing. There was one or two people who looked at it with a hackers eye and said let’s get together and use our skills to make some cash.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"><img src="http://imgs.xkcd.com/comics/post_office_showdown.png" /> <!-- Begin Google Adsense code --> <script type="text/javascript"><!-- google_ad_client = "pub-9774791470740882"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- End Google Adsense code --> </p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=52#respond" title="Comment on The mindset">Comments (0)</a> </div> </div> <div class="post"> <h2 id="post-51"><a href="http://hamsterswheel.com/techblog/?p=51" rel="bookmark">Fuzzy wuzzy wuz a fuzz</a></h2> <div class="meta">Posted by Eric | <a href="http://hamsterswheel.com/techblog/?cat=15" title="View all posts in Fuzzing" rel="category">Fuzzing</a>, <a href="http://hamsterswheel.com/techblog/?cat=11" title="View all posts in Research" rel="category">Research</a> | Monday 17 March 2008 8:10 pm </div> <div class="storycontent"> <p><meta content="text/html; charset=utf-8" http-equiv="CONTENT-TYPE" /><title /><meta content="OpenOffice.org 2.0 (Linux)" name="GENERATOR" /><meta content="20080317;18274300" name="CREATED" /><meta content="20080317;19062400" name="CHANGED" /><br /> <style> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style> <p style="margin-bottom: 0in">I suppose it’s been a few day’s since my last post. So much for going with the flow of exploitation on Linux. I’ve been working on that over here, but I’ve had some other stuff to work on as well. I’ve also been pretty caught up with family obligations. It’s hard to balance the time between everything.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">One thing I’ve been hitting pretty hard is Fuzzing. I was never too intrigued by fuzzing until a few months ago. I started on a small scale with Comraider, which is a fuzzer but the need for knowledge to fuzz is virtually non existent. Hell, to an extent Comraider will even write the proof of concept code for you. SPIKE Fuzzer from Immunitysec is pretty old school, I played with that momentarily but the documentation was lacking at best, and it was more or less a lesson in code reading than anything else. You seriously have to walk through all the code of the other fuzzing templates and then attempt to decipher why certain variables are declared. My next attempt was Peach Fuzzer. Peach at first gave me great hope, despite it running on Windows only. I was using Peach to Fuzz some web servers since the HTTP protocol is somewhat easy to build simple templates for. Once I started going, I ran into an error with Peach, what’s worse it was an error with their code, and their HTTP Example. I did a quick fix on the error (that was, I cast the messed up variable to unicode) and I got passed that. However, I kept hitting snags. One snag after another until I finally just gave up on Peach. I even attempted to write to the author, he responded to my first email, but didn’t respond to my last two. The one really cool thing I have to say about peach was the ability to easily create XML files for the fuzzer. Peach works by accepting XML files of the protocol. Using Peachshark you can easily create the XML file based on a pdml file from Wireshark… Sniff, export, script and you’ve got a fuzzable XML file of the protocol. Nice!</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Finally Sulley, Sulley is the new Rave. Uses block based fuzzing, is written in Python, Was released last year at Blackhat… Or Defcon. I can’t remember, that week seems fuzzy! Crazy people from work, crazy stories. Probably the most drinking I did all of 2007 no lie! Anyhow, Once you get past the whole path issues with python, and you RTFM Sulley really kicks ass. Sulley comes documented enough that if you read the API and the quick intro you can figure out how to work it. Sulley also comes with the SPIKE Method of documentation via two sample requests in the request folder, these allow you to explore more complex protocol fuzzing.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">So far I’m really impressed with sulley, I was using it to Fuzz some web servers that I knew were vulnerable from the past. The first time I ran Sulley was using the (included) HTTP Request to go against Savant Web Server. Not even 100 tests in and I started to get results. The Next step I’m trying to take is to get post AUTH fuzzing going on protocols such as IMAP, FTP and POP3. Although not quite as delicious as Pre AUTH, POST Auth still count for something. I’ve been talking with Tebo on IRC and inspired him to do a little testing. He emailed me late in the evening saturday and woke my wife up when the blackberry started chirping. All in all it was a good email, with some code built off the stuff I had sent him. I noticed he enjoys using groups, whereas I build everything in blocks for my ftp example. I went to test some of the POST AUTH stuff he had sent me, and some of my POST AUTH code I was playing with saturday evening but my Box at work decided to not play well with others today. I didn’t really have time to look into it since I’ve been assigned a programming project at work. For taskings = sucks;</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Example of my quick solution that seemed to work for POST AUTH can be found in hamsterswheel.com/code.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">If you have solutions for the best method to hit POST AUTH on a protocol with sulley, let me know please!</p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=51#comments" title="Comment on Fuzzy wuzzy wuz a fuzz">Comments (1)</a> </div> </div> <div class="post"> <h2 id="post-50"><a href="http://hamsterswheel.com/techblog/?p=50" rel="bookmark">Smart Teen Criminals… Or pawns in organized crime?</a></h2> <div class="meta">Posted by Eric | <a href="http://hamsterswheel.com/techblog/?cat=1" title="View all posts in General" rel="category">General</a> | Thursday 6 March 2008 11:41 am </div> <div class="storycontent"> <p><meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8" /><title /><meta name="GENERATOR" content="OpenOffice.org 2.0 (Linux)" /><meta name="CREATED" content="20080306;9172600" /><meta name="CHANGED" content="16010101;0" /><br /> <style> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style> <p style="margin-bottom: 0in">A recent blog entry on the TrendMicro blog got me thinking about the potential structure of Cyber crime and organized cyber crime. The blog post (<a href="http://blog.trendmicro.com/so-young-yet-so-bad/">found here</a>) briefly discusses how the age of those involved in cyber crime is blowing up the media spotlight lately. I started thinking about how one could organize a cyber crime tier system and someone on the top, much older and well versed in cyber crime could easily let these minors have fun, get paid and take the blame for everything. If you grab them young enough, its possible they could even escape prosecution. The way the united states legal system is set up you could end up on probation for a few years and nothing more. Those involved at the top simply collect money, dish out new orders and recruit new ones. I have to wonder where the mindset or intelligence is coming from. I myself always thought in the likes of a criminal, but when I was 14-18 I was chasing women, not creating a large enterprising botnet that stole credit cards and fixed stock prices. I mean, seriously that’s kind of cool that someone that age could come up with that, and even know about the workings of stock… Or do they? Could it be coming from somewhere else? Anyone have thoughts on this or even an article to back it up perhaps?</p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=50#respond" title="Comment on Smart Teen Criminals… Or pawns in organized crime?">Comments (0)</a> </div> </div> <div class="post"> <h2 id="post-48"><a href="http://hamsterswheel.com/techblog/?p=48" rel="bookmark">Process Memory Linux</a></h2> <div class="meta">Posted by Eric | <a href="http://hamsterswheel.com/techblog/?cat=3" title="View all posts in Linux" rel="category">Linux</a>, <a href="http://hamsterswheel.com/techblog/?cat=10" title="View all posts in exploits" rel="category">exploits</a> | Wednesday 5 March 2008 10:03 am </div> <div class="storycontent"> <p><meta content="text/html; charset=utf-8" http-equiv="CONTENT-TYPE" /><title /><meta content="OpenOffice.org 2.0 (Linux)" name="GENERATOR" /><meta content="20080305;7343200" name="CREATED" /><meta content="16010101;0" name="CHANGED" /><br /> <style> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style> <p style="margin-bottom: 0in">Every Process has an address space with three segments: Text (code), Data, and Stack.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">The Text segment ,sometimes also called code segment contains the machine instructions that form the programs executable code. This section is usually read only and is generated by the compiler.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">The Data segment contains storage for program variables, strings, arrays and other data. This segment contains two parts, initialized and uninitialized data. The Uninitialized portion is known (historically at least) as BSS. The data segment can change, unlike the text(code) segment.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">The Stack Segment starts at the top of the Virtual Address Space and grows down towards 0. If the stack grows beyond its bounds a hardware fault occurs and the operation system lowers the bottom of the stack by 1 page. When you start a program all its variables and command line arguments are stored on the stack segment. This last statement should connect in your memory and fill in the “why” from any tutorials you may have read, which did something like strcpy(buffer, argv[1]).</p> <p style="margin-bottom: 0in"> <pre>Process Memory Layout: (Borrowed w/o permission from tutorial by: xgc/dx A.K.A Thyago Silva http://milw0rm.com/papers/4) 0xc0000000</pre> <pre>--------------------- | | | env/argv pointer. | | argc | |-------------------| | | | stack | | | | | | | | | | V | / / | | | ^ | | | | | | | | | | heap | |-------------------| | bss | |-------------------| | initialized data | |-------------------| | text | |-------------------| | shared libraries | | etc. | |-------------------|</pre> <pre>0x8000000</pre> <p style="margin-bottom: 0in">Above when discussing the stack segment we briefly mentioned that the operating system will increase the stack by 1 page when it grows out of its boundaries. A page is a 4Kb area of memory and is the basic unit of memory with which both the kernel and the CPU deal. Although both can access individual bytes (or even bits), the amount of memory that is managed is usually in pages. For more information on Linux paging and the linux memory model in general see <a href="http://www.ibm.com/developerworks/linux/library/l-memmod/">This link</a></p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=48#respond" title="Comment on Process Memory Linux">Comments (0)</a> </div> </div> <div class="post"> <h2 id="post-47"><a href="http://hamsterswheel.com/techblog/?p=47" rel="bookmark">X64 UnPacking Armadillo</a></h2> <div class="meta">Posted by Eric | <a href="http://hamsterswheel.com/techblog/?cat=13" title="View all posts in Reversing" rel="category">Reversing</a> | Monday 3 March 2008 9:46 pm </div> <div class="storycontent"> <p>PnLuck over at  Universidad de  cracking italiano  wrote up a tutorial on Unpacking Armadillo5 on x64. Check it out when you get a chance</p> <p>http://quequero.org/Armadillo5_x64_Unpacking</p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=47#comments" title="Comment on X64 UnPacking Armadillo">Comments (1)</a> </div> </div> <div class="post"> <h2 id="post-46"><a href="http://hamsterswheel.com/techblog/?p=46" rel="bookmark">The Briefest ELF intro EVAR!</a></h2> <div class="meta">Posted by Eric | <a href="http://hamsterswheel.com/techblog/?cat=3" title="View all posts in Linux" rel="category">Linux</a>, <a href="http://hamsterswheel.com/techblog/?cat=11" title="View all posts in Research" rel="category">Research</a> | Sunday 2 March 2008 1:15 am </div> <div class="storycontent"> <p><meta content="text/html; charset=utf-8" http-equiv="CONTENT-TYPE" /><title /><meta content="OpenOffice.org 2.0 (Linux)" name="GENERATOR" /><meta content="20080301;22530800" name="CREATED" /><meta content="16010101;0" name="CHANGED" /><br /> <style> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style> <p style="margin-bottom: 0in">March marks a new month and lately that means a new topic for discussion and research on the blog. This month I’ve chosen a going back to basics tour dealing with linux exploitation. I’ve created a general outline to follow and will begin this evening with a few words on the Elf Format. There are a few tutorials out there already so I will make this brief.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">The Elf Format is a common standard for object files in linux, unix and unix like operating systems. The three main types of object files are:</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Relocatable file which holds code and data suitable for linking with other files</p> <p style="margin-bottom: 0in">Executable files- which hold a program suitable for execution.</p> <p style="margin-bottom: 0in">Share objects – which holds code and data suitable for linking</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">The ELF Format can be view visually as the following:</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"><a href="http://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Elf-layout--en.svg/200px-Elf-layout--en.svg.png"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Elf-layout--en.svg/200px-Elf-layout--en.svg.png" /><br /> </a></p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Each ELF file has an elf header followed by data which includes:</p> <ul> <li> <p style="margin-bottom: 0in">program header table</p> </li> <li> <p style="margin-bottom: 0in">section header table</p> </li> <li> <p style="margin-bottom: 0in">data referred to by entries in the program</p> </li> </ul> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">The ELF Header is located at the beginning of the file and is used to describe the files internal organization.</p> <p style="margin-bottom: 0in">Similar to PECOFF, The Sections hold the bulk of information such as instructions, data, symbol table and location info.</p> <p style="margin-bottom: 0in"> <p> <!-- Begin Google Adsense code --> <script type="text/javascript"><!-- google_ad_client = "pub-9774791470740882"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- End Google Adsense code --> </p> <p style="margin-bottom: 0in">For more information on ELF you can visit the following links, although some of them are rather dry.</p> <p style="margin-bottom: 0in"><a href="http://www.linux-foundation.org/spec/book/ELF-generic/ELF-generic/book1.html">http://www.linux-foundation.org/spec/book/ELF-generic/ELF-generic/book1.html</a></p> <p style="margin-bottom: 0in"><a href="http://www.linux-foundation.org/spec/book/ELF-IA32/ELF-IA32/book1.html">http://www.linux-foundation.org/spec/book/ELF-IA32/ELF-IA32/book1.html</a></p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Next post we will be going into Linux Memory Management</p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=46#respond" title="Comment on The Briefest ELF intro EVAR!">Comments (0)</a> </div> </div> </div> <div id="footer"> © Copyright 2009 | <a href="http://hamsterswheel.com/techblog">Phn1x – Hamsterswheel</a> | Theme by <a href="http://clubparexcellancetech.com/">Club Par Excellance</a> | All Rights Reserved | Sponsored by <a href="http://www.voipkit.ca/">VoIP</a> </div> </body> </html>