Thursday, August 10, 2017
Tutorial How to make an IP logger To get others IP Detailed
Tutorial How to make an IP logger To get others IP Detailed
An IP-address (Internet Protocol) is a specific, unique number given to each computer, this is used to communicate with other computer devices.
There are right now, two different kind of IP-addresses, the ipv4 (32-bit system) and ipv6 (128-bit system).
The first one was the ipv4 system, but because we were running out of IP-addresses, we needed a new system and then, the ipv6 was born.
Examples:
Ipv4 - 173.194.112.0
Ipv6 - 2a00:1450:4001:c02::8a:
But some people abuse this system to do harm to other people.
Well, to do this, we need multiple things:Basic knowledge about HTML, CSS, JavaScript, and PHP (No worry if you don’t know them).A webhost (000webhost.com)A domain name (dot.tk)A .txt file
Okay, it maybe seems like a LOT for you, and extremely hard – Well, it isn’t!
We only are making a simple button in HTML & CSS, an alert-box in JS, and the log-system in PHP. :)
I’ll explain every line, so don’t worry!
We’ll be making a simple web-page that gets the IP of the victim, and then saves it in a .txt file.
Okay, first we have to make the webpage, for this we need two languages, HTML and CSS.
I assume you already know these, if not, I highly recommend learning them. :)
http://codecademy.com can help you a lot further.
We only need the basics though.
First we need an editor (program to code in, Mostly used for Mark-up (HTML), Stylesheet (CSS), and scriping languages (JavaScript).
Notepad++ is a good free one, but if you dont have that one your normal Notepad is okay to.
Go here: http://notepad-plus-plus.org/download/ - Recommended; Download & Install
Or, if you want to do it fast and now, useWinkey + R > "Notepad".
Now, were ready to go!
The basic HTML tags:
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
So, let me explain all these things.
Every tag you open in the HTML language, must also be closed (most of the time).
<html> (open) </html> (close it "").
<!DOCTYPE html> - Our browsers must know were using the latest HTML version (HTML5)<head> - Here we place all our metadata and styling,...<title> - The text you see in your browser bar (Hack Forums)<body> - All the content (not necessary layout) is placed here
Peanuts isnt it? :)
Well, now lets go deeper in our HTML code, Ill use comments (<!-- TEXT -->) to show what Ive added this time. Comments wont be displayed on the webpage
because its ignored by browsers.
Code:
<!DOCTYPE html>
<html>
<head>
<!-- NEW! Ive set a title here, this will be displayed in the browser tab-->
<title>Give a damn • Now!</title>
</head>
<body>
<!--NEW! Ive added a division-->
<div>Give a damn</div>
</body>
</html>
Okay, So, Ive added a browser tab title, and adivision.
Let me explain that division.
A division means in HTML... Nothing!
You dont say anything with it.
But for what is it used then?
Just to wrap text together, or wrap other elements in your text together, or to only select a specific area on/in your page/code.
If you save it now as index.php (nothing else! It MUST be index.php (mention the .php extension),
and open it with your browser you will see the title in your browser tab + The text "Give a damn!".
Not much, isnt it?
It looks, so boring... Lets style it!
For styling we use the language CSS (Cascading StyleSheet), cascading because the structure of such a code, and StyleSheet because its to... Style. :D
Code:
<!DOCTYPE html>
<html>
<head>
<title>Give a damn • Now!</title>
<!-- NEW! Ive added <style>-->
<style>
</style>
</head>
<body>
<!--NEW! Ive added an ID in this division-->
<div id="button">Give a damn</div>
</body>
</html>
I again added two things.
Style, and an id.
In the <style> tags we are going to place our CSS codes.
Let me now explain what an ID is;
If you give an element in HTML an ID by adding id="anything" to it, you say that only that one element, no other, only that one must listen to what the CSS says.
That means that if CSS says: "EVERYTHING RED, NOW!" But id-anything says: "Please, become blue" The element including id-anything will turn blue.
In short: You can edit only one element with it. :P
If you want to give an element an id in HTML, you add id="text" to it, where text can be anything.
Example:
Code:
<p id="turnBlue"></p> - Paragraph has an ID called "turnBlue"
<div id="main"></div> - This division has an ID called "main", probably its the biggest div of all
<font id="specialFontFamily"></font> - This font has an ID called "specialFontFamily", probably the coder added a special font-family (Arial, Courier,...) to it.
But we may set as many unique IDs as we want, if there is no CSS, those IDs have no clue what to do! And we dont want to confuse our IDs, do we?
So we add it in our CSS, I pick out a piece of our long code, so its easier to explain etc.
Weve got a division with ID "button", in CSS we declare were picking out an ID from our HTML using the #-symbol.
Thatd give:
Code:
<!-- Remember our Style where we place all our CSS?-->
<style>
#button {
}
</style>
Lets say, we want to give it a yellow colour, with black coloured text which is in font-family Courier.
Thatd give:
Code:
<!-- Remember our Style where we place all our CSS?-->
<style>
#button {
background-color: #FFFF00;
width: 25%;
height: 15%;
font-family: Courier;
font-size: 250%;
text-align: Center;
position:absolute; top:40%; left:40%;
}
</style>
Let me explain everything about it!
- First we of course say were using an ID called "button" > #button, everything we style for that ID do we place in {} brackets.
- Background-color ~ Declare we want to set a specific background-color for our ID (division).
- With # ~ we dont only declare IDs, but also that were using HTML-colour-codes to say what colour to use, #FFFF00 gives yellow (you dont have to learn those
from outside >>http://html-color-codes.info<< well, you may learn those from outside, but eh...)
- Width and height ~ to set a specific width and height of our division.
- Font-family ~ to say we want to use a specific font family
- Font-size ~ To set a specific font size (250% = 2.5 times bigger as default [mostly 16px])
- text-align: Center ~ We want all our text in our div(ision) with id "button" is in the center (you can also place left and right)
- Position ~ We set our division box 40% away from the top, and 40% away from the left, so its perfectly in the middle of our browser screen.
So, now weve got a button, but on a white background? That doesnt look professional!
Lets make it blue!
We do that with the body element, the body (<body>) element goes over our whole webpage.
We do it like this:
Code:
<style>
/*NEW! We added the body to change (CSS has special comments [/*Comment Text*/])*/
body {
background-color:#0000FF;
}
#button {
background-color: #FFFF00;
width: 25%;
height: 15%;
font-family: Courier;
font-size: 250%;
text-align: Center;
position:absolute; top:40%; left:40%;
}
</style>
Because body isnt an ID, nor a class (.myClassName - Able to give to multiple elements) we use body directly in our CSS without a special icon.
And we make it blue (#FFFF00).
Lets place our style back in our HTML code.
No weve got a nice button! :)
It doesnt look much, but it isnt needed. The IP gets logged directly after a person visits it, we just style our webpage so it doesnt look suspicious. ;)
So, our full HTML & CSS code would be:
Spoiler (Click to View)
Now, lets move on to our next language called JavaScript, JavaScript is an extremely powerful scripting (just say programming) language on the web, and also exists
as long as the web does. We wont be using it that much now, but okay.
Were going to make a pop-up box, we do that with the alert() function, it looks like this:
alert("This Text will be displayed");
And
Quote:This Text will be displayed
will pop-up.
Well, Lets go!
To code in JavaScript, we have to include <script> tags.
<script>
//JS here
</script>
So, our code will look like this:
Code:
<!DOCTYPE html>
<html>
<head>
<title>Give a damn • Now!</title>
<style>
body {
background-color:#0000FF;
}
#button {
background-color: #FFFF00;
width: 25%;
height: 15%;
font-family: Courier;
font-size: 250%;
text-align: Center;
position:absolute; top:40%; left:40%;
}
</style>
<script>
alert("Thanks for giving a Damn!!!!!");
</script>
</head>
<body>
<div id="button">Give a damn</div>
</body>
</html>
No click on that give-a-damn button!
...
Yeah, it doesnt work.
We have to make it work by Clicking On the button, lets use onClick for that in our HTML!
To use onClick we need two things:A JS-functionA HTML element
Weve already got a HTML element (our DIV), but no JS-function.
I wont go to deep on this because you can write a whole book about functions.
Anyway, we use functions to say a piece of code to return something, that piece of code do we place between {} brackets while we defined our function.
Example:
Code:
<script>
function myFunctionName() {
//Piece of code to do something...
}
</script>
Now, we can trigger that function using onClick in our div. Like this:
Code:
<div id="button" onClick="myFunctionName()"></div>
So, your full code would be:
Spoiler (Click to Hide)
Code:
<!DOCTYPE html>
<html>
<head>
<title>Give a damn • Now!</title>
<style>
body {
background-color:#0000FF;
}
#button {
background-color: #FFFF00;
width: 25%;
height: 15%;
font-family: Courier;
font-size: 250%;
text-align: Center;
position:absolute; top:40%; left:40%;
}
</style>
<script>
function thx() {
alert("Thanks for giving a Damn!");
}
</script>
</head>
<body>
<div id="button" onClick="thx()">Give a damn</div>
</body>
</html>
Lets move on! :)
Now, weve got our HTML, CSS, and JS done!
Now we have to program our PHP.
PHP stands for Hypertext PreProcessor and is a server-side language, that means we cant test it while coding offline (except if you got an APACHE server downloaded). :)
But as soon as we upload it, you can.
Okay, the code we will be using is this one:
Code:
<?php
$ip = $_SERVER[REMOTE_ADDR]." ";
$logFile = logs.txt;
$fO = fopen(logs.txt , a);
fwrite($fO, $ip);
fclose($fO);
?>
You can place it anywhere, I recommend beneath the <HTML> tags. :)
The <script> for JS and the <style> for CSS is <?php ?> for PHP.
In PHP we declare variables using the $-symbol, we keep using that symbol if we want to use our variable for something.
So, Ive got a variable called IP with this as value:
Code:
//Just to get IP
$_SERVER[REMOTE_ADDR]
That is to get the IP, " " so the IPs get listened beneath each other and not side-by-side. :)
- $logFile is our variable which says what .txt file were going to use.
Make a .txt file called: logs.txt and just type: "--IP-addresses:--" [Press Enter]X2 in it.
- $fo variable together with the fopen function to open the file (fopen), we open the file logs.txt the a means that we only allow to write something in the file, but nothing else!
Not reading, not editing, only writing. :)
- And then the most important, the fwrite function, we write the value of $ip and $ date in logs.txt with the permission a.
- And as last we close it (fclose).
Not that hard, is it? :)
So, our full, full, code will be:
Spoiler (Click to Hide)
Code:
<!DOCTYPE html>
<html>
<head>
<title>Give a Damn - Now!</title>
<style>
body {
background-color:#0000FF;
}
#button {
background-color:#FFFF00;
width:25%;
height:15%;
position:absolute; top:40%; left:40%;
font-family:Courier;
font-size:250%;
text-align:Center;
}
</style>
<script>
function thx() {
alert("Thanks for giving a damn!");
}
</script>
</head>
<body>
<div id="button" onClick="thx()">Give a Damn!</div>
</body>
</html>
<?php
$ip = $_SERVER[REMOTE_ADDR]." ";
$logFile = logs.txt;
$fO = fopen(logs.txt , a);
fwrite($fO, $ip);
fclose($fO);
?>
Now, our site is ready.
But, we need to put it online!
And we dont want to spend a penny of course.
What we need is a free webhost, and a free domain name.
The webhost will make sure our site is online, theyre the server.
The domain name will translate that complex ip-address in to a domain name (http://www.example.com).
We will be usinghttp://www.000webhost.com as webhost, and http://www.dot.tk as domain name system (DNS).
Ill be also making a video explaining this.
First, register at dot.tk, leave that tab open and browse to 000webhost.com.
Now, you register at 000webhost.
When thats ready (and you waited a long time) you can got your CPanel, there on the top-left you should see Account details.
The first 4 tables include the info you need, it are our Nameserves, that is what we will be linking to our Domain Name Service (Dot.tk).
When youre on the dot.tk page of registering your Domain (you can also edit it afterwards) you should see these boxes:
Just type the nameserver details over (Keep the order like you see at 000webhost).
You can choose how long you want that domain, and save it! :)
After that, our site# should be online in 48 hours or less! ;)
So, the site is online, but our files yet arent!
You should have two files now:index.php (including the code for our webpage)logs.txt (inlcuding the text: --IP-addresses--
We will both upload them.
Go to File Manager on your CPanel of 000webhost. Log-in there, after that you need to browse to public_html. Its a folder.
Now, you just click upload and select the files you want to upload (logs.txt and index.php). Accept > Accept (Green check-icon).
If you visit your site now you should get refered to your index.php site! :)
Now, you can check the content of logs.txt through your FTP-server (click view, open)!
And the IP-address of everyone who visits it.
You can use url-shorteners (bitf.ly) to spoof the URL so it looks more legit. ;)
(Ill post videos about this part soon if you want).
Now, lets analyse what weve done.
First we created a webpage in HTML, CSS, JavaScript and PHP.
Full code (Bit customized by me):
Spoiler (Click to View)
Like you see, not a beast website.
Of course we could make a nice style 100% responsive scroll-style website, if we hadnt a 18.000 character limit. :)
Also, it isnt needed, the IP gets logged as soon the user visits the webpage.
After that, we uploaded the website to 000webhost, and linked it to our Dot.tk DNS (100% free of course).
Done! :)
Well, you can also short the URL with #/dot.tk/goog.gl... so it looks again less suspicious.
You just send the URL to any person you want the IP of, if he doesnt use Tor/VPN/Proxy/... You get the IP! :)
What can I do with an IP?
An IP is an unique number, that means that you can track the unique device who uses that IP and their users.
http://www.infosniper.net/ is an awesome site where you can get some info about the IP-address. (Location, ISP,..).
When you got all these info, you can start DOXing, DOXing (documenting) is getting a lot of info about a specific person, an IP is an important part of that.
Another thing is to take down that IP, you can DDoS (An attack where you overflood a server (/router)) that IP, if your attack is strong enough that IP cant connect
to the internet for a while, that means that the persons who uses that IP also cant connect to the internet anymore! But this is not legal (of course). ;)
For DDoSing you need a booter/Botnet. :)
And best of all... Getting IP-addresses this way is 100% legal! Its done by millions of sites a day, maybe while you dont even know it! :D
Of course we could also just link a third-party tool to our webpage, but doesnt it feel better to 100% code it yourself?
Anyway
download file now