<?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/"
	>

<channel>
	<title>Patterns In The Void</title>
	<atom:link href="http://www.patternsinthevoid.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.patternsinthevoid.net/blog</link>
	<description>Anarchism, Particle Physics, Occultism, &#38; Hacking</description>
	<lastBuildDate>Sun, 29 Jan 2012 09:01:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>pyrsync: A pure Python module for the rsync algorithm</title>
		<link>http://www.patternsinthevoid.net/blog/2012/01/rsync-in-pure-python/</link>
		<comments>http://www.patternsinthevoid.net/blog/2012/01/rsync-in-pure-python/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 08:10:44 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Anarchism]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1178</guid>
		<description><![CDATA[I quickly modified and packaged a pure Python implementation of the rsync algorithm today. It&#8217;s on Github and PyPi. It&#8217;s going to be used in the open-source, symmetrically-encrypted, bandwidth-efficient, cross-platform backup software that I&#8217;m writing. Because why, for fuck&#8217;s sake, would you trust *all the files* on your computer, plus your cryptographic scheme, and potentially, [...]]]></description>
			<content:encoded><![CDATA[<p>I quickly modified and packaged a pure Python implementation of the <a href="http://samba.anu.edu.au/rsync/">rsync algorithm</a> today. It&#8217;s on <a href="https://github.com/isislovecruft/pyrsync">Github</a> and <a href="https://pypi.python.org/pypi/pyrsync/0.1.0">PyPi</a>. It&#8217;s going to be used in the open-source, symmetrically-encrypted, bandwidth-efficient, cross-platform backup software that I&#8217;m writing. Because why, for fuck&#8217;s sake, would you trust *all the files* on your computer, plus your cryptographic scheme, and potentially, keys, to a bunch of capitalist pig-dogs?</p>
<p>I hope other people find this useful, because making Python modules is totally not as exciting as just coding in Python.</p>
<p>And jetlag FTL: I need to sleep now. And <a href="http://www.forbes.com/sites/erikkain/2012/01/02/president-obama-signed-the-national-defense-authorization-act-now-what/">WTF, America</a>: I hate your <a href="https://www.indybay.org/newsitems/2010/01/30/18636597.php">filthy</a> <a href="http://articles.latimes.com/2011/jul/10/health/la-he-gmo-foods-20110710">guts</a> and I&#8217;m leaving ASAFP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2012/01/rsync-in-pure-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Viennese Cathedrals &amp; Sleepy Hollow</title>
		<link>http://www.patternsinthevoid.net/blog/2012/01/viennese-cathedrals-sleepy-hollow/</link>
		<comments>http://www.patternsinthevoid.net/blog/2012/01/viennese-cathedrals-sleepy-hollow/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 08:24:21 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[cathedral]]></category>
		<category><![CDATA[gothic]]></category>
		<category><![CDATA[graveyard]]></category>
		<category><![CDATA[sleepy hollow]]></category>
		<category><![CDATA[vienna]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1213</guid>
		<description><![CDATA[Two of the prettier places I&#8217;ve visited recently. I need to start making a better effort at photodocumentation. &#160;]]></description>
			<content:encoded><![CDATA[<p>Two of the prettier places I&#8217;ve visited recently. I need to start making a better effort at photodocumentation.</p>
<p><a href="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/wtf_wien.jpeg"><img class="aligncenter  wp-image-1216" title="wtf_wien" src="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/wtf_wien.jpeg" alt="" width="777" height="243" /></a></p>
<p><a href="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/sleepy_hollow_crypt.jpeg"><img class="aligncenter  wp-image-1214" title="sleepy_hollow_crypt" src="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/sleepy_hollow_crypt.jpeg" alt="" width="779" height="278" /></a></p>
<p><a href="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/sleepy_hollow_vault1.jpeg"><img class="aligncenter size-full wp-image-1218" title="sleepy_hollow_vault" src="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/sleepy_hollow_vault1.jpeg" alt="" width="781" height="294" /></a></p>
<p><a href="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/sleepy_hollow_train_bridge.jpeg"><img class="aligncenter  wp-image-1217" title="sleepy_hollow_train_bridge" src="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/sleepy_hollow_train_bridge.jpeg" alt="" width="764" height="402" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2012/01/viennese-cathedrals-sleepy-hollow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Italia</title>
		<link>http://www.patternsinthevoid.net/blog/2012/01/italia/</link>
		<comments>http://www.patternsinthevoid.net/blog/2012/01/italia/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 07:14:59 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hackers]]></category>
		<category><![CDATA[italia]]></category>
		<category><![CDATA[Tor]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1151</guid>
		<description><![CDATA[I&#8217;m sitting in a cottage in the Italian countryside outside Florence, eating a breakfast of cafe brewed in an antique mocha, fette biscottate con riso with vegan hazelnutella and arance amare, a spread of bitter oranges. Outside the lead-paned window with iron fittings, I can see hills covered with vineyards, and a haze of clouds [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sitting in a cottage in the Italian countryside outside Florence, eating a breakfast of cafe brewed in an antique mocha, fette biscottate con riso with vegan hazelnutella and arance amare, a spread of bitter oranges. Outside the lead-paned window with iron fittings, I can see hills covered with vineyards, and a haze of clouds below covers a snowy valley with forested mountains in the distance. The floors and roof are both constucted of bricks and timbers, and a castlemonte woodstove creaks and crackles behind me.</p>
<p>Last night I shared a sleeping compartment on a night train from Munich with four noisy Estonians and a cute Italian hacker boy, who cuddled next to me reading white papers on homomorphic cryptography. He works on Tor, and also writes screenplays and acted in an Italian television series.</p>
<p>We hiked through the countryside, through olive orchards, practicing mentalist magic on kachi trees with rotten fruits, daring them to drop to the ground. We marched through the keep of a fortress older than the country I was born in.</p>
<p>I don&#8217;t want to go home. Or rather, I&#8217;ve rediscovered that my home is a terrible place.</p>
<p><a href="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/arturorome2.jpg"><img class="aligncenter  wp-image-1155" title="arturorome2" src="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/arturorome2-1024x768.jpg" alt="" width="601" height="450" /></a></p>
<p><center><a href="http://translate.google.com/?q=gt+Via+viaVieni+via+con+me.Niente+pi%C3%B9+ti+lega+a+questi+luoghiPaolo+Neanche+questi+fiori+azzuri.Via+viaNeanche+questo+tempo+grigio,pieno+di+musicheConte+e+di+uomini+che+ti+son+piaciuti.&#038;oe=utf-8&#038;rls=org.mozilla:en-US:unofficial&#038;client=iceweasel-a&#038;um=1&#038;ie=UTF-8&#038;hl=en&#038;sa=N&#038;tab=wT#auto|en|Via%20via%20vieni%20via%20con%20me.%20Niente%20pi%C3%B9%20ti%20lega%20a%20questi%20luoghi%20neanche%20questi%20fiori%20azuri.%20Via%20via%20neanche%20questo%20tempo%20grigio%2C%20pieno%20di%20musiche%20conte%20e%20di%20uomini%20che%20ti%20son%20piaciuti.%0AVia%20via%20vieni%20via%20con%20me.%20Entra%20in%20questo%20amore%20buio%2C%20non%20perderti%20per%20niente%20al%20mondo.%20Via%20via%20non%20perderti%20per%20niente%20al%20mondo.%20Lo%20spettacolo%20darti%20varia%20di%20uno%20innamorato%20di%20te.%20%0AVia%20via%20vieni%20via%20con%20me.%20Conte%20entra%20in%20questo%20amore%20buio%20pieno%20di%20uomini.%20Via%20via%20entra%20e%20fatti%20un%20bagno%20caldo.%20Via%20C%C3%A8%20un%20accappatoio%20azzurro.%20Fuori%20piove%2C%20%C3%A8%20un%20mondo%20freddo.%20%0A%0A"><3</a> <a href="http://www.youtube.com/watch?v=VJKX9Z86WuY"><3</a> <a href="http://www.youtube.com/watch?v=hVHjwAwZdNk&#038;feature=BFp&#038;list=PL17D01C49099D0F12"><3</a><center></p>
<p><a href="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/arturorome11.jpg"><img class="aligncenter  wp-image-1157" title="arturorome11" src="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/arturorome11-1024x768.jpg" alt="" width="600" height="450" /></a></p>
<p><a href="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/arturorome10.jpg"><img class="aligncenter  wp-image-1156" title="arturorome10" src="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/arturorome10-1024x768.jpg" alt="" width="600" height="450" /></a></p>
<p><a href="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/rome8.jpg"><img class="aligncenter  wp-image-1158" title="rome8" src="http://www.patternsinthevoid.net/blog/wp-content/uploads/2012/01/rome8-1024x768.jpg" alt="" width="600" height="450" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2012/01/italia/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Journey to the End of the Night</title>
		<link>http://www.patternsinthevoid.net/blog/2012/01/journey-to-the-end-of-the-night/</link>
		<comments>http://www.patternsinthevoid.net/blog/2012/01/journey-to-the-end-of-the-night/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 10:55:47 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Anarchism]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1146</guid>
		<description><![CDATA[In Berlin, on New Year&#8217;s Eve, I participated in a race through the streets of Berlin, called Journey to the End of the Night &#8212; except this one, being at the end of the year, is called Journey to the End of the Year. The rules: run through six checkpoints in order, complete a challenge [...]]]></description>
			<content:encoded><![CDATA[<p>In Berlin, on New Year&#8217;s Eve, I participated in a race through the streets of Berlin, called Journey to the End of the Night &#8212; except this one, being at the end of the year, is called <a href="http://totheendoftheyear.com/">Journey to the End of the Year</a>. The rules: run through six checkpoints in order, complete a challenge at each one, and don&#8217;t get caught by the chasers or lose your armband.</p>
<p>I formed a running team with <a href="http://hellais.wordpress.com/">an Italian hacker who works on Tor</a>, and his friend from Greece who is also a hacker. They showed up thirty minutes late (for which the organizers, my friends <a href="https://twitter.com/#!/fin">from Vienna</a> and <a href="https://twitter.com/#!/Rubin110">San Francisco</a>, postponed the race) with a backpack full of explosives. Let me tell you: Berliners take their fireworks <em>very seriously</em>, and firework safety inversely so. It&#8217;s not uncommon at all for a complete stranger to throw the equivalent of a quarter stick of dynamite <em>in your direction</em>. Also, I noticed that Berliners like to surprise you by throwing bottles and chairs. </p>
<p>So, armed to the teeth with explosives, we set out running through the streets with others chasing us. Because there was a joke rule that my friend Redbeard&#8217;s beard was a safe zone, I ended up having to kidnap him from a checkpoint by aiming explosives at the other participants in the race, and a few of the organizers too. Redbeard is awesome. He&#8217;s a professional kernel hacker with a red beard down to his waist, if the later wasn&#8217;t obviously by the name. I also had to dodge the aforementioned chairs, bottles, and fireworks with parkour while wearing a tinfoil hat. And at the end of it all, I found myself at <a href="http://c-base.org/">C-Base, a hackerspace built into the remains of a two-millenia-old alien spaceship crash</a>, discussing DIY soldering iron buttprobes, theoretical physics, and hackers on sailboats, while drinking Chink Chank Chunk (Club Mate with sugar, lime, vodka). </p>
<p>Oh Berlin, how I want to live in you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2012/01/journey-to-the-end-of-the-night/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>28c3 &amp; Kontakt Informationen</title>
		<link>http://www.patternsinthevoid.net/blog/2011/12/28c3/</link>
		<comments>http://www.patternsinthevoid.net/blog/2011/12/28c3/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 22:36:06 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[28c3]]></category>
		<category><![CDATA[artificial intelligence]]></category>
		<category><![CDATA[Chaos Computer Club]]></category>
		<category><![CDATA[hackers]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[Noisebridge]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1137</guid>
		<description><![CDATA[I&#8217;m going to be traveling abroad for about six weeks, so anyone who is trying to contact me during this period should know that it may take a while to get back to you. I&#8217;m going to the Chaos Computer Club&#8217;s 28c3, so I&#8217;ll post updates on things that I learn there. I also believe [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to be traveling abroad for about six weeks, so anyone who is trying to contact me during this period should know that it may take a while to get back to you. I&#8217;m going to the <a href="http://events.ccc.de/congress/2011/wiki/Welcome">Chaos Computer Club&#8217;s 28c3</a>, so I&#8217;ll post updates on things that I learn there. I also believe that I will be giving a short talk on the artificial intelligence work I&#8217;ve been involved in.</p>
<p>I&#8217;ll be getting a German SIM card when I get off the plane in Berlin, and I&#8217;ll probably not post the new number here, or maybe I will. Normally I&#8217;m worried about people tracking me down, but hey, why not &#8212; it&#8217;s a throwaway SIM afterall. It&#8217;s not like anyone&#8217;s going to stalk me all across Europe.</p>
<p>After Germany, I&#8217;ll be in Austria, Denmark, Czech, Sweden(?), The Netherlands, and maybe a few other countries. I want to mention that the only reason someone as poor as I is able to go all these places is due to a couple of <a href="http://starset.net/">amazing</a> <a href="http://tomlowenthal.com/">hackers</a> at <a href="https://www.noisebridge.net/wiki/Noisebridge">Noisebridge</a> in San Francisco, who felt like I should be able to go, provided tons of support, help, and encouragement. Their only request for me was that one day I &#8220;pay it forward.&#8221;</p>
<h3>Kontakt Informationen</h3>
<p>Isis Lovecruft<br />
Deutschland Telefonnummer = +49.1578.779.2714<br />
Osterreich Telefonnummer = +43.681.201.857.84<br />
Email = isis(at)patternsinthevoid(dot)net<br />
GPG Public Key = <a href="www.patternsinthevoid.net/isis_pgp_public_key.html">view</a> <a href="http://www.patternsinthevoid.net/isis.txt">download</a><br />
Fingerprint = 0A6A 58A1 4B59 46AB DE18  E207 A3AD B67A 2CDB 8B35<br />
Pidgin = isislovecruft(at)jabber(dot)ccc(dot)de<br />
OTR Fingerprint = DBD3AB55 D2691E05 38B9528C 2C25C9D9 E2EDE0ED<br />
Pidgin (<a href="https://help.riseup.net/en/chat">over Tor Hidden Services!</a>) = isis(at)riseup(dot)net<br />
OTR Fingerprint = 226265F2 DA257A80 EB19B2AE 0D7E6317 E560D817</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2011/12/28c3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Progress &amp; Problems: Tmux for Android</title>
		<link>http://www.patternsinthevoid.net/blog/2011/12/progress-problems-tmux-for-android/</link>
		<comments>http://www.patternsinthevoid.net/blog/2011/12/progress-problems-tmux-for-android/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 22:03:31 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[28c3]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[android ndk]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Chaos Computer Club]]></category>
		<category><![CDATA[cyanogen]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[tmux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1131</guid>
		<description><![CDATA[One of the things I need for xqdr, the flying robot that I&#8217;m building, is a terminal multiplexer, like screen or tmux. I use tmux, personally, and jeepers wouldn&#8217;t it be neat to have it run natively on my phone so that I don&#8217;t have to use ConnectBot to an outside server and then do [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I need for <a href="http://www.patternsinthevoid.net/blog/2011/12/xqdr-a-flying-robot-that-does-things/" title="xqdr: A Flying Robot That Does Things">xqdr</a>, the flying robot that I&#8217;m building, is a terminal multiplexer, like <a href="http://en.wikipedia.org/wiki/GNU_Screen">screen</a> or <a href="http://tmux.sourceforge.net/">tmux</a>. I use tmux, personally, and jeepers wouldn&#8217;t it be neat to have it run natively  on my phone so that I don&#8217;t have to use ConnectBot to an outside server and then do &#8220;tmux attach&#8221;?</p>
<p>Fortunately (or so I thought when starting this project), tmux is written entirely in C. This turned out to be difficult, and so I&#8217;ll outline how I did it. </p>
<p>The Android kernel uses a slimmed down version of standard C libraries (libc.so), called bionic. This is where all the allowed calls are stored. It&#8217;s possible to either:</p>
<ol><a href="http://android-tricks.blogspot.com/2009/02/hello-world-in-c-on-android.html">Statically link libc</a> to the tmux source code, <a href="https://sourcery.mentor.com/sgpp/lite/arm/portal/release2029">using CodeSorcery&#8217;s cross compiler</a>, which compiles the required libraries directly into the package. This obviously makes the installed package much larger, however it also allows the compiler to optimize both the source code and the libraries.</ol>
<ol><a href="http://android-tricks.blogspot.com/2009/02/hello-world-c-program-on-using-android.html">Dynamically link the bionic library</a> to the tmux source code. This would make the installed binary much smaller, but also requires some crazy ninja haxor skills combined with hardcore black magic, and honestly, I&#8217;m out of half my wizarding supplies right now &#8212; I&#8217;ve been meaning to go to the apothecary for powdered rat tail for weeks now.</ol>
<p>Surprisingly, I attempted the second option first. <em>This was insane.</em> I had to <a href="https://gist.github.com/1518816">compile a compiler to compile a compiler to compile a compiler</a> to <a href="http://plausible.org/andy/agcc">compile a shared object library through a perl wrapper</a> to compile the code. I think I made it through all the compiling compilers parts, and then my <a href="https://github.com/jsnyder/arm-eabi-toolchain">finished compiler</a> crapped all over its pants. </p>
<p>It was at this point that I decided to check my phone, and I realised that CyanogenMod7 already has a shared object library for standard C. (It&#8217;s at /system/lib/libc.so). There is the possibility that I could use this pre-ARM-compiled library, bundle it with tmux, and then use <a href="http://developer.android.com/sdk/ndk/index.html">Android</a> <a href="http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/">NDK</a> to compile tmux for ARM. This would also necessitate creating a .JNI makefile for the frontend, which includes <a href="http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/">a trivial amount of Java to wrap the native code</a>.</p>
<p>I&#8217;ll update when I finish or fuck myself over, but right now I&#8217;m getting on brutal series of international flights for <a href="http://www.ccc.de/en/">Chaos Computer Club</a>&#8216;s <a href="http://events.ccc.de/congress/2011/wiki/Welcome">28C3</a> in Berlin, and my connection is slower than liberal reformist tactics are at creating a freer society. </p>
<p><(A)3</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2011/12/progress-problems-tmux-for-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disassembly</title>
		<link>http://www.patternsinthevoid.net/blog/2011/12/disassembly/</link>
		<comments>http://www.patternsinthevoid.net/blog/2011/12/disassembly/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 01:58:22 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[assembly languages]]></category>
		<category><![CDATA[exploit development]]></category>
		<category><![CDATA[fancy punks]]></category>
		<category><![CDATA[hex]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shellcode]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1125</guid>
		<description><![CDATA[Often when doing exploit development, it&#8217;s necessary to extract hex opcodes from an assembly or C program to generate shellcode. Normally, to do this, one uses objdump as in the following example: isis@wintermute:~$ cat shellcode.asm section .text &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;global _start _start: &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;;; setreuid (0,0) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;xor eax, eax&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;;clear the eax registry &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mov al, 0x46&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;;set the syscall # [...]]]></description>
			<content:encoded><![CDATA[<p>Often when doing exploit development, it&#8217;s <a href="http://www.patternsinthevoid.net/blog/2011/09/learning-assembly-through-writing-shellcode/" title="Learning Assembly Through Writing Shellcode">necessary to extract hex opcodes</a> from an assembly or C program to generate shellcode. Normally, to do this, one uses <strong>objdump</strong> as in the following example:</p>
<p><pre><code>isis@wintermute:~$ cat shellcode.asm
section .text
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;global _start

_start:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;; setreuid (0,0)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xor eax, eax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;clear the eax registry
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mov al, 0x46&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;set the syscall # to decimal 70 or hex 46, one byte
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xor ebx, ebx
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xor ecx, ecx
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int 0x80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;system interrupt to call kernel to execute syscall

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;; spawn shellcode with execve
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xor eax, eax
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push eax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;push a NULL value on the stack
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push 0x68732f2f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;push &#039;//sh&#039; onto the stack
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push 0x6369622f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;push &#039;/bin&#039; onto the stack
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mov ebx, esp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;esp now points to &#039;/bin/sh&#039;, so write to ebx
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push eax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;push another NULL to terminate char ** argv on stack
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push ebx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;push pointer to &#039;/bin/sh&#039; onto stack
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mov ecx, esp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;esp now holds the address of argv, so write to ecx
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xor edx, edx
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mov al, 0xb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;set the syscall # to decimal 11 or hex b, one byte
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int 0x80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;sytem interrupt to call kernel to execute syscall

isis@wintermute:~$ nasm -f elf shellcode.asm 
isis@wintermute:~$ ld -melf_i386 -o shellcode shellcode.o
isis@wintermute:~$ objdump -d ./shellcode

./shellcode:&nbsp;&nbsp;&nbsp;&nbsp; file format elf32-i386

Disassembly of section .text:

08048060 &lt;_start&gt;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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push&nbsp;&nbsp; %ebx
 804807b:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 89 e1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp;&nbsp;%esp,%ecx
 804807d:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 31 d2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor&nbsp;&nbsp;&nbsp;&nbsp;%edx,%edx
 804807f:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b0 0b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp;&nbsp;$0xb,%al
 8048081:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd 80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;$0x80
</code></pre></p>
<p>So, from this example, the shellcode would be:</p>
<p><pre><code>\x31\xc0\xb0\x46\x31\xdb\x31\xc9\xcd\x80\x31\xc0\x50\x68\x2f\2f\x73\
x68\x68\x2f\x62\x69\x63\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80</code></pre></p>
<p>But! What if you have some shellcode, say from a nasty PDF that someone sent you (though a malPDF&#8217;s shellcode would be in JavaScript, and so it would look like &#8220;%u68%u73%u2f%u2f&#8221;), and you don&#8217;t want to have to sit there with a hex-to-ascii chart looking everything up by hand just to find out what this shellcode is doing? As it turns out, there&#8217;s a handy little thing called <a href="http://udis86.sourceforge.net/">udis86</a> to do all that boring work for you. You have to download their tarball, then do:</p>
<p><code>$ ./configure &amp;&amp; make &amp;&amp; make install</code></p>
<p>To run udis86 at the commandline, do:</p>
<p><code>$ udcli</code></p>
<p>Words can&#8217;t describe how much I&#8217;m crushing on this program. Check this out:</p>
<p><pre><code>isis@wintermute:~/$ udcli -x
31 c0 b0 46 31 db 31 c9 cd 80 31 c0 50 68 2f 2f 73 68 68 2f 62 69 63 89 e3 50 53 89 e1 31 d2 b0 0b cd 80
0000000000000000 31c0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor eax, eax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0000000000000002 b046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov al, 0x46&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0000000000000004 31db&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor ebx, ebx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0000000000000006 31c9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor ecx, ecx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0000000000000008 cd80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
000000000000000a 31c0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor eax, eax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
000000000000000c 50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push eax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
000000000000000d 682f2f7368&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push dword 0x68732f2f&nbsp;&nbsp; 
0000000000000012 682f626963&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push dword 0x6369622f&nbsp;&nbsp; 
0000000000000017 89e3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ebx, esp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0000000000000019 50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push eax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
000000000000001a 53&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push ebx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
000000000000001b 89e1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ecx, esp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
000000000000001d 31d2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor edx, edx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
000000000000001f b00b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov al, 0xb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
0000000000000021 cd80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2011/12/disassembly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated, Bandwidth-Efficient, and Encrypted Backups</title>
		<link>http://www.patternsinthevoid.net/blog/2011/12/automated-bandwidth-efficient-and-encrypted-backups/</link>
		<comments>http://www.patternsinthevoid.net/blog/2011/12/automated-bandwidth-efficient-and-encrypted-backups/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 03:29:12 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash scripting]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[duplicity]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1117</guid>
		<description><![CDATA[I made a bash shell script to automate encrypted (remote or local) data backups with Duplicity. Duplicity uses asymmetric GPG RSA keys to encrypt a tarballs of specified files to be backed up, and it also supports incremental backups. So, after making a full backup, it is more efficient do to the fact that it [...]]]></description>
			<content:encoded><![CDATA[<p>I made a bash shell script to automate encrypted (remote or local) data backups with <a href="http://duplicity.nongnu.org/" title="Duplicity" target="_blank">Duplicity</a>. Duplicity uses asymmetric GPG RSA keys to encrypt a tarballs of specified files to be backed up, and it also supports incremental backups. So, after making a full backup, it is more efficient do to the fact that it only saves changes made to files and not entirely new copies of files. Duplicity also supports versioning, i.e. you can say &#8220;give me File A from 3 days ago&#8221;.</p>
<p>Duplicity is <em>not</em> efficient in it&#8217;s cryptographic design, as my friend Tom wisely pointed out, in that use of asymmetric cryptographic algorithms is heavily intensive upon processor resources, and it would be better to replace this feature with something more along the lines of the algorithms (e.g. AES, Serpent, and Twofish) and read/write speed testing features which <a href="http://www.truecrypt.org/" title="TrueCrypt" target="_blank">TrueCrypt</a> supports, for example.</p>
<p>This script depends on both curl and a newer version of duplicity (which is not yet included in the standard repositories), so to install those dependencies in Ubuntu do:</p>
<p><pre><code>$ sudo apt-add-repository ppa:duplicity-team/ppa
$ sudo apt-get update
$ sudo apt-get install duplicity curl</code></pre></p>
<p>Here&#8217;s version 0.1.2 of the backup script <a href="https://github.com/isislovecruft/duplikat">(or view it on github here)</a>:</p>
<p><pre><code>
#!/bin/bash
# _____________________
#| BACKUP[your].SH[it] |
#|---------------------|
#|v.0.1.2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^&nbsp;&nbsp;&nbsp;&nbsp;/^
#|Written by&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | \&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/ \&nbsp;&nbsp;// \
#|Isis Lovecruft&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;\&nbsp;&nbsp; |\___/|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp; \//&nbsp;&nbsp;.\
#|isis@patternsinthe&nbsp;&nbsp; |&nbsp;&nbsp; \&nbsp;&nbsp;/O&nbsp;&nbsp;O&nbsp;&nbsp;\__&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;| \ \&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *----*
#|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void.net|&nbsp;&nbsp;&nbsp;&nbsp; /&nbsp;&n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p;\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ -~
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ///-._ _ _ _ _ _ _{^ - - - - ~
#
# Backup script to automate SSH, SCP, SFTP, FTP, and IMAP backups through
# Duplicity. Duplicity encrypts backup files through GPG before sending
# files through protocol. This script runs a check on the available 
# bandwidth, and only runs the backup when the bandwidth available is 
# above a configurable threshhold.
#
# This is going to be rewritten using duplicati instead of duplicity in the
# next major version release.

SPEED=$(curl -w %{speed_download} -o /dev/null -s http://speedtest.sea01.softlayer.com/speedtest/speedtest/random1000x1000.jpg)
INT=${SPEED/\.*}
KBPS=$(echo $[INT / 1024])
THRESHOLD=&quot;200&quot;
# Uncomment and set the following in order to not type your password.
# This is incredibly insecure, as your password is then stored 
# plaintext.
#export PASSPHRASE=&#039;passphrase&#039;

# The $SPEED variable downloads a nice image of snow (into /dev/null so that
# it isn&#039;t actually saved anywhere on disk). It also gives us a write-out 
# (-w %{speed_download}) for the average available bandwidth (incoming) in
# bytes per second.
#
# $INT turns the float $SPEED into an integer.
#
# $KBPS, as I&#039;m sure you can surmise, turns the bytes per second into
# kilobytes per second.
#
# $THRESHOLD can be changed to fit the user&#039;s preferences, and it defines
# the minimum bandwidth which should be available for a duplicity backup to
# take place.

if [[ &quot;$#&quot; == &quot;0&quot; ]]; then
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Usage: ./backup.sh &lt;BACKUP_TO_LOCATION_1&gt; &lt;BACKUP_TO_LOCATION_2&gt; ... &lt;BACKUP_TO_LOCATION_N&gt;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Backup locations can be locally stored on the same disk (not recommended), &quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;or may be stored remotely. For remote backups, duplicity provides several &quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;options for transport, including SCP, FTP, and IMAP, please see &#039;man duplicity&#039; &quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;for more information. Also, all duplicity backups are automatically GnuPG &quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;encrypted, so transportation is much safer than it would be otherwise. &quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Note: Duplicity&#039;s SSH backend performs a check that the remote directory end &quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;in a &#039;/&#039;, so this must be present for SSH, SCP, or SFTP backups to work correctly.&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;exit 1
fi

# Make sure this script is run as root.
if [[ `id -u` != 0 ]]; then
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Sorry, backups must be made as root in order for files in the / directory to&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;be backed up safely. Please do &#039;sudo su&#039; and try running this script again.&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Exiting...&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;exit 1
fi

# Set up BACKUP_TO_LOCATION positional parameters.
for i in &quot;$@&quot;; do
&nbsp;&nbsp;&nbsp;&nbsp;$(BACK_UP_LOCATION_$i)=$i
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Would you like to make a full backup, or add an incremental backup to the &quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;last full backup stored?&quot;
&nbsp;&nbsp;&nbsp;&nbsp;select fullinc in &quot;Full&quot; &quot;Incremental&quot;; do
&nbsp;&nbsp;case $fullinc in
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Full)
&nbsp;&nbsp;&nbsp;&nbsp;USERLIST=$(cat /etc/passwd | grep &quot;/home&quot; | grep -E &quot;([1-5][0-9]{3})|([5-9][0-9]{2})?&quot; | cut -d : -f 1)
&nbsp;&nbsp;&nbsp;&nbsp;# fix above regex to match &#039;1000&#039;, &#039;500&#039; and &#039;1392&#039;
&nbsp;&nbsp;&nbsp;&nbsp;# 
&nbsp;&nbsp;&nbsp;&nbsp;# This command searches the password file for users with a home directory 
&nbsp;&nbsp;&nbsp;&nbsp;# (to filter out programs with user accounts) whose UID number is in the 
&nbsp;&nbsp;&nbsp;&nbsp;# range of 500-1599 (normal users, does not include root). It then takes 
&nbsp;&nbsp;&nbsp;&nbsp;# that returned list of users and cuts it (the delimiter is &quot;:&quot;) and returns 
&nbsp;&nbsp;&nbsp;&nbsp;# only the first field, which is the username.
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Please select the user(s) whose home directories should also be backed up:&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;for users in $USERLIST; do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#need a way to assign numbers like $1 $2 $3 to users
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select users in $USERLIST; do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case $users in
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#so that those numbers can be passed in over here
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$@)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Please confirm that this is where you wish to store your full backup: (&quot;$BACKUP_TO_LOCATION_$i&quot;)?&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select yn in &quot;Yes&quot; &quot;No&quot;; do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case $yn in
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Yes) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if [[ $KBPS -gt $THRESHOLD ]]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duplicity full -vN --ssh-askpass --exclude /proc --exclude /mnt --exclude /media --exclude /tmp --exclude /sys --exclude $HOME/.local --exclude $HOME/.config exclude /var/log/ $BACKUP_TO_LOCATION_$i 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;esac
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;done
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;esac
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;done
&nbsp;&nbsp;&nbsp;&nbsp;done
&nbsp;&nbsp;&nbsp;&nbsp;break;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Incremental)
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Please confirm that this is where you wish to store your incremental backup: (&quot;$BACKUP_TO_LOCATION_$i&quot;)?&quot;
&nbsp;&nbsp;&nbsp;&nbsp;select yn in &quot;Yes&quot; &quot;No&quot;; do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case $yn in
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Yes)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if [[ $KBPS -gt $THRESHOLD ]]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duplicity incremental -vN --ssh-askpass --exclude /proc --exclude /mnt --exclude /media --exclude /tmp --exclude /sys --exclude $HOME/.local --exclude $HOME/.config exclude /var/log / $BACKUP_TO_OCATION_$i
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;esac
&nbsp;&nbsp;&nbsp;&nbsp;done
&nbsp;&nbsp;esac
&nbsp;&nbsp;&nbsp;&nbsp;done
done

unset PASSPHRASE
</code></pre></p>
<p>This can be added as a <a href="http://unixgeeks.org/security/newbie/unix/cron-1.html">crontab</a> (so that the script, in this crontab example, will run automatically, once per hour at one minute after the hour) by doing (but the script will still check the network connection before sending anything out).</p>
<p>If you have any comments, suggestion, or feature requests, please <a href="mailto:isis@patternsinthevoid.net?Subject=Bash%20Backup%20Script" title="email me" target="_blank">email me</a> and <a href="http://www.patternsinthevoid.net/isis_pgp_public_key.html" title="my GPG public key is here" target="_blank">my GPG public key is here</a>.</p>
<p>Features yet to be added:</p>
<li>Differentiation between Wifi, Ethernet, and 3G/4G connections.</li>
<li>Support for cleaning up old backups and how often to do so.</li>
<li>Configurable setting for what percentage of the available bandwidth should be utilised.</li>
<li><del datetime="2012-01-04T09:38:41+00:00">Fix the bug in Duplicity that makes it default to SFTP when SCP is called.</del></li>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2011/12/automated-bandwidth-efficient-and-encrypted-backups/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Depression Has Infinite Recursion</title>
		<link>http://www.patternsinthevoid.net/blog/2011/12/the-saddest-boy-i-ever-saw/</link>
		<comments>http://www.patternsinthevoid.net/blog/2011/12/the-saddest-boy-i-ever-saw/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 11:03:44 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[i thought robots weren't supposed to have emotions]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1103</guid>
		<description><![CDATA[#!/env/python&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def do_nothing(): &#160;&#160;&#160;&#160;while depressed is True: &#160;&#160;&#160;&#160;&#160;&#160; do_nothing() &#160;&#160;&#160;&#160;&#160;&#160; print &#34;you are still depressed&#34; if __name__ == &#34;__main__&#34;: &#160;&#160;&#160;&#160;depressed = True &#160;&#160;&#160;&#160;do_nothing()]]></description>
			<content:encoded><![CDATA[<p><pre><code>#!/env/python&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

def do_nothing():
&nbsp;&nbsp;&nbsp;&nbsp;while depressed is True:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do_nothing()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;you are still depressed&quot;

if __name__ == &quot;__main__&quot;:
&nbsp;&nbsp;&nbsp;&nbsp;depressed = True
&nbsp;&nbsp;&nbsp;&nbsp;do_nothing()
</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2011/12/the-saddest-boy-i-ever-saw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hivemind</title>
		<link>http://www.patternsinthevoid.net/blog/2011/12/hivemind/</link>
		<comments>http://www.patternsinthevoid.net/blog/2011/12/hivemind/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 23:31:12 +0000</pubDate>
		<dc:creator>Isis</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[botnet]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[digital security]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hivemind]]></category>
		<category><![CDATA[IRC]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[text-based RPGs]]></category>

		<guid isPermaLink="false">http://www.patternsinthevoid.net/blog/?p=1097</guid>
		<description><![CDATA[So I hacked together this IRC bot to play oldschool text-based RPGs with multiple people in an IRC channel. The RPGs are pre-written and are run by a Z-Machine interpreter called Frotz, which runs on a server somewhere, and commands to Frotz are piped to stdin through a python program called pexpect. I&#8217;m not going [...]]]></description>
			<content:encoded><![CDATA[<p>So I hacked together this IRC bot to play oldschool text-based RPGs with multiple people in an IRC channel. The <a href="http://www.ifarchive.org/indexes/if-archiveXgamesXzcode.html">RPGs are pre-written</a> and are run by a Z-Machine interpreter called <a href="http://frotz.sourceforge.net/">Frotz</a>, which runs on a server somewhere, and commands to Frotz are piped to stdin through a python program called <a href="http://www.noah.org/python/pexpect/">pexpect</a>.</p>
<p>I&#8217;m not going to say which channel this thing is is, because it&#8217;s hella insecure (Frotz uses multiple uses of strcpy(), wtf?!), but I will say that while looking into pexpect I found some old 1990s botnet C&amp;C software when I totally wasn&#8217;t expecting it. Check out this file, <a href="http://patternsinthevoid.net/hive.py.txt">hive.py</a>, which comes with pexpect! So oldschool! (Don&#8217;t worry, that link goes to a .txt file, so nothing will run on this server nor on your computer. It&#8217;s safe, I promise.)</p>
<p>For some reason, this made me really happy. &lt;(A)3</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patternsinthevoid.net/blog/2011/12/hivemind/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

