<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>WebstersProdigy &#187; Linux</title>
	<atom:link href="http://webstersprodigy.net/category/computers/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://webstersprodigy.net</link>
	<description>Updates every other Friday... usually</description>
	<lastBuildDate>Sat, 26 May 2012 06:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='webstersprodigy.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>WebstersProdigy &#187; Linux</title>
		<link>http://webstersprodigy.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://webstersprodigy.net/osd.xml" title="WebstersProdigy" />
	<atom:link rel='hub' href='http://webstersprodigy.net/?pushpress=hub'/>
		<item>
		<title>GPG Cheat Sheet</title>
		<link>http://webstersprodigy.net/2009/07/08/gpg-cheat-sheet/</link>
		<comments>http://webstersprodigy.net/2009/07/08/gpg-cheat-sheet/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 05:16:24 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[GrayHat]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[gpg]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=580</guid>
		<description><![CDATA[The gnu Privacy handbook has a ton of useful information, but I thought I&#8217;d make a quick reference for the gpg usage I use most. Especially because I was just an idiot and lost my gpg private key (though I do remember the passphrase) &#8211; this time there will be a backup! List all keys [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=580&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The gnu Privacy handbook has a ton of useful information, but I thought I&#8217;d make a quick reference for the gpg usage I use most. Especially because I was just an idiot and lost my gpg private key (though I do remember the passphrase) &#8211; this time there will be a backup!</p>
<p>List all keys</p>
<blockquote><p>gpg &#8211;list-keys</p></blockquote>
<p>print key to a file (mypublickey) &#8211; &lt;keyid&gt; is listed when you do list-keys</p>
<blockquote><p>gpg -ao mypublickey.key &#8211;export &lt;keyid&gt;</p></blockquote>
<p>show secret keys</p>
<blockquote><p>gpg &#8211;list-secret-keys</p></blockquote>
<p>backup secret keys</p>
<blockquote><p>gpg -a &#8211;export-secret-keys &lt;keyid&gt; | gpg-aco myprivatkeyfile.key.gpg</p></blockquote>
<p>Restoring the key</p>
<blockquote><p>gpg &#8211;import {keyfile}</p></blockquote>
<p>Restore an encrypted key</p>
<blockquote><p>gpg &#8211;decrypt {privatekeyfile} | gpg &#8211;import</p></blockquote>
<p>Sign a file</p>
<blockquote><p>gpg &#8211;output doc.sig &#8211;sign doc</p></blockquote>
<p>verify signature</p>
<blockquote><p>gpg &#8211;output mydoc &#8211;decrypt doc.sig</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/580/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=580&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/07/08/gpg-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>execv-like system call</title>
		<link>http://webstersprodigy.net/2009/06/30/execv-like-system-call/</link>
		<comments>http://webstersprodigy.net/2009/06/30/execv-like-system-call/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 15:54:38 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=569</guid>
		<description><![CDATA[From the system man page, it explicitely says: Do not use system() from a program with set-user-ID or set-group-ID privileges, because strange values for some environment variables might be used to subvert system integrity. Good advice, but sometimes you need to get stuff done anyway. This is experimenting with pam and execv from a stupid [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=569&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>From the system man page, it explicitely says:</p>
<blockquote><p>Do not use <strong>system</strong>() from a program with set-user-ID or set-group-ID privileges, because strange values for some environment variables might be used to subvert system integrity.</p></blockquote>
<p>Good advice, but sometimes you need to get stuff done anyway. This is experimenting with pam and execv from a stupid google apps pam module I wrote</p>
<p><pre class="brush: cpp;">

PID = fork();
if (PID == 0) {
  //child
  char* argvarray[4] = {progarg0, username, newpass, (char *) 0};
  execv(netprog, argvarray);
  if (debug == 1)
    printf(&quot;forking failure\n&quot;);
  report_error(1);
  return PAM_CRED_ERR;
}
else if (PID &lt; 0) {
  if (debug == 1)
    printf(&quot;unexpected error\n&quot;);
  report_error(1);
  return PAM_CRED_ERR;
}
 
wait(&amp;amp;execreturn);
//make sure this does exit properly and isn't killed
if (WIFEXITED(execreturn)) {
  rc = WEXITSTATUS(execreturn);
}
else {
  report_error(1);
  return PAM_CRED_ERR;
}
</pre></p>
<p>The first 18 lines emulate a system call. The rest is used to get the return value, which you would also need to do with a system call. Basically, it has close to the same functionality as if it were:</p>
<p><pre class="brush: cpp;">
system(&quot;programcall&quot;);
 
wait(&amp;amp;execreturn);
//make sure this does exit properly and isn't killed
if (WIFEXITED(execreturn)) {
  rc = WEXITSTATUS(execreturn);
}
else {
  report_error(1);
  return PAM_CRED_ERR;
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/569/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/569/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/569/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/569/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/569/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/569/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/569/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/569/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/569/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/569/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/569/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/569/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/569/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/569/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=569&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/06/30/execv-like-system-call/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>browsing with firefox, tor, refcontrol, and noscript on ubuntu</title>
		<link>http://webstersprodigy.net/2009/05/08/browsing-with-firefox-tor-refcontrol-and-noscript-on-ubuntu/</link>
		<comments>http://webstersprodigy.net/2009/05/08/browsing-with-firefox-tor-refcontrol-and-noscript-on-ubuntu/#comments</comments>
		<pubDate>Fri, 08 May 2009 20:54:43 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[GrayHat]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[referer]]></category>
		<category><![CDATA[tor]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=534</guid>
		<description><![CDATA[I am doing some research that involves a *lot* of google searches. Because this research involves a significant number of directed queries, it seems logical to hide this information as much as practical. If there is a web host who notices sequential names in a Google referer URL repeatedly, this might raise suspicion or alter behavior which could skew results. Similarly, it is desirable to hide IP information from both the web host (for similar reasons) and possibly even search engines.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=534&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a topic that&#8217;s been covered a lot. However, it took a bit of research to find a solution that worked for me, so I thought I&#8217;d write about it here.</p>
<p>I am doing some research that involves a *lot* of google searches. Because this research involves a significant number of directed queries, it seems logical to hide this information as much as practical. If there is a web host who notices sequential names in a Google  referer URL repeatedly, this might raise suspicion or alter behavior which could skew results. Similarly, it is desirable to hide IP information from both the web host (for similar reasons) and possibly even search engines.</p>
<p>First, to  avoid any changes to usual browsing, a new firefox profile was created using:</p>
<blockquote><p>firefox -ProfileManager</p></blockquote>
<p>Additionally, to run both firefox profiles at once, the first was run as normal, which the second has the additional options:</p>
<blockquote><p>firefox -P &lt;new-profile&gt; -no-remote</p></blockquote>
<p>I add this to my taskbar alongside the regular old firefox %u so I can choose a profile with a click.</p>
<p>To hide the HTTP referer, a firefox extension called RefControl was selected  <a href="https://addons.mozilla.org/en-US/firefox/addon/953">https://addons.mozilla.org/en-US/firefox/addon/953</a>. This simply replaces the referer for every query with one that is configurable. Although this is certainly possible with a more traditional proxy (like paros), RefControl&#8217;s ease of use is essential with the shear number of queries that were performed for this research. For this research, I changed the referer passed several times from names like “yahoo.com”, “cnn.com”, etc. Although the traffic patterns may still seem suspicious to an administrator who carefully monitors his logs, it reveals virtually no information about what it is that is being searched for.</p>
<p>To obfuscate the IP address, tor and privoxy were used. Tor bounces the HTTP requests around a distributed network of relays all around the world. An in depth discussion of Tor is out of the context here, but in a nutshell “it prevents somebody watching your Internet connection from learning what sites you visit, and it prevents the sites you visit from learning your physical location” http://www.torproject.org/. Privoxy is additionally used to prevent applications like flash or dns from leaking information. Since both privoxy and tor are required, you need to install these:</p>
<blockquote><p>apt-get install tor privoxy</p></blockquote>
<p>and to get privoxy to work with tor, I uncommented the following line (if it&#8217;s not there just add it):</p>
<blockquote><p>forward-socks4a / localhost:9050 .</p></blockquote>
<p>Despite the advantages, this did make browsing for names quite slow. I really like torbutton. In the not so distant future I remember having to modify proxy settings every time I wanted to go back and forth using tor. With tor</p>
<p>Lastly, the noscript firefox plugin was used to mitigate all javascript based attacks that might be used to obtain IP information http://noscript.net/.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/534/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/534/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=534&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/05/08/browsing-with-firefox-tor-refcontrol-and-noscript-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>Security in an Insecure Environment</title>
		<link>http://webstersprodigy.net/2009/04/22/security-in-an-insecure-environment/</link>
		<comments>http://webstersprodigy.net/2009/04/22/security-in-an-insecure-environment/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 03:30:48 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[GrayHat]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[windoze]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=520</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=520&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<iframe src="https://docs.google.com/present/embed?id=dhnfxq99_279djvf95fd" frameborder="0" width="410" height="342"  marginheight="0" marginwidth="0"></iframe>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/520/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=520&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/04/22/security-in-an-insecure-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>stk500 avr atmega16 linux gcc hello, world</title>
		<link>http://webstersprodigy.net/2009/04/04/stk500-avr-atmega16-linux-gcc-hello-world/</link>
		<comments>http://webstersprodigy.net/2009/04/04/stk500-avr-atmega16-linux-gcc-hello-world/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 06:12:48 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[Bits and Bytes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[atmel]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[rtos]]></category>
		<category><![CDATA[stk500]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=467</guid>
		<description><![CDATA[Does my title sound like buz-word central? You bet it does. That's because it was a bit difficult to find any good introductory material on this. Maybe that's because there's so much information out there...<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=467&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Does my title sound like buz-word central? You bet it does. That&#8217;s because it was a bit difficult to find any good introductory material on this. Maybe that&#8217;s because there&#8217;s so much information out there&#8230;</p>
<p>Anyway, here is some. The README:</p>
<blockquote><p>Rich Lundeen<br />
lundrich@isu.edu</p>
<p>The Specification:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>The purpose of this assignment is to introduce you to the software tools we will use for the<br />
AVR microprocessor, and to give you a better understanding of the run-time environment that<br />
a C program operates under.<br />
For this assignment, you will write a C main program and two subroutines &#8211; one in AVR<br />
assembly, and the other in C. The subroutines should each do the same thing:<br />
1. Monitor a port (your choice) that is connected to a switch. Wait until the switch is<br />
pressed.<br />
2. Once pressed, the routine should keep track of how long the switch is held down.<br />
3. Wait for approximately one second.<br />
4. Using another port (your choice) connected to a LED, turn on the LED for the same<br />
amount of time that the switch was pressed earlier.<br />
In addition to writing the code, determine the size of the code (main and both subroutines) in<br />
your program.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>This code requires avrdude, avr-gcc, and objcopy are installed.</p>
<p>To compile the C version, type:</p>
<p>make</p>
<p>To compile the asm version, type:</p>
<p>make asm</p>
<p>After it&#8217;s compiled, to install to a connected and powered on atmega16 board, type:</p>
<p>make install</p>
<p>homework1.avi contains a short demonstration of the C version &#8211; however, both do the same thing. It<br />
will play with vlc or mplayer.</p></blockquote>
<p>Here is a demo of the program.. oooh blinky lights. Yeah, and anyway, the hardest part is just to find a hello world. This includes one in both C and assembly, so good hunting!</p>
<span style="text-align:center; display: block;"><a href="http://webstersprodigy.net/2009/04/04/stk500-avr-atmega16-linux-gcc-hello-world/"><img src="http://img.youtube.com/vi/I654p4fcjww/2.jpg" alt="" /></a></span>
<p>Download the source<a href="https://skydrive.live.com/redir.aspx?cid=19794fac33285fd5&amp;resid=19794FAC33285FD5!141&amp;parid=19794FAC33285FD5!140"> here</a>,</p>
<p><pre class="brush: cpp;">
/*main.c*/
#include &quot;portstuff.h&quot;

int main (void) {
  DDRB = 0xff;  /*11111111 means all output */
  DDRD = 0x00;  /*00000000 for all input */

  PORTB = 0xff;
  portmon();
  return(0);
}
</pre><br />
<pre class="brush: cpp;">
/*portstuff.h*/
#include
#include
#include

void portmon();
</pre><br />
<pre class="brush: cpp;">
/* portstuff.c */
#include &quot;portstuff.h&quot;

/*this is in clock cycles for my board.
* 30000 seems to be close to about a sec */
const DELAY = 30000;

void portmon() {
  while(1) {
    unsigned long timer = 0;
    unsigned long i;
    /*while a button is pressed */
    while (PIND != 0xff) {
      /*light up the button pressed */
      PORTB = PIND;
      timer += 1;
    }
    PORTB = 0xff;
    /*if the timer is not zero, we need to handle a button pressed */
    if (timer != 0) {
      /*delay for about a second */
      for (i = DELAY; i!=0; i--);
      PORTB = 0x00;
      /*delay for timer roughly equal to how long button was pressed */
      for (i = timer; i!=0; i--);
      timer = 0;
    }
  }
}
</pre><br />
<pre class="brush: cpp;">
#Makefile
#c specific - this is the default

homework1.hex: homework1.out
    objcopy -S -O ihex homework1.out homework1.hex
homework1.out: main.o portstuff.o
    avr-gcc -mmcu=atmega16 main.o portstuff.o -o homework1.out
main.o: portstuff.h main.c
    avr-gcc -c -mmcu=atmega16 main.c
portstuff.o: portstuff.h portstuff.c
    avr-gcc -c -mmcu=atmega16 portstuff.c

#assembly specific rules

asm: howework1asm.out
    objcopy -S -O ihex homework1.out homework1.hex
howework1asm.out: main.o portstuffasm.o
    avr-gcc -mmcu=atmega16 main.o portstuffasm.o -o homework1.out
portstuffasm.o: portstuff.h portstuff.s
    avr-gcc -c -mmcu=atmega16 portstuff.s -o portstuffasm.o

#clean and install

clean:
    rm ./*.o ./*.hex ./homework1.out

install:
    avrdude -y -C /etc/avrdude/avrdude.conf -p atmega16 -P /dev/ttyS0 -c stk500v2 -U flash:w:homework1.hex:i
</pre><br />
<pre class="brush: cpp;">
/*portstuff.s*/
#include &quot;portstuff.h&quot;

.file	&quot;portstuff.c&quot;
PORTB  = 56-0x20
PORTD  = 48-0x20
ALLON  = 31
WAIT   = 0xa
.text
.global	portmon
.type	portmon, @function
portmon:
/*initialize count to zero */
.BEGIN:
/*r18 is our counter*/
ldi     r18,0x00

/*initialize port values*/
in  r24,PORTD
out PORTB, r24

.LEDWAIT:
in  r24,PORTD
nop

/*see if the button is currently pressed - if it is then continue
if not jump to .LEDWAIT */
cpi r24, lo8(-1)
breq .LEDWAIT

.BUTTONPRESSED:

out PORTB, r24

/*measure the number of delays the button is pressed*/
rcall delay
inc r18

/*see if button is still currently pressed - if it is then
jump to Buttonpressed */

in   r24, PORTD
cpi  r24, lo8(-1)
brne .BUTTONPRESSED

out PORTB, r24
ldi r23, WAIT
.DELAYSECOND:
/*theoretically this delays a second */
rcall delay
dec r23
cpi r23,0
brne .DELAYSECOND

.LEDSON:
/*light up all leds for the amount of time the one was pressed*/
out PORTB, ALLON
rcall delay
dec r18
cpi r18,0
breq .BEGIN
rjmp .LEDSON

/*delay function makes time reasonable to deal with */
delay:
ldi r17,0x60
waitouterloop:
ldi r16,0xFF
waitinnerloop:
subi r16,0x01
brne waitinnerloop
subi r17,0x01
brne waitouterloop
ret

.size	portmon, .-portmon
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/467/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=467&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/04/04/stk500-avr-atmega16-linux-gcc-hello-world/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>php multiuser system &#8211; the www-data problem</title>
		<link>http://webstersprodigy.net/2009/03/19/php-multiuser-system-the-www-data-problem/</link>
		<comments>http://webstersprodigy.net/2009/03/19/php-multiuser-system-the-www-data-problem/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 20:58:19 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=459</guid>
		<description><![CDATA[On our multi-user system, one where we have 300+ users all with usermod enabled, we also happen to have other web services running. It's inconvenient and in some ways insecure for everyone to be running their dynamic web stuff as the same user. One problem in particular is php. suexec was built for cgi-bin stuff - but php is a whole other beast. That's what I'm talking about here - getting php to run as the user who owns it. More specifically, this will show how /home/user/public_html/myphp.php will run as "user", but stuff in /var/www will still run as www-data.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=459&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>On a lot of multi-user systems, like the one at the school where we have 300+ users all with usermod enabled, we also happen to have other web services running. It&#8217;s inconvenient and in insecure for everyone to be running their dynamic web stuff as the same user. I understand this is nearly impossible to do with good security, but this is a university and the point of this server is to let students learn, which means being able to host code.</p>
<p>One security problem in particular is php. suexec was built for cgi-bin stuff &#8211; but php is a whole other beast. That&#8217;s what I&#8217;m talking about here &#8211; getting php to run as the user who owns it. More specifically, this will show how /home/user/public_html/myphp.php will run as &#8220;user&#8221;, but stuff in /var/www will still run as www-data.</p>
<p>One good article I found describing this is here: http://alain.knaff.lu/howto/PhpSuexec/</p>
<p>First things first &#8211; mod_php needs to be disabled. This can be done globally, but it&#8217;s better to just disable it for public_html dirs. This can be done by adding the following to /etc/apache2/apache2.conf.<br />
<pre class="brush: plain;">
&lt;Directory /home&gt;
 php_admin_flag engine off
&lt;/Directory&gt;
</pre><br />
Now, to enable suphp.</p>
<p>First install php-cgi. and the apache2 prefork which has some things we&#8217;ll need later on.<br />
<pre class="brush: plain;">apt-get install php-cgi apache2-prefork-dev</pre><br />
Do not install libapache2-mod-suphp &#8211; at least not on 8.04. This older version lacks some of the things most people need&#8230; like having more than one directory.</p>
<p>Download the latest suphp module from http://www.suphp.org/Home.html.  Compile this like:<br />
<pre class="brush: plain;">
tar xfzv suphp-SNAPSHOT-2008-03-31.tar.gz
cd suphp-SNAPSHOT-2008-03-31
./configure --with-apxs=/usr/bin/apxs2 --with-setid-mode=owner
make
make install
</pre></p>
<p>Modify apache&#8217;s config<br />
<pre class="brush: plain;">
LoadModule suphp_module /usr/lib/apache2/modules/mod_suphp.so
&lt;Directory /home&gt;
AddHandler application/x-httpd-php .php .php3 .php4 .php5 .phtml
suPHP_AddHandler application/x-httpd-php
suPHP_Engine on
&lt;/Directory&gt;
</pre></p>
<p>Now in /usr/local/etc/suphp.conf</p>
<p><pre class="brush: plain;">
[global]
webserver_user=www-data
docroot=${HOME}/public_html
check_vhost_docroot=false

[handlers]
;Handler for php-scripts
application/x-httpd-php=&quot;php:/usr/bin/php-cgi&quot;
</pre></p>
<p>Restart apache. To debug, check /var/log/apache2/errors.log.  To test create scripts in public_html directories and in /var/www that exec(&#8216;whoami&#8217;) and make sure they&#8217;re called with the correct permissions.</p>
<p>It&#8217;s a start, but then there&#8217;s always stuff like XSS, etc.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/459/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=459&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/03/19/php-multiuser-system-the-www-data-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>Auto Restore Virtualbox</title>
		<link>http://webstersprodigy.net/2009/03/18/auto-restore-virtualbox/</link>
		<comments>http://webstersprodigy.net/2009/03/18/auto-restore-virtualbox/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 15:55:41 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[GrayHat]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[windoze]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=446</guid>
		<description><![CDATA[For the security class I'm teaching we recently had a box to pwn. Problem is, they would sometimes get the address wrong and crash the virtual system. I probably would have just distributed the vdi, but not all of them have machines robust enough to run a vm, so I had to set something up.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=446&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For the security class I&#8217;m teaching we recently had a box to pwn. Problem is, they would sometimes get the address wrong and crash the virtual system. I probably would have just distributed the vdi, but not all of them have machines robust enough to run a vm, so I had to set something up.<br />
First off, I gave the virtual vulnerable box a public IP by bridging.</p>
<p>/etc/network/interfaces</p>
<p><pre class="brush: plain;">
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
    address 134.50.1.2
    netmask 255.255.0.0
    gateway 134.50.1.254
    bridge_ports eth0 vbox0 vbox1

# The loopback network interface
auto lo
iface lo inet loopback
</pre></p>
<p>/etc/vbox/interfaces</p>
<p><pre class="brush: plain;">
vbox0 lundeen br0
vbox1 lundeen br0
</pre></p>
<p>Awesome, now firewall rules work. In the vulnbox, I give myself an ip address. On the host, I set up very strict firewall rules using iptables.</p>
<p>Another big issue is auto-restore. Since the class often gets an address wrong, the vulnbox often crashes.</p>
<p>The following will shut the box down, revert to a snapshot, and turn it back on.</p>
<p><pre class="brush: plain;">
/usr/bin/VBoxManage controlvm vulnxp poweroff;
sleep 5;
/usr/bin/VBoxManage snapshot vulnxp discardcurrent -state
sleep 10;
/usr/bin/VBoxManage startvm vulnxp&lt;/pre&gt;
</pre></p>
<p>Anyway, I put this in crontab to do every 20 minutes.</p>
<p><pre class="brush: plain;">0,20,40 * * * * /path/to/virtualscript</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/446/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=446&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/03/18/auto-restore-virtualbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>Count number of lines in a file</title>
		<link>http://webstersprodigy.net/2009/02/26/count-number-of-lines-in-a-file/</link>
		<comments>http://webstersprodigy.net/2009/02/26/count-number-of-lines-in-a-file/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 20:13:28 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=443</guid>
		<description><![CDATA["find . -type f -exec cat {} ; &#124; wc -l;" and if you don't want repeats "find . -type f -exec cat {} ; &#124; egrep \S &#124; wc -l"
<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=443&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote><p>find . -type f -exec cat {} ; | wc -l</p></blockquote>
<p>and if you don&#8217;t want repeats</p>
<blockquote><p>find . -type f -exec cat {} ; | egrep \S | wc -l</p></blockquote>
<p>I even thought about cat, but I ended up doing something like:</p>
<p><pre class="brush: bash;">
total=0
for i in $( find -H . -type f ); do
  temp=$( wc -l &quot;$i&quot; | cut -f 1 -d  )
  if [ $temp &amp;gt; 0 ]; then
    total=$(($total+$temp))
  fi
  echo $total
done
echo $total
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/443/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=443&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/02/26/count-number-of-lines-in-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>mounting partitions from a disk image</title>
		<link>http://webstersprodigy.net/2009/02/03/mounting-partitions-from-a-disk-image/</link>
		<comments>http://webstersprodigy.net/2009/02/03/mounting-partitions-from-a-disk-image/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 20:10:38 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[Bits and Bytes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[forensics]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=438</guid>
		<description><![CDATA[My laptop drive recently died on me. Of course, this is the one machine that I don't have good backups on. After various passes of dd_rescue (forward and backward) I had a pretty good disk image. Now I wanted to mount a partition. Problem is, I had an image.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=438&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My laptop drive recently died on me. Of course, this is the one machine that I don&#8217;t have good backups on. After various passes of dd_rescue (forward and backward) I had a pretty good disk image. Now I wanted to mount a partition. Problem is, I had an image.</p>
<p>The first step is to identify where the partitions are.<br />
<pre class="brush: plain;">
# fdisk -l /mnt/backup/brian/brian.iso 

Disk /mnt/backup/brian/brian.iso: 250 GB, 250056737280 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                      Device Boot      Start         End      Blocks   Id  System 
/mnt/backup/brian/brian.iso1               1           6       48163   de  Dell Utility
/mnt/backup/brian/brian.iso2   *           7       30009   240991065    7  HPFS/NTFS
/mnt/backup/brian/brian.iso3           30010       30401     3140707    f  Extended LBA
</pre></p>
<p>Notice the cylinder size (512) and where the partitions are.</p>
<p>TODO: fix this. The -u option should be used so fdisk specifies cylinders. then it can be mounted with loop and offset.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/438/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=438&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/02/03/mounting-partitions-from-a-disk-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>madwifi == awesome</title>
		<link>http://webstersprodigy.net/2008/11/12/madwifi-awesome/</link>
		<comments>http://webstersprodigy.net/2008/11/12/madwifi-awesome/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 19:44:33 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=420</guid>
		<description><![CDATA[You know, with how much people tout the prism2 chipset, atheros sometimes gets looked over.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=420&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You know, with how much people tout the prism2 chipset, atheros sometimes gets looked over.</p>
<p>http://madwifi-project.org/wiki/About/MadWifi?redirectedfrom=MadWifi</p>
<p>https://www.ath9k.org/wiki/UserDocs/MonitorModeInterface</p>
<p>blam.</p>
<p>I mean, it&#8217;s got interfaces to act as vaps, to go in rfmon mode&#8230;  pretty cool.  I haven&#8217;t figured out how to reach the full potential of my prism2.5 card yet though, so I guess I&#8217;ll need more experimenting with both</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/420/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=420&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2008/11/12/madwifi-awesome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
	</channel>
</rss>
