#Script_it


SUBMITTED BY: Guest

DATE: Dec. 4, 2013, 11:55 a.m.

FORMAT: Bash

SIZE: 3.5 kB

HITS: 745

  1. #Script_it, a simple script which simply tidy your .cap packets collection and prepare them for cracking with oclHashcat-Plus.
  2. #You're free to redistribute this script anywhere you want, but keep the original credits. Thank You.
  3. #Concept by Hash-IT
  4. #Code by SmilingWolf
  5. #You're using the v1.0 of Script_it, codename Strike Of The Ninja
  6. echo "Script_it, a simple script which simply tidy your .cap packets collection and prepare them for cracking with oclHashcat-Plus."
  7. echo "You're free to redistribute this script anywhere you want, but keep the original credits. Thank You."
  8. echo "Concept by Hash-IT"
  9. echo "Code by SmilingWolf"
  10. echo "You're using the v1.0 of Script_it, codename Strike Of The Ninja"
  11. sleep 3
  12. mkdir -p B/OriginalCaps
  13. OriginalCaps=0
  14. for f in A/*.cap
  15. do
  16. CorrectString=`file "$f" | grep -o "tcpdump capture file"`
  17. if [ "$CorrectString" == 'tcpdump capture file' ];
  18. then
  19. cp "$f" B/OriginalCaps/
  20. OriginalCaps=$(($OriginalCaps + 1))
  21. fi
  22. done
  23. echo "Deleting duplicated packets..."
  24. mkdir B/UniqueCaps
  25. md5sum B/OriginalCaps/* > /tmp/hashes_files.tmp
  26. LIST=`md5sum B/OriginalCaps/* | cut -d ' ' -f 1 | sort | uniq`
  27. for MD5 in $LIST
  28. do
  29. ULIST=`grep $MD5 /tmp/hashes_files.tmp | head -1 | cut -d ' ' -f 3-`
  30. cp "$ULIST" B/UniqueCaps/
  31. done
  32. rm /tmp/hashes_files.tmp
  33. echo "Done."
  34. mkdir B/BadCaps
  35. BadCaps=0
  36. for f in B/UniqueCaps/*
  37. do
  38. l=`wpaclean /dev/null "$f" | wc -l`
  39. if [ $l == 2 ];
  40. then
  41. NewPos=`echo -n "$f" | cut -b 14-`
  42. echo "Bad capture file found!!! Moving it to B/BadCaps/$NewPos"
  43. mv "$f" B/BadCaps/
  44. BadCaps=$(($BadCaps + 1))
  45. fi
  46. done
  47. mkdir B/ReallyUniqueCaps
  48. UniqueCaps=0
  49. for f in B/UniqueCaps/*
  50. do
  51. BSSID=`wpaclean /dev/null "$f" | cut -d ' ' -f 2 | tail -2 | head -1`
  52. echo "$BSSID $f">> /tmp/bssids_files.tmp
  53. done
  54. LIST=`cat /tmp/bssids_files.tmp | cut -d ' ' -f 1 | sort | uniq`
  55. for BSSIDS in $LIST
  56. do
  57. ULIST=`grep $BSSIDS /tmp/bssids_files.tmp | head -1 | cut -d ' ' -f 2-`
  58. cp "$ULIST" B/ReallyUniqueCaps/
  59. UniqueCaps=$(($UniqueCaps + 1 ))
  60. done
  61. rm /tmp/bssids_files.tmp
  62. mkdir B/CleanCaps
  63. CleanCaps=0
  64. c=1
  65. for f in B/ReallyUniqueCaps/*
  66. do
  67. l=`wpaclean /dev/null "$f" | tail -2 | head -1 | cut -d ' ' -f 3-`
  68. if [ -e "B/CleanCaps/$l clean.cap" ];
  69. then
  70. if [ -e "B/CleanCaps/$l ($c) clean.cap" ];
  71. then
  72. c=$(( $c + 1 ))
  73. else
  74. wpaclean "B/CleanCaps/$l ($c) clean.cap" "$f"
  75. fi
  76. else
  77. wpaclean "B/CleanCaps/$l clean.cap" "$f"
  78. c=1
  79. fi
  80. CleanCaps=$(($CleanCaps + 1))
  81. done
  82. mkdir B/HCcaps
  83. HCcaps=0
  84. for f in B/CleanCaps/*
  85. do
  86. n=`echo -n "$f" | cut -b 13- | sed s/\ clean\.cap//g`
  87. aircrack-ng -J "B/HCcaps/$n" "$f" >> /dev/null
  88. echo "Converting $f to B/HCcaps/$n.hccap"
  89. HCcaps=$(($HCcaps + 1))
  90. done
  91. echo ""
  92. echo ""
  93. echo "Report Time!"
  94. echo "Starting number of .cap files: $OriginalCaps"
  95. echo "They are in B/OriginalCaps"
  96. echo "Corrupted Caps found: $BadCaps"
  97. echo "They are in B/BadCaps"
  98. echo "Unique Caps found: $UniqueCaps"
  99. echo "They are in B/ReallyUniqueCaps"
  100. echo "Clean Caps obtained: $CleanCaps"
  101. echo "They are in B/CleanCaps"
  102. echo "Caps converted to HCcaps: $HCcaps"
  103. echo "They are in B/HCcaps"

comments powered by Disqus