代码之家  ›  专栏  ›  技术社区  ›  krupal

我的Worpress站点主页中有人注入的脚本

  •  0
  • krupal  · 技术社区  · 6 年前

    我有WordPress网站。在我的主页中,有人在我的post div之后添加了一些脚本,我正在尝试找出如何删除此脚本,但脚本正在动态生成,

    我想我的网站被人入侵了

    在这里,我将分享某人注入的脚本 function 7a3() {var h = document.head;if (!h) { h = document.getElementsByTagName(“head”); h = h[0]; }var s = document.createElement(“style”);s.type = “text/css”;var c = “#swboc-10o{display:flex; overflow:hidden; margin:0px}#home-right-bottom #swboc-10o>*{width:497px; flex-shrink:0; margin:0}#swboc-10o>#swboc-10{margin-left:-497px; flex-shrink:1; background-color:rgb(255, 255, 255); width:100%}@media only screen and (max-width: 1024px) and (min-width: 960px) {#swboc-10o{float: left; margin: 0 25px;}}“;if(s.styleSheet) s.styleSheet.cssText = c; else s.appendChild(document.createTextNode(c)); h.appendChild(s);}

    <script>function erewhonf75() {var h = document.head;if (!h) { h = document.getElementsByTagName("head"); h = h[0]; }var s = document.createElement("style");s.type = "text/css";var c = "#erewhon-f75o{display:flex; overflow:hidden; margin:10px 0px}#erewhon-f75o>*{width:407px; flex-shrink:0; margin:0}#erewhon-f75o>#erewhon-f75{margin-left:-407px; flex-shrink:1; background-color:rgb(255, 255, 255); width:100%}";if(s.styleSheet) s.styleSheet.cssText = c; else s.appendChild(document.createTextNode(c)); h.appendChild(s);}</script> 
    

    HTML标记为

      <div><a href="https://cialrx.com/">Cialis 10 mg</a> proved to be a really reliable drug that helps me in dealing with women. I accept it two or three hours before the meeting. When it starts to work, I feel a rush of blood to my face, a small stuffiness in my nose, but eventually it all descends to the genitals. The effect is only positive, lasting several days.</div><p id="erewhon-f75">Erewhon Santa Monica features a beautiful patio, terraced courtyard, and a street-level view of Erewhon’s open kitchen. Erewhon has been independent and family-owned for fifty years. We are proud to work with innovative and passionate vendors and farmers to bring you a unique mix of products, held to the highest standards. Hope to see you soon!</p></div>
    <script>erewhonf75();</script></li></ul></div></div>
    

    我不知道这个脚本和HTML div

    我在整个项目中都被搜索过,但在我这边找不到任何东西任何人都知道我的网站发生了什么

    2 回复  |  直到 5 年前
        1
  •  1
  •   MRuf    6 年前

    你最好的选择是使用Wordfence(这是一个插件,有一个免费版本)之类的东西来运行扫描。大多数代码注入都是通过eval(base64\u decode)片段完成的。它可能在你的功能中。php文件,但他们可能会破坏每个php文件。

    一句话:安装Wordfence或任何其他扫描工具,并按照它提供的方向操作。确保更新所有插件和Wordpress版本。如果主题代码是在git中跟踪的,那么您也可以比较代码并从master中删除所有垃圾。

        2
  •  -2
  •   Ambitus    6 年前

    尝试使用文件样式。css a[href="https://cialrx.com/"]{ display: none; }

    并更改密码和登录。