前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >python 获取itune中存放的手机短信

python 获取itune中存放的手机短信

作者头像
用户5760343
发布2019-07-31 15:55:28
2.4K0
发布2019-07-31 15:55:28
举报
文章被收录于专栏:sktjsktj

!/usr/bin/python

coding=utf-8

import os import sqlite3 import optparse

def isMessageTable(iphoneDB): try: conn = sqlite3.connect(iphoneDB) c = conn.cursor() c.execute('SELECT tbl_name FROM sqlite_master WHERE type=="table";') for row in c: if 'message' in str(row): return True except: return False

def printMessage(msgDB): try: conn = sqlite3.connect(msgDB) c = conn.cursor() c.execute('select datetime(date,'unixepoch'), address, text from message WHERE address>0;') for row in c: date = str(row[0]) addr = str(row[1]) text = row[2] print '\n[+] Date: '+date+', Addr: '+addr + ' Message: ' + text except: pass

def main(): parser = optparse.OptionParser("[]Usage: python iphoneParse.py -p <iPhone Backup Directory> ") parser.add_option('-p', dest='pathName', type='string',help='specify skype profile path') (options, args) = parser.parse_args() pathName = options.pathName if pathName == None: print parser.usage exit(0) else: dirList = os.listdir(pathName) for fileName in dirList: iphoneDB = os.path.join(pathName, fileName) if isMessageTable(iphoneDB): try: print '\n[] --- Found Messages ---' printMessage(iphoneDB) except: pass

if name == 'main': main()

itune存放iphone的路径

image.png

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019.07.29 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • !/usr/bin/python
  • coding=utf-8
  • itune存放iphone的路径
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档