phone fimder


SUBMITTED BY: Guest

DATE: Nov. 16, 2013, 3:25 a.m.

FORMAT: Text only

SIZE: 2.8 kB

HITS: 973

  1. # Phone Number Lookup Tool
  2. # Version 1.0.0
  3. # Coded by InvisibleMan in Python 3.3.2
  4. # Download : N/A
  5. # File : phonetrak.py
  6. #IMPORTS
  7. import re
  8. import sys
  9. import urllib.request
  10. #BYTE CONTROL
  11. def encodeString(string) : return string.encode('utf-8')
  12. def decodeString(string) : return string.decode('utf-8')
  13. #DEBUG MESSAGES
  14. def action(msg) : print('[#] - ' + msg)
  15. def alert(msg) : print('[+] - ' + msg)
  16. def error(msg) : print('[!] - ' + msg)
  17. def errorExit(msg) : raise SystemExit('[!] - ' + msg)
  18. #GET BETWEEN
  19. def getBetween(source, start, stop):
  20. search = encodeString(start + '(.*?)' + stop)
  21. data = re.compile(search).search(source)
  22. if data:
  23. found = decodeString(data.group(1))
  24. return found.replace('\n', '')
  25. else:
  26. return False
  27. #GET CARRIER
  28. def getCarrier(number):
  29. source = urllib.request.urlopen('http://www.fonefinder.net/findome.php?npa=' + number[:3] + '&nxx=' + number[3:6] + '&thoublock=' + number[6:]).read()
  30. carrier = getBetween(source, '</A><TD><A HREF=\'http://fonefinder.net/', '\'>')
  31. if carrier == 'att.php':
  32. alert('Carrier : AT&T')
  33. alert('SMS Gateway : ' + number + '@txt.att.net')
  34. elif carrier == 'metropcs.php':
  35. alert('Carrier : Metro PCS')
  36. alert('SMS Gateway : ' + number + '@mymetropcs.com')
  37. elif carrier == 'sprint.php':
  38. alert('Carrier : Sprint')
  39. alert('SMS Gateway : ' + number + '@messaging.sprintpcs.com')
  40. elif carrier == 'tmobile.php':
  41. alert('Carrier : T-Mobile')
  42. alert('SMS Gateway : ' + number + '@tmomail.net')
  43. elif carrier == 'verizon.php':
  44. alert('Carrier : Verizon')
  45. alert('SMS Gateway : ' + number + '@vtext.com')
  46. else:
  47. errorExit('Carrier : Unknown')
  48. errorExit('SMS Gateway : Unknown')
  49. #VERIFY PHONE
  50. def verifyPhone(number):
  51. if len(number) == 10 and number.isdigit() == True:
  52. return True
  53. else:
  54. return False
  55. #VERSION CHECK
  56. def versionCheck():
  57. if sys.version_info.major != 3 or sys.version_info.minor != 3:
  58. errorExit('Requires Python version 3.3 to be installed.')
  59. #START
  60. if len(sys.argv) != 2:
  61. error('Missing command line arguments!')
  62. errorExit('Usage : phonetrak.py <number>')
  63. number = sys.argv[1]
  64. if verifyPhone(number) == True:
  65. try:
  66. getCarrier(number)
  67. except:
  68. errorExit('Failed to retrieve carrier!')
  69. else:
  70. error('Invalid phone number!')
  71. errorExit('Usage : phonetrak.py <number>')

comments powered by Disqus