如何模糊我使用的网站? -- hooks 领域 drupal 相关 的问题

How can I obscure what I am using to run my site?





如果无法完全隐藏网站使用drupal的事实,它至少可以混淆它们(例如,通过将节点页面与URL相加,如 99887660 )?< / p>


Is there anything I can do to prevent somebody from knowing my site is using Drupal by looking at the source code of the front page? I am referring to people who scan sites using software that detects the software used to run the website to be able to attack it using any known weak point.

If it is not possible to completely hide the fact that the site is using Drupal, is it at least possible to confuse them (e.g., by aliasing the node pages with URLs like http://example.com/servlets/<node-id>.jsp)?





  • 拆下Drupal 7
  • 的元发电机
  • 删除像changelog.txt
  • 这样的tell-tale-text
  • 检查expires header
  • HTTP 200/404/403状态代码的步行目录
  • 查找默认短信 - 调整所有面向用户的消息
  • 查看HTML - 来自核心的默认HTML,模块是一个Telltale Sign



This is an old and already answered question, but I recently put some effort into writing up a description of all the things you would need to change:

  • Remove the meta generator for Drupal 7
  • Remove tell-tale-text like CHANGELOG.txt
  • Check the Expires header
  • Walking directories for HTTP 200/404/403 status codes
  • Look for default text messages - tweak all user-facing messages
  • Look at the HTML - default html from core and modules is a telltale sign

Basically: it might technically be possible to hide the fact that your site runs Drupal, but you would spend so much time on it that it's not worth it. You should instead focus on making it secure and on secure operations (e.g. the ability to deploy updates quickly, monitoring logs, etc.).


你无法完全隐藏它。大多数需要做什么,需要黑客核心。最大的说明是 function mymodule_preprocess_page(&vars) { var_dump($vars); //output: nothings that reference the views! if($_GET['q'] == 'my/view/path') { drupal_add_js([...]); drupal_add_css([...]); } } 1 javascript变量,它可以从前页或任何页面读取。



You can't hide it completely. Most of what's needed to do it, would require hacking core. The biggest tell, is the Drupal JavaScript variable which is readable from the front page, or any page for that matter.

If you want to improve your sites security by hiding that it's a Drupal site, your effort is better spent on code reviews than it is on trying to hide the fact that the site is made with Drupal.



  • 使用反向代理或自定义HTTP守护程序以过滤令人讨厌的Drupal HTTP标头
  • 拒绝对任何Drupal默认文件夹的HTTP访问
  • 使用PHP输出缓冲来重写并模糊您的HTML源,删除不必要的数据
  • 使用URL别名或custom_url_rewrite_in / Outbound来使您的URL是一个混乱
  • 更改默认404错误,删除/更改update.php
  • 如果有人发现,请制定任何其他改变

并持续但不是最不重要的,确保您的网站非常简单,不需要正常行为的JS或CSS(不使用视图或CTools ......),不支持用户身份验证等您的网站应该像静态HTML网站一样简单。



It's too easy to do, kiam!

  • Use a reverse proxy or customize your http daemon to filter the annoying Drupal http header
  • Deny http access to any Drupal default folders
  • Use PHP output buffering to rewrite and obscure your HTML source, remove unnecessary data
  • Use url alias or custom_url_rewrite_in/outbound to make your URLs a mess
  • Change the default 404 error, remove/change update.php
  • Make any other changes if someone finds out

And last but not least, make sure that your site is so simple that does not require JS or CSS for normal behaviors (don't use Views or Ctools...), does not support user authentication, etc. that means your site should be as simple as a static html site.

Ok, all that to make people believe that your site does not run Drupal. Anyway, security by obscurity is useless.





  • 自动攻击(到目前为止 最常见的攻击)甚至以前甚至没有检查服务器 尝试他们的利用
    检查任何原木的日志 高调的网站将显示成千上万的无果子的要求 /AspBB/db/betaboard.mdb _private/cmd.asp /scripts/../../winnt/system32/cmd.exe /wp-login/ /administrator/components/com_wmtgallery/admin.wmtgal /cgi-bin/ip.cgi ......以及任意数量的尝试 任何无关系统的历史利用。
    攻击 即使您的操作系统上不存在漏洞,也会发生漏洞 CMS。无论您如何执行错误识别您的网站 无论如何都被业余黑客忽略了。
  • 无论你为什么 认为你可以隐藏,有其他系统的线索
    只需删除包含'drupal'的所有字符串都没有 伪装您的网站到任何合理的窥探器。有几十种方式 这可以用来猜测什么是您的页面,甚至专用 告诉Service是运行Drupal的网站。只是关键词 认识并思考是一种威胁是一个次要的子集 真正的指标。
    询问index.php /?q =用户。然后尝试 禁用该响应而不扼杀您的网站。
  • 通过默默无本的安全性没有安全。它给了一个 当你只隐藏时,"安全" 是"安全" 的虚假印象 烟幕背后的漏洞,任何提出任何攻击者 真正的威胁将能够看到。
  • 虽然不是 完全不可能将代码破解到大多数的点 Drupal的痕迹是隐藏的HTML源,(它是开源的 毕竟)所需的步骤必须突破核心 严重你的代码的黑客分支是不兼容的 使用真实安全更新您无法修补 并真正向识别的任何真正的未来威胁开放 安全团队。这是系统漏洞的真正路由。
  • 最重要或有用的模块有自己的代码'签名' 这很难隐藏,没有重写。如果您正在使用 "观点" ,'cck','广告','imageCache','jQuery',CSS-aggregation, 贡献的主题或任何有用的网站 - 有人可以 告诉。隐藏完全通常需要总计 至少转换主题功能 - 至少。即便如此,obsucation 可能不会工作
  • 删除识别 许多高级功能,甚至可以轻松安装可能使用的Google Analytics Drupal图书馆工作,您必须削减那些 完全包括,或以不采取的方式重写它们 Drupal基础设施的优势。有时这是可能的, 但在所有情况下,它都是反效率的。


记住从hack core


There is an official article and discussion regarding the same.

You can't. Do not try

  • Automated attacks (by far the most common attacks) do not even inspect the server before trying their exploits.
    Inspecting the logs of any high-profile site will show thousands of fruitless requests for /AspBB/db/betaboard.mdb _private/cmd.asp /scripts/../../winnt/system32/cmd.exe /wp-login/ /administrator/components/com_wmtgallery/admin.wmtgal, /cgi-bin/ip.cgi ... and any number of attempts at historical exploits on any unrelated system.
    Attacks on exploits happen even if the exploits do not exist on your OS or CMS. Whatever you do to mis-identify your site will be ignored anyway by amateur hackers.
  • Whatever you think you can hide, there are other clues for any system.
    Simply removing the some of all strings that contain 'drupal' does not disguise your site to any reasonable snooper. There are dozens of ways that can be used to guess what is serving your pages, even dedicated services to tell Is that site running Drupal. Just the keywords that you recognize and think are a threat are a minor subset of the real indicators.
    Ask for index.php/?q=user . Then try to disable that response without crippling your site.
  • Security by obscurity is no security. It gives a false impression of being 'safe' when you are only hiding vulnerabilities behind a smokescreen that any attacker that posed any real threat would be able to see through.
  • Although it's not entirely impossible to hack the code to the point where most traces of Drupal are hidden from the HTML source, (It's Open source after all) the steps required to do so would necessarily break core so badly that your hacked branch of the code would be incompatible with the real security updates that you could not patch and would genuinely be open to any real future threats identified by the security team. This is a true route to system vulnerability.
  • Most significant or useful modules have their own code 'signature' that is hard to hide without significant rewrites. If you are using 'views', 'cck', 'ad', 'imagecache', 'jquery', css-aggregation, contributed themes or anything useful on your site - someone can tell. Hiding that entirely would usually require a total conversion of the theme functions - at least. Even then, obsfucation probably won't work.
  • To remove identification of many of the advanced features, like even the easy install of Google Analytics that may use Drupal Libraries to work, you must necessarily either forgo those features altogether, or rewrite them in a way that does not take advantage of the Drupal infrastructure. Sometimes this is possible, but in all cases it is counter-productive.

You may be interested in reading Securing your site too.

Remember Never hack core


隐藏您的网站运行drupal没有任何意义。这是看开发网站的错误方式。你应该关注的是安全。确保您实施所有证券措施,一切都会好起来的。世界上没有一个原因隐藏您正在使用某个CMS或其他软件。使用像Wappalyzer这样的FF Addons,如果网站使用Drupal,则可以在即时判断,因此问题非常实际上。


There is no point in hiding that your site runs Drupal. It is the wrong way to look at developing websites. What you should be focusing on is security. Make sure you implement all securities measures and everything will be fine. There is not one reason in the world to hide that you are using a certain cms or other piece of software. With FF addons like Wappalyzer, you can tell in an instant if a site uses Drupal, so the question is pretty moot.



文件别名模块允许您为上传文件使用令牌可自定义的别名,为您提供能力保留您的文件系统根据通常组织,同时提供干净的观察路径(即,不再/站点/默认/文件/).< / p>


An extra thing you may do is using also the File Aliases module to change the default file structure.

The File Aliases module allows you to use token customisable aliases for your uploaded files, giving you the ability to keep your file system organised as per usual while providing clean looking paths (i.e., no more /sites/default/files/).




I agree with other people that you can't hide it entirely. If you look at the HTML source, you will notice that many times CSS and JavaScript files haven't been aggregated. CSS and JavaScript aggregation should be enabled.


在过去我已经交换了我的字体,因为典型的Rucida Sans等典型的Ruby项目字体,也越来越多的输入大小,就像所有的臀部孩子一样。

另一个放弃是自动完成领域的"Throbber" 图形。当您提高输入大小时,它也不工作。这是一个你可以偷窃: http://beta.seattlebedandebreakfast.com/misc/throbber.gif


In that past I've swapped my fonts for the typical Ruby project fonts like Lucida Sans, also increasing input sizes like all the hip kids do.

Another give away is the "throbber" graphic for autocomplete fields. It also doesn't work when you increase the input size. Here's one you can steal: http://beta.seattlebedandbreakfast.com/misc/throbber.gif



1  hook_translated_menu_link_alter()认为仅在翻译的菜单链接上使用?  ( Is hook translated menu link alter thought to be used only on translated menu ) 
可以 hook_translated_menu_link_alter() 实现以简单地改变渲染之前的菜单链接? 清楚, hook_translated_menu_link() 仅针对从 hook_menu_link_alter() 已更改的菜单项调用的菜单项;如果模块使用 998876664 在呈现之前更改菜单项,则...

7  我可以改变调用不同模块的挂钩实现的顺序吗?  ( Can i change the order in which hook implementation by different modules are cal ) 
在D6中,我使用opply模块,但我想覆盖一小部分其行为。我有一个自定义模块,但我在Contract模块的实现之前调用了相关钩子的实现,因此Contract模块的版本"WINS" 。 有没有办法改变它,并强迫我自己的钩子呼叫? 以下是具体细节: 我想在评论表单中删除未注册用户的默认"匿名" 用户名。我创建了一个小...

2  如何提供带有Node调用的上下文/ NID的过滤器?  ( How can i provide a filter with context nid of node invoking ) 
我目前正在处理具有一个过滤器的自定义模块,该过滤器需要输出的节点对象。 最初过滤器只需从arg(1)中的niD中拉动NID,并在节点对象中使用该滤波器,但不幸的是,如果滤波器缓存被刷新,并且节点重建从节点页面本身以外的任何位置重建其输出(1)不会包含NID,因此过滤器将破坏。 我正在考虑将nid放入令牌转换的令牌,但...

1  允许第三方模块更改模块执行的查询  ( Allowing third party modules to alter the query executed by a module ) 
我正在开发一个暴露公共API的模块,该模块包括在他自己的数据库表中保存数据的函数,它应该从使用我的模块的任何模块中使用。 模块检查数据库的内容,以验证用户是否不允许访问该站点,或者如果在其用户配置文件中更改某些内容时应使用错误消息通知用户。 考虑到在大多数情况下,数据库表是唯一要检查的表,如果我更改代码以允许第三方模...

17  如何创建钩子?  ( How to create a hook ) 
如何为其他Drupal模块创建自己的钩子(类似于Drupal Core创建)使用? ...

2  如何在节点/编辑页面上加载用hook_library()定义的库?  ( How do i load a library defined with hook library on node edit pages ) 
我已经定义了使用 hook_library() 的模块函数所需的JavaScript文件和CSS文件库。 如何在节点/编辑页面上加载此库? ...

4  是否有一种方法可以改变第三方模块或核心模块给出的钩子的实现?  ( Is there a way to alter the implementation of a hook given by a third party modu ) 
我有一个模块,应该替换另一个模块完成的钩子的实现。 司布7有可能做到吗?如果有可能,在哪个条件下? 通过替换由另一个模块完成的钩子的实现,我的意思是使用drupal启用时自动调用的函数。例如,如果启用了轮询模块,则Drupal应调用 poll_user_restriction_info() 或 poll_metata...

2  Ubercart:更改产品显示表单标签“SKU”  ( Ubercart change the product display form label sku ) 
如何更改SKU的显示? (哪个钩子管理产品节点显示?) 我需要sku输出以显示"型号#" 。在产品节点页面上 drupal版本6.2x ...

11  在hook_install上创建新的内容类型  ( Create new content type on hook install ) 
可以有人向我展示如何在模块的 hook_install 方法? 我还想知道 hook_uninstall 清理我的混乱;我读了一些关于只删除内容的争论。 我没有找到正确完成此任务的正确方法的示例,任何帮助都会受到赞赏! ...

3  加载特定节点修订版视图  ( Loading a specific node revision for view ) 
我试图加载特定的修订版以通过最终用户查看。 Drupal 7. 我在我的.module中有以下内容; function mymodule_node_load($nodes, $types) { if ($nodes[821]->vid != 5928) { $nodes[821] = node_l...

1  最小化模块中的Hook_Views_default_views时,可以删除的内容?  ( What can be removed when minimizing hook views default views in a module ) 
我正在研究一个新的drupal 6.x模块(当前在沙箱等待评论中 - http:/ /drupal.org/sandbox/sdague/1072704 )通过视图导出它的数据。当我实现的hook_views_default_views()时,我刚刚在视图上使用导出功能,以获取几个基本视图以获取事项启动。 工作,...

7  如何从另一个模块覆盖默认视图模板?  ( How do i override a default view template from another module ) 
drupal提供 hook_theme() 。但是有一个hook_theme_alter()吗?我正在寻找像 <代码> hook_menu_link_alter() ,它覆盖挂钩菜单条目,但是对于主题。我想修改View Hook主题条目,以便我可以指定在哪里寻找我的自定义模板之一。我不兴趣通过视图接口指定它,因为...

8  使用自己的菜单自定义模块?  ( Custom module with its own menu ) 
我在编写我的第三种定制模块的过程中,这是我最大的挑战。 我知道如何使用hook_menu生成菜单项,并且根据您选择的路径确定它们在网站上显示的位置(管理菜单或主菜单等)。 我的问题是 - 如何指定一个新菜单,以便我创建的路径不会出现在"主链接" 或"导航" 中,而是在自己的"自定义模块" 菜单中? ...

1  在哪个情况下应使用hook_process()和hook_process_hook()?  ( In which cases should hook process and hook process hook be used ) 
考虑某些模块实现 hook_process()要更改某些变量的内容,并将其内容替换为主题内容,在该内容中,其中模块应该实现 hook_process() 而不是 hook_preprocess()(或 hook_preprocess_hook())? function rdf_process(&$variable...

2  使用node_view()显示节点未打印本地菜单项  ( Using node view to display a node doesnt print local menu items ) 
当使用node_view()以显示节点(通过从hook_menu()调用的函数返回)缺少通常的视图/编辑选项卡。 是这个预期的行为吗? ...

2  为WebForm提交页面添加注释  ( Add comments to webform submission pages ) 
我们使用WebForms进行各种目的,例如反馈问卷,联系表格和申请表格。 对于申请表格,我们希望在提交页面附上注释。这是如此,在提交了表单后,用户和管理员可以从请求中的跟进通信。 从我理解的内容页面是唯一的,只能对提交它们或管理员的用户来看。 任何人都知道我如何单独将唯一的评论表单附加到这些提交方案,以便只有提交表格...

1  用于模块激活和取消激活的钩子  ( Hook for module activation and deactivation ) 
我正在尝试在用户激活或停用模块时在模块中执行函数。在Drupal 7中似乎有一个钩子,但不是在Drupal 6中。可以在Drupal 6中用解决方法进行解决方案? ...

7  您可以与页面标题不同的钩子_menu()项目标题吗?  ( Can you make the hook menu item title different from the page title ) 
我正在用hook_menu()建立一个菜单。 当您为此构建阵列时,您将指定标题,然后将其传递给您所通话的页面并成为页面标题。它也是菜单项的显示名称。 $items['somewhere/something'] = array( 'title' => 'Something', 'description' => ...

6  发送电子邮件附件  ( Send email with attachment ) 
我想用 workbench administration0 使用 workbench administration1 发送附件。您是否对我应该使用哪个参数的想法? 变量 workbench administration2 帮助,以某种方式? ...

1  sop_form_alter()中保存和预览差异  ( Save and preview differences in hook form alter ) 
我创建了一个使用 hook_form_alter()。加载表单(节点/添加)时,我隐藏一个字段,挂钩正常工作。当我完成表单的预览时,会出现问题。当表单再次出现时,我会看到隐藏的字段(挂钩不起作用)。为什么? 我通过线隐藏字段: $form['field_versio']['und']['0']['value'][...

© 2021 it.wenda123.org All Rights Reserved. 问答之家 版权所有

Licensed under cc by-sa 3.0 with attribution required.