You are on page 1of 10

#!

/usr/bin/python
from __future__ import print_function
import os
import sqlite3
import optparse
import sys
import time
try:
input = raw_input
except:
pass
'''
Title: Sype!rea
"escription: # cross platform forensic tool for Sype
#uthor: $san%a &alith '($san%a&alith) * +asoob ,hali%
'(yasoobhali%)
-./: http://osan%amalith01ithub0io/Sype!rea/
"isclaimer: This tool is meant for ethical 'le1al) purposes
only0
2otes: 3lease note this tool may contain errors4 an%
is pro5i%e% 6as it is60 There is no 1uarantee
that it will wor on your tar1et systems's)4 as
the co%e may ha5e to be a%apte%0
This is to a5oi% script i%%ie abuse as well0

/icense:
This pro1ram is free software: you can re%istribute it
an%/or mo%ify
it un%er the terms of the 72- 7eneral 3ublic /icense as
publishe% by
the !ree Software !oun%ation4 either 5ersion 3 of the
/icense4 or
'at your option) any later 5ersion0

This pro1ram is %istribute% in the hope that it will be
useful4
but 89T:$-T #2+ 8#..#2T+; without e5en the implie%
warranty of
&<.=:#2T#>9/9T+ or !9T2<SS !$. # 3#.T9=-/#. 3-.3$S<0 See
the
72- 7eneral 3ublic /icense for more %etails0

+ou shoul% ha5e recei5e% a copy of the 72- 7eneral 3ublic
/icense
alon1 with this pro1ram0 9f not4 see
?http://www01nu0or1/licenses/@0
'''
contributors = A
'$san%a &alith (osan%amalith'4
'&uhamma% +asoob -llah ,hali% (yasoobhali%'
B
class SypeCun'obDect):
'''
This is the main obDect which contains all of the
require% functions0
9t contains the followin1 metho%s:
E) __init__'self4%b)
E) _1et_profile'self)
E) _1et_contacts'self)
E) _1et_calls'self)
E) _1et_ms1s'self)
E) _1en_report'self)
E) _1en_full_report'self)
E) _put_to_file'self4filename4%ata)
E) _1et_choice'self)
E) _1et_sa5e_choice'self)

+ou Dust nee% to pass a sype %atabase path which
instantiatin1 this class0
!or example SypeCun''/home/?username@/0Sype/?sype
username@/main0%b')0
#fter that you can use any metho% from this class0
'''
%ef __init__'self4sype%b4pathname):
self0%b = sype%b
self0con = sqlite30connect'self0%b)
self0path = pathname
self0name = os0path0basename'self0path)
self0type_of= 2one
%ef _1et_profile'self):
with self0con:
cur = self0con0cursor')
%ata = cur0execute'6S</<=T fullname4 sypename4
city4 country4F
%atetime'profile_timestamp4'unixepoch') !.$&
#ccounts6)

for row in %ata:
self0%etails = G
'AHB -ser ' : str'rowAIB)4
'AHB Sype -sername' : str'rowAJB)4
'AHB =ountry ' : str'rowAKB) or
6unnown64
'AHB /ocation ' : str'rowA3B)4
'AHB 3rofile "ate' : str'rowALB)
M
self0type_of = 6profile6
return self0%etails
%ef _1et_contacts'self):
with self0con:
cur = self0con0cursor')
%ata = cur0execute'6S</<=T %isplayname4
sypename4 country4 city4 about4 phone_mobile4F
homepa1e4 birth%ay 4
%atetime'lastonline_timestamp4'unixepoch') !.$& =ontacts;6)
self0%etails = GM
for count4row in enumerate'%ata):
self0%etailsAcountB = GM
self0%etailsAcountBA'AHB -ser 'B =
str'rowAIB)
self0%etailsAcountBA'AHB Sype -sername'B =
str'rowAJB)
if rowAKB:
self0%etailsAcountBA'AHB =ountry 'B =
str'rowAKB)
elif rowA3B:
self0%etailsAcountBA'AHB =ity 'B =
str'rowA3B)
elif rowALB:
self0%etailsAcountBA'AHB #bout 'B =
str'rowALB)
elif rowANB:
self0%etailsAcountBA'AHB &obile 2o 'B =
str'rowANB)
elif rowAOB:
self0%etailsAcountBA'AHB :omepa1e'B =
str'rowAOB)
elif rowAPB:
self0%etailsAcountBA'AHB >irth%ay'B =
str'rowAPB)
elif rowAQB:
self0%etailsAcountBA'AHB /ast $nline'B =
str'rowAQB)
self0type_of = 6contacts6
return self0%etails
%ef _1et_calls'self):
with self0con:
cur = self0con0cursor')
%ata = cur0execute'6S</<=T
%atetime'be1in_timestamp4'unixepoch')4 F
time'%uration4'unixepoch')4
is_incomin14 i%entity !.$& calls4 F
con5ersations 8:<.< calls0con5_%bi% =
con5ersations0i%;6)
self0%etails = GM
for count4 row in enumerate'%ata):
self0%etailsAcountB = row
self0type_of = 6calls6
return self0%etails
%ef _1et_ms1s'self):
with self0con:
cur = self0con0cursor')
%ata = cur0execute'6S</<=T
%atetime'timestamp4'unixepoch')4 F
%ialo1_partner4 author4 bo%y_xml !.$&
&essa1es;6)
self0%etails = GM
for count4 row in enumerate'%ata):
try:
if 'partlist' not in str'rowA3B):
if str'rowAJB) != str'rowAKB):
ms1"irection = A'AHB ToFt'4
str'rowAJB)B
else:
ms1"irection = A'AHB !rom'4
str'rowAKB)B
self0%etailsAcountB = G
ms1"irectionAIB : ms1"irectionAJB4
'AHB Time' : str'rowAIB)4
'AHB &essa1e' :
str'rowA3B)0replace''*apos;'46'6)
M
except:
pass
self0type_of = 6ms1s6
return self0%etails
%ef __status'self4num):
if num == I:
return 6$ut1oin16
elif num == J:
return 69ncommin16
else:
return num
%ef _1et_contributors'self):
print''Fn=ontributors:Fn')
for one in contributors:
print'one)
sys0exit'I)
%ef _1en_report'self):
%ata = ''
if self0type_of == 6profile6:
%ata H= 'FnAEB RRRRR !oun% The 3rofile RRRRR FnFn'
for i in self0%etails:
%ata H= iH'Ft'H': 'Hself0%etailsAiBH'Fn'
return %ata
elif self0type_of == 6contacts6:
%ata H= 'FnAEB RRRRR !oun% GIM =ontacts RRRRR
Fn'0format'len'self0%etails))
for i in self0%etails:
%ata H= 'Fn'
for sin1le in self0%etailsAiB:
%ata H= sin1leH'Ft'H': 'Hself0%etailsAiB
Asin1leBH'Fn'
return %ata
elif self0type_of == 6calls6:
formatin1 = A'AHB "ateFt'4'AHB "uration'4'AHB
StatusFt'4'AHB -serFt'B
%ata H= 'FnAEB RRRRR !oun% GIM =alls RRRRR
'0format'len'self0%etails))H'Fn'
for i in self0%etails:
%ata H= 6Fn6
for c4sin1le in enumerate'self0%etailsAiB):
%ata H= formatin1AcBH'Ft:
'Hstr'self0__status'sin1le))H'Fn'
return %ata
elif self0type_of == 6ms1s6:
%ata H= 'FnAEB RRRRR !oun% GIM &essa1es RRRRR
'0format'len'self0%etails))H'Fn'
for i in self0%etails:
%ata H= 'Fn'
for sin1le in self0%etailsAiB:
%ata H= sin1leH'Ft: 'Hself0%etailsAiB
Asin1leBH6Fn6
return %ata
%ef _1en_full_report'self):
self0_1et_profile')
%ata = self0_1en_report')
self0_1et_contacts')
%ata H= 'Fn'Hself0_1en_report')
self0_1et_calls')
%ata H= 'Fn'Hself0_1en_report')
self0_1et_ms1s')
%ata H= 'Fn'Hself0_1en_report')H'Fn'
print'%ata)
self0_1et_sa5e_choice'%ata)
%ef _put_to_file'self4file4%ata):
%ata H= 6FnAEB This file was 7enerate% by Sype
!reaFnASB http://osan%amalith01ithub0io/Sype!rea/6
with open'file4'wb') as f:
f0write'%ata0enco%e''utfRQ'))
%ef _1et_choice'self):
choice = 2one
while choice is 2one:
try:
choice = int'input'6ASB 8hat "o +ou /ie to
9n5esti1ateT F
FnJ0 3rofileFnK0 =ontactFn30 =allsFnL0
&essa1esFnN0 7enerate !ull .eportFnF
O0 3rint the list of contributors * exitFnP0 <xitFn6 ))
except Ualue<rror:
print''A!B <nter $nly a 2umber')
choices = G
J : self0_1et_profile4
K : self0_1et_contacts4
3 : self0_1et_calls4
L : self0_1et_ms1s4
N : self0_1en_full_report4
O : self0_1et_contributors4
P : sys0exit
M
if choice not in AN4OB:
choices01et'choice4sys0exit)')
%ata = self0_1en_report')
print'%ata)
self0_1et_sa5e_choice'%ata)
else:
choices01et'choice4sys0exit)')
%ef _1et_sa5e_choice'self4%ata):
choice = 2one
while True:
choice = input''ASB 8oul% you lie to sa5e these
results in a fileT ')
if 'y' in choice:
filename = input''ASB 8hat shoul% be the name
of the fileT ')
self0_put_to_file'filename4%ata)
print''AEB #ll of the %ata is sa5e%')
time0sleep'J)
brea
elif 'n' in choice:
brea
else:
print''A!B +ou selecte% wron1 option0FnA!B
3lease try a1ain!')
print''out of while choices_sa5e')
%ef clear_screen'):
if os0name == 6nt6:
os0system''cls')
else:
os0system''clear')
%ef print_banner'):
print''''
Q6666Q
Q e e e e eeeee eeee
Qeeeee Q Q Q Q Q Q Q
QQ QeeeQe QeeeeQ QeeeQ Qeee
e QQ QQ Q QQ QQ QQ
QeeeQQ QQ Q QQ QQ QQee

Q6666
Q eeeee eeee eeeee e e
Qeeee Q Q Q Q Q Q Q
QQ QeeeQe Qeee QeeeQ QeeeQe
QQ QQ Q QQ QQ Q QQ Q
QQ QQ Q QQee QQ Q QQ Q
''')
print''AEB # creation of $san%a &alith * &uhamma% +asoob
-llah ,hali%FnF
AEB !ollow ($san%a&alith an% (yasoobhali%FnF
AEB -./: http://osan%amalith01ithub0io/Sype!rea/Fn')
%ef main'):
clear_screen')
username = input''ASB <nter your Sype -sername: ')
clear_screen')
try:
%b4path = 1en_path'username)
except Type<rror:
print''A!B The name you entere% was not correct')
sys0exit'I)
sype = SypeCun'%b4path)
try:
while True:
print_banner')
sype0_1et_choice')
clear_screen')
except ,eyboar%9nterrupt:
print''FnA!B 7ot =trlH= ey0 Shuttin1 %own
1racefullyFn')
sys0exit'I)
%ef 1en_path'username):
if os0name == 6nt6:
3ath2ame = os01eten5''app%ata') H 6FFSypeFF6 H
username
elif os0name == 6posix6:
3ath2ame = os01eten5'':$&<') H 6/0Sype/6 H username
if 3ath2ame == 2one :
print''A!B 3lease <nter a 5ali% Sype username ')
elif ''os0name == 6posix6) an% 'os0path0is%ir'3ath2ame)
== !alse)):
3ath2ame = os01eten5'':$&<') H 6//ibrary/#pplication
Support/Sype/6 H username
sype"> = os0path0Doin'3ath2ame4 'main0%b')
if os0path0isfile'sype">):
return sype">43ath2ame
elif os0path0is%ir'3ath2ame) == !alse:
print''A!B -sername "oes 2ot <xist ')
else:
sype"> = os0path0Doin'3ath2ame4 'main0%b')
if os0path0isfile'sype">):
return sype">43ath2ame
if __name__ == '__main__':
main'

You might also like