<%
/**
* -----------------------------------------------------------------------------
* Countomat.com
* Script for robots detecting
* JSP
* -----------------------------------------------------------------------------
*/
String UrlRef = request.getHeader("Referer");
String LogServer = "log3.countomat.com";
int LogPort = 80;
boolean CookieCM = false;
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for(int i = 0; i < cookies.length; i++) {
Cookie cookie = cookies[i];
if (cookie.getName().equals("t11235v3")) {
CookieCM = true;
break;
}
}
}
if ((!CookieCM) && (UrlRef == null || UrlRef.equals(""))) {
String IPAddress = "";
java.net.InetAddress thisIp = java.net.InetAddress.getLocalHost();
if (!thisIp.getHostAddress().equals("")) {
IPAddress = thisIp.getHostAddress();
}
String UserAgent = "";
if (!request.getHeader("User-Agent").equals("")) {
UserAgent = java.net.URLEncoder.encode(request.getHeader("User-Agent"));
}
String URL = "";
if (!request.getRequestURL().toString().equals("")) {
URL = java.net.URLEncoder.encode(request.getRequestURL().toString());
if (request.getQueryString() != null) {
URL += "?" + request.getQueryString();
}
}
try {
java.net.Socket socket = new java.net.Socket(LogServer, LogPort);
java.io.PrintWriter sw = new java.io.PrintWriter(socket.getOutputStream(), true);
sw.print("GET http://" + LogServer + ":80/_log/index.php?0=8|0|" + URL + "|||" + UserAgent + "||" + IPAddress + " HTTP/1.0\r\n\r\n");
sw.flush();
}
catch (java.net.UnknownHostException e) {}
catch (java.net.NoRouteToHostException e) {}
catch (java.net.ConnectException e) {}
catch (java.io.IOException e) {}
}
%>