恶意软件清理后数据库中的引号被逃脱

发布于 2024-11-14 21:53:35 字数 604 浏览 3 评论 0原文

我有一个基于 Wordpress 的博客。该网站遭到恶意软件攻击,完全锁定了一个表并导致该网站无法访问。托管公司清理后,我帖子中的所有图像(以及其他内容,文本除外)都停止显示。

经查,发现所有的引号"都被转义了,即变成了\"。下面是来自 Wordpress 帖子的示例代码:

<img title=\"Wendy&#39;s Chicken club - Fast food: ads vs reality\"
     height=\"344\" alt=\"Wendy&#39;s Chicken club\"
     src=\"http://www.sawantshah.com/wp-content/uploads/2009/04/image-thumb.png\"
     width=\"640\" border=\"0\" />

现在,我该如何通过 SQL 将这些转义引号恢复正常?简单的查找和替换可以用于转义序列吗?

发生问题的博客,供参考:www.sawantshah.com

I have a Wordpress-based blog. There was a malware attack on the site, which totally locked a table and made the site inaccessible. After the hosting company cleaned it up, all the images (and other stuff, except for text) in my posts stopped displaying.

Upon investigation, I found that all the quotation marks " had been escaped, that is they had turned into \". Here's a sample code from a Wordpress post:

<img title=\"Wendy's Chicken club - Fast food: ads vs reality\"
     height=\"344\" alt=\"Wendy's Chicken club\"
     src=\"http://www.sawantshah.com/wp-content/uploads/2009/04/image-thumb.png\"
     width=\"640\" border=\"0\" />

Now, how shall I turn these escaped quotes back to normal through SQL? Will a simple find and replace work for escape sequences?

Blog where the problem is occurring, for reference: www.sawantshah.com.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清晨说晚安 2024-11-21 21:53:35

在实际执行此操作之前,请确保您的主机已完全禁用恶意软件。根据您帖子的问题,他们已将所有 " 替换为 \",这可能会禁用恶意软件,直到您将 \" 恢复为 < code>"——即不一定是你想要的。向你的主人抱怨并问他们“有什么问题?!?”/告诉他们在进一步采取行动之前他们引入了一个新问题。

Before you actually do so, make sure your host has competently disabled the malware. Based on your post's question, they've replaced all " with \", which might disable the malware until you revert \" back to " -- i.e. not necessarily what you want. Complain to your host and ask them "what gives?!?"/tell them they introduced a new problem before moving a step further.

等风来 2024-11-21 21:53:35
update my_table set my_column = replace(my_column, '\\"', '"');
update my_table set my_column = replace(my_column, '\\"', '"');
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文