<?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>Stealthcopter.com &#187; website</title>
	<atom:link href="http://www.stealthcopter.com/blog/tag/website/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stealthcopter.com/blog</link>
	<description>Android, Linux, Python and stealthcopters</description>
	<lastBuildDate>Fri, 13 Jan 2012 16:29:58 +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>Cracking real world salted MD5 passwords in python with several dictionaries</title>
		<link>http://www.stealthcopter.com/blog/2010/06/cracking-real-world-salted-md5-passwords-in-python-with-several-dictionaries/</link>
		<comments>http://www.stealthcopter.com/blog/2010/06/cracking-real-world-salted-md5-passwords-in-python-with-several-dictionaries/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 10:45:56 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[cryptography]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.stealthcopter.com/blog/?p=917</guid>
		<description><![CDATA[Recently a friend (who will remain unnamed for obvious reasons) asked me to penetration test a website he created. I found a very simple exploit where I could upload an avatar but the file was not checked to ensure it was an image, so I uploaded a php script I wrote an began exploring the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently a friend (who will remain unnamed for obvious reasons) asked me to penetration test a website he created. I found a very simple exploit where I could upload an avatar but the file was not checked to ensure it was an image, so I uploaded a php script I wrote an began exploring the server. I printed out all of the usernames, passwords and salts from the database to see how many of the 1,109 passwords could be easily cracked.</p>
<p>The passwords were stored as MD5 hashes with a random 6 character alphanumeric salt. To create the MD5 hash of the password the salt was prefixed to the password and then the combination was hashed. Thanks to this method we can employ a simple bruteforce/dictionary attack on the passwords. I will start with the wordlists creation, then results I obtained to keep your interest, and finally show my python code.</p>
<p><strong>Creating wordlists</strong><br />
I already has two reasnoble sized dictionaries that I use for different things like <a href="http://www.stealthcopter.com/wordcube">wordcube</a>. I used john the ripper on my double sized dictionary to create lots of common permutations on words, such as captial first letter, and a number affixed to the end. To do this you run john with the following parameters, where dic.txt is the input dictionary and dic_plus_rules.txt is the output from john with all of the additions it has made.</p>
<blockquote><p>
john &#8211;wordlist=dic.txt &#8211;rules &#8211;stdout > dic_plus_rules.txt
</p>
</blockquote>
<p>I also download two wordlists from <a href="http://download.openwall.net/pub/wordlists/">openwall</a>, one which is a list of ~3100 <a href="http://download.openwall.net/pub/wordlists/passwords/">common passwords</a>, and one labelled <a href="http://download.openwall.net/pub/wordlists/">ALL</a> that has a large amount of words (~4 million) in various languages. Because of the highly compressible nature of text the files are available in small gzip files. ALL is 11.5Mb which unzips to 41.4Mb and password 12kb which unzips to 21.8kb. There are also more <a href="http://download.openwall.net/pub/wordlists/languages/">wordlists avaliable for different languages</a>, but the ALL file includes these.</p>
<p>The size of all of the wordlists I used is shown below:</p>
<table>
<tr>
<th>Dictionary</th>
<th>Combinations</th>
</tr>
<tr>
<td>English</td>
<td>42,987</td>
</tr>
<tr>
<td>Double-English</td>
<td>80,368</td>
</tr>
<tr>
<td>Double+john-rules</td>
<td>3,986,706</td>
</tr>
<tr>
<td>Openwall Common Passwords</td>
<td>3,158</td>
</tr>
<tr>
<td>Openwall ALL</td>
<td>3,917,116</td>
</tr>
</table>
<p><strong>Results</strong></p>
<table>
<tr>
<th>Dictionary</th>
<th>Cracked</th>
<th>Percentage</th>
<th>Time</th>
</tr>
<tr>
<td>English</td>
<td>60</td>
<td>5.41%</td>
<td>80s</td>
</tr>
<tr>
<td>Double-English</td>
<td>65</td>
<td>5.86%</td>
<td>170s</td>
</tr>
<tr>
<td>Double+john-rules</td>
<td>116</td>
<td>10.46%</td>
<td>2.5hrs (8393s)</td>
</tr>
<tr>
<td>Openwall Common Passwords</td>
<td>112</td>
<td>10.10%</td>
<td>7s</td>
</tr>
<tr>
<td>Openwall All</td>
<td>210</td>
<td>18.94%</td>
<td>2.45hrs (8829s)</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</td>
<tr>
<td>Total Passwords Obtained</td>
<td>254</td>
<td>22.90%</td>
<td>~5hrs</td>
</tr>
</table>
<p><strong>Comical passwords</strong></p>
<p>Here are some of the more amusingly bad passwords, the number in brackets shows the frequency of the password.</p>
<p><em><strong>Crap passwords</strong></em>: 123456 (18), password (4), 1234567 (4), 123456789 (3) 12345678 (2),  12345 (2), abc123 (2), asdfgh (2), nintendo (2), 123123, abcd1234, abcdefg, qwerty<br />
<em><strong>Self-describing passwords</strong></em>: catholic, cowboy, creator, doger, ginger, killer, maggot, player, princess, skater, smallcock, smooth, super, superman, superstar, tester, veggie, winner, wolverine<br />
<em><strong>Some other passwords</strong></em>:bananas, cheese, cinnamon, hampster ,DRAGON, dribble1, poopie, poopoo</p>
<p><strong>Python Program</strong></p>
<pre name="code" class="python">
# -*- coding: utf-8 -*-
#pymd5cracker.py
import hashlib, sys
from time import time

# Change to commandline swtiches when you have the time!
hash = ""
hash_file = "hash2.csv"
wordlist = "mass_rules.txt"; 

# Read the hash file entered
try:
	hashdocument = open(hash_file,"r")
except IOError:
	print "Invalid file."
	raw_input()
	sys.exit()
else:
	# Read the csv values seperated by colons into an array
	hashes=[]
	for line in hashdocument:
		line=line.replace("\n","")
		inp = line.split(":")
		if (line.count(":")<2):
			inp.append("")
		hashes.append(inp)
	hashdocument.close();

# Read wordlist in
try:
	wordlistfile = open(wordlist,"r")
except IOError:
	print "Invalid file."
	raw_input()
	sys.exit()
else:
	pass

tested=0
cracked=0
tic = time()
for line in wordlistfile:

	line = line.replace("\n","")
	tested+=1
	for i in range(0,len(hashes)):

		m = hashlib.md5()
		m.update(hashes[i][2]+line)
		word_hash = m.hexdigest()
		if word_hash==hashes[i][1]:
			toc = time()
			cracked+=1
			hashes[i].append(line)
			print hashes[i][0]," : ", line, "\t(",time()-tic,"s)"

	# Show progress evey 1000 passwords tested
	if tested%1000==0:
		print "Cracked: ",cracked," (",tested,") ", line

# Save the output of this program so we can use again
# with another program/dictionary adding the password
# to each line we have solved.
crackout = open("pycrackout.txt","w")
for i in hashes:
	s=""
	for j in i:
		if s!="":
			s+=":"
		s+=j
	s+="\n"
	crackout.write(s)
crackout.close()

print "Passwords found: ",cracked,"/",len(hashes)
print "Wordlist Words :", test
print "Hashes computed: ",len(hashes)*tested
print "Total time taken: ",time()-tic,'s'
</pre>
<p><strong>Next</strong></p>
<ul>
<li>Play with more dictionaries</li>
<li>Speed up code:
<ul>
<li>Add multi-threading: My experience with multi-threading in python is that it doesn't work well for cpu intensive tasks, if you know otherwise please let me know.</li>
<li>Have a look at <a href="http://mathema.tician.de/software/pycuda">PyCUDA</a> to see if I can use my graphics card to speed up the code significantly (another type of mutli-threading really...) without having to change language like in my previous post of <a href="http://www.stealthcopter.com/blog/2010/06/cracking-md5-hashes-or-passwords-ultra-fast-with-gpu-acceleration/">CUDA MD5 cracking</a></li>
</ul>
</li>
<li>Remove hash once found to stop pointless checking</li>
<li>Add command line switches to all it to be used like a real program</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.stealthcopter.com/blog/2010/06/cracking-real-world-salted-md5-passwords-in-python-with-several-dictionaries/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Wordcube feedback</title>
		<link>http://www.stealthcopter.com/blog/2010/03/wordcube-feedback/</link>
		<comments>http://www.stealthcopter.com/blog/2010/03/wordcube-feedback/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 00:31:14 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[WordCube]]></category>

		<guid isPermaLink="false">http://www.stealthcopter.com/blog/?p=783</guid>
		<description><![CDATA[This page was created for feedback from users of wordcube available via the wordcube website or as an app for android phones (available in market). Filling in these polls and leaving feedback will help improve wordcube for everyone. Thanks for your feedback. Please post any bugs, suggestions, complaints or ideas below.]]></description>
			<content:encoded><![CDATA[<p>This page was created for feedback from users of wordcube available via the <a href="http://www.stealthcopter.com/wordcube">wordcube website</a> or as an app for android phones (available in market). Filling in these polls and leaving feedback will help improve wordcube for everyone.</p>
<p>Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.<br />
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.<br />
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.<br />
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.<br />
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.</p>
<p>Thanks for your feedback. Please post any bugs, suggestions, complaints or ideas below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stealthcopter.com/blog/2010/03/wordcube-feedback/feed/</wfw:commentRss>
		<slash:comments>73</slash:comments>
		</item>
		<item>
		<title>Android: WordCube &#8211; Daily puzzle game</title>
		<link>http://www.stealthcopter.com/blog/2010/01/android-wordcube-daily-puzzle-game/</link>
		<comments>http://www.stealthcopter.com/blog/2010/01/android-wordcube-daily-puzzle-game/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 17:37:36 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[WordCube]]></category>

		<guid isPermaLink="false">http://www.stealthcopter.com/blog/?p=454</guid>
		<description><![CDATA[Due to the success (and small amount of addiction) of my browser-based wordcube game (see here), I decided to make a WordCube application for android. Features Anagram / Wordsearch based puzzle Small file size (~100kb) and footprint Updated daily Share score with twitter integration (compete with friends) Saves your last attempts so you can continue [...]]]></description>
			<content:encoded><![CDATA[<p>Due to the success (and small amount of addiction) of my browser-based wordcube game (<a href="http://www.stealthcopter.com/wordcube">see here</a>), I decided to make a WordCube application for android.</p>
<p><strong>Features</strong></p>
<ul>
<li>Anagram / Wordsearch based puzzle</li>
<li>Small file size (~100kb) and footprint</li>
<li>Updated daily</li>
<li>Share score with twitter integration (compete with friends)</li>
<li>Saves your last attempts so you can continue at later time</li>
<li>This also means you can continue your last game offline</li>
<li>Several achievements can be unlocked (more to come, also looking for suggestions for achievements)</li>
</ul>
<p><div id="attachment_501" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.stealthcopter.com/blog/wp-content/uploads/2010/01/wordcube_ss1.png"><img src="http://www.stealthcopter.com/blog/wp-content/uploads/2010/01/wordcube_ss1.png" alt="wordcube screenshot" title="wordcube_ss1" width="320" height="480" class="size-full wp-image-501" /></a><p class="wp-caption-text">screenshot of wordcube</p></div></p>
<p><strong>Gameplay</strong><br />
Find as many words as possible using letters from the grid. The words must be 4 letters or more, contain the central letter and each letter may not be used more than once. There is at least one word that uses all of the letters in the cube.</p>
<p>The main interface is by tapping the letters in order to construct a word, but keyboards (and on screen keyboards) are also supported.</p>
<p><div id="attachment_502" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.stealthcopter.com/blog/wp-content/uploads/2010/01/WordCubePro_ss2.png"><img src="http://www.stealthcopter.com/blog/wp-content/uploads/2010/01/WordCubePro_ss2.png" alt="wordcube screenshot 2" title="WordCubePro_ss2" width="320" height="480" class="size-full wp-image-502" /></a><p class="wp-caption-text">Another wordcube screenshot</p></div></p>
<p><strong>Twitter Integration </strong><br />
Once you have attained all the words that you can, you can post your score to twitter and then compare with your friends to see how they did in comparison. In order to use this feature you need to have a twitter client installed, I would recommend twidroid.</p>
<p><div id="attachment_503" class="wp-caption aligncenter" style="width: 345px"><a href="http://www.stealthcopter.com/blog/wp-content/uploads/2010/01/android_twidroid1.png"><img src="http://www.stealthcopter.com/blog/wp-content/uploads/2010/01/android_twidroid1.png" alt="wordcube twitter integration" title="android_twidroid" width="335" height="492" class="size-full wp-image-503" /></a><p class="wp-caption-text">Twitter integration in wordcube</p></div></p>
<p><strong>Download</strong><br />
WordCube can be downloaded from the market on your android phone either by searching for wordcube or following one the two android links below. To download the WordCube app from this website, follow the Web link.</p>
<p>Android: <a href="market://details/?id=com.sc.wordcubefree">WordCube Free</a><br />
Android: <a href="market://details/?id=com.sc.wordcubee">WordCube Pro</a> (only £1)<br />
Web: <a href="mhttp://www.stealthcopter.com/android/apps/wordcubefree/wordcubefree.apk">WordCube Free</a></p>
<p>The pro version is available for £1, with the money going to support the developer and the development and maintenance of this application. The pro version features all of the latest features and in the near future will support personal statistics to keep track of performance.</p>
<p>If you enjoyed this please leave feedback for me either here or on the market. Comments, suggestions and constructive criticism is also welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stealthcopter.com/blog/2010/01/android-wordcube-daily-puzzle-game/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bash: Script to convert .flv to mp3</title>
		<link>http://www.stealthcopter.com/blog/2010/01/bash-script-to-convert-flv-to-mp3/</link>
		<comments>http://www.stealthcopter.com/blog/2010/01/bash-script-to-convert-flv-to-mp3/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 21:04:50 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.stealthcopter.com/blog/?p=484</guid>
		<description><![CDATA[Flash Video (.FLV) is currently a very popular format of online videos, inparticular youtube. This post explains how to use a simple script to extract the sound from a flash video file and turn it into an mp3. In order for the script to work you will need to download ffmpeg (to decode the video) [...]]]></description>
			<content:encoded><![CDATA[<p>Flash Video (.FLV) is currently a very popular format of online videos, inparticular youtube. This post explains how to use a simple script to extract the sound from a flash video file and turn it into an mp3.</p>
<p>In order for the script to work you will need to download ffmpeg (to decode the video) and lame (to encode the mp3). This can be achieve in ubuntu by opening a terminal and running the following or alternatively you can use your package manager GUI to search and download the packages for you.</p>
<blockquote><p>
sudo apt-get install ffmpeg lame
</p>
</blockquote>
<p>You then need to create a new file named &#8220;flv2mp3.sh&#8221; and paste the following into it using your preferred text editor (which hopefully isn&#8217;t VI). Save the file and then change the file permissions so that it is executable (by running:`chmod a+x flv2mp3.sh` in the terminal or via the gui in you file browser)</p>
<pre name="code" class="bash">
#!/bin/sh
# this script should convert files from FLV to WAV and then to MP3
echo " "
echo "  Welcome to FLV to MP3 converter!  version 0.1"
echo " "
infile_name="$@"
# exit if the user did not enter anything:
if [ -z "$infile_name" ]; then
    echo " "
    echo "You did not tell me the file name, so I will exit now."
    echo " "
    exit
fi
echo " "
ffmpeg -i "$infile_name" -acodec pcm_s16le -ac 2 -ab 128k -vn -y "${infile_name%.flv}.wav"
lame --preset cd "${infile_name%.flv}.wav" "${infile_name%.flv}.mp3"
rm "${infile_name%.flv}.wav"
echo " "
echo "OK. I'm done! Have fun!"
echo " "
exit
</pre>
<p>You should now be able to convert a flashvideo into an mp3 by running the following command (changing the filenames to fit your purpose):<br />
<code>sh flv2mp3.sh videofilename.flv</code></p>
<p><strong>Extra: Youtube</strong><br />
In linux it might be worth noting that youtube downloads the flv&#8217;s to your /tmp folder and you can easily copy them or convert to mp3&#8242;s (Ensure video is completly finished loading).</p>
<p>Also there is an application called &#8216;youtube-dl&#8217; which can be installed from the repositories</p>
<blockquote><p>sudo apt-get install youtube-dl</p>
</blockquote>
<p>and then run using</p>
<blockquote><p>youtube-dl http://www.youtube.com/video_to_borrow</p>
</blockquote>
<p>Of course it&#8217;s up to your moral guidance to decide what you can and can&#8217;t download.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stealthcopter.com/blog/2010/01/bash-script-to-convert-flv-to-mp3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Python: Wordwheel / WordCube solver</title>
		<link>http://www.stealthcopter.com/blog/2009/12/python-wordwheel-wordcube-solver/</link>
		<comments>http://www.stealthcopter.com/blog/2009/12/python-wordwheel-wordcube-solver/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 17:36:50 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[strings]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[WordCube]]></category>

		<guid isPermaLink="false">http://www.stealthcopter.com/blog/?p=240</guid>
		<description><![CDATA[Often in newspapers there is a wordwheel or some variant, whereby you have to find as many words greater than 3 letters long, containing the centre word and using the letters no more than once. I have created a webpage that generates a &#8220;WordCube&#8221; daily for people to peruse at their leisure (www.stealthcopter.com/wordcube). This post [...]]]></description>
			<content:encoded><![CDATA[<p>Often in newspapers there is a wordwheel or some variant, whereby you have to find as many words greater than 3 letters long, containing the centre word and using the letters no more than once. I have created a webpage that generates a &#8220;WordCube&#8221; daily for people to peruse at their leisure (<a href="http://www.stealthcopter.com/wordcube">www.stealthcopter.com/wordcube</a>). This post contains the code and explanation of the solutions to wordcube&#8217;s (and all other word&lt;insert shape here&gt;). </p>
<p><img src="http://stealthcopter.com/wordcube/images/20091212.png" alt="WordCube from http://www.stealthcopter.com/wordcube for 12/12/2009" /><br />
Example WordCube image for the 12th December 2009 from <a href="http://www.stealthcopter.com/wordcube/2009/12/12">www.stealthcopter.com/wordcube/2009/12/12</a></p>
<p>Below is a function I wrote to check if an input was a valid anagram (or partial anagram, as it isn&#8217;t essential to use every letter). The function works by cycling over each letter of word we are testing (word), and checks if the letter is valid (checked against chkword). If the letter is valid then it removes the letter from the original word and moves to the next letter until we run out of letters (returns True) or if the letter is invalid (returns False).</p>
<pre name="code" class="python">
def anagramchk(word,chkword):
	for letter in word:
		if letter in chkword:
			chkword=chkword.replace(letter, '', 1)
		else:
			return False
	return True

f=open('english', 'r')
word=raw_input('Input letters (starting with mandatory letter) :')
minlen=4
count=0
for l in f:
	l=l.strip()
	if len(l)&lt;=len(word) and len(l)&gt;=minlen and word[0] in l and anagramchk(l,word):
		if len(l)==len(word):
			print l,'  &lt;-- Long word'
		else:
			print l
		count+=1
f.close()
print count
</pre>
<p>This will output a list of the possible words, along with a total. The results can be seen for the WordCube in the example above <a href="www.stealthcopter.com/wordcube/2009/12/12?solutions=1">here</a> (To prevent spoiling it if you&#8217;d like to have a go at it yourself).</p>
<p>As always I&#8217;d be interested to see if anyone knows any faster methods or any other general improvements or comments.</p>
<p>The dictionary file can be found here (not perfect):<br />
<a href="http://www.stealthcopter.com/files/english.txt">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stealthcopter.com/blog/2009/12/python-wordwheel-wordcube-solver/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

