exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

slrc.sh.txt

slrc.sh.txt
Posted Nov 16, 2006
Authored by Stefan Behte | Site ge.mine.nu

SLRC is a simple bash script put together to crack rar archives on Linux.

tags | cracker, bash
systems | linux
SHA-256 | 3eb62117334b9dc42cf227a04409053ed722aa6e8092e51f6c63540a8b3f0a94

slrc.sh.txt

Change Mirror Download
#!/bin/bash
# simple linux rar cracker (slrc) v0.2 by Stefan Behte (http://ge.mine.nu)
#
# I wrote this to practise/test bash getopts and also because I didn't find any
# rar cracker for linux when I wanted to check a file against a wordlist.
# I know doing it this way is slow but I wanted a quick hack ;)
#
# Copyright (c) 2006 by Stefan Behte
#
# slrc 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.
#
# slrc 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 slrc; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Written by Stefan Behte
#
# Please send bugs, comments, wishes and success stories to:
# Stefan.Behte at gmx dot net
#
# Also have a look at my page:
# http://ge.mine.nu/
#

echo -e "\nsimple linux rar cracker (slrc) v0.2 by Stefan Behte (http://ge.mine.nu)"

usage()
{
printf "\n$0 [-b /path/to/unrar] [-B /path/to/john] [-f rarfile] [-w wordlist] [-i maxlen:chartype] [-r]\n"
printf " \"chartype\" may be alpha, digits, alnum or all\n"
printf "\nexamples:\n"
printf "$0 -f /tmp/test.rar -w ./passwords.txt\n"
printf "$0 -b /opt/rar/bin/unrar -B /usr/sbin/john -f /tmp/test.rar -i 4:digits\n\n"
exit 1
}

die()
{
printf "$@\n"
exit 1
}

if [ ! -n "`which unrar`" ]
then
die "\nunrar not found.\n"
fi

fcnt=0;
RAR=unrar
RARPARAMS="t -p"
JOHN=john

while getopts ":f:w:l:i:b:B:r" Option
do
case $Option in
f) if [ -e ${OPTARG} ]; then FILE=${OPTARG};else die "$OPTARG does not exist.\n";fi;;
w) if [ -e ${OPTARG} ]; then total=`wc -l ${OPTARG} | awk '{print $1}'`;cmd="cat ${OPTARG}";else die "$OPTARG does not exist.\n";fi;;
l) fcnt=${OPTARG};;
i) john=y;cmd="$JOHN -stdout:`echo ${OPTARG} | awk -F: '{print $1}'` -i:`echo ${OPTARG} | awk -F: '{print $2}'`";;
b) RAR=${OPTARG};;
B) JOHN=${OPTARG};;
r) john=y;cmd="john -restore";;
*) usage;;
esac
done

if [ "$cmd" = "" ]
then
usage
fi

cnt=0
starttime=`date +'%s'`
RETVAL=0
echo

$cmd | while read pwd
do

cnt=$[$cnt + 1]

if [ $fcnt -le $cnt ]
then
if [ "${pwd}" != "" ]
then
$RAR $RARPARAMS"${pwd}" $FILE &>/dev/null
RETVAL=$?
fi

diff=$[ `date +'%s'` - $starttime ]

if [ $diff -eq 0 ]
then
diff=1
fi
persec=$[${cnt} / ${diff}]

if [ $persec -eq 0 ]
then
persec=1
fi

if [ "$john" != "y" ]
then
todo=$[$total - $cnt]
echo "[$cnt/$todo/$total] [${persec}/s] [$diff/$[ ${todo} / ${persec} ]s]: ${pwd}"
else
# (todo &) total ausrechnen -> alpha=26 * stellen
echo "[$cnt] [${persec}/s]: ${pwd}"
fi

if [ $RETVAL -eq 0 ]
then
$RAR $RARPARAMS"${pwd}" $FILE &>/dev/null
if [ $? -eq 0 ]
then
echo -e "\nPassword found: ${pwd}"
fi
exit
fi
fi

done
echo

if [ ! $RETVAL -eq 0 ]
then
echo -e "Sorry, password not found.\n"
fi

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close