├── .gitignore ├── LICENSE ├── README.md ├── doc ├── __init__.py └── screenshot │ ├── __init__.py │ └── sir.png ├── lib ├── __init__.py ├── actions.py ├── core.py ├── logger.py ├── settings.py ├── source.py └── update.py └── sir.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pydevproject 3 | *.project -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 AeonDave 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SIR 2 | === 3 | 4 | Skype Ip Resolver 5 | 6 | ![Screenshot](https://raw.githubusercontent.com/AeonDave/sir/master/doc/screenshot/sir.png) 7 | 8 | ## Description 9 | 10 | SIR, is a simple tool which resolve from the net the last known ip of a Skype Name 11 | 12 | ## Download and install 13 | 14 | You can download the latest version by cloning SIR from the Git repository: 15 | 16 | git clone https://github.com/AeonDave/sir.git 17 | 18 | ## Dependencies 19 | 20 | For http data retrival i used BeautyfulSoup library so you need to install it into your python libraries. Don't worry, it's easy! 21 | 22 | pip install beautifulsoup4 23 | 24 | or 25 | 26 | easy_install BeautifulSoup4 27 | 28 | or you just simply download the library and then 29 | 30 | cd BeautifulSoup 31 | python setup.py install 32 | 33 | ## Thanks to: 34 | 35 | BeautyfulSoup http://www.crummy.com/software/BeautifulSoup/ 36 | ResolveThem http://www.resolvethem.com/ 37 | 38 | 39 | 40 | .:rA@##@2 41 | .;h@@@@@@@@@@ 42 | ;S@@@@@@@@@@@@@@@@@; 43 | :2M@@@@@@@@@@@@@@@@@@@@@A 44 | ;A@@@@@@@@@@@@@@@@@@@@@@@@@@@5 45 | r&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: 46 | .&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 47 | .s#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@2 48 | .s@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 49 | ,A@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@5 50 | .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@r 51 | i@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@5 52 | A@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; 53 | s@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: .: 54 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@, ,:X#@@@@@: 55 | .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@; ,S#@@@@@@@@@@@, 56 | .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Mh5rrB: r2@@@@@@@@@@@@@@M2 57 | @@@@@@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 5@@@@@@@@@@@@3@@@, 2B 9@ A 77 | #@9i 2: @@. :i.s r,.@: #@@@@H. .#@@@ .. GS @# X@ A 78 | #@hi & A@: ,s i. :;;@, A@@@M 3@; .@2 2@ . A 79 | @@A5 #2 ;@@#:i. s@#X @@@2 GX ;2Hh9; @# 2@, ,@H3&&&@@@AM 80 | @@H5 Ar ,2M#GBHAs i@@h X@i h@r;22; ;A M@ @@@@@@@@B@A 81 | @#AS @9 ,A@: .@@B M@@ ,A#2: @H r@@HAH#@G. 82 | #@AS ;A @H@9,@@@. r@3 , ;@i :##@M9r 83 | H@GG @. i@#@@@2 H@ i@X 84 | ;@@B @, @; r@@h 85 | @@Hh 3s @@ ,,S@@@@G 86 | #@@r 9; @@ ;@@@@#B#@@r 87 | @@#, H2 3@G &@@; #& 88 | &@@rG: r@@: H@& Mh 89 | H@@@#, .M@@@ :@H #& 90 | :#@@@&i, ;@@@@X @@ ,riX@@9i;. 91 | ;@@@@@MS: ,3@@@Xs@@ @@ ;ir;,;rsr, 92 | .5A@@@@@H2;r;,,.::;;:..:r559@@@@@S i @@s #@ 93 | i@@@@@@@@@@@#@@@@@@@@@@@@@#@M r. @@@@3r. @@ 94 | i@#S.,:sB@, ;# @@9: @@#@r .S.#@i@@@@@X. :@@. 95 | &X M; :# &@XX; @#iA 2H # 2@@@@2. :@@H 96 | 3@. :@ @@@#@&2 ,@ A3 XX.@ s@@@@@@@ 97 | #@r @@M#X i@ X@@5 H@ @: ,MM# :2i 98 | @@X .;:@A ;G ;@@M@@A @; #2B@ 99 | @@@i is iM @@G;.@@ ,@r9; ,@@ 100 | :@@@# @B r@ ,@&S @9 ;@G 2@, 101 | @@s@@5 AG. @. r@h; ;@: A; @@ 102 | #@ #@#, 33:i h@A; @M ,@ @A 103 | ;@, r@#S hH@: r@A2 @ @: 9@ 104 | @@ .@Mi s@@ @@#. H, @: @; 105 | S@, @#s iG .@#9 Ai,i@ &@ 106 | @@ @@r 32 s@@S .@#.:@ @; 107 | i@, @M3rh&5. .@@rA#@#@# XG X# 108 | @@ .rB@@@9B@@@@#@@@ #B hr M. :@ 109 | ;@ #@@@@@#:,@@@@@M5; ;2; .9 hS @. 110 | #@@@@2 ;@s @: .rh9@5@; @H 111 | SM5 @@i @ :2@s #@ 112 | @@S M X 2@ 113 | ;#3s., .M: 114 | 115 | -------------------------------------------------------------------------------- /doc/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | pass 9 | -------------------------------------------------------------------------------- /doc/screenshot/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | pass 9 | -------------------------------------------------------------------------------- /doc/screenshot/sir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeonDave/sir/4f9ec2f05ddff28cc90cb631f8eae4882ee2d293/doc/screenshot/sir.png -------------------------------------------------------------------------------- /lib/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | pass 9 | -------------------------------------------------------------------------------- /lib/actions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | import sys, os, core, settings 9 | 10 | from lib.logger import logger 11 | 12 | __version__ = settings.VERSION 13 | __author__ = settings.AUTHOR 14 | 15 | def header(): 16 | os.system("clear") 17 | 18 | print "" 19 | print " =============================================== " 20 | print " | Skype Ip Resolver v{0}\t\t\t|".format(__version__) 21 | print " | by {0}\t\t\t\t\t|".format(__author__) 22 | print " =============================================== " 23 | print "" 24 | 25 | def showhelp(): 26 | print """ 27 | Usage: python sir.py [Name] [Output] 28 | 29 | Target: 30 | -n, --name SkypeName Target Skype Name 31 | 32 | Options: 33 | -h, --help Show basic help message 34 | -v, --version Show program's version number 35 | -u, --update Update program from repository 36 | 37 | Output: 38 | -o, --output file Print log on a file 39 | 40 | Examples: 41 | python sir.py -n name 42 | python sir.py -n name -o 43 | python sir.py -u 44 | """ 45 | 46 | def resolve(name): 47 | ip = core.get_ip_by_name(name) 48 | msg = ip 49 | if msg: 50 | logger.info('[+] Resolved! IP: ' + msg) 51 | else: 52 | logger.error('[-] Error: Impossible to resolve ' + name) 53 | -------------------------------------------------------------------------------- /lib/core.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | import socket, sys, urllib2, urllib, source 9 | from lib.logger import logger 10 | 11 | 12 | 13 | def get_ip_by_name(name): 14 | 15 | ip = source.get_reverse_from_resolvethem(name) 16 | return ip 17 | 18 | def get_html_from_url(url, name): 19 | 20 | values = {'username' : name, 'submit' : ''} 21 | data = urllib.urlencode(values) 22 | req = urllib2.Request(url, data) 23 | req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0') 24 | req.add_header('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8') 25 | req.add_header('Connection', 'keep-alive') 26 | 27 | try: 28 | response = urllib2.urlopen(req) 29 | return response.read() 30 | except: 31 | logger.error('[-] Error') 32 | 33 | -------------------------------------------------------------------------------- /lib/logger.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | import logging, sys 9 | 10 | logger = logging.getLogger('sirLogger') 11 | stream = logging.StreamHandler(sys.stdout) 12 | formatter = logging.Formatter("\r[%(levelname)s] %(message)s", "%H:%M:%S") 13 | stream.setFormatter(formatter) 14 | logger.addHandler(stream) 15 | logger.setLevel(logging.INFO) -------------------------------------------------------------------------------- /lib/settings.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | import os ,sys 9 | 10 | VERSION = "0.1" 11 | AUTHOR = "AeonDave" 12 | DESCRIPTION = "SIR: Skype Ip Resolver" 13 | SITE = "https://github.com/AeonDave/sir.git" 14 | ISSUES_PAGE = "" 15 | GIT_REPOSITORY = "git://github.com/AeonDave/sir.git" 16 | 17 | PLATFORM = os.name 18 | ROOTDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) 19 | LIBDIR = os.path.abspath(os.path.dirname(__file__)) 20 | PYVERSION = sys.version.split()[0] 21 | -------------------------------------------------------------------------------- /lib/source.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | import sys, core, re 9 | from lib.logger import logger 10 | from bs4 import BeautifulSoup 11 | 12 | def get_reverse_from_resolvethem(name): 13 | url = 'http://www.resolvethem.com/' 14 | html = core.get_html_from_url(url, name) 15 | if html: 16 | parser = BeautifulSoup(html) 17 | data = parser.find('div','inner') 18 | ip = re.search("(?:[0-9]{1,3}\.){3}[0-9]{1,3}", data.get_text()) 19 | if ip: 20 | if re.match("(?:[0-9]{1,3}\.){3}[0-9]{1,3}", ip.group(0)): 21 | return ip.group(0) 22 | else: 23 | return False 24 | else: 25 | return False 26 | -------------------------------------------------------------------------------- /lib/update.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | import sys, os 9 | from lib.logger import logger 10 | from subprocess import PIPE 11 | from subprocess import Popen 12 | from lib.settings import ROOTDIR 13 | from lib.settings import PLATFORM 14 | 15 | def update(): 16 | if not os.path.exists(os.path.join(ROOTDIR, ".git")): 17 | msg = "[-] Not a git repository. Please checkout the repository from GitHub (e.g. git clone https://github.com/AeonDave/sir.git)" 18 | logger.error(msg) 19 | if PLATFORM == 'nt': 20 | msg = "[-] Please checkout the repository from GitHub with GitHub for Windows (e.g. https://windows.github.com)" 21 | logger.warning(msg) 22 | msg = "[*] Repository at https://github.com/AeonDave/sir.git" 23 | logger.info(msg) 24 | else: 25 | msg = "[*] Updating SIR from latest version from the GitHub Repository\n" 26 | logger.info(msg) 27 | Popen("git stash", shell=True, stdout=PIPE, stderr=PIPE) 28 | Popen("git stash drop", shell=True, stdout=PIPE, stderr=PIPE) 29 | process = Popen("git pull origin master", shell=True, stdout=PIPE, stderr=PIPE) 30 | process.communicate() 31 | success = not process.returncode 32 | 33 | if success: 34 | msg = "[+] Updated!\n" 35 | logger.info(msg) 36 | sys.exit(0) 37 | else: 38 | msg = "[-] Error!\n" 39 | logger.error(msg) 40 | sys.exit(1) 41 | -------------------------------------------------------------------------------- /sir.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Copyright (c) 2014 tilt (https://github.com/AeonDave/sir) 5 | See the file 'LICENSE' for copying permission 6 | """ 7 | 8 | import sys, getopt, logging 9 | 10 | from lib import update 11 | from lib import actions 12 | from lib.logger import logger 13 | 14 | # Tilt Setup 15 | 16 | try: 17 | options, args = getopt.getopt(sys.argv[1:], 'n:vhu', ['name=', 'version', 'help', 'update', 'output']) 18 | except getopt.GetoptError: 19 | actions.showhelp() 20 | sys.exit(1) 21 | 22 | name=None 23 | output=None 24 | 25 | for opt, arg in options: 26 | if opt in ('-h', '--help'): 27 | actions.showhelp() 28 | sys.exit(0) 29 | elif opt in ('-v', '--version'): 30 | actions.header() 31 | sys.exit(0) 32 | elif opt in ('-u', '--update'): 33 | actions.header() 34 | update.update() 35 | sys.exit(0) 36 | elif opt in ('-n', '--name'): 37 | name = arg 38 | elif opt in ('-o', '--output'): 39 | output = arg 40 | else: 41 | actions.header() 42 | actions.showhelp() 43 | sys.exit(1) 44 | 45 | if not name: 46 | actions.header() 47 | actions.showhelp() 48 | msg = "[-] ERROR: You must provide a Skype Name." 49 | logger.error(msg) 50 | sys.exit(1) 51 | 52 | def main(): 53 | if output: 54 | handler = logging.FileHandler(output) 55 | handler.setLevel(logging.INFO) 56 | logger.addHandler(handler) 57 | 58 | if name: 59 | logger.info('[*] Trying to resolve name: '+ name) 60 | actions.resolve(name) 61 | 62 | if output: 63 | logger.info('[+] File log written: ' + output) 64 | # Program 65 | 66 | if __name__ == '__main__': 67 | actions.header() 68 | main() 69 | sys.exit(0) 70 | --------------------------------------------------------------------------------