<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zero Intellect &#187; Security</title>
	<atom:link href="http://www.zerointellect.com/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zerointellect.com</link>
	<description>Technology Blog requiring Zero Intellect to follow !!!</description>
	<lastBuildDate>Mon, 28 Jun 2010 14:09:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Nslookup command overview</title>
		<link>http://www.zerointellect.com/networking/nslookup-command-overview/</link>
		<comments>http://www.zerointellect.com/networking/nslookup-command-overview/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 06:00:27 +0000</pubDate>
		<dc:creator>zrydento</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tool Zone]]></category>
		<category><![CDATA[CNAME]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[DNS record]]></category>
		<category><![CDATA[fully qualified domain name]]></category>
		<category><![CDATA[ls command]]></category>
		<category><![CDATA[lserver]]></category>
		<category><![CDATA[MX]]></category>
		<category><![CDATA[mx record]]></category>
		<category><![CDATA[NS]]></category>
		<category><![CDATA[nslookup]]></category>
		<category><![CDATA[PTR]]></category>
		<category><![CDATA[query refused]]></category>
		<category><![CDATA[querytype]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[system32]]></category>
		<category><![CDATA[type]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[zone transfer]]></category>

		<guid isPermaLink="false">http://www.zerointellect.com/?p=286</guid>
		<description><![CDATA[<p> </p>
<p>Nslookup.exe (abbreviation for name server lookup) is a command line utility used for testing and troubleshooting DNS servers. It is built into Unix (including Linux and variants) and Windows. The main purpose of the utility is to query DNS servers to find DNS details, MX records for a domain, NS servers of a domain</p>
<p>In Windows, Nslookup.exe <p>Continue reading <a href="http://www.zerointellect.com/networking/nslookup-command-overview/">Nslookup command overview</a></p>]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>Nslookup.exe (abbreviation for name server lookup) is a command line utility used for testing and troubleshooting DNS servers. It is built into Unix (including Linux and variants) and Windows. The main purpose of the utility is to query DNS servers to find DNS details, MX records for a domain, NS servers of a domain</p>
<p>In Windows, Nslookup.exe is automatically installed along with the TCP/IP protocol installation which is done by default during a new Windows installation or setup. The actual executable lies in the system directory <strong>c:\windows\system32 directory</strong> by default in Windows XP and most other versions of Windows.</p>
<p> </p>
<p><strong>To get started with Nslookup.exe, the following prerequisites need to be present: </strong></p>
<p>The TCP/IP protocol must be installed on the computer that you want to execute the Nslookup command without which the command will not be available</p>
<p>When you run the ipconfig /all command, at least one DNS server should exist in the list of DNS servers</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/09122009-diagram-1-1.png" alt="" width="505" height="309" /></p>
<p> </p>
<p>The Nslookup command always devolves (delegates from) the domain name from the current context (depending on the DNS Server settings listed). If you fail to use a fully qualified domain name, i.e. ending the domain name with a trailing dot (.), the first query will append the DNS settings to your query domain name. For example, if you have your DNS settings listed as <strong>xyz.com</strong> and you run a query for <strong>www.bing.com</strong>, the actual query will go out as <strong>www.bing.com.xyz.com</strong> because of you entering an unqualified query. However, if you were to query for <strong>www.bing.com. </strong>[with the trailing dot (.)], then the query would rightly go out to <strong>www.bing.com</strong> only (diagram below). This strange behavior is specific to the Microsoft version of the Nslookup command. I do not know of how Nslookup behaves while run with other vendors.</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/09122009-diagram-1-2.png" alt="" width="450" height="350" /></p>
<p> </p>
<p>If the DNS search list is being used in the Domain suffix search order in TCP/IP advanced properties DNS tab (diagram below), devolution will not take place. The query will be appended to the domain suffixes specified in the list. To override the search list, always use the Fully Qualified Domain Name in your query.</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/09122009-diagram-1-3.png" alt="" width="550" height="632" /></p>
<p> </p>
<p>The command can be used directly (<strong>non-interactive</strong> mode) or with subcommands (<strong>interactive</strong> mode). Using Nslookup.exe in the non-interactive mode is useful when we just need the output of a specific query and only a single value needs to be returned. But when we need to get the output for multiple queries and actions it is better to use the interactive mode</p>
<p> </p>
<p>The syntax of Non Interactive Mode is as follows:</p>
<p> </p>
<blockquote><p><strong>nslookup [-option] [hostname] [server]</strong></p>
<p> nslookup [-opt ...]                          # interactive mode using default server</p>
<p>nslookup [-opt ...] &#8211; server          # interactive mode using &#8216;server&#8217;</p>
<p>nslookup [-opt ...] host                 # just look up &#8216;host&#8217; using default server</p>
<p>nslookup [-opt ...] host server    # just look up &#8216;host&#8217; using &#8216;server&#8217;</p>
<p>Option refers to the various options that are available covered below</p>
<p>Hostname refers to the query that we need information on</p>
<p>Server refers to the DNS server to be used to search for the host</p></blockquote>
<p> </p>
<p> Look at the following output from a unix and windows based host</p>
<p> </p>
<p><strong>Command line output (without subcommands)</strong></p>
<p> </p>
<blockquote><p><strong>UNIX</strong></p>
<p>unix% nslookup example.com</p>
<p>Server:        192.168.1.1<br />
Address:    192.168.1.1#53</p>
<p>Non-authoritative answer:</p>
<p>Name:    example.com<br />
Address: 202.7.18.16</p>
<p> </p>
<p><strong>Windows</strong></p>
<p>C:\&gt;nslookup microsoft.com.</p>
<p>Server:  PQRTVXXXXD002DNS076<br />
Address:  210.213.34.3</p>
<p>Non-authoritative answer:</p>
<p>Name:    microsoft.com<br />
Addresses:  207.46.197.32, 207.46.232.182</p></blockquote>
<p> </p>
<p><strong>Using subcommands (unix example)</strong></p>
<p> </p>
<blockquote><p><strong>nslookup</strong></p>
<p><strong>&gt; server ns1.com</strong></p>
<p>Default Server:  ns1.com<br />
Address:  172.204.22.25</p>
<p>&gt; set<br />
&gt; example.com</p>
<p>Server:  ns1.com<br />
Address:  202.7.18.16</p>
<p>example.com   MX preference = 10, mail exchanger = mail.example.com<br />
&gt; exit</p></blockquote>
<p> </p>
<p>After entering the interactive mode, typing ? or help will reveal all the options that are available</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/09122009-diagram-1-4.png" alt="" width="550" height="371" /> </p>
<p>To interrupt interactive commands, press CTRL+C. To exit interactive mode and return to the command prompt, type exit at the command prompt. A number of different options can be set in Nslookup.exe by running the set command at the command prompt. A complete listing of these options is obtained by typing set all.</p>
<p> </p>
<p><strong>Looking up different data types: type and querytype</strong> </p>
<p>We will discuss the two options, type and querytype that belong to the set command. To look at different query type options within the domain name space, we use the set type or set querytype command at the command prompt. Both of them are exactly the same and are interchangeable. For example, to query for mail exchanger records (mail server details) of a particular domain like yahoo.com, we can type the following:</p>
<p> </p>
<blockquote><p><strong>C:\&gt;nslookup</strong></p>
<p>&gt; set q=mx<br />
&gt; yahoo.com.</p>
<p>Server:  google-public-dns-a.google.com<br />
Address:  8.8.8.8</p>
<p>Non-authoritative answer:<br />
yahoo.com       MX preference = 1, mail exchanger = a.mx.mail.yahoo.com<br />
yahoo.com       MX preference = 1, mail exchanger = b.mx.mail.yahoo.com<br />
yahoo.com       MX preference = 1, mail exchanger = c.mx.mail.yahoo.com<br />
yahoo.com       MX preference = 1, mail exchanger = e.mx.mail.yahoo.com<br />
yahoo.com       MX preference = 1, mail exchanger = f.mx.mail.yahoo.com<br />
yahoo.com       MX preference = 1, mail exchanger = g.mx.mail.yahoo.com</p></blockquote>
<p> </p>
<p>The first time a remote host is queried, the local DNS server contacts the DNS server that is authoritative for that domain. The local DNS server will then cache that information, so that subsequent queries are answered nonauthoritatively out of the local server&#8217;s cache. The first time a query is made for a remote name, the answer is authoritative, but subsequent queries are nonauthoritative.</p>
<p> </p>
<p><strong>Querying another name server directly: server  and lserver</strong></p>
<p>If we wanted to use another DNS server on the internet to send our queries, we can use the server or lserver commands. For example, using the DNS server 8.8.8.8 that is the Google Public DNS server</p>
<p> </p>
<blockquote><p><strong>C:\&gt;nslookup</strong></p>
<p>Default Server:  nameserver1.example.com<br />
Address:  10.1.2.3</p>
<p>&gt; server 8.8.8.8<br />
Default Server:  google-public-dns-a.google.com<br />
Address:  8.8.8.8</p></blockquote>
<p> </p>
<p>The difference between the <strong>server</strong> and <strong>lserver</strong> commands is that the server command is uses the current default server to get the address of the server to switch to, whereas the lserver uses the local server to get the same address. For example, if you have a broadband connection and get a DHCP IP address from your ISP, you would also automatically get some DNS servers (assume dns1.isp1.com), the lserver command forces the usage of these local dns servers that were retrieved from your ISP. However, while using the Nslookup.exe command, if you earlier changed the DNS server that is used to query for other domains (assume you changed it to dns1.somefreedns.com), the server command would use the current default server (dns1.somefreedns.com) and not the local dns servers (dns1.isp1.com)</p>
<p> </p>
<p><strong>Zone Transfers : LS command</strong></p>
<p>Nslookup.exe can be used to transfer an entire zone by using the ls command. The best use of this command is if you want to store a list of all host names within a particular remote domain into a local file (example below)</p>
<p> </p>
<p>The syntax of this command is</p>
<p> </p>
<blockquote><p><strong>ls [opt] DOMAIN [&gt; FILE] &#8211; list addresses in DOMAIN (optional: output to FILE)<br />
</strong>    -a          -  list canonical names and aliases<br />
    -d          -  list all records<br />
    -t TYPE     -  list records of the given type (e.g. A,CNAME,MX,NS,PTR etc.)</p></blockquote>
<p> </p>
<p>Using ls with no arguments will return a list of all address and name server data. The -a switch will return alias and canonical names, -d will return all data, and -t will filter by type.</p>
<p> </p>
<blockquote><p><strong>&gt;ls example.com</strong></p>
<p>[nameserver1.example.com]</p>
<p>nameserver1.example.com.    NS     server = ns1.example.com<br />
nameserver2.example.com     NS     server = ns2.example.com<br />
nameserver1                            A      10.0.0.1<br />
nameserver2                            A      10.0.0.2</p></blockquote>
<p> </p>
<p>While this is obviously a security issue, zone transfers can be blocked at the DNS Server level and this would be the case most of the time on the internet (unless someone foolish enough would like you to see his internal structure and naming conventions). This command is useful if we want to see the structure of hosts within a LAN environment. If zone transfers have been blocked, we would get output like the following</p>
<p> </p>
<blockquote><p><strong>&gt; ls google.com.<br />
*** Can&#8217;t list domain example.com.: Query refused</strong></p></blockquote>
<p> </p>
<p>When we want to send the output to a file (the file will be saved in the location that was mentioned in the command prompt before the nslookup command was started, we can do so as follows</p>
<p> </p>
<blockquote><p><strong>&gt; ls google.com. &gt; lsoutput.txt<br />
Received 0 records.<br />
*** Can&#8217;t list domain google.com.: Query refused</strong></p></blockquote>
<p> </p>
<p>In the following example below, we want to view all mail server records within a particular domain and store the output to a file</p>
<p> </p>
<blockquote><p><strong>&gt; ls –t MX google.com. &gt; lsoutput.txt<br />
Received 0 records.<br />
*** Can&#8217;t list domain google.com.: Query refused</strong></p></blockquote>
<p> </p>
<p>In this article the Nslookup command was covered. While this was just a brief overview, there are many other issues like troubleshooting and whether using Nslookup itself is recommend which will be covered in future articles</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerointellect.com/networking/nslookup-command-overview/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Preventing Smurf attacks by stopping IP directed broadcasts</title>
		<link>http://www.zerointellect.com/security/preventing-smurf-attacks-by-stopping-ip-directed-broadcasts/</link>
		<comments>http://www.zerointellect.com/security/preventing-smurf-attacks-by-stopping-ip-directed-broadcasts/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 15:56:03 +0000</pubDate>
		<dc:creator>zrydento</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[access list]]></category>
		<category><![CDATA[acl]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[denial of service]]></category>
		<category><![CDATA[icmp]]></category>
		<category><![CDATA[ip forward-protocol]]></category>
		<category><![CDATA[no ip directed-broadcast]]></category>
		<category><![CDATA[smurf attack]]></category>

		<guid isPermaLink="false">http://www.zerointellect.com/?p=213</guid>
		<description><![CDATA[<p> </p>
<p>An IP Directed broadcast gives the sender the capability to send a packet and broadcast it to the entire network. An example of a network broadcast address for the classful network ID 140.101.0.0/16 is 140.101.255.255. When Cisco introduced this command in IOS version 10.0, they did not realize the ramifications of enabling directed broadcasts which enabled <p>Continue reading <a href="http://www.zerointellect.com/security/preventing-smurf-attacks-by-stopping-ip-directed-broadcasts/">Preventing Smurf attacks by stopping IP directed broadcasts</a></p>]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>An IP Directed broadcast gives the sender the capability to send a packet and broadcast it to the entire network. An example of a network broadcast address for the classful network ID 140.101.0.0/16 is 140.101.255.255. When Cisco introduced this command in IOS version 10.0, they did not realize the ramifications of enabling directed broadcasts which enabled users to launch DOS attacks like the ICMP Smurf attack. In version 12.0 of the IOS, they made amends by changing the default behavior of dropping all directed broadcasts by default.</p>
<p>To understand what attackers can do if IP directed broadcasts are left enabled, we need to understand what a Smurf attack is and how it works</p>
<p><strong>SMURF Attacks</strong></p>
<p>These are a type of Denial of Service attack where the attacker sends source packets with a spoofed source IP address that belongs to the host that is being targeted in the attack. Now if the router is enabled for sending IP directed broadcasts, these ICMP packets will be sent to all hosts in the network. Now imagine that there are 100 active hosts in that network and then imagine all of them simultaneously sending ICMP reply messages to the source IP address of the attacker which is nothing but the IP address of the victim. These hosts would starve the bandwidth of the network and would also deny legitimate users from accessing the victim host, thus creating a Denial of Service for the host being attacked. The diagram below explains this effectively.</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/04122009-diagram-1-5.png" alt="" width="539" height="390" /></p>
<p> </p>
<p>The only way to stop this type of a Smurf attack is by filtering the traffic that comes in at the network border. One method is to ensure that IP Directed Broadcasts are disabled and another method would be to use an ACL (which would be more cumbersome but flexible and detailed)</p>
<p>The first thing we will do is find out the version of the IOS that the router is running by typing in the <strong>show version </strong>command</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/04122009-diagram-1-1.png" alt="" width="517" height="99" /></p>
<p> </p>
<p>We see that the IOS is running version 12.4 which means that IP directed broadcasts are disabled on all interface by default. To enable or disable directed broadcasts, we first need to know of the interfaces our router has, we do that by running the command <strong>show ip interface brief</strong> and the output is as shown in the diagram below. We can see from the output below that interface FastEthernet0/0 is enabled and FastEthernet0/1 is disabled.</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/04122009-diagram-1-2.png" alt="" width="448" height="63" /></p>
<p> </p>
<p>Now to see if directed broadcasts are enabled for any of the interfaces, we need to scroll through the running configuration to see if directed-broadcasts are enabled or disabled</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/04122009-diagram-1-3.png" alt="" width="274" height="181" /></p>
<p> </p>
<p>Now since directed broadcasts are enabled on FastEthernet0/0, we will disable it. We do that by entering the no ip directed-broadcast command under the interface configuration as can be seen from the diagram below</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/04122009-diagram-1-4.png" alt="" width="492" height="65" /></p>
<p> </p>
<p><strong>So do we ever need to enable Directed broadcasts ?</strong></p>
<p>Yes, there might be certain situations where directed broadcasts are required such as DHCP. For example, if you LAN where clients in a particular network, say 33.35.22.0/24 (Vlan 33) connect to a DHCP Server (IP address 55.35.76.1) in another VLAN (Vlan 55) to receive IP dynamic IP addresses. By default the border router of VLAN 33 would not allow the DHCP server in Vlan 55 to receive any DHCP requests as well as send a DHCP reply or Dynamic IP address to any of the clients within Vlan 33.</p>
<p>In addition, the ip helper-address interface configuration command would be required to tell your Cisco router to forward DHCP requests to a central DHCP server located at 55.35.76.1. This is accomplished by the commands below</p>
<p> </p>
<blockquote><p><strong>Point all clients in Vlan 33 to the DHCP server in Vlan 55<br />
</strong>R1(config)#int FastEthernet0/0<br />
R1(config-if)#ip helper-address 55.35.76.1</p>
<p><strong>Allow DHCP using this statement</strong><br />
R1(config)#ip forward-protocol udp bootpc</p>
<p><strong>The following statements are to be included for all protocols that are not allowed<br />
</strong>R1(config)#no ip forward-protocol udp domain<br />
R1(config)#no ip forward-protocol udp echo</p></blockquote>
<p> </p>
<p>One often overlooked fact is that ip helper-address will actually forward many other UDP-based broadcasts to the address specified which might not be what you want. In such a situation, we would need to enable directed broadcasts but only specifically for the DHCP protocol (using the <strong>ip forward-protocol</strong> command and negating any other protocols that we do not want using the <strong>no ip forward-protocol</strong> command</p>
<p>To summarize, if we&#8217;ve got the latest gear (updated IOS versions), IP directed broadcasts would be disabled by default, but we need to know in what situations it needs to be enabled and for what protocols. In general few applications will make use of the IP directed broadcast as a concept, so it is should always be disabled by default and only enabled on specific interfaces for specific protocols and an alternative method is to configure access lists to permit or deny IP Directed-Broadcasts. This is not feasible however, in larger networks and enabling directed broadcasts on specific interfaces when needed for specific protocols is a better solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerointellect.com/security/preventing-smurf-attacks-by-stopping-ip-directed-broadcasts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Manipulating network routing tables with the ROUTE command</title>
		<link>http://www.zerointellect.com/security/manipulating-network-routing-tables-with-the-route-command/</link>
		<comments>http://www.zerointellect.com/security/manipulating-network-routing-tables-with-the-route-command/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 10:20:47 +0000</pubDate>
		<dc:creator>zrydento</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Tool Zone]]></category>
		<category><![CDATA[active routes]]></category>
		<category><![CDATA[hosts file]]></category>
		<category><![CDATA[network routing table]]></category>
		<category><![CDATA[networks file]]></category>
		<category><![CDATA[persistent routes]]></category>
		<category><![CDATA[route add]]></category>
		<category><![CDATA[route change]]></category>
		<category><![CDATA[route delete]]></category>
		<category><![CDATA[route print]]></category>

		<guid isPermaLink="false">http://www.zerointellect.com/?p=163</guid>
		<description><![CDATA[<p> </p>
<p>We might sometimes need to manually configure the routes in the routing table. To get a better understanding of the capabilities of the ROUTE command, its best to get started with the documentation. Hence, running a route command without any parameters gives us the syntax and documentation of this command as can be seen from the <p>Continue reading <a href="http://www.zerointellect.com/security/manipulating-network-routing-tables-with-the-route-command/">Manipulating network routing tables with the ROUTE command</a></p>]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>We might sometimes need to manually configure the routes in the routing table. To get a better understanding of the capabilities of the <strong>ROUTE</strong> command, its best to get started with the documentation. Hence, running a route command without any parameters gives us the syntax and documentation of this command as can be seen from the screen shot below and the examples below</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/30112009-diagram-2-1.png" alt="" width="550" height="469" /></p>
<p> </p>
<blockquote><p>Examples:</p>
<p>    &gt; route PRINT<br />
    &gt; route ADD <strong>157.0.0.0</strong> MASK <strong>255.0.0.0</strong>  <strong>157.55.80.1</strong> METRIC <strong>3</strong> IF <strong>2</strong><br />
       where the parameters above in bold refer to<br />
      <strong>destination</strong> , <strong>mask </strong>, <strong>gateway</strong> , <strong>metric </strong>, <strong>Interface</strong></p>
<p>If IF is not given, it tries to find the best interface for a given gateway<br />
    &gt; route PRINT<br />
    &gt; route PRINT 157*          &#8230;. Only prints those matching 157*<br />
    &gt; route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2</p>
<p>      CHANGE is used to modify gateway and/or metric only.<br />
    &gt; route PRINT<br />
    &gt; route DELETE 157.0.0.0<br />
    &gt; route PRINT</p></blockquote>
<p> </p>
<p>To get started we will print out the output of the current routing table</p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/30112009-diagram-2-2.png" alt="" width="550" height="236" /></p>
<p>The output above of the <strong>route PRINT</strong> command firstly displays the list of interfaces that are present in the local system and the type of interface, manufacturer they belong to. Under that the list of Active and Persistent routes are displayed. We can very well see that the IP address 123.236.4.217 refers to our local systems IP address and theIP address 123.236.4.1 is the default gateway</p>
<p> </p>
<p>Let us add an active route to the list of routes, we type the command</p>
<blockquote><p><strong>route ADD 123.17.17.0 MASK 255.255.255.0 123.236.4.1 METRIC 33 IF 196610</strong></p>
<p><strong>Note: 196610 is derived from the hex value 0&#215;30002 which is the interface identifier of our Local Area Network</strong></p></blockquote>
<p> </p>
<p>To verify that the route has been added with the dummy metric of 33, lets run a <strong>route PRINT</strong></p>
<p> <img src="http://www.zerointellect.com/uploads/30112009-diagram-2-3.png" alt="" width="550" height="246" /></p>
<p>We see that the route has been added as can be viewed from the screenshot (red arrow)</p>
<p> </p>
<p>The problem here is that when we reboot the pc the network 123.17.17.0 will not persist and will be removed. If we want the route to survive a reboot, we need to type in something like</p>
<blockquote><p><strong>route -p ADD 123.18.18.0 MASK 255.255.255.0 123.236.4.1 METRIC 44 IF 196610</strong></p></blockquote>
<p> </p>
<p> <img src="http://www.zerointellect.com/uploads/30112009-diagram-2-4.png" alt="" width="550" height="271" /></p>
<p>The persistent route has been added (green arrow)</p>
<p> </p>
<p>If we made an error and wanted to change the metric for this persistent route, we could run the command</p>
<blockquote><p><strong>route -p CHANGE 123.18.18.0 MASK 255.255.255.0 123.236.4.1 METRIC 55 IF 196610 </strong></p></blockquote>
<p> </p>
<p>The change in metric has been carried out below (yellow arrow)</p>
<p><img src="http://www.zerointellect.com/uploads/30112009-diagram-2-5.png" alt="" width="550" height="268" /></p>
<p> </p>
<p>To delete the persistent route we just added, we can run the command</p>
<blockquote><p><strong>route -p DELETE 123.18.18.0 MASK 255.255.255.0 123.236.4.1 METRIC 55 IF 196610 </strong></p></blockquote>
<p> </p>
<p>All symbolic names used for destination are looked up in the network database file NETWORKS. The symbolic names for gateway are looked up in the host name database file HOSTS </p>
<p>Lets take a better look at the default hosts file (the file doesn&#8217;t have an extension and needs to be opened in notepad)</p>
<blockquote><p><strong>Location: C:\WINDOWS\system32\drivers\etc\hosts</strong></p>
<p><strong># Copyright (c) 1993-1999 Microsoft Corp.<br />
#<br />
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.<br />
#<br />
# This file contains the mappings of IP addresses to host names. Each<br />
# entry should be kept on an individual line. The IP address should<br />
# be placed in the first column followed by the corresponding host name.<br />
# The IP address and the host name should be separated by at least one<br />
# space.<br />
#<br />
# Additionally, comments (such as these) may be inserted on individual<br />
# lines or following the machine name denoted by a &#8216;#&#8217; symbol.<br />
#<br />
# For example:<br />
#<br />
#      102.54.94.97     rhino.acme.com          # source server<br />
#       38.25.63.10     x.acme.com              # x client host</strong></p>
<p><strong>127.0.0.1       localhost</strong></p></blockquote>
<p>This file contains a list of all the hosts in the system, let us add a line to signify a dummy host, the line would look like</p>
<blockquote><p><strong>64.4.8.147     gotothebingwebsite</strong></p>
<p><strong>123.19.19.1     123dummygateway</strong></p></blockquote>
<p>To test if our newly added host is working, we can do a few things</p>
<p>1. Type the URL <strong>http://gotothebingwebsite</strong> in any browser and this should redirect us to the IP address 64.4.8.147 which is nothing but <a href="http://www.bing.com" target="_blank">www.bing.com</a></p>
<p>2. Ping the host gotothebingwebsite would send a ping to 64.4.8.147 as can be seen from the output below</p>
<blockquote><p><strong>C:\&gt;ping gotothebingwebsite</strong></p>
<p><strong>Pinging gotothebingwebsite [64.4.8.147] with 32 bytes of data:</strong></p>
<p><strong>Request timed out.<br />
Request timed out.<br />
Request timed out.<br />
Request timed out.</strong></p>
<p><strong>Ping statistics for 64.4.8.147:<br />
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),</strong></p></blockquote>
<p>  </p>
<p>Similarly lets look at the default networks file</p>
<blockquote><p><strong>C:\WINDOWS\system32\drivers\etc\hosts</strong></p>
<p><strong># Copyright (c) 1993-1999 Microsoft Corp.<br />
#<br />
# This file contains network name/network number mappings for<br />
# local networks. Network numbers are recognized in dotted decimal form.<br />
#<br />
# Format:<br />
#<br />
# &lt;network name&gt;  &lt;network number&gt;     [aliases...]  [#&lt;comment&gt;]<br />
#<br />
# For example:<br />
#<br />
#    loopback     127<br />
#    campus       284.122.107<br />
#    london       284.122.108</strong></p>
<p><strong>loopback                 127</strong></p></blockquote>
<p>The networks file as of now only contains a single network which is the localhost network starting with network number 127. Let us add another network starting with network number <strong>123.19.19.0<br />
</strong>Let us take a scenario where all traffic starting with <strong>123.19.19.0</strong> network, should be routed to the gateway we created earlier called <strong>123dummygateway</strong></p>
<p>To do that, we go back to the command prompt and type the command</p>
<blockquote><p><strong>C:\&gt;route ADD 123.19.0.0 MASK 255.255.254.0 123dummygateway METRIC 7</strong></p></blockquote>
<p>The use of symbolic names is useful when adding many entries to the routing table and the networks and IP addresses have to be typed many times</p>
<p> </p>
<p>We can also selective print output that we want instead of displaying the entire routing table. For example, the command below only displays routes starting with 123.18</p>
<blockquote><p><strong>route PRINT 123.18.*</strong></p></blockquote>
<p> </p>
<p>Wildcards supported are * and ? where, the &#8216;*&#8217; matches any string, and &#8216;?&#8217; matches any one character</p>
<p> </p>
<p>The last option is the -F option which is used to clear the routing tables of all gateway entries.  If this is  used in conjunction with one of the commands, the tables are  cleared prior to running the command. </p>
<p> </p>
<p>To summarize, we need to understand the route command and how the output is interpreted because it will help us in identifying any entries that are not supposed to be there or have been maliciously added to redirect traffic to specific interfaces. For example, if a malicious user is able to install a router/gateway with an IP address belonging to the same network that a company is running on and then makes an entry into a PC&#8217;s routing table (via a shell script, etc), the attacker can indirectly redirect traffic that is destined to another gateway to the gateway that is being run by him thereby creating a Man in the Middle (MIM) type attack where all the traffic of the victim passes through his gateway. This can have security implications and also hamper performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerointellect.com/security/manipulating-network-routing-tables-with-the-route-command/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Securing your URL with Hexadecimal codes</title>
		<link>http://www.zerointellect.com/security/securing-your-url-with-hexadecimal-codes/</link>
		<comments>http://www.zerointellect.com/security/securing-your-url-with-hexadecimal-codes/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 03:22:25 +0000</pubDate>
		<dc:creator>zrydento</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[ascii]]></category>
		<category><![CDATA[ascii table]]></category>
		<category><![CDATA[hexadecimal]]></category>
		<category><![CDATA[url security]]></category>

		<guid isPermaLink="false">http://www.zerointellect.com/?p=158</guid>
		<description><![CDATA[<p> </p>
<p>Hexadecimal equivalent codes of ASCII characters can be used to represent characters of a URL&#8217;s path and filename.</p>
<p>Each hex number is preceded by a &#8220;%&#8221; symbol to identify the following two numbers/letters as a hexadecimal representation of the character</p>
<p>An ASCII chart can be used for the conversion from ASCII to Hex or vice versa</p>
<p>One good source <p>Continue reading <a href="http://www.zerointellect.com/security/securing-your-url-with-hexadecimal-codes/">Securing your URL with Hexadecimal codes</a></p>]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>Hexadecimal equivalent codes of ASCII characters can be used to represent characters of a URL&#8217;s path and filename.</p>
<p>Each hex number is preceded by a &#8220;%&#8221; symbol to identify the following two numbers/letters as a hexadecimal representation of the character</p>
<p>An ASCII chart can be used for the conversion from ASCII to Hex or vice versa</p>
<p>One good source for ASCII to Hex charts is <a href="http://en.wikipedia.org/wiki/ASCII" target="_self">http://en.wikipedia.org/wiki/ASCII</a> (both the tables below have been taken from this URL)</p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/30112009-diagram-1.png" alt="" width="494" height="860" /></p>
<p> </p>
<p><img class="aligncenter" src="http://www.zerointellect.com/uploads/30112009-diagram-2.png" alt="" width="614" height="859" /></p>
<p> </p>
<p>The need for typing in Hex codes into a URL is to make it possible to include special characters in a URL which would otherwise be wrongly interpreted or not allowed. A good example is SPACE which would not be able to fit into a URL in its original form and hence is represented by the Hex code 20 (prefixed by % in a URL making it %20)</p>
<p> </p>
<p>For example, if we were to visit the URL <a href="http://www.bing.com" target="_blank">www.bing.com</a> , it could be written as</p>
<p> </p>
<blockquote><p><strong>B =  %42</strong></p>
<p><strong>I = %49</strong></p>
<p><strong>N = %4e</strong></p>
<p><strong>G = %47</strong></p></blockquote>
<p> </p>
<p>Hence, <a href="http://www.bing.com" target="_blank">www.bing.com</a> could be written as <a href="http://www.%42%49%4e%47.com" target="_blank">www.%42%49%4e%47.com</a></p>
<p> </p>
<p>Note: The &#8220;slashes&#8221; in the address cannot be represented in hex; nor can the IP address be rendered using this logic (the %XX way) but the rest of the URL can be manipulated</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerointellect.com/security/securing-your-url-with-hexadecimal-codes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

