This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose . See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.When you put a copy of ASMCrack to a web page, ftp server etc., please leave all files together and contact me, by that I know where to send newer versions. By saying that this program is free software I didn't mean that you mustn't send me money. Just think about the following: The more money I get, the sooner I can upgrade my computer to MMX, the earlier I can programm an MMX version of ASMCrack, that will certainly be faster than the current version. My Email: dkuehlin@hell1og.be.schule.de (valid till june 2000)Snailmail: David Kühling |
aaa aab aac aad aae aaf aag ... zzy zzz
)
ASMCrack was not programmed to be used for criminal activities. It should be a tool for testing and improving security on unix systems. I started the developement of this program to defend myself and my account. The reason for my continuing to devolop this cracker until it has become the fastest and most complex one was my desire to prove myself. I'm not a hacker, I'm a freak!
I take no responsability for any effect that the usage of this program may
have on you or any other person. I released it in the hope that the users
behave well. Allways keep in mind, that in almost all countries using cracked
passwords or passing them to other persons is itself a criminal action that
could bring you into jail.
2. ASMCRACK
2. 1. Command line options
You can get an overview about ASMCrack's command line options by
"asmcrack -help
". Here is a more accurate list of them:
-ACcuracy:
num
20
).
-ALert:
num
-alert:0
" will switch off any kind of accoustic signals,
even the "cracking finished" signal.
-Bruteforce
aaa aab aac aae aaf ... zzy zzz
)
-CRacked
-noncracked
".
-CHars:
string
abcdefghijklmnopqrstuvwxyz
)
-DICtfile:
name
-DISplay
-Geco
-HElp
-List:
name
-MASk:
mask
g___t
" will create 5 character words, that begin on
'g' and end on 't'. This option is quite practical to crack passwords,
you saw beeing typed. Note, that if you use "-mask
" in
Smart Force mode, you mustn't specify characters or
character combinations, that weren't in the dictionary.
-MAXlength:
num
8
)
-MInlength:
num
2
)
-MUpdate
asmcrack.got
" every 5 minutes.
-MUlti:
name,
num
-NONcracked
-cracked
".
-NORrestore
-Pwdfile:
name
-REstore
-RStfile:
name
asmcrack.rst
")
-SMartforce
-STdin
stdin
instead of the file, specified
by "-dictfile:
name".
-SYllables:
num
-TEst
-TImeabort:
num
-User:
list
','
'*'
'?'
'[...]'
'!'
, matches if the character is
not in the range. Between the brackets, the range is specified by
listing the characters that are in the range, or two characters
separated by '-'
to indicate all characters in that
range. For example, '[a-d]'
matches 'a'
,
'b'
, 'c'
, or 'd'
.
'\'
'\*'
matches an asterisk.
-Words
-VDabort:
num
v/d:
" - value) is less than num.
ASMCrack starts checking this event after the first
password was cracked. This option is also stored within the
restore-file.
-Xuser:
list
-user
" option.
-max:6
" is ok, but
"-ma:6
" is a problem, for the reason that ASMCrack
now doesn't know, whether you mean "-maxlength
" or
"-mask
". If a parameter contains spaces or other special characters,
you have to quote it, otherwise it could be truncated or seperated, which is
certainly not what you want.
(e.g. "asmcrack "-chars:$_@'#~" -brute -pwd:passwd.dat
")
-test
" option. As the performance of these
programs also depends on the number of loaded accounts, you will allways
have to specify a password file. You can also use all the other options like
"-user:list
" or "-xuser:list
" to test it for special
cases. Here is a small list about the versions:
-user:username
").
-list
" option. If ASMCrack finds a file
"asmcrack.got
" in the current directory, it will read this file
before loading the accounts. "asmcrack.got
" not only contains
the cracked passwords, but also contains the encrypted passwords, as they
are in linux password files. These encrypted pwds are used to identify
accounts that have allready been cracked. That's why you can allways replace
the password file by a newer one. If cracked passwords, are changed, they will
be loaded again. You can reload the accounts while ASMCrack is
working by pressing Ctrl+R.
A restore-file is created by ASMCrack every 5 minutes, and when
the session is aborted, except you use the "-norestore
" option.
It contains almost all options you set from the command line. Some options,
that don't have much to do with the cracking itsself, e.g.
"-alert:number
" and "-display
" are excluded from
being saved. The restore-file also contains the last tried word (in
geco mode it is the last tried account) and information for the cracking
statistics, such as the duration the session has been running, the total number
of encryptions and the number of cracked passwords. You can explicitely specify a restore
file by the "-rstname:filename
" option. To restore an aborted
session, use the "-restore
" option.
A dictionary file is only required, if you run ASMCrack in the
Word, Smart Force or Syllable Word Generation
mode. If there are characters above #127 in the dictionary they will automatically
be reduced by clearing bit7. You should note, that the the syllable statistics
generation in the syllable mode can take up to 10 minutes, if the dictonary is
quite big, and your computer is slow. If you want to try many dictionaries at
at once, you can use ASMCDict to merge them. ASMCDict
supports wildcards and subdirectory recursing.
"asmcdict @c:\*.dic -inc -outfile:huge.dic
"
will search all dictionary files on drive C
and write them to
"huge.dic
". ASMCDict eliminates all words that
contain characters above 127.
2. 4. The cracking modes
ASMCrack supports the following cracking modes:
-geco
")The Geco cracking mode reads the geco and login field from the pwd file and combines them to generate words. These passwords will only be tried on the account the login and names come from. It will then mix the words in any order and with any length. The first characters of the words will be tried uppercase and lowercase. It will also concatenate up to 3 digit numbers to truncated geco/login names. Since ASMCrack tries the generated pwds on one account only, it can try thausands of words, without getting speed problems. Instead of saving the last tried word to the restore file, it will stores the last tried account. Note that the geco mode can't be used with MCM.
-bruteforce
")
Brute Force is a very stupid algorithm, that just tries all
possible combinations of letters from a given alphabet. The characters that
are used by default are abcdefghijklmnopqrstuvwxyz
.
Since the number of words to try grows exponential with the increasing length,
Brute Force only works effectively on few accounts and with
"-maxlengh:num
" set to a value smaller than 6. Brute
Force is especialy very practical to crack special users' accounts.
For example, you saw that someone with the login name "guest
"
has 'g
' as the first character of his/her pwd, and that the
password has 5 characters. Than you can crack the password easyly, by:
ASMCrack -user:guest -mask:g____ -brute -pwd:passwd.dat
ASMCrack will generate the shortest words first and the
longest words last. The "-chars
" option specifies which
characters should be used. This overwrites the default alphabet.
-smartforce
")Smart Force is a statistic optimized Brute Force algorithm, that I developed. It is about 15 times more effective than stupid Brute Force, but still has the ability of beeing masked. It cracked a password, that I knew to be 5 characters long in 46 seconds, and a 6 digit password that wouldn't have been in any dictionary in about 20 minutes. Smart Force gains its statistics from a dictionary. These statistics include data about the most frequently beginning characters, and about the frequency of character combinations. When Smart Force generates its words, it generates the words with the most frequently combinations first, and the ones with the least frequently combinations last. Smart Force never tries combinations that weren't in the dictionary. It also uses an Accuracy Value to drop very seldom combinations. The Accuracy Value means the following:
If w is a Smart Force word, A is the accuracy value and x is the following letter of y, then y must be among the A most frequently following charcters of x.The default accuracy value is 20. This means that one character can only be followed by his 20 most frequency following characers. Normaly you will abort Smart Force a very long time before it finished, when you use it to crack many accounts. This is because the probability of a word to be a valid password decreases, the longer Smart Force works. When I used it to crack 400 accounts, it got 10 passwords in the first 5 minutes, and only 1 in the next 5 minutes. In opposite to Brute Force, Smart Force generates passwords of different lengths mixed, since the length has no effect on the frequency of the character combinations. Otherwise Smart Force behaves like Brute Force.
If you want Smart Force to use numbers you can do the following things:
-syllable:
num")
The Syllable Word Generation mode gains syllables and
statistic information about these syllables from a dictionary. Then it
puts num of these syllables together to create new words. If
you use "-syllable:num
", you can specify neither a mask nor an
accuracy value. The only thing you can influence is the length of the words
that are tried, by "-maxlength:
num" and
"-minlength:
num". This algorithm is due to its
complexity quite slow, especialy if you specify a small range of lengths.
That's why you should only use it to crack many accounts, where the word
generation is only a small part of all operations. Syllable Word
Generation is not as accurate as Smart Force, but because
it takes syllables to create new words the length doesn't matter. So it can
for example crack 7 and 8 digit passwords, that only consist of 2 syllables,
that are impossible to crack by Smart Force because of their
length.
If you want Syllable Word Generation to use numbers, note that it treats numbers (and all other special characters) as consonants, when extracting the syllables. It distinguishes from syllables that it extracted from a words begin and syllables it found anywhere within a word. So if you give it a dictionary, that contains words that begin on numbers, Syllble Word Generation will only generate words, beginning on numbers.
-multi:
configfile,
num"
option. Here is a little example:
Let's say you've got a Pentium 200 and an old 486 DX2 80, and you want to crack the account of a user, namedatrotzke
. The configuration file contains the names of the computers and their speeds and is on both computers. You can get the speed value, by executing:
ASMCrack -test -pwdfile:passwd.dat.
config.mcm:
Pentium 200 : 20000 My good old DX2 80 : 3000
When the computers crack one or more passwords, you can update the "
- On the Pentium you will execute:
ASMCrack -multi:config.mcm,0 -pwd:passwd.dat -brute -maxlength:8
- And on the 486:
ASMCrack -multi:config.mcm,1 -pwd:passwd.dat -brute -maxlength:8
asmcrack.got
" files, with the help of the "-list:
filename" option. This command outputs a list of all cracked passwords into the file, specified by filename. You can then input this file into the ASMCracks, by
"ASMCrack -dict:filename -norestore -pwd:passwd.dat
".
This is an example, for what to do if you run ASMCrack on two or more seperated computers. In case you use it on a network system, it becomes more interesting:
Assuming you have access to a network with 10 equal computers, and the current directory is located on a network drive, and is the same on all computers, your config file will be the following: (for the reason that it is on a network drive, you only have to create it once)config.mcm:
Computer0 : 20000 Computer1 : 20000 Computer2 : 20000 Computer3 : 20000 Computer4 : 20000 Computer5 : 20000 Computer6 : 20000 Computer7 : 20000 Computer8 : 20000 Computer9 : 20000
Ok, now you can execute ASMCrack:"
- 1st Computer:
ASMCrack -multi:config.mcm,0 -rst:restore0.rst -mupdate -pwd:passwd.dat -brute -max:8
- 2nd Computer:
ASMCrack -multi:config.mcm,1 -rst:restore1.rst -mupdate -pwd:passwd.dat -brute -max:8
- 3rd Computer:
ASMCrack -multi:config.mcm,2 -rst:restore2.rst -mupdate -pwd:passwd.dat -brute -max:8
- 4th Computer:
ASMCrack -multi:config.mcm,3 -rst:restore3.rst -mupdate -pwd:passwd.dat -brute -max:8
....
- 10th Computer:
ASMCrack -multi:config.mcm,9 -rst:restore9.rst -mupdate -pwd:passwd.dat -brute -max:8
-rst:restoreX.rst
" is necessary, to make the ASMCracks to use different restore-files, else all the running ASMCracks would modify the same file, which would certainly cause problems. I programmed the "-mupdate
" option especialy for network drives. It causes ASMCrack to update the loaded accounts with "asmcrack.got
" every 5 minutes. This means, if one of the running ASMCracks cracks a password, all other computers will remove this password from their account list after not more than 5 minutes.
Now you got it?
If ASMCrack runs in MCM - mode, it divides up the
passwords to try, by just ignoring all passwords that it expects to be done
by the other computers. That's why it could run quite ineffectively if you
load few accounts or use slow cracking modes, such as Syllable Word
Generation. If ASMCrack shows the status, after you
pressed Space, the c:
and c/s:
value
will be calculated by the number of encryptions, that where made by
this computer. If you want to get a speed value, that considers the
work of all computers, use the "-test
" option.
2. 6. Exit codes
ASMCrack has different exitcodes, that will help you to call it
from batch files:
Event | Exit code |
---|---|
Cracking finished | 0 |
Aborted due to "-timeabort:minutes "
or "-vdabort:num " | 1 |
Aborted due to Ctrl+C | 2 |
Aborted due to an error | 3 |
[00:01:00] v:6 v/d:144 c:36000000 s:3600 c/s:10000 Brute Force:ghijk
You can gain the following information from it:
[00:01:00]
v:6
v/d:144
c:36000000
s:3600
c/s:10000
Brute Force:ghijk
ghijk
"
asmcdict [[@]file1] [[@]file2] [...] [-option1] [-option2] [...]
"file1
", "file2
" etc. are input filenames. If you
don't specify an input file ASMCDict will read from
stdin
. You are allowed to use wildcards in the filenames, such
as "*.dic
" or "words???.lst
". "@file1
",
"@file2
" etc. are input wildcards, that are searched, recursing
subdirectories.
There are three types of options:
-alpha
a-z A-Z
. By this option, you can read .txt files
etc. word by word.
-chars:
string.
-maxlength:
num
-minlength:
num
-wholewords
Space
(#32) excepted. This will cause
ASMCDict to read whole words instead of phrases.
E.g. if your dictionary contains: "Intel Pentium 2
"
ASMCDict will then read it separated:
"Intel
", "Pentium
" and "2
".
-truncate:
num
asmcdict diction.ary -uppercase -reverse
" will
generate two variations of every word, an uppercase and a reversed
version. If you want to get an uppercase converted and reversed
version, you will have to type in:
"asmcdict diction.ary -uppercase|asmcdict -reverse
")
-include
-lowercase
-lowercase:
num
-prefixes:
string
-prefixes:123
": foo->1foo,2foo,3foo
)
-replace:
XY
-reverse
foo->oof
).
-suffixes:
string
-suffixes:123
": foo->foo1,foo2,foo3
).
-uppercase
foo->Foo
)
-uppercase:
num
-lowercase
" option, you can
use "-uppercase
" multiple in one command line.
-substract:
name
-help
If you use special characters in a parameter (such as space
), you
will have to quote the whole option (as it was mentioned in 2.1), to be shure
that it is interpreted right.
3. 3. Functionality
ASMCDict can work with up to 16000000 words. After it added
200000 words to the dictionary it will use harddisk swapping, accessed
through a 130000 words cache.
If you don't specify an output file name ("-outfile:name
"),
ASMCDict will print all words to stdout
.
When ASMCDict prints all words directly to a file, the resulting
dictionary will be smaller than in stdout
mode, since it will then
be created, using the linux .txt format, that uses one byte for linebreaks
instead of the two in DOS format.
ASMCDict opens the input files in binary mode. So you are able
to read even formatted word documents or orthography-check wordlists from
special programs with the "-alpha
" option (if these wordlists
aren't encrypted or compressed). If you don't specify any input file,
ASMCDict will read words from stdin
.
ASMCDict will cut out every word that contains characters above
#127.
4. SOME TIPS
4. 1. How to get the unix password file
There are thousands of documents about this theme out there in the internet.
Just search for terms like "linux passwords" or "hack faq" etc.. However, for
all those people who don't have permanent internet access, this section
describes the most common methods. I don't know unix very well, so don't ask
me questions about it.
Every line in the password file should look like this:
dkuehlin:2BtIWTtucBTW.:764:100:David Kuehling:/home/student/dkuehlin:/bin/bash
If the result of one of your tries is a text, where every line looks like this,
you were successfull. You can than redirect the output by suspending
" > passwd.dat
" to the command that succeeded.
Here is a list of commands that could word:
cat /etc/passwd
ypcat /etc/passwd
(or just ypcat passwd
)
#includemain() { struct passwd *p; while(p=getpwent()) printf("%s:%s:%d:%d:%s:%s:%s\n", p->pw_name, p->pw_passwd, p->pw_uid, p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell); }
cc unshadow.c -ounshadow
unshadow
ASMCrack -pwd:passwd.dat -geco
ASMCDict your_file -alpha -lowercase -out:words1.lst
ASMCDict *.txt *.htm *.doc *.wri *.hlp -alpha -lowercase -out:words2.lst
ASMCDict @c:\*.txt @c:\*.htm c:\*.doc c:\*.wri c:\*.hlp -alpha -lowercase -out:words3.lst
*.pas
, *.c
or *.asm
files, if you think, that there are users that have programming
keywords as password.
ASMCDict *.lst -include -out:allwords.lst
ASMCDict allwords.lst -lowercase -uppercase -uppercase:8 -out:this.lst
ASMCrack -pwd:passwd.dat -dict:this.lst
ASMCrack -pwd:passwd.dat -dict:english.lst -smartforce -min:4 -max:5 -abort:15
ASMCrack -pwd:passwd.dat -brute -chars:0123456789 -maxlen:6
ASMCDict allwords.lst -suffixes:01234 -out:this.lst
ASMCrack -pwd:passwd.dat -dict:this.lst
ASMCDict allwords.lst -suffixes:56789 -out:this.lst
ASMCrack -pwd:passwd.dat -dict:this.lst
ASMCDict allwords.lst -uppercase|ASMCDict -suffixes:01234
ASMCrack -pwd:passwd.dat -dict:this.lst
ASMCDict allwords.lst -uppercase|ASMCDict -suffixes:56789
ASMCrack -pwd:passwd.dat -dict:this.lst
If you want, you can also suspend numbers to a completely uppercase
version of the dictionary ("-uppercase:8
"). But this
brought me no password.
ASMCrack -pwd:passwd.dat -dict:english.lst -syllables:2
ASMCDict small.lst -suffixes:0123456789 -out:wordsnum.lst
ASMCDict wordsnum.lst -suffixes:01 -out:this.lst
ASMCrack -pwd:passwd.dat -dict:this.lst
ASMCDict wordsnum.lst -suffixes:23 -out:this.lst
ASMCrack -pwd:passwd.dat -dict:this.lst
...
I'm open for any suggestions you have, concerning cracking modes, new functions of ASMCDict etc.. I prefer this much more, than if anyone, who has a little idea, reprogramms his own, small program version. If you find something, that looks like a bug, please contact me immediately. I will certainly correct the bug within a week, and send you the repaired version.
Currently I have three C-crypt functions, that can be used to replace the ASM
sourcefiles of this ASMCrack version, and thereby make it
possible to compile ASMCrack for other systems. One of them uses
8.5MByte and the other 72K look-up tables. One of the 72K versions is
especially optimized to be compiled for a 64 bit processor. However, you will
have to get a DJGPP - C compiler to compile it. (because of the 64bit
long long
integers and some other DJGPP specific programming
techinics) These sourcecodes aren't included within the ASMCrack
release, but I will send them to anyone who mails me. I will also help anyone,
who tries to programm ASM crypt functions for other systems. (the C-sourcecodes
should be a quite good base for beeing translated to ASM).
6. CONTACTING ME
My addresses are listed at the beginning of this document, but you should
note, that my email is at my account at school. That's why it could take some
time until I answer, if I have hollidays, our sysop died etc.. I'm currently
in the 11th grade, so I will finish school in june 2000. Don't try to contact
me via email after this date. If you want me to send you the sourcecodes,
mentioned in section 5, by normal mail, include $2-$3 into your letter, for
disc and mail costs.
7. CREDITS
I owe to thank the following persons:
crypt.c
I needed to understand how DES is implemented to
encrypt unix passwords.
http://www.delorie.com
)