Package: ec2hashcat
Password Cracking in the Cloudec2hashcatis a utility to automate the process of password cracking on the AWS Cloud using GPU Instances.Installation% pip install ec2hashcatThats it!ConfigurationAll arguments beginning with--can be specified in~/.ec2hashcat.ymland$PWD/ec2hashcat.ymlaws-key:AWS_KEYaws-secret:AWS_SECRETaws-region:AWS_REGIONec2-key-name:EC2_KEY_NAMEec2-key-file:EC2_KEY_FILEs3-bucket:S3_BUCKET_NAMEUsageFor more information, check the online help:% ec2hashcat --help
% ec2hashcat <command> --helpExampleA working example using the provided sample files:% ec2hashcat crack -b examples/batch.ec2
% ec2hashcat list sessions
% ec2hashcat list files
% ec2hashcat cat wordlists hashlist.dic
% ec2hashcat get wordlists hashlist.dic
% ec2hashcat delete dumps hashlist.dmpCrackingHandles the uploading/downloading of files to/from S3/EC2, starting/stopping of instances and runningcudaHashcat.Basic usage is very similar to thehashcatfamily of programs:% ec2hashcat crack -a3 -m0 <hashlist> <mask>
% ec2hashcat crack -a0 -m0 <hashlist> <wordlist>
% ec2hashcat crack -a0 -m0 -r <rulesfile> <hashlist> <wordlist>Any arguments not directly handled byec2hashcatcan be passed tocudaHashcatusing the--hashcat-argsargument:% ec2hashcat crack -a3 -m0 --hashcat-args='--increment' <hashlist> <mask>ec2hashcatwill attempt to detect any filenames passed via--hashcat-argsand handle them appropriatly.When using the--rulesargument,ec2hashcatwill store any custom rules in S3 and exposes access to the builtin rules using thebuiltin:keyword:% ec2hashcat crack -a0 -m0 -r builtin:<rulesfile> <hashlist> <wordlist>By defaultcrackwill write an updatedhashlist,dump, andwordlistto S3, you can use the--no-write-hashlists,--no-write-dumps, and--no-write-wordlistsarguments respectively.Once the maincracktask has completed and any files updated, the machine will be shut down. To keep the instance alive, use the--no-shutdownargument. Additionally, to drop into a shell once the task has completed, used the--shellargument. Note that dropping into a shell will block the shutdown until the shell is exited.crackcan also operate in a batch mode, combining multiple attacks into a single session. The batchfile is specified using the--batchfileargument, and follows the same rules as script name inrunscript:% ec2hashcat crack -b+
batch> crack -a3 -m0 <hashlist> <mask>
batch> crack -a0 -m0 <hashlist> <wordlist>

% cat <<EOF | ec2hashcat -b-
crack -a3 -m0 <hashlist> <mask>
crack -a0 -m0 <hashlist> <wordlist>

% cat batch.ec2
#!/usr/bin/env ec2hashcat -b
crack -a3 -m0 <hashlist> <mask>
crack -a0 -m0 <hashlist> <wordlist>
% ec2hashcat crack -b ./batch.ec2
% ./batch.ec2For more information on hashcat usage, seethe hashcat wiki.Running ScriptsArbitrary scripts can be run against new or running sessions by following similar syntax tocrack. Scripts are executed inside a screen named after the local filename.Run a script on a new instance:% ec2hashcat runscript <script>If the providedscriptis-the script contents will be read fromSTDINand ifscriptis+the contents will be promted for.Run a script on an existing instance (as withcrack, the--use-instanceflag implies--no-shutdown):% ec2hashcat runscript -i <session-name> <script>The--no-attach,--shell, and--no-shutdownarguments can be used as with thecrackcommand.Spot PricesBy default,ec2hashcatwill place a bid at the average price in your selected region.To check the spot current instance prices:% ec2hashcat list pricesFile Handlingec2hashcatstores all files in S3 and offersdelete,get,list, andputcommands for manipulating them.
There are 4 types of file:dumps,hashlists,rules, andwordlists.Show all files:% ec2hashcat list filesShow all files of a specific type:% ec2hashcat list <type>Download a specific file:% ec2hashcat get <type> <name>Download all wordlists; this will download all wordlists into the current directory:% ec2hashcat get wordlistsDownload all wordlists and merge into a single wordlist with a specified filename:% ec2hashcat get wordlists --merge --outfile=master.lstCat a file:% ec2hashcat cat <type> <name>Delete all files of a specified type (prompting for each file):% ec2hashcat delete <type>Delete all files of a specified type without prompting:% ec2hashcat delete -f <type>Delete the specified files without prompting:% ec2hashcat delete <type> <file> <file> ...Delete the specified files (prompting for each file):% ec2hashcat delete -i <type> <file> <file> ...Session HandlingThe session name can be specified by using the-sor--session-nameargument to thecrackandrunscriptcommands.List all active sessions:% ec2hashcat list sessionsAttaching to a runningcracksession:% ec2hashcat crack ... <hashlist>
% ec2hashcat attach <hashlist>Attaching to a runningrunscriptsession:% ec2hashcat runscript ... <script>
% ec2hashcat attach -n <script> <script>Sessions can be attached via the session name or the instance ID:% ec2hashcat attach <instance-id>
% ec2hashcat attach <session-name>Alternatively, a shell can be opened on the instance using the same syntax asattach:% ec2hashcat shell <instance-id>
% ec2hashcat shell <session-name>Terminating an instance, giving it a chance to commit work to S3:% ec2hashcat stop <instance-id>
% ec2hashcat stop <session-name>The--forceflag can be used to initiate immediate termination:% ec2hashcat stop -f <instance-id>
% ec2hashcat stop -f <session-name>Security GroupsManages inbound rules on port 22 for the specified Security GroupView the current allowed masks:% ec2hashcat secgrp showAdd the current external IP address:% ec2hashcat secgrp addAdd a specified mask:% ec2hashcat secgrp add <mask>Delete a specified mask:% ec2hashcat secgrp del <mask>Delete all masks:% ec2hashcat secgrp del -aBenchmarksBenchmarks for the g2.8xlarge instance type, which is generally available for around $0.50/h, are availablehere.Known Issuesspaces in filenames were an afterthought, for now assume the world will end if you have spacesthe required AMI is only available in us-east-1 and eu-west-1, if you need another regionopen an issue.