Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

Commit c977918

Browse files
authored
update
1 parent 458e190 commit c977918

29 files changed

+16206
-53
lines changed

1.jpg

-518 KB
Binary file not shown.

2.png

-56.7 KB
Binary file not shown.

3.png

-10.1 KB
Binary file not shown.

README.md

Lines changed: 28 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,28 @@
1-
# File-Header-Forger
2-
绕过部分云盘的文件分享限制
3-
## 用途
4-
此工具针对使用部分云盘时,受到文件分享类型限制进行伪造
5-
## 原理
6-
- aliyundrive在分享文件时,会查看文件头(即文件类型),假如检测到压缩文件等受到限制的文件时会无法分享,在对受限制的文件进行伪造文件头后,即可突破限制,正常分享
7-
- 如zip的文件头为504b0304,将其改为aliyundrive支持的格式即可
8-
9-
- ![image](1.jpg)
10-
11-
- 经过多次测试,经伪造后再还原的文件与原文件对比,hash值始终相同,可放心使用(毕竟只是改了文件的前几个字节)
12-
13-
- ![image](2.png)
14-
15-
- 目前(2022/5/2)经过多次测试,aliyundrive只对文件头进行了限制,没对扩展名做限制
16-
## 伪造/还原格式
17-
- 目前已支持伪造jpg,png,zip,rar,psd,dll格式,其实可以自己去py文件添加相应的数据
18-
- 还原模式下无需手动添加,程序会根据后缀名自动恢复
19-
20-
- ![image](3.png)
21-
22-
## 缺点
23-
使用麻烦,配置麻烦,会随之后的更新逐步完善操作体验
24-
## 参考内容:
25-
- https://blog.csdn.net/qq_40657585/article/details/83097386
26-
- https://blog.csdn.net/qq_36171645/article/details/88966127
27-
- https://qa.1r1g.com/sf/ask/3714342551/?lastactivity
28-
- https://www.cnblogs.com/schut/p/8410961.html
29-
- https://blog.51cto.com/u_15052689/2562469
30-
- https://blog.csdn.net/beijingyk/article/details/108581150
31-
- https://bluebird.blog.csdn.net/article/details/51122027
32-
- https://blog.csdn.net/qq_35441988/article/details/84994453
33-
- https://blog.csdn.net/weixin_40895135/article/details/121033002
34-
- https://www.jb51.net/article/143446.htm
35-
- https://blog.csdn.net/qq_40044912/article/details/122596325
36-
- http://www.wb86.com/post/308.html
37-
- https://www.bilibili.com/video/BV1134y1B7bo?p=2&spm_id_from=pageDriver
38-
- https://zhuanlan.zhihu.com/p/457429631
39-
- https://blog.csdn.net/weixin_29952383/article/details/113983844
40-
- https://blog.csdn.net/weixin_46348230/article/details/120684653
41-
- https://blog.csdn.net/qq_25921925/article/details/103987572
42-
- https://www.pythonheidong.com/blog/article/441185/3494dd82eeff9f34d613/
43-
- https://www.jianshu.com/p/2a931ce70b4b
44-
- https://www.cnpython.com/qa/412691
45-
- https://www.jianshu.com/p/d55e43c694db
46-
- https://blog.csdn.net/fan0829/article/details/119984383
47-
- https://www.pythonheidong.com/blog/article/190465/0049cea7f264404867fb/
48-
- https://www.5axxw.com/questions/content/29kxjs
49-
- https://zhuanlan.zhihu.com/p/162164360
50-
- https://zhuanlan.zhihu.com/p/338499426
51-
---
52-
##### 2022/5/2 21:10 Created by cyh128
53-
1+
# File Header Forger/文件伪造器
2+
- 使用Python编写的程序,GUI使用PyQt5
3+
- 该程序可用于绕过部分网盘的分享限制(如阿里云盘)
4+
5+
## 原理
6+
经本人测试(2023.1),阿里云盘对文件不光有后缀识别还有文件头识别(不确定,但修改它有效),所以光修改后缀没用,什么是文件头可以自行搜索。如下图,这是一张zip格式的文件的十六进制数据,选中的**504B0304**是zip格式的文件头,它可以说明这是一个zip格式的文件,所以我们想绕过检测的话,也要把它改了。
7+
![1](/img/1.png)
8+
我的做法是将首尾的4个字节对调,实现修改
9+
```
10+
with open(filePath,"rb+") as rawFile:
11+
rawFile.seek(0,0) #移动到文件的0(头)处偏移为0的位置
12+
BOC = rawFile.read(4) #读取节
13+
rawFile.seek(-4,2) #移动到文件的2(尾)处偏移为-4(向前4个字节)的位置
14+
EOC = rawFile.read(4
15+
rawFile.seek(-4,2)
16+
rawFile.write(BOC) #向文件末尾的4个写成文件开头的4个字节
17+
rawFile.seek(0,0)
18+
rawFile.write(EOC) #向文件开头的4个写成文件末尾的4个
19+
rawFile.close() #关闭文件
20+
```
21+
## 使用教程
22+
1. 将需要伪造的文件的路径填入框内(不要加双引号),支持选择文件或拖入文件 <br>
23+
仅支持伪造zip文件,如果你想伪造的文件不是zip格式,用压缩软件(如winrar)压缩成zip格式即可
24+
![2](img/2.png)
25+
26+
2. 点击伪造或还原按钮,提示伪造成功,文件后缀自动改成.pdf,这时你的文件就可以骗过一些程序的文件类型识别
27+
3. 如需还原文件(即解压文件),将伪造的文件(pdf格式)拖入程序,点击伪造或还原按钮,提示还原成功
28+

about.ui

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>about</class>
4+
<widget class="QWidget" name="about">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>536</width>
10+
<height>300</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>关于</string>
15+
</property>
16+
<property name="windowIcon">
17+
<iconset resource="res.qrc">
18+
<normaloff>:/ico/img/Logo.ico</normaloff>:/ico/img/Logo.ico</iconset>
19+
</property>
20+
<widget class="QLabel" name="label">
21+
<property name="geometry">
22+
<rect>
23+
<x>0</x>
24+
<y>20</y>
25+
<width>251</width>
26+
<height>261</height>
27+
</rect>
28+
</property>
29+
<property name="text">
30+
<string/>
31+
</property>
32+
<property name="pixmap">
33+
<pixmap resource="res.qrc">:/ico/img/Logo.png</pixmap>
34+
</property>
35+
<property name="scaledContents">
36+
<bool>true</bool>
37+
</property>
38+
</widget>
39+
<widget class="QWidget" name="layoutWidget">
40+
<property name="geometry">
41+
<rect>
42+
<x>260</x>
43+
<y>30</y>
44+
<width>246</width>
45+
<height>242</height>
46+
</rect>
47+
</property>
48+
<layout class="QVBoxLayout" name="verticalLayout_3">
49+
<item>
50+
<layout class="QVBoxLayout" name="verticalLayout_2">
51+
<item>
52+
<layout class="QVBoxLayout" name="verticalLayout">
53+
<item>
54+
<widget class="QLabel" name="label_2">
55+
<property name="font">
56+
<font>
57+
<family>Microsoft YaHei</family>
58+
<pointsize>16</pointsize>
59+
<weight>75</weight>
60+
<bold>true</bold>
61+
</font>
62+
</property>
63+
<property name="text">
64+
<string>文件伪造器</string>
65+
</property>
66+
<property name="scaledContents">
67+
<bool>false</bool>
68+
</property>
69+
</widget>
70+
</item>
71+
<item>
72+
<widget class="QLabel" name="label_3">
73+
<property name="font">
74+
<font>
75+
<family>Microsoft YaHei</family>
76+
<pointsize>10</pointsize>
77+
</font>
78+
</property>
79+
<property name="text">
80+
<string>本软件使用python和pyqt5编写</string>
81+
</property>
82+
</widget>
83+
</item>
84+
<item>
85+
<widget class="QLabel" name="label_4">
86+
<property name="font">
87+
<font>
88+
<family>Microsoft YaHei</family>
89+
<pointsize>10</pointsize>
90+
</font>
91+
</property>
92+
<property name="text">
93+
<string>MIT License</string>
94+
</property>
95+
</widget>
96+
</item>
97+
<item>
98+
<widget class="QLabel" name="label_5">
99+
<property name="font">
100+
<font>
101+
<family>Microsoft YaHei</family>
102+
<pointsize>10</pointsize>
103+
</font>
104+
</property>
105+
<property name="text">
106+
<string>Version 1.4</string>
107+
</property>
108+
</widget>
109+
</item>
110+
</layout>
111+
</item>
112+
</layout>
113+
</item>
114+
<item>
115+
<spacer name="verticalSpacer">
116+
<property name="orientation">
117+
<enum>Qt::Vertical</enum>
118+
</property>
119+
<property name="sizeType">
120+
<enum>QSizePolicy::Fixed</enum>
121+
</property>
122+
<property name="sizeHint" stdset="0">
123+
<size>
124+
<width>20</width>
125+
<height>60</height>
126+
</size>
127+
</property>
128+
</spacer>
129+
</item>
130+
<item>
131+
<widget class="QPushButton" name="pushButton">
132+
<property name="font">
133+
<font>
134+
<family>Microsoft YaHei</family>
135+
<pointsize>12</pointsize>
136+
</font>
137+
</property>
138+
<property name="text">
139+
<string>Github项目</string>
140+
</property>
141+
<property name="icon">
142+
<iconset resource="res.qrc">
143+
<normaloff>:/ico/img/github Logo.png</normaloff>:/ico/img/github Logo.png</iconset>
144+
</property>
145+
</widget>
146+
</item>
147+
</layout>
148+
</widget>
149+
</widget>
150+
<resources>
151+
<include location="res.qrc"/>
152+
</resources>
153+
<connections/>
154+
</ui>

forge.ui

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>Form</class>
4+
<widget class="QWidget" name="Form">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>445</width>
10+
<height>261</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>伪造成功</string>
15+
</property>
16+
<property name="windowIcon">
17+
<iconset resource="res.qrc">
18+
<normaloff>:/ico/img/Logo.ico</normaloff>:/ico/img/Logo.ico</iconset>
19+
</property>
20+
<widget class="QLabel" name="label">
21+
<property name="geometry">
22+
<rect>
23+
<x>20</x>
24+
<y>20</y>
25+
<width>150</width>
26+
<height>150</height>
27+
</rect>
28+
</property>
29+
<property name="text">
30+
<string/>
31+
</property>
32+
<property name="pixmap">
33+
<pixmap resource="res.qrc">:/ico/img/forge.png</pixmap>
34+
</property>
35+
<property name="scaledContents">
36+
<bool>true</bool>
37+
</property>
38+
</widget>
39+
<widget class="QLabel" name="label_2">
40+
<property name="geometry">
41+
<rect>
42+
<x>210</x>
43+
<y>60</y>
44+
<width>201</width>
45+
<height>61</height>
46+
</rect>
47+
</property>
48+
<property name="font">
49+
<font>
50+
<family>Microsoft YaHei</family>
51+
<pointsize>30</pointsize>
52+
<weight>75</weight>
53+
<bold>true</bold>
54+
</font>
55+
</property>
56+
<property name="text">
57+
<string>伪造成功</string>
58+
</property>
59+
</widget>
60+
<widget class="QPushButton" name="pushButton">
61+
<property name="geometry">
62+
<rect>
63+
<x>30</x>
64+
<y>190</y>
65+
<width>381</width>
66+
<height>41</height>
67+
</rect>
68+
</property>
69+
<property name="font">
70+
<font>
71+
<pointsize>10</pointsize>
72+
<weight>50</weight>
73+
<bold>false</bold>
74+
</font>
75+
</property>
76+
<property name="text">
77+
<string>关闭</string>
78+
</property>
79+
</widget>
80+
</widget>
81+
<resources>
82+
<include location="res.qrc"/>
83+
</resources>
84+
<connections>
85+
<connection>
86+
<sender>pushButton</sender>
87+
<signal>clicked()</signal>
88+
<receiver>Form</receiver>
89+
<slot>close()</slot>
90+
<hints>
91+
<hint type="sourcelabel">
92+
<x>59</x>
93+
<y>24</y>
94+
</hint>
95+
<hint type="destinationlabel">
96+
<x>222</x>
97+
<y>130</y>
98+
</hint>
99+
</hints>
100+
</connection>
101+
</connections>
102+
</ui>

img/1.png

37.4 KB
Loading

img/2.png

12.2 KB
Loading

img/Logo.ico

66.1 KB
Binary file not shown.

img/Logo.png

73.4 KB
Loading

0 commit comments

Comments
 (0)