吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 13194|回复: 22
收起左侧

[iOS 原创] iOS Cookies.binarycookies(俗称63数据)存取

[复制链接]
qazx84265 发表于 2019-6-21 11:04
本帖最后由 qazx84265 于 2019-6-21 11:15 编辑

iOS 系统会自动将Safari或APP中网络请求的cookie保存为文件,APP的cookie保存路径为
APP的沙盒路径:var/mobile/Containers/Data/Application/x-x-x/Library/Cookies/Cookies.binarycookies

Cookies.binarycookies是二进制文件,文件结构有个魔术头:字符串:“cook”,二进制为636f6f6b,所以
Cookies.binarycookies数据又被称为63数据。

要对文件内容进行存取,首先得了解文件结构:
字段 大小端 类型 大小 备注
Magic 大端 UTF-8 4 "cook", no terminator
Number of pages 大端 Unsigned Int 4
Page N size 大端 Unsigned Int 4 Repeat for N pages
Page Page N size Page N content

Page(
可以理解为cookie属性中domain,即相同domain的cookie保存在一个page里

字段 大小端 类型 大小 备注
Header 大端 4 0x00000100
Number of cookies 小端 Unsigned Int 4
Cookie N offset 小端 Unsigned Int 4 Repeat for N cookies
Footer 4 0x00000000
Cookie N Cookie N size Cookie N content

Cookie

字段 大小端 类型 大小 备注
Size 小端 Unsigned Int 4 Size in bytes
Version 小端 Unsigned Int 4 0 or 1
Flags 小端 Bit field 4 isSecure = 1, isHTTPOnly = 1 << 2, unknown1 = 1 << 3, unknown2 = 1 << 4
Has port 小端 Unsigned Int 4 0 or 1
URL Offset 小端 Unsigned Int 4 Offset from the start of the cookie
Name Offset 小端 Unsigned Int 4 Offset from the start of the cookie
Path Offset 小端 Unsigned Int 4 Offset from the start of the cookie
Value Offset 小端 Unsigned Int 4 Offset from the start of the cookie
Comment Offset 小端 Unsigned Int 4 Offset from the start of the cookie, 0x00000000 if not present
Comment URL Offset 小端 Unsigned Int 4 Offset from the start of the cookie, 0x00000000 if not present
Expiration 小端 Double 8 Number of seconds since 00:00:00 UTC on 1 January 2001
Creation 小端 Double 8 Number of seconds since 00:00:00 UTC on 1 January 2001
Port 小端 Unsigned Int 2 Only present if the "Has port" field is 1
Comment 小端 String Null-terminated, optional
Comment URL 小端 String Null-terminated, optional
URL 小端 String Null-terminated
Name 小端 String Null-terminated
Path 小端 String Null-terminated
Value 小端 String Null-terminated

上面的Creation字段指的是,保存cookie这一时刻相对于2001/1/1 00:00:00的时间戳
Expiration指:如果cookie有max-age属性,Creation + max-age;如果cookie有expires属性,为expires转为时间戳

了解文件结构后,具体存取就很简单了,只要按照结构进行字节操作就可以了,不再赘述。

免费评分

参与人数 4吾爱币 +12 热心值 +4 收起 理由
15022078987 + 1 我很赞同!
qtfreet00 + 9 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
liboing + 1 + 1 用心讨论,共获提升!
Anonymous、 + 2 + 1 我很赞同!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

757299248 发表于 2019-6-21 11:08
请问这个有什么用
时光。。 发表于 2021-11-13 09:46
迷恋自留地 发表于 2021-6-10 02:11
这个下面的com.apple.mobile.internal   这个节点SysCfgData   的结构有人知道吗

我也想知道该如何解密
sampson9210 发表于 2019-6-21 11:48
songleyan 发表于 2019-6-21 11:55
微信62数据和这个不一样吧
mengnimen 发表于 2019-6-21 17:31
有了这个就可以知道Cookies了,然后就...
塞北的雪 发表于 2019-6-22 00:16
首先你得越狱后才能访问其他沙盒里的文件,其次,可以用fiddler进行抓包截获cookies
xixicoco 发表于 2019-6-22 11:09
这个要jb还可以
拜鳌 发表于 2019-6-23 09:49
就是一63开头的一串二进制,和市面的62如出一辙,外面的源码都泛滥了
头像被屏蔽
263007151a 发表于 2019-6-24 13:58
提示: 该帖被管理员或版主屏蔽
头像被屏蔽
263007151a 发表于 2019-6-24 14:22
提示: 该帖被管理员或版主屏蔽
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-4-25 07:58

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表