T
T
tuxx2016-04-10 23:50:47
Nginx
tuxx, 2016-04-10 23:50:47

Why sometimes scripts do not make friends as they should?

When refreshing pages, sometimes an error occurs:


13:18:01.478 SyntaxError: expected expression, got '<' angular-swiper.js:1:0
13:18:01.479 SyntaxError: expected expression, got '<' angular-translate.min.js:1:0
13: 18:01.480 SyntaxError: expected expression, got '<' ngDialog.min.js:1:0
13:18:01.510 Error: [$injector:modulerr] errors.angularjs.org/1.3.15/$injector/modulerr?p0 =...
angular.min.js:6:417
13:18:01.697 SyntaxError: expected expression, got '<' index.php:1:0

The error occurs if you do not update the tab for half an hour or more, but it does not always appear.
When opening erroneous files through a link, the following code is displayed in the console:
<html><head></head> 
  <body>
    <script> 
      var xmlhttp = new XMLHttpRequest(); 
      function eraseCookieFromAllPaths(name) { var pathBits = location.pathname.split("/");var pathCurrent = " path=";document.cookie = name + "=; expires=Thu, 01-Jan-1970 00:00:01 GMT;";for (var i = 0; i < pathBits.length; i++) {pathCurrent += ((pathCurrent.substr(-1) != "/") ? "/" : "") + pathBits[i]; 
      document.cookie = name + "=; expires=Thu, 01-Jan-1970 00:00:01 GMT;" + pathCurrent + ";";}} 
      eraseCookieFromAllPaths("BHC"); 
      xmlhttp.onreadystatechange=function() { 
                            if (xmlhttp.readyState==4 && xmlhttp.status==200) { 
                                var a=xmlhttp.responseText.trim();document.cookie="BHC="+a+"; path=/";document.location.href="/js/swiper.js"; } }; 
      xmlhttp.open("GET", "/banhammer/pid", true);xmlhttp.send(); 
    </script> 
  </body></html>

The files themselves are readable by everyone.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-04-11
@tuxx

Very similar to the system of protection against attacks through the installation of cookies.
The cookie time expires and all requests instead of files return such a stub.
If you yourself have not installed anything like this, then perhaps your hoster uses this system.
Here, for example, is an office that provides protection according to a similar principle - https://ddos-guard.net/ru/clients/
Write to your hoster, specify whether such an attack protection system is used and what to do.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question