我的页面受到 xss 攻击,但 ftp 上的所有文件都没有更改?
昨天我注意到我的网页上有时会显示 javascript 错误。 当我查看源代码时,我发现其中一个 .js 文件完全被大量色情链接替换。
我检查了 ftp 中是否有这个文件,但只有旧的 javascript 文件,没有任何更改。 但我回去通过浏览器检查源代码,确实又出现了原始的.js,
今天我再次访问了我的网页,问题又出现了。
- 第一次访问显示大量色情页面
- 缓存的 .js 文件被黑客攻击
- ,但在清除浏览器缓存 js 后返回到原始
版本,我对照我的离线版本检查了 ftp 上的所有文件,但所有文件都没有任何更改。
在过去的几年里,我被 xss 攻击过几次,但在每种情况下都很容易诊断和修复。但现在我花了12小时没有发现感染。
你知道如何找到它吗?
yesterday i noticed that sometimes on my webpage shows up javascript errors.
when i went to source code, i found that one of .js files was totaly replaced with a ton of porn links.
i checked the ftp for this file, but there was just old javascript file without any changes.
yet i go back to check source code via browser and indeed there was again original .js
today i visited my webpage again and the problem repeated.
- first visit showed me ton of porn pages
- cached .js file was hacked
- but after clearing browser cache js go back to oryginal
i checked all files on my ftp against my offilne version, but all files are without any change.
in last few years i was attacked by xss few times but in every case it was easy to diagnose and fix. but now i spend 12h and didnt find infection.
do you have any idea how to find it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
他们很可能发现了一个漏洞,该漏洞会在您的数据库和/或 CMS 文件中插入 XSS 数据,然后当您转到特定页面时会显示这些数据。
您似乎正在使用 Quick CMS,它可能在某个地方包含一些缺陷,但是如果您自己开发了任何自定义功能,这可能就是问题所在。
当您将数据插入数据库时,请始终使用 mysql escape 函数,当您将数据从数据库输出到页面时,请使用 php htmlentities() 函数,这将保护您免受 XSS 攻击。
Most likely they've found an exploit inserting XSS data in your DB and / or CMS files, which then is displayed when you go to a specific page.
You seem to be using Quick CMS and it might contain some flaw somewhere, however if you've developed any custom functions yourself this might be where the problem is.
When you insert data into a DB always use the mysql escape function, and when you output the data from the DB on to the page use the php htmlentities() function, this will protect you from XSS attacks.
XSS 攻击不需要更改服务器端的文件,它使用特殊格式的查询链接,然后您的代码由于未正确检查输入而将其呈现到网页。
您只需要转义或检查您的输入即可。搜索“如何防止 xss”。
防止跨站脚本攻击
XSS attack does not need to change files at server side, it uses specially formatted query link which your code then renders to the webpage due to not checking inputs correctly.
You just need to escape or check your inputs. Search for "how to prevent xss".
Preventing Cross Site Scripting Attacks