WPA Strip, Clean and Convert Script
#11
can pyrit export to aircrack?
#12
pyrit reads the same libpcap format as aircrack. Suitable options is to use something analyze verb, ie
$pyrit -r file.cap analyze
This shows info on handshakes found in the capture.

P.s. make sure you use at least pyrit 0.4 for this to have the right results
#13
I mentioned this earlier when I noticed problems with Aircrack.

http://hashcat.net/forum/thread-498.html

Unfortunately WPAclean can produce errors also. As mentioned in the link.
#14
For a project of mine I use combination of tools to make sure I have clean captures:
http://sourceforge.net/p/dwpa/code/123/t...force=True
See submission function at line 30
#15
(11-17-2011, 05:02 PM)RealEnder Wrote: For a project of mine I use combination of tools to make sure I have clean captures:
http://sourceforge.net/p/dwpa/code/123/t...force=True
See submission function at line 30

Thank you for your contribution Smile

Looks complicated !! ha ha ! I also notice that it uses WPAClean which I have had some issues with mentioned in my link.

I am unable to find a reliable .cap cleaner, I guess we have to use different tools to see which work best on each case.

My fear is spending a lot of time trying to test a .cap or .hacp file only to find out later that it has been corrupted all along !

I wish airodump-ng was better at checking to start with.

#16
Ok I think this is now ready to go Big Grin

Code:
#Script_it, a simple script which simply tidy your .cap packets collection and prepare them for cracking with oclHashcat-Plus.
#You're free to redistribute this script anywhere you want, but keep the original credits. Thank You.
#Concept by Hash-IT
#Code by SmilingWolf
#You're using the v1.0 of Script_it, codename Strike Of The Ninja
echo "Script_it, a simple script which simply tidy your .cap packets collection and prepare them for cracking with oclHashcat-Plus."
echo "You're free to redistribute this script anywhere you want, but keep the original credits. Thank You."
echo "Concept by Hash-IT"
echo "Code by SmilingWolf"
echo "You're using the v1.0 of Script_it, codename Strike Of The Ninja"
sleep 3
mkdir -p B/OriginalCaps
OriginalCaps=0
for f in A/*.cap
do
CorrectString=`file "$f" | grep -o "tcpdump capture file"`
  if [ "$CorrectString" == 'tcpdump capture file' ];
  then
    cp "$f" B/OriginalCaps/
    OriginalCaps=$(($OriginalCaps + 1))
  fi
done
echo "Deleting duplicated packets..."
mkdir B/UniqueCaps
md5sum B/OriginalCaps/* > /tmp/hashes_files.tmp
LIST=`md5sum B/OriginalCaps/* | cut -d ' ' -f 1 | sort | uniq`
for MD5 in $LIST
  do
  ULIST=`grep $MD5 /tmp/hashes_files.tmp | head -1 | cut -d ' ' -f 3-`
  cp "$ULIST" B/UniqueCaps/
done
rm /tmp/hashes_files.tmp
echo "Done."
mkdir B/BadCaps
BadCaps=0
for f in B/UniqueCaps/*
  do
  l=`wpaclean /dev/null "$f" | wc -l`
  if [ $l == 2 ];
    then
    NewPos=`echo -n "$f" | cut -b 14-`
    echo "Bad capture file found!!! Moving it to B/BadCaps/$NewPos"
    mv "$f" B/BadCaps/
    BadCaps=$(($BadCaps + 1))
  fi  
done
mkdir B/ReallyUniqueCaps
UniqueCaps=0
for f in B/UniqueCaps/*
  do
  BSSID=`wpaclean /dev/null "$f" | cut -d ' ' -f 2 | tail -2 | head -1`
  echo "$BSSID $f">> /tmp/bssids_files.tmp
done
LIST=`cat /tmp/bssids_files.tmp | cut -d ' ' -f 1 | sort | uniq`
for BSSIDS in $LIST
  do
  ULIST=`grep $BSSIDS /tmp/bssids_files.tmp | head -1 | cut -d ' ' -f 2-`
  cp "$ULIST" B/ReallyUniqueCaps/
  UniqueCaps=$(($UniqueCaps + 1 ))
done
rm /tmp/bssids_files.tmp
mkdir B/CleanCaps
CleanCaps=0
c=1
for f in B/ReallyUniqueCaps/*
  do
  l=`wpaclean /dev/null "$f" | tail -2 | head -1 | cut -d ' ' -f 3-`
  if [ -e "B/CleanCaps/$l clean.cap" ];
    then
    if [ -e "B/CleanCaps/$l ($c) clean.cap" ];
      then
      c=$(( $c + 1 ))
      else
      wpaclean "B/CleanCaps/$l ($c) clean.cap" "$f"
    fi
    else
    wpaclean "B/CleanCaps/$l clean.cap" "$f"
    c=1
  fi
  CleanCaps=$(($CleanCaps + 1))
done
mkdir B/HCcaps
HCcaps=0
for f in B/CleanCaps/*
  do
  n=`echo -n "$f" | cut -b 13- | sed s/\ clean\.cap//g`
  aircrack-ng -J "B/HCcaps/$n" "$f" >> /dev/null
  echo "Converting $f to B/HCcaps/$n.hccap"
  HCcaps=$(($HCcaps + 1))
done
echo ""
echo ""
echo "Report Time!"
echo "Starting number of .cap files: $OriginalCaps"
echo "They are in B/OriginalCaps"
echo "Corrupted Caps found: $BadCaps"
echo "They are in B/BadCaps"
echo "Unique Caps found: $UniqueCaps"
echo "They are in B/ReallyUniqueCaps"
echo "Clean Caps obtained: $CleanCaps"
echo "They are in B/CleanCaps"
echo "Caps converted to HCcaps: $HCcaps"
echo "They are in B/HCcaps"

Mainly added the logging capacity and the format check, along with some minor changes.

This is the version 1.0 of Script_it, codename "Strike Of The Ninja" Smile

.txt   script_it.txt (Size: 3.04 KB / Downloads: 13)
#17
Great work there SmilingWolf !! Smile

Updated to version 6 with my humble attempt. The most humiliating code contribution known to mankind ! Smile

Sleep 3 and clear; !!!!! ha ha ! What makes things worse is that I added them twice, twice the humiliation for the same bit of code !! I don’t do myself any favours do I !!

Oh dear, you make me look retarded ! Sad

I am getting false Bad Caps reported, however this is not your script but a fault with wpaclean. Until wpaclean is fixed I wouldn’t totally dismiss the bad caps in the bad caps folder. Leave your excellent script as it is though, this isn’t your fault.

I will PM you soon to ask you some questions for the wiki.


Attached Files
.txt   script_it[1][2][3][4][5][6].txt (Size: 3.06 KB / Downloads: 17)
#18
OK this is up on the wiki,.. atom, perhaps it may be a good idea to lock this now ?

SmilingWolf has a Google project page for support or requests and things may get complicated if there is more than one place to download the script from. People getting hold of old versions etc.

Thanks.
#19
ok, thread closed.