Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 41 guests online
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Other
converting IP adresses
EH-Net
May 21, 2013, 05:06:06 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Ethical Hacking Discussions and Related Certifications
>
Other
(Moderator:
don
) >
converting IP adresses
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: converting IP adresses (Read 6928 times)
0 Members and 1 Guest are viewing this topic.
Dutchie
Newbie
Offline
Posts: 33
converting IP adresses
«
on:
June 18, 2010, 04:30:12 AM »
Next week I will sit for my CEH examen. I'm still struggling with converting IP adresses from decimal to normal expression of the IP-adress, for instance
the decimal IP = 340590649
converted to normal expression should give: 203.2.4.5
How is this been calculated with a normal calculator?
What's the scientific method for converting?
Thanks for feedback,
Logged
RA, CISA, CISSP, C|EH, C|HFI, CWSP, LPIC-1
UNIX
Hero Member
Offline
Posts: 1235
Re: converting IP adresses
«
Reply #1 on:
June 18, 2010, 04:55:48 AM »
Did you already search for tutorials/ explanations? You'll find quite a few explanations when googling for it. Is there a specific part or step where you have difficulties in understanding?
Logged
Data_Raid
Full Member
Offline
Posts: 165
Re: converting IP adresses
«
Reply #2 on:
June 18, 2010, 06:51:19 AM »
Quote from: Dutchie on June 18, 2010, 04:30:12 AM
Next week I will sit for my CEH examen. I'm still struggling with converting IP adresses from decimal to normal expression of the IP-adress, for instance
the decimal IP = 340590649
converted to normal expression should give: 203.2.4.5
How is this been calculated with a normal calculator?
What's the scientific method for converting?
Thanks for feedback,
The address
340590649
340590949 is expressed in decimal (dotless long format), if you then convert that address to hex you should get: CB020405
Since the IP address consists of 4 octets each part of the address is represented as:
CB (203) 02 (2) 04 (4) 5 (5)
If you want to convert to the long decimal URL:
linux.org= 198.182.196.56
Convert to HEX: 198 (C6) 182 (B6) 196 (C4) 56 (38)
http://0xC6B6C438
Convert HEX to Decimal: C6B6C438 = 3333866552 (decimal, dotless address)
http://3333866552
*Note: this only works with some browsers like IE, and this won't work with Firefox. Your results may vary though.
HTH
*edit: modified dotless address
«
Last Edit: June 18, 2010, 02:23:31 PM by Data_Raid
»
Logged
All men by nature desire knowledge.
Aristotle
Dutchie
Newbie
Offline
Posts: 33
Re: converting IP adresses
«
Reply #3 on:
June 18, 2010, 08:34:53 AM »
Thanks Data_Raid for your constructive reply.
But as this is a valid question from the exam, they're expecting that we know all the Hex-notations by head? Can't be true!
Isn't there another method?
Logged
RA, CISA, CISSP, C|EH, C|HFI, CWSP, LPIC-1
jimbob
Guest
Re: converting IP adresses
«
Reply #4 on:
June 18, 2010, 09:32:35 AM »
Quote from: Dutchie on June 18, 2010, 08:34:53 AM
But as this is a valid question from the exam, they're expecting that we know all the Hex-notations by head? Can't be true!
Isn't there another method?
This is still by far the easiest way to do it. If you have a good scientific calculator it should support hexadecimal, which makes converting to hex and back again easy.
Knowing how to do hex arithmetic is a useful skill. If you're only covering 8-bit numbers you only need work with numbers in the rannge of 0x00-0xFF or 0-255 in decimal. Don't beat yourself up over it though, it does not come naturally to most and taking a minute doing a simple sum in your head can be time well spent.
Jim
Logged
ziggy_567
Sr. Member
Offline
Posts: 361
Re: converting IP adresses
«
Reply #5 on:
June 18, 2010, 09:37:50 AM »
Converting hex to decimal is fairly simple multiplication. In the previous example CB represents 203. Here's how you get that:
Dec Hex
0 0
1 1
2 2
3 3
4 4
5 5
...
A 10
B 11
C 12
D 13
E 14
F 15
Hex is base 16, which means that each digit is a multiple of 16 rather than 10 (decimal). In other words, 203 is equal to (2*10*10) + (0*10) + (3*1). In Hex you say (C*16) + (B*1). C represents 12 so C*16 is 12*16 which equals 192. B represents 11, so 192+11=203.
HTH
Logged
--
Ziggy
eCPPT - GSEC - GCIH - GCUX - RHCE - SCSecA - Security+ - Network+
Dutchie
Newbie
Offline
Posts: 33
Re: converting IP adresses
«
Reply #6 on:
June 18, 2010, 09:39:49 AM »
With the help of Data_Raid and the advice from Awesec to google, it seems that I got the method to convert. But my outcome is not what I expect. I do not seem to discover where I got wrong. It's for sure in the stage of converting decimal to hex!
So I will detail my outcome, maybe someone can review it and point me to my mistake:
decimal 340590649
340590649/16 21.286.915 rest 9 this is in hex 9
21286915/16 1.330.432 rest 3 hex 3
1330432/16 83.152 rest 0 hex 0
83152/16 5.197 rest 0 hex 0
5197/16 324 rest 13 hex D
324/16 20 rest 4 hex 4
20/16 1 rest 4 hex 4
1/16 0 rest 1 hex 1
so in hex this gives: 144D0039
but the correct answer is: CB020405
Pls can someone review this and give me feedback!
«
Last Edit: June 18, 2010, 09:46:19 AM by Dutchie
»
Logged
RA, CISA, CISSP, C|EH, C|HFI, CWSP, LPIC-1
Ignatius
Jr. Member
Offline
Posts: 91
Re: converting IP adresses
«
Reply #7 on:
June 18, 2010, 12:49:26 PM »
I thought I was going crazy when I started to work through this myself. I *thought* I knew how to do it ... but the maths just didn't work out.
The problem is that the decimal IP quoted (340590649) converts to
0x144D0039. However, 3405906
9
49 converts to 0xCB020405.
I confirmed this by using calc.exe in Scientific mode, rather than manually.
«
Last Edit: June 18, 2010, 12:51:47 PM by Ignatius
»
Logged
Dutchie
Newbie
Offline
Posts: 33
Re: converting IP adresses
«
Reply #8 on:
June 18, 2010, 12:56:03 PM »
Chapeau Ignatius,
Now I can be sure that my calculations were right.
The fault is within the question and it came from an official and recommended instance!!
Great you solve the "bug" completely!!
Thanks!!
Now doubt any more over here concerning converting IP adresses!!
Logged
RA, CISA, CISSP, C|EH, C|HFI, CWSP, LPIC-1
Data_Raid
Full Member
Offline
Posts: 165
Re: converting IP adresses
«
Reply #9 on:
June 18, 2010, 02:21:19 PM »
I just checked my calculations again:
144D0039 is 340590
6
49
and CB020405 is 3405906
9
49 which is the correct address.
I can't recall my steps but 3405906649 never worked out in binary and I was scratching my head, and I tried another method, I possibly worked back from the IP address to binary and then to HEX hence my original HEX value was correct
with a simple conversion 3405906949 works out fine in binary:
11001011 00000010 00000100 00000101
«
Last Edit: June 18, 2010, 02:25:36 PM by Data_Raid
»
Logged
All men by nature desire knowledge.
Aristotle
ziggy_567
Sr. Member
Offline
Posts: 361
Re: converting IP adresses
«
Reply #10 on:
June 18, 2010, 03:20:37 PM »
Here's another tip.
The C|EH is multiple choice, so you don't necessarily have to be able to go both ways to pass the test. (I understand that this doesn't help you learn for the sake of learning) But, the easiest (for me at least) solution is to work from the IP address to hex to binary to decimal. So no matter which way they ask the question, since I have all the possible answers, I can get to the correct answer fairly quickly by a process of elimination if they ask me to go from decimal to IP.
HTH
Logged
--
Ziggy
eCPPT - GSEC - GCIH - GCUX - RHCE - SCSecA - Security+ - Network+
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
SANSFIRE 2013
June 15 - 22
5% Off
w/ Code
:
EHN_5
SANS Deals 4 EH-Netters
5% OFF
Any
SANS Course
in Any Format!
Coupon Code:
EHN_5
Including
SANS Rocky Mountain 2013
&
SANS Boston 2013
Polls
Compared to this year, 2013 will be:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
Programming
: Finished Python Course in Codecademy now what?
(13) by
securitian
Network Pen Testing
: Ruby on Rails Vulnerabilities/Attacks in BackTrack 5 r3
(0) by
SUdoctstudent
Network Pen Testing
: De-ICE 1.140 released!
(2) by
superkojiman
Network Pen Testing
: AIX Vulnerability Assessments
(1) by
3xban
General Certification
: CPT Practical Submission
(1) by
UNIX
OSCP - Offensive Security Certified Professional
: Failed my first attempt at the OSCP exam
(94) by
azmatt
Tools
: Social-Engineer Toolkit (SET) Version 5.0 “The Wild West” Released
(2) by
m0wgli
Malware
: EICAR?
(3) by
UKSecurityGuy
Advisories
: HTB23154: Multiple Vulnerabilities in Exponent CMS
(0) by
AndyP
Advisories
: HTB23153: Multiple Vulnerabilities in Jojo CMS
(0) by
AndyP
Advisories
: HTB23151: Cross-Site Request Forgery (CSRF) in UMI.CMS
(0) by
AndyP
Tutorials
: Need guidance
(8) by
r0ckm4n
OSCP - Offensive Security Certified Professional
: Class Scheduled 6/8 - Linux n00b
(7) by
Taemyks
OSCP - Offensive Security Certified Professional
: OSCP exam scheduled
(6) by
gbhat
Incident Response
: LinkedIn Forensics
(0) by
AFENTIS_Forensics
General Certification
: Red Team/Blue Team
(1) by
ajohnson
Career Central
: Starter cert?
(3) by
Grendel
Network Pen Testing
: Beginner Ethical Hacker
(1) by
m0wgli
Web Applications
: Nessus and Nikto
(4) by
Seen
Network Pen Testing
: Cracking salted MD5 hash
(4) by
n37sh@rk
CEH - Certified Ethical Hacker
: Passed my C|EH
(3) by
n37sh@rk
Mass Media
: EC-council hacked, irony at his best?
(0) by
j0rDy
Web Applications
: SQL Injection into an INSERT statement.
(6) by
eyenit0
Network Pen Testing
: Solution for sipXtapi INVITE Message CSeq Field Header Remote Overflow
(1) by
m0wgli
Web Applications
: dns
(2) by
H1t M0nk3y
Other
: BSides Boston
(0) by
3xban
Career Central
: InfoSec in Central, FL
(2) by
tturner
Web Applications
: Web vulnerability scanner
(4) by
H1t M0nk3y
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.