Click here to Skip to main content
15,891,607 members
Articles / Web Development / HTML5
Tip/Trick

IP Address & URL Encoder

Rate me:
Please Sign up or sign in to vote.
4.29/5 (5 votes)
19 Jan 2015CPOL2 min read 22.2K   506   10   1
Non Printing Characters are invalid when placing it in URL field. These characters may include &, ^, % signs, etc. most Web Platforms somehow have ways to encode and decode this escaped format. This program is design to develop a Logic for Encoding and Decoding the URL, IP Address and HTML Attribute

Introduction

URL (Uniform Resource Locator) encoding is normally performed to convert data passed via HTML forms, Different links, addresses that have been received via Email Attachments, MMS Messages, Instant Messages, Blogs, Forums can be used to trick users in order to compromise their systems. This program is deliberately made for identifying forge URL addresses, Encoded IP Addresses.

Image 1

Background

Some Common Special Characters
Here's a table of some often used characters and their URL encodings:

Character

URL Encoded

; %3B
? %3F
/ %2F
: %3A
# %23
& %26
= %3D
+ %2B
$ %24
, %2C
<space> %20 or +
% %25
< %3C
> %3E
~ %7E
% %25

Using the Code

C++
double firstans1  = firstoct * 16777216;
double secondans2 =    secct * 65536;
double thridans   = thridoct * 256;
double forthans   = ourthoct;

double answer = firstans1 + secondans2 + thridans + forthans;

Example : (first octet * 256³) + (second octet * 256²) + (third octet * 256) + (fourth octet)

Image 2

Points of Interest

There are thousands of spammers that used encoded URL and IP address in order to redirect user to another malicious Web Page. This Encoding Program will help user to check, verify the link, Path of the URL. Some examples are shown below:

http%3A%2F%2Fwww%2Eubaidjafri%2Ecom

directed as:

http://www.ubaidjafri.com

Image 3

Another example:

http%3A%2F%2Fwww%2Eubaidjafri%2Ecom%2Fimages%2Fflag.png

directed as:

http://www.ubaidjafri.com/images/flag.png

User could be able to see the clear picture as shown in the above example, If user receives any malicious encoded link, they would be able to decode that link and check what the original link is.

History

Electronic spamming is the use of electronic messaging systems to send unsolicited messages (spam), especially advertising. As well as sending messages repeatedly on the same site.Spamming remains economically viable because advertisers have no operating costs beyond the management of their mailing lists, and it is difficult to hold senders accountable for their mass mailings.

Email spam, also known as unsolicited bulk Email (UBE), junk mail, or unsolicited commercial email (UCE), is the practice of sending unwanted email messages, frequently with commercial content, in large quantities to an indiscriminate set of recipients. Spam in email started to become a problem when the Internet was opened up to the general public in the mid-1990s. It grew exponentially over the following years, and today composes some 80 to 85% of all the email in the world, by a "conservative estimate".

Increasingly, Email spam today is sent via "zombie networks", networks of virus- or worm-infected personal computers in homes and offices around the globe. Many modern worms install a backdoor which allows the spammer to access the computer and use it for malicious purposes. This complicates attempts to control the spread of spam, as in many cases the spam does not obviously originate from the spammer. In November 2008, an ISP, McColo, which was providing service to botnet operators, was depeered and spam dropped 50%-75% Internet-wide.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Information Security Expert

Comments and Discussions

 
Question[My vote of 2] prevent XSS Pin
Member 382109322-Jan-15 3:13
Member 382109322-Jan-15 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.