大网数据广告活动
网站运营与故障问答

Where are these spammy posts generated from?

· 52CE 我爱测

While doing a a random Google search, I realized that my WordPress blog is populated with several spammy posts. Ex: (intentionally delinked) http://example.com/2016/02/06/free-download-wallpaper-ringtones-mobile/ http://example.c…

问题原文

原帖链接 · Sathyajith Bhat · CC BY-SA 3.0

While doing a a random Google search, I realized that my WordPress blog is populated with several spammy posts.

Ex: (intentionally delinked)

  • http://example.com/2016/02/06/free-download-wallpaper-ringtones-mobile/
  • http://example.com/2016/02/06/under-the-dome-seizoen2/

And many more such on the sidebar.

At first I thought my WordPress install was compromised, analyzing further I was at a loss..

  • The posts are nowhere to be seen in my db(expected), neither on the filesystem as flat files or uploaded files(expected)
  • I can't find any eval() or base64_decode done wrong, at least not at first glimpse
  • Even after changing the WordPress theme, these posts are served with the same theme as they were prior to the change.

I have:

  • Scanned using Exploit scanner
  • Checked for evals/base64_decode/php shortcodes etc as mentioned in WP Codex
  • Added a comment on the footer and this doesn't reflect on the spammy posts, while it does on the 'actual' posts
  • nginx access logs indicate the posts are being served from my server

So where are these posts being served from?

已采纳解答

原帖链接 · Sathyajith Bhat · CC BY-SA 3.0

Turns out, the WordPress install was indeed compromised. I did a diff of my existing install vs a new WordPress install, and diff reported new file:

# diff -qr wordpress_installed/ wordpress_new/

Only in wordpress_installed/wp-includes: class-wp-init.php

I also found wp-config.php had been edited to include this

@include_once(ABSPATH . 'wp-includes/class-wp-init.php' );

Fishy file indeed, this was what the file contained:

http://pastebin.com/Mr7N09Pq (linked to external because it kills Stack Exchange's syntax highlighter)

Removing the file & edited wp-config.php to remove out the include removed the spammy posts, for now.

I've also changed the db/user passwords and regenerated salts using this link.

next step would be to wipe out the Wordpress install, reinstall and restore from backup

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-05-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。