WangQiFei

蒸 馏 器


思想提纯
  • 首页
  • 归档
  • 标签
  • 关于
  •     

© 2024  by  Wangqifei

ios抓包去广告的一个操作实例演示

发布于 2023-06-26 10:06 抓包 去广告 

photo_2023-06-26_10-47-29.jpg

555 影视的 ios 伪装上架 app 去广告

AppStore 上很多影视 APP 都是伪装上架,555 影视是其中之一,除了一些色情系的广告植入之外其他都还是不错的,并且支持 TV 端。这里就使用纯 ios 端演示下如何去抓包并实现去广告

主要工具

抓包工具:Storm Sniffer(小螃蟹)。其他抓包工具也同理,appstore 上抓包工具非常多。
重写工具:LOON,类似的网络调试工具也很多,自行选择。

实现步骤

  • 开启 Storm Sniffer,打开 mitm 和 http capture
  • 打开 555 影视,内容加载完成
  • 关闭 http capture,打开抓取的数据,并找到疑似广告内容的数据请求,优先从图片请求中筛选更直观.
  • 复制该 request url 的文件名,在所有请求中查找该文件名,打开筛选的请求及 response 并确认是否有含有广告内容
  • 分析 json 数据,找出广告内容的规律:轮播广告的type值都是 3,banner 广告的 layout值都是adbert_self
  • 根据找出的规律写个 js,并将请求的 url 转换成正则。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
[Mitm]
hostname =a.weilai555.com

[Script]
http-response ^https?:\/\/a\.weilai555\.com:1000\/api\/v1\/movie\/index_recommend\?pack=([\w\/\+\%]+)&signature=([\w]+)$ script-path=https://raw.githubusercontent.com/fqw000/tools/main/script/555.js, requires-body=true, binary-body-mode=false, timeout=10, tag=555去广告
*/

var body = $response.body;
var obj = JSON.parse(body);

// 屏蔽layout值为advert_self的项
if (obj.data && obj.data.length > 0) {
var newData = [];
for (var i = 0; i < obj.data.length; i++) {
if (obj.data[i].layout !== "advert_self") {
newData.push(obj.data[i]);
}
}
obj.data = newData;
}

// 过滤轮播图中type为3的项
if (obj.data && obj.data.length > 0) {
var carousel = obj.data.find(item => item.title === '轮播图');
if (carousel && carousel.list && carousel.list.length > 0) {
carousel.list = carousel.list.filter(item => item.type !== 3);
}
}

$done({body: JSON.stringify(obj)});
  • 配置 loon,实现 rewrite。这里图方便配置成了555 去广告插件,其他网络调试工具的配置请自行调整。
1
2
3
4
5
6
7
8
9
10
11
12
// 555.plugin

# 555去广告
#!name=555去广告
#!desc=不包含开屏广告
#!author=wangqifei

[Mitm]
hostname =a.weilai555.com

[Script]
http-response ^https?:\/\/a\.weilai555\.com:1000\/api\/v1\/movie\/index_recommend\?pack=([\w\/\+\%]+)&signature=([\w]+)$ script-path=https://raw.githubusercontent.com/fqw000/tools/main/script/555.js, requires-body=true, binary-body-mode=false, timeout=10, tag=555去广告

追加更新

大意了这个 555 影视会不定期的更换域名和 ip,抓个几个经常用的域名,使用正则做了匹配,修改了下脚本,脚本里已更新。

 上一篇: Storm Sniffer的功能解锁 

下一篇: yt-dlp一个优秀的视频下载工具 

© 2024  by  Wangqifei