Ultimate Hackers are the people having vision of making hacking community a better place by helping each other by learning and sharing. They emphasis on basics and how things work so you can learn the deep concepts in this field.
Welcome back, reader! I hope you know the basics of XSS and have read my previous article about bypassing XSS filters.
In this article, we will perform Cross Site Scripting (XSS) on some websites which use XSS filters.
So without wasting any time lets get straight to the work.
I have a target here and I am going to inject alert(‘XSS’); into the search:
Huh! Nothing happened. Now let’s take a look at the source to see what blocked our script.
There is nothing related to our script except then this line:
How can we bypass this? Any ideas? If you have some knowledge of HTML then it will help you in many XSS Scenario. So do you know how to bypass this filter?
In my previous article about filter bypass, we saw the source code was making some changes to the input but everything seems fine here. Isn’t it?
Now let’s break down the above line to have a better idea of what is happening,
<input /> is an HTML tag which used to get input from a user.
type=”text” means the input entered by the user will be treated as text
name=”q” class=”search” is used to define the input (none of our use)
value=”alert(‘XSS’);” assigns user input as a value which can be used by the webpage to do things like search something.
Hmmm, so any ideas now?
No? Ok, I expected that.
When we enter something in the search box, the webpage puts it in value=”our_input”. Then type=”text” forces our input to behave as plaintext (just like normal words).
So as long as our input stays inside the value, our efforts are worthless.
Well bypassing this filter is easy if you apply some common sense and basic knowledge of HTML.
We will inject such a script which closes the value tag and then executes our script. *Thug Life*
Here is what we are going to enter:
Now a question you should ask is why there is “> at the start of our script.
Well, our input goes straight to this tag—> value=”our_input”
Now “> will do magic, it will close the value tag.
See this: value=””>our_script”
Our input stays between ” “ and we just added an” in our input which will make the tag think the value is contained within ” “ (but it is not lol). So “> bypass the value tag and closes it.
Now let’s see how it goes:
I knew it would work! We did it.
Now lets target another website, starting with the most basic payload i.e. alert(‘XSS’);
So I tried and failed…But you know what to do when you fail to inject? Yeah. Check the source code.
So here is the source code:
Looks like the previous example huh?
Let’s use “> again to close the input tag.
I did try closing it but failed.
I tried encoding ‘XSS’ to String.fromCharCode format but failed.
I tried encoding it to HTML characters using Hackbar but failed.
Sometimes developer block the word script as input (its rare). So I tried using <ScRipT>, <scRipt>, <scRiPt> etc. to bypass but failed.
Looks like this website is blocking alert statements or script tag.
So I will use a different payload i.e. “><marquee>our_input</marquee>
And here we go sir:
Now let’s sum up what we learned today:
Enter a payload and check source code see how it handled it our input.
Try closing tags on the basis of source code. Be creative!
Try using different encoding techniques.
If one payload doesn’t work, try another.
That’s all for now. I hope you enjoyed this article about bypassing XSS filters. Keep hacking! Keep XSSing!
In the previous article, we learned the basics of Cross Site Scripting (XSS). But the webpage we attacked in previous was way too simple but many websites use XSS filters.
XSS filters are some algorithms or techniques which try to filter user input to stop XSS. Let’s face them to understand what are they and how to bypass them.
So I have a webpage here and I am going to enter our classic query i.e. alert(‘XSS’);
So I press the “Go” button but nothing happens. Why? Is this page invulnerable to XSS? Let’s check the source code for clues:
Hmm.. (‘XSS’) got changed to (\’XSS\’). Which means the script disabled our single quotes ( ‘ ) by adding a backslash ( \ ) before them. It is a very common filter named magic_quotes_gpc.
This filter disables ‘ and ” only. So how to bypass this filter?
A, B, C, etc. these are ASCII characters but they can also be written in the unicode format as 65, 66, 67, etc.
So if you write String.FromCharCode(65) it means A, string.FromCharCode(66) means B and so on.
Do you see? Problem Solved. To convert an ASCII character to Unicode without the hassle you can install an addon named Hackbar in your Firefox. Well, it is available for Chrome too but we love Firefox.
So now to bypass the filter, we will convert (‘XSS’) to String.FromCodeChar() format by using Hackbar.
To access hack bar press F9 and you will see this awesome thing:
Now click on XSS and choose the String.FromCharCode option and enter whatever you want to convert.
So I converted ‘XSS’ using this function and the result is String.fromCharCode(39, 88, 83, 83, 39).
Now we will enter the following query in the input box:
alert(String.fromCharCode(39, 88, 83, 83, 39));
aaaand boom! It worked:
Ok that was good. Now lets try to inject another target.
I entered alert(‘XSS’); in the search box but nothing happened
Now let’s take a look at the source code to see what went wrong
It disabled (escaped) ‘ by adding \.
Hahaha, we know how to bypass this right? Great.
Lets enter alert(String.fromCharCode(39, 88, 83, 83, 39)); and bypass it.
Damn! Nothing happened. But why? Let’s take a look at the source code:
Hmmm take a look at the condition of our input and think why our script didn’t get executed.
Want a hint? Look at the color of and tag. They are different right? A pink tag (loosely speaking) means the tag got executed and a normal black tag means the filter sanitized it (blocked it or whatever).
What to do now? Be patient I don’t know what to do. Let’s try to solve this problem, together.
So the filter allows the tag but blocks the tag. Maybe the filter blocks the tag because it denotes starting of a script?
I got an idea! I am not sure it will work or not. The trick is to enter alert(String.fromCharCode(39, 88, 83, 83, 39));alert(String.fromCharCode(39, 88, 83, 83, 39));
As you can see above I just copied the previous input two times.
Here is my plan, when the filter will see the , it will think an attacker is trying to run a script so the filter will block it. As we saw in the source code, the filter doesn’t block tag maybe because it can’t work without or some other reason.
The filter will allow thinking that the “malicious” script entered by the user is over but this time we are going to try
As you can see I copied the same script two times. If I am right, the filter will block the first script and will allow everything after the </script> tag of the first script.
Now let’s see if it works
Whoa! That’s beautiful! It worked perfectly!
Wait I have another idea!
Lets try this
Today we will learn the basics of Cross Site Scripting (XSS).
Ahh please stop thinking why they call it XSS and not CSS, I wasted hours thinking about that.
Now let’s get straight to the point.
What Is XSS?
It is a web application vulnerability which lets an attacker run his own scripts (client-side scripts actually) into web pages.
An attacker can easily steal cookies, credentials and even spread malware by successfully exploiting an XSS vulnerability.
Most of the times, an input form is used by an attacker to inject his malicious code.
Well, you can’t understand what is XSS without seeing it in action, so let’s do it.
Finding And Exploiting XSS Vulnerability
I have a website here:
As you can see in the above screenshot, there is a search box on top as you can see. Now lets the search for something.
Ummm ok…I searched for ultimate and here is the result:
It looks normal. Now let’s take a look at the source code of the webpage to know how webpage processes our input. You can do this by right-clicking anywhere on the page and choosing view page source option.
But if you are in a hurry you can always right-click on the search result (ultimate in our case) and then choose Inspect Element option which will take you to the desired line directly.
Look at the code above, before ultimate there is </li> and after ultimate there is </ul>. There is nothing between </li> and </ul>. So it looks like there is nothing which can interfere with our input.
We can verify it by entering a basic script in the search box.
So I entered alert(‘Just a test by Ultimate Hackers’); and boom!
We got a pop up here:
Great! This webpage is vulnerable to XSS.
Now we will try to make the page to show an image of our choice.
For this I will enter the following query in the search box:
And here is our desired image on the victim webpage,
Unfortunately*, no user will be able to see this image or the pop up unless we send him the link.
Like if we want him to see the Just a test by Ultimate Hackers pop up then we must ask him to visit the URL for search result i.e.
It doesn’t sound cool. Does it? Well XSS is just not limited to here.
Here some things to consider:
1. If there is an input form, like a search box, or a comment box or just anything where you can type and submit something to the website then you should try checking for XSS vulnerability.
2. We exploited a search box here, and the pages generated by the search were dynamic. Which means, every time you search something there will be different results. These search results do not get stored on the website.
But sometimes there are such forms which can let an attacker save the malicious script permanently in the server and make it load every time when a user visits the infected page.
For example, on many websites, you can comment on your views about the post by the comment box and website saves it in the database. So whenever a user views that post on which you commented, then he will be able to see your comment.
But what if you write a malicious script in the comment box? Yep, the script will get executed whenever a user will access that post.
3. The website we used as an example here was way too simple at handling input but many websites filter user input and try to block XSS attempts. We will learn what kind of filters are used and how to bypass them in the next article.
4. The only thing we did today was to display a harmless pop-up and an image. But as I told you earlier that XSS can be used for phishing, cookie stealing and spreading malware. We will learn how to do these things later in the XSS series.
Till then keep reading and start learning HTML if you haven’t learned it already and believe me HTML is really easy.
What is an Event Handler?
<body onload=alert('Welcome To My Website')>
So whenever the body tag loads, the user will get a message saying Welcome To My Website. Here the loading of the body tag is an event or a happening and onload is an event handler which decides what will happen on that event.
FSCommand() (attacker can use this when executed from within an embedded Flash object)
onAbort() (when user aborts the loading of an image)
onActivate() (when object is set as the active element)
onAfterPrint() (activates after user prints or previews print job)
onAfterUpdate() (activates on data object after updating data in the source object)
onBeforeActivate() (fires before the object is set as the active element)
onBeforeCopy() (attacker executes the attack string right before a selection is copied to the clipboard – attackers can do this with the execCommand("Copy") function)
onBeforeCut() (attacker executes the attack string right before a selection is cut)
onBeforeDeactivate() (fires right after the activeElement is changed from the current object)
onBeforeEditFocus() (Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected)
onBeforePaste() (user needs to be tricked into pasting or be forced into it using the execCommand("Paste") function)
onBeforePrint() (user would need to be tricked into printing or attacker could use the print()or execCommand("Print") function).
onBeforeUnload() (user would need to be tricked into closing the browser – attacker cannot unload windows unless it was spawned from the parent)
onBeforeUpdate() (activates on data object before updating data in the source object)
onBegin() (the onbegin event fires immediately when the element’s timeline begins)
onBlur() (in the case where another popup is loaded and window looses focus)
onBounce() (fires when the behavior property of the marquee object is set to “alternate” and the contents of the marquee reach one side of the window)
onCellChange() (fires when data changes in the data provider)
onChange() (select, text, or TEXTAREA field loses focus and its value has been modified)
onClick() (someone clicks on a form)
onContextMenu() (user would need to right click on attack area)
onControlSelect() (fires when the user is about to make a control selection of the object)
onCopy() (user needs to copy something or it can be exploited using the execCommand("Copy")command)
onCut() (user needs to copy something or it can be exploited using the execCommand("Cut")command)
onDataAvailable() (user would need to change data in an element, or attacker could perform the same function)
onDataSetChanged() (fires when the data set exposed by a data source object changes)
onDataSetComplete() (fires to indicate that all data is available from the data source object)
onDblClick() (user double-clicks a form element or a link)
onDeactivate() (fires when the activeElement is changed from the current object to another object in the parent document)
onDrag() (requires that the user drags an object)
onDragEnd() (requires that the user drags an object)
onDragLeave() (requires that the user drags an object off a valid location)
onDragEnter() (requires that the user drags an object into a valid location)
onDragOver() (requires that the user drags an object into a valid location)
onDragDrop() (user drops an object (e.g. file) onto the browser window)
onDragStart() (occurs when user starts drag operation)
onDrop() (user drops an object (e.g. file) onto the browser window)
onEnd() (the onEnd event fires when the timeline ends.
onError() (loading of a document or image causes an error)
onErrorUpdate() (fires on a databound object when an error occurs while updating the associated data in the data source object)
onFilterChange() (fires when a visual filter completes state change)
onFinish() (attacker can create the exploit when marquee is finished looping)
onFocus() (attacker executes the attack string when the window gets focus)
onFocusIn() (attacker executes the attack string when window gets focus)
onFocusOut() (attacker executes the attack string when window looses focus)
onHashChange() (fires when the fragment identifier part of the document’s current address changed)
onHelp() (attacker executes the attack string when users hits F1 while the window is in focus)
onInput() (the text content of an element is changed through the user interface)
onKeyDown() (user depresses a key)
onKeyPress() (user presses or holds down a key)
onKeyUp() (user releases a key)
onLayoutComplete() (user would have to print or print preview)
onLoad() (attacker executes the attack string after the window loads)
onLoseCapture() (can be exploited by the releaseCapture() method)
onMediaComplete() (When a streaming media file is used, this event could fire before the file starts playing)
onMediaError() (User opens a page in the browser that contains a media file, and the event fires when there is a problem)
onMessage() (fire when the document received a message)
onMouseDown() (the attacker would need to get the user to click on an image)
onMouseEnter() (cursor moves over an object or area)
onMouseLeave() (the attacker would need to get the user to mouse over an image or table and then off again)
onMouseMove() (the attacker would need to get the user to mouse over an image or table)
onMouseOut() (the attacker would need to get the user to mouse over an image or table and then off again)
onMouseOver() (cursor moves over an object or area)
onMouseUp() (the attacker would need to get the user to click on an image)
onMouseWheel() (the attacker would need to get the user to use their mouse wheel)
onMove() (user or attacker would move the page)
onMoveEnd() (user or attacker would move the page)
onMoveStart() (user or attacker would move the page)
onOffline() (occurs if the browser is working in online mode and it starts to work offline)
onOnline() (occurs if the browser is working in offline mode and it starts to work online)
onOutOfSync() (interrupt the element’s ability to play its media as defined by the timeline)
onPaste() (user would need to paste or attacker could use the execCommand("Paste") function)
onPause() (the onpause event fires on every element that is active when the timeline pauses, including the body element)
onPopState() (fires when user navigated the session history)
onProgress() (attacker would use this as a flash movie was loading)
onPropertyChange() (user or attacker would need to change an element property)
onReadyStateChange() (user or attacker would need to change an element property)
onRedo() (user went forward in undo transaction history)
onRepeat() (the event fires once for each repetition of the timeline, excluding the first full cycle)
onReset() (user or attacker resets a form)
onResize() (user would resize the window; attacker could auto initialize with something like: self.resizeTo(500,400);)
onResizeEnd() (user would resize the window; attacker could auto initialize with something like: self.resizeTo(500,400);)
onResizeStart() (user would resize the window; attacker could auto initialize with something like: self.resizeTo(500,400);)
onResume() (the onresume event fires on every element that becomes active when the timeline resumes, including the body element)
onReverse() (if the element has a repeatCount greater than one, this event fires every time the timeline begins to play backward)
onRowsEnter() (user or attacker would need to change a row in a data source)
onRowExit() (user or attacker would need to change a row in a data source)
onRowDelete() (user or attacker would need to delete a row in a data source)
onRowInserted() (user or attacker would need to insert a row in a data source)
onScroll() (user would need to scroll, or attacker could use the scrollBy() function)
onSeek() (the onreverse event fires when the timeline is set to play in any direction other than forward)
onSelect() (user needs to select some text – attacker could auto initialize with something like: window.document.execCommand("SelectAll");)
onSelectionChange() (user needs to select some text – attacker could auto initialize with something like: window.document.execCommand("SelectAll");)
onSelectStart() (user needs to select some text – attacker could auto initialize with something like: window.document.execCommand("SelectAll");)
onStart() (fires at the beginning of each marquee loop)
onStop() (user would need to press the stop button or leave the webpage)
onStorage() (storage area changed)
onSyncRestored() (user interrupts the element’s ability to play its media as defined by the timeline to fire)
onSubmit() (requires attacker or user submits a form)
onTimeError() (user or attacker sets a time property, such as dur, to an invalid value)
onTrackChange() (user or attacker changes track in a playList)
onUndo() (user went backward in undo transaction history)
onUnload() (as the user clicks any link or presses the back button or attacker forces a click)
onURLFlip() (this event fires when an Advanced Streaming Format (ASF) file, played by a HTML+TIME (Timed Interactive Multimedia Extensions) media tag, processes script commands embedded in the ASF file)
seekSegmentTime() (this is a method that locates the specified point on the element’s segment time line and begins playing from that point. The segment consists of one repetition of the time line including reverse play using the AUTOREVERSE attribute.)
So when a client requests some data from a server, the server breaks down the data in smaller parts which are called data packets. So how data packets know where they have to go? What port they have to reach? How will the client know who sent the data? Blah! Blah!
This is where Headers come into play. A data packet has to carry some information which is necessary for the transmission and this information is what we call a Header.
Today we are going to talk about the TCP Header. The size of a TCP Header can range from 20 bytes to 60 bytes.
So what kind of information does the header contain?
Let’s take a look at this representation of TCP Header,
Types of TCP Headers
Now let’s see what this all weird stuff means,
1. Source Port: This indicates the port which sent the data packet.
2. Destination Port: It indicates the port which is supposed to receive the data packet.
3. Sequence Number: It used to identify and reassemble the received data packets on the client side.
If you have no idea what the hell I just said then click here
3. Data Offset: It tells the receiver where data is present in the data packet to the client can directly jump to the data. Basically, its function is to tell where the header ends and data (which is meant to be sent and received) begins.
5. Control Flags: These are used to indicate the nature of the data packet.
URG (Urgent Flag): It is used when we need to prioritize a data packet.
ACK (Acknowledgement Flag): It is used in TCP 3 way handshake. (You will read about it later in the article)
PSH (Push Flag): It is used to when we need to send the data packets immediately and is mainly used in streaming (where we need continuity)
RST (Reset Flag): It is used to reset the connection.
SYN (Synchronize Flag): It is used in TCP 3 way handshake.
FIN (End Of Data): It indicates the end of connection like when a download is complete the sender (server) sends a FIN Flagged packet and connection is terminated
There are 3 other flags too but we are only discussed the standard 6.
6. Urgent Pointer: It points to the end of “urgent” data in the packet. It only used when there is a URG Flag on the data packet.
7. Checksum: This field is used by the receiver to verify the integrity of the data. If the check fails, the receiver rejects the data.
8. Window Size: It is the maximum amount of received data, in bytes, that can be buffered at one time on the receiving side of a connection. The sender can send only that amount of data before waiting for an acknowledgment and window update from the receiver.
9. Reserved: It is reserved for future use. Its value is always zero.
10. Padding: It is the area of the header which is filled with zeros to ensure that the size of the header is a multiple of 32 bits where it is specific. If you are not good at maths then let me tell you, being multiple of 32 means the size of the data packet (in bits, 8 bits = 1 byte) should be divisible by 32 and that necessary for the proper processing of the data.
11. Options: It may contain additional fields which can be added to the header. (Out of the scope of this article)
TCP 3 Way Handshake
Let’s say two computers A and B want to connect to each other.
Step 1. Computer A sends a TCP data packet with the SYN flag. Step 2. Computer B receives the TCP data packet and by looking at the SYN flag it finds out that A wants to connect. Step 3. Computer B sends a TCP data packet with two flags, SYN and ACK. Step 4. Computer A receives the TCP data packet and with the SYN-ACK Flags it finds out that B has confirmed the connection. Step 5. Computer A sends a TCP data packet with ACK Flag on it. Step 6. Computer B receives the TCP data packet and by looking at the ACK flag it finds out A received its SYN-ACK Packet successfully. Step 7. A TCP connection is established.
So TCP 3 way handshake is all about SYN—>SYN-ACK—>ACK. This 3-way handshake is one of the reasons which makes TCP a reliable protocol.
So that’s all, for now, we will go deeper into networking in upcoming articles.
Till then check out other articles about networking and build a good base.
So, thank you for reading our article. Keep hacking and exploring!
These are some words that you will encounter often in your hacking journey and with this article, I will introduce you to the world of proxies and will clear some misconceptions too.
So let’s get started.
What Is A Proxy?
Let’s see what Wikipedia has to say about proxies,
Proxy server is a server that acts as an intermediary for requests from clients seeking resources from other servers.
Okay! It means the proxy server is a server which sits between client and server and exchanges requests made by them.
So normally (without proxies and stuff) when a client connects to a server, the connection happens to be like this
And when you (client) use a proxy, the connection becomes like this,
So why will someone add another server between his computer and the server he is trying to access?
Well there can be different reasons and some of them are:
1. Bypassing Restrictions:
It is one of the most common uses of proxies. Like if your school has banned Facebook then you can use a proxy to bypass the filter. Your computer will interact with the proxy server (not with Facebook’s server) and that proxy server will connect to Facebook and you will be able to use Facebook. *Like A Boss*
And it can be used to bypass Geographical Restrictions too. Like if a website is banned in India I may use another country’s proxy server to bypass this filter.
2. For Anonymity:
One may use a proxy if he wants to hide his IP Address. Theoretically, the proxy is interacting with the target server at the behalf of the user so his IP Address is safe.
3. For Faster Browsing: If a proxy server has cached resources (like webpages) that you will need, it can give you a faster browsing experience.
Types Of Proxies:
On The Basis Of Protocols Used: 1. HTTP: As its name suggests it used for browsing
2. HTTPS: Another proxy type for browsing but the connection is encrypted in this one.
3. SOCKS4: It can be used as a proxy for browsing as well as for another program which uses the TCP protocol.
4. SOCKS5: a Better version of SOCK4 which supports TCP as well as UDP protocol. It also supports authentication mechanisms and Domain Name Resolution (DNS).
On The Basis Of Anonymity
Transparent Proxy: This kind of proxy will identify itself as a proxy server and your IP Address will be visible to the target server through HTTP headers. So it doesn’t provide any kind of anonymity.
Anonymous (Elite) Proxy: It identifies itself as a proxy server too but it doesn’t include your IP Address in the HTTP Header.
Distortion Proxy: It identifies itself as a proxy server too but it includes a wrong IP Address (not yours) in the HTTP Header.
High Anonymous Proxy: It doesn’t identify itself as a proxy server and it doesn’t include your IP Address in the HTTP Header.
How To Use A Proxy?
1. Open Menu and click on Preferences
3. Go to Advanced–>Network and click settings
4. Select Manual and add your proxy
Save your changes and you are ready to go.
Is it safe to use a proxy?
I will not answer this question, keep reading and decide yourself.
If the owner of a proxy server has malicious intents he can easily steal your confidential information (like usernames and passwords). He can redirect you to malicious websites and can install the malware in your computer. Scary huh?
Do you just want to hide your IP Address? Great.
Suppose you hacked a website while using a proxy, admin of the target website will have the IP Address of the proxy server in logs.
That admin will contact the police and will give them the IP Address of the proxy server.
Police will contact the admin of the proxy server and then he will give your IP Address to police and will get caught.
Well, we can’t say which proxy is secure and which proxy is not but there are a few things you can keep in mind like never use a proxy given by someone or from a website which is infamous.
Prefer HTTPS proxies over HTTP, SOCKS are even better.
Use Highly Anonymous or Distortion proxies. We recommend using proxy servers from Russia because privacy laws are better there.
So, guys, this was my attempt to introduce you to the world of proxies.
Now if you wish to use a proxy then you can get them from following websites:
Understanding of Domain Name System, IP & MAC Address
I hope you have read my previous article which was about how data is sent from one computer to another.
So every person has an identity by using which other people can identify him. And that identity is called as Domain Name System. So let’s begin to learn more about this.
When a computer is manufactured, they are given a serial number to their Network Adapter or NIC (Network Interface Card) called MAC Address. A MAC Address looks like this 00:A0:C9:24:C3:
It is used to identify devices in a LAN.
But when a device (mobile/computer) is connected to the internet then MAC Address can’t be used to identify it. It gets a new identity called IP address. Didn’t get it?
When we have to send and receive something from a person who is far away, we need his address, right?
Well in case of internet an address is called an IP Address. and here is how an IP Address looks like 18.104.22.168.
But it looks too weird for an address right? It looks familiar to a phone number and the human brain is bad at memorizing meaningless things for long.
Domain Name System (DNS)
So someone developed a system called the Domain Name System. DNS is like a phone book, like a phone book stores numbers with respect to names, so we do not have to memorize all those digits. A DNS does exactly the same, it assigns a name called Domain to every IP address. A domain looks like example.com or xyz.in etc.
So whenever we want to go to a website, we enter its domain and then DNS changes it in a computer readable address (IP Address).
Let me explain this process in detail with a graphic
So I want to visit WebsiteYouWantToVisit.com and I entered its domain in my browser so what happens behind the scenes is:
Your PC then asks your DNS server (Your ISP’s DNS server or some custom server) for the IP address of the server hosting the domain you want to go to.
Your ISP’s DNS server checks the root DNS servers to find out which servers know about the domain you want to visit.
ISP’s DNS server then asks that DNS server for the domain you want IP information of. When it receives the information its stores the information for future use (and this process is called caching) and then returns it to your PC.
Your browser connects to this IP address and asks for a web page.
Your computer then stores the domain name and its respective IP address so it does not have to look it up in DNS Server. The cache of this information is called DNS Cache and hackers can use to perform an attack called DNS Cache Poisoning.
That’s all for now. Thanks for reading.
The server is a device that provides services. It is mostly a computer which contains the files of a website and sends those files when a user requests for them.
When you enter a URL in your address bar you are asking for that page to show and it’s not a website which contains the page, it is a computer which has that page stored and this computer is called Server. But its not only limited to websites, but it can also be any device which provides services/information.
In simple words, a computer which uploads data for users is called a server.
A user of a service is called Client. You are downloading stuff? You are a client. Do you visit a web page? You are a client. That’s pretty simple, A computer which downloads something from a server is called a Client.
Whenever we do something the software has to do some processing right? Yep, and it takes time. But some programs/devices have a feature that can store information about the tasks that the user does often so it can give faster results when the same task is requested by the user.
This process is called Caching and the stored data is called Cache.
Now that’s a delicious word but a cookie means something totally different in case of networking.
Let’s take an example, I am using Facebook and my mom calls me for lunch so I turn off my data connection and I turn it on after sometime after lunch
Now I open Facebook again and here is what happens: Me: Opens Facebook Facebook: Login to continue Me: Wtf man? It’s me Manal! Do I need to log in every time? I mean this is a really annoying mate. Facebook: But this is a security check, sir! But if you find it annoying when you can show us a cookie instead. Me: Cookie? What’s that? Facebook: Every time you log into your Facebook Account we send a small piece of data to you called Cookie. It helps us to identify that it’s you. Me: Oh that’s cool.
Well yeah, this is what a cookie does, it is sent by a website and stored in your browser. It tells the website about the previous interactions you have made with the website so the website can provide you better services.
5. Address Resolution Protocol (ARP)
Do you guys know what is a LAN? Well “A group of computers which share a common Internet connection is called Local Area Network.” So if 3 computers use the same router they are on LAN.
But there is something interesting about LAN when two computers in a LAN want to connect to each other then IP Address is not sufficient, we need MAC Address too. But as I told you before that when a data packet is sent it contains IP Address and Port number but not the MAC Address. So how they can know MAC Addresses of each other? Well, that’s where Address Resolution Protocol comes into play.
Let’s imagine two computers A and B are in a LAN and Computer A wants to connect to Computer B so can A connect directly to B? No. They have to verify if this is the same computer they want to connect to.
Let’s see how it works:
1. Computer A sends an ARP request it’s like asking “Hi! I was looking for a computer with IP Address 192.168.42.4 and I think that’s you! And it looks like we are in a LAN so can you please tell me whats your MAC Address?
2. Computer B sends him a confirmation like “Yeah bro! That’s me and here is my MAC Address”.
3. Computer A “Yeah now we can establish a connection” and then Computer A builds a cache where it can store the MAC Address of Computer B so that it can connect faster next time.
This is what ARP does, it asks for MAC Address before connection if the target computer is in LAN.
I hope you guys enjoyed this article about networking terms.
Thanks for reading. Hope you share this article and comment down if you want more articles like this(Networking Terms).