1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6 <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
7 <link rel="stylesheet" type="text/css" media="screen" href="/css/Plain.css">
8 <title>Your violation has been reported</title>
10 $ip = $_SERVER ["REMOTE_ADDR"];
11 $page = $_REQUEST ["page"];
12 $date = date ("m/d/Y @ h:i A");
14 function GetEmails ($ip) {
18 "whois.nsiregistry.net",
20 "whois.networksolutions.com"
23 $email_address = array ();
25 foreach ($whois_list as $whois_server) {
28 if ($whois_server == "") {
31 $lines = `whois -h $whois_server $ip`;
34 preg_match_all ("/\s(\S+\@\S[\.\S]+)/", $lines, $matches, PREG_PATTERN_ORDER);
36 foreach ($matches [1] as $match) {
37 $email_address [$match] = $match;
40 $count = count ($email_address);
41 if (count ($email_address) > 0) {
46 return $email_address;
49 function LogViolation ($ip, $email_address, $page) {
51 $filename = "/web/violation.log";
53 $fh = fopen ($filename, "a");
57 if ($email_address == "<unknown>") {
58 $msg = "$date $ip attempted to access $page - No email address found to report violation to\n";
60 $msg = "$date $ip attempted to access $page - violation reported to $email_address\n";
68 function SendViolation ($ip, $email_address) {
69 $domain = "DeFaria.com";
70 $contact = "Andrew@DeFaria.com";
71 $subject = "Illegal attempts to break into $domain from your domain ($ip)";
75 <title>$subject</title>
80 <p>On $date somebody from your domain with an IP Address of $ip has been
81 attempting to break into my domain, <a
82 href=\"http://$domain\">$domain</a>. Breaking into somebody else's
83 computer is <font color=\"red\"><b>illegal</b></font> and <font
84 color=\"red\"><b>criminal prosecution can result</b></font>. As a
85 responsible ISP it is in your best interests to investigate such
86 activity and to shutdown any such illegal activity as it is a
87 <u>violation of law</u> and most likely a violation of your user
88 level agreement. It is expected that you will investigate this and
89 send the result and/or disposition of your investigation back to <a
90 href=\"mailto:$contact\">$contact</a>. <font color=\"red\"><b>If you
91 fail to do so then criminal prosecution may result!</b></font>
95 // To send HTML mail, the Content-type header must be set
96 $extra_headers = "MIME-Version: 1.0\n";
97 $extra_headers .= "Content-type: text/html; charset=iso-8859-1\n";
100 $extra_headers .= "From: Andrew DeFaria <$contact>\n";
101 //$extra_headers .= "Cc: $contact\n";
103 if (mail ($email_address, $subject, $message, $extra_headers)) {
104 print "Sent violation report to $email_address<br>";
106 print "Error sending violation report to $email_address</br>";
114 <div class="heading">
115 <h1 class="centered">Your violation has been reported!</h1>
119 <p>You have purposely and illegal probed my site to arrive at this page. As a
120 result your IP address <?php echo $ip;?> has been logged and a
121 report was sent to your ISP.</p>
124 $email_addresses = GetEmails ($ip);
126 if (count ($email_addresses) == 0) {
127 LogViolation ($ip, "<unknown>", $page);
129 foreach ($email_addresses as $email_address) {
130 SendViolation ($ip, $email_address);
131 LogViolation ($ip, $email_address, $page);