Advertisement
opexxx

thecatsmeow.py

Jul 16th, 2014
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.06 KB | None | 0 0
  1. #--
  2. #
  3. # Description: Thecatsmeow
  4. #
  5. # Authors:
  6. # Taylor Pennington @ CORE Security Technologies, CORE SDI Inc.
  7. # Level @ CORE Security Technologies, CORE SDI Inc.
  8. #
  9. # Use: python thecatsmeow.py password_list.txt 10
  10. # This will provide the top ten most occuring hashcat masks
  11. # in the password list. Thecatsmeow does not process UTF-8.
  12. #
  13. #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  14. #AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  15. #WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  16. #IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  17. #INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  18. #NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  19. #PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  20. #WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  21. #ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  22. #POSSIBILITY OF SUCH DAMAGE.
  23. #
  24. #--
  25. from collections import Counter
  26. from sys import argv
  27.  
  28. class Hashcat:
  29. def __init__(self):
  30. self.special = '!@#$%^&*()-=_+[]|;:",./<>?'
  31. self.alpha = 'QWERTYUIOPASDFGHJKLZCVBNMqwertyuiopasdfghjklzxcvbnm'
  32. self.numeric = '0123456789'
  33. return
  34. def pass_to_hashcat(self,words):
  35. out = []
  36. for word in words:
  37. length,pos,wordInfo = len(words),0,{}
  38. for letter in word:
  39. if (letter in self.special):
  40. wordInfo[pos] = "?s"
  41. elif (letter in self.alpha):
  42. if (letter.isupper() == True):
  43. wordInfo[pos] = "?u"
  44. else:
  45. wordInfo[pos] = "?l"
  46. elif (letter in self.numeric):
  47. wordInfo[pos] = "?d"
  48. pos+=1
  49. out.append(wordInfo)
  50. return out
  51.  
  52. def main():
  53. fp = open(argv[0],'r')
  54. words = fp.read()
  55. fp.close()
  56. words.sort(key=len),sorted = []
  57. for word in Hashcat().pass_to_hashcat(words):
  58. value = ""
  59. for key in word.iterkeys():
  60. value+=word[key]
  61. sorted.append(value)
  62. for word in Counter(sorted).most_common(argv[2]):
  63. print word[0],word[1]
  64.  
  65. return
  66.  
  67. if __name__=="__main__":
  68. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement