<?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>port &#8211; VeriTeknik</title>
	<atom:link href="https://www.veriteknik.net.tr/en/tag/port/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.veriteknik.net.tr/en/</link>
	<description>VeriTeknik Bilişim &#124; VeriTeknik Bilişim</description>
	<lastBuildDate>Mon, 07 May 2012 14:27:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Nmap : Scanning Methods</title>
		<link>https://www.veriteknik.net.tr/en/nmap-scanning-methods/</link>
					<comments>https://www.veriteknik.net.tr/en/nmap-scanning-methods/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Mon, 07 May 2012 14:27:42 +0000</pubDate>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[scan]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tcp]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=394</guid>

					<description><![CDATA[<p>Earlier we&#8217;ve discussed target specification in detail. But it is almost as import to choose your method to scan the target host. Nmap can scan in various algorithms, we should choose wisely considering the network, operating system and firewalls. Even though we usually don&#8217;t know what network architecture or operating system the target is affiliated [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/nmap-scanning-methods/">Nmap : Scanning Methods</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Earlier we&#8217;ve discussed <a href="http://www.plugged.in/network/nmap-target-specification-in-detail.html" title="Nmap : Target Specification in Detail">target specification</a> in detail. But it is almost as import to choose your method to scan the target host. Nmap can scan in various algorithms, we should choose wisely considering the network, operating system and firewalls. Even though we usually don&#8217;t know what network architecture or operating system the target is affiliated to, these methods are also useful for determining such information.</p>
<p>To understand the background of scanning, we should know some basic thing about the &#8220;three-way handshake&#8221; that occurs during a network connection. The three-way handshake is another way of describing the SYN/ACK method. When a computer sends a &#8220;Hello&#8221; signal to a target machine, it actually sends a SYN packet. After receiving this packet, if the target is listening, it will normally respond with a SYN/ACK packet. When the first computer receives this SYN/ACK packet, it will respond back to the target machine with an ACK packet. This way, the three-way handshake is accomplished.</p>
<p>The SYN/ACK handshake is analogously described by talking on the phone (back on the old days when there weren&#8217;t caller id&#8217;s!). When we dial some number, we basically send a SYN signal, when the target answers the phone saying &#8220;Hello?&#8221;, it actually is a SYN/ACK packet, meaning &#8220;I&#8217;m listening?&#8221;, after that when we introduce ourselves as in &#8220;Hi, I&#8217;m calling from VeriTeknik&#8221;, then we&#8217;re sending the last ACK packet.</p>
<p>Now since we understand what SYN, SYN/ACK and ACK means, we can start digging around with nmap and see what it uses these information for.<br />
By the way, for what it&#8217;s worth, SYN stands for <em>synchronize</em> and ACK stands for <em>acknowledge</em>.</p>
<p><strong>The TCP Scan</strong></p>
<p>Like we&#8217;ve discussed earlier in our target specification post, nmap executes a TCP scan with the <strong>-sT</strong> option. A TCP scan is accomplished with the full three-way handshake, meaning that when we ask nmap to execute a TCP scan on a port on some target, it will send a SYN, wait for the SYN/ACK and send back the ACK, after these, it will tell us that the port is open (or closed). Since we&#8217;re going all the way through with the three-way handshake in this method, even though it seems the most reliable one on standard targets (not behind firewall etc.) it has the slightest possibility to flood the target.</p>
<p>Here&#8217;s is the basic command to perform one.</p>
<p><strong>$ nmap -sT 10.20.30.40</strong></p>
<p><strong>The SYN Scan</strong></p>
<p>This is the most popular scan type of nmap. In fact, it is also the default option on nmap, meaning if you don&#8217;t specify any scan type, nmap will use the default SYN scan method.</p>
<p>The SYN scan is popular because it is faster. This comes from the fact that it doesn&#8217;t complete the three-way handshake. It only goes through the two steps of the handshake, first sending the SYN packet, waiting for a SYN/ACK packet, after this, instead of sending an ACK packet, it sends an RST (<em>reset</em>) packet, which tells the target to disregard any previous packets and close the connection between the two machines. The advantage of this is that the RST packet is much smaller than the ACK packet. Even though it may sound like one tiny packet won&#8217;t change much, when you add up hundreds (or thousands) of ports on multiple hosts, tiny packets do matter! Also, sending less information to the target always means less possibility to flood it.</p>
<p><strong>$ nmap -sS 10.20.30.40<br />
$ nmap 10.20.30.40</strong></p>
<p><strong>The UDP Scan</strong></p>
<p>Overlooking the UDP scanning technique is a common rookie mistake. Even though most services use the TCP ports today, UDP ports are still essential and cause security vulnerabilities. Also, UDP ports are as useful as TCP ports for getting information on the system.</p>
<p>Note that both TCP and SYN scanning use the TCP method of connection. There are basically two methods for computers to communicate, either the TCP (<em>Transmission Control Protocol</em>) or the UDP (<em>User Datagram Protocol</em>). TCP ensures that the packets sent from one computer to another arrive at the receiver intact and in the order they were sent. But, UDP has no such mechanism, it just sends the data and we never know whether it arrived to the target or not. There are many advantages and disadvantages between the two technologies including speed, reliability, error checking etc. The important thing is to know which one to use under your case.</p>
<p>Comparing the UDP scan to our analogous example of the phone call, it is often described with a mailing system. It is like when we write a mail (not an e-mail, the regular ones!), put a stamp on it, no return address and put it in the mailbox. Maybe sometime the post officer will pick it up, deliver it to the address. You&#8217;ll never know if the mail reached its destination or not, and the receiver might not know the origin.</p>
<p><strong>$ nmap -sU 10.20.30.40</strong></p>
<p>Don&#8217;t forget that even though people tend to think that services run on TCP ports, a lot of them still stick with the UDP ones, such as DNS, DHCP, SNMP, or TFTP.</p>
<p><strong>The Xmas Scan</strong></p>
<p>This scan method is based on the technical descriptions on the RFC 793 (page 65) of TCP. If the target operating system is bound to the RFC, then when dealing with TCP connections it should obey the following two rules.</p>
<p><strong>* If a closed port receives a packet that doesn&#8217;t have a SYN, ACK or RST flag, the port should respond with an RST packet of its own.<br />
* If an open port receieves a packet that doesn&#8217;t have a SYN, ACK or RST flag, the packet should be ignored.</strong></p>
<p>So, according to these rules, if a send a packet that doesn&#8217;t contain any one of SYN, ACK and RST, and if the relevant port does not answer back, that port should be open. So when we tell Nmap to perform a Xmas scan on a target, it simply sends FIN, PSH and URG packet flags on. The name Xmas comes from the fact that it has so many flags set to &#8220;on&#8221; as if it lights like a Christmas tree!</p>
<p>The problem with this scan type is that we <em>assume</em> the target operating system fully complies with the RFC standard of the TCP. Linux and Unix operating systems do, but Microsoft operating systems don&#8217;t. Ironically this makes Linux systems vulnerable to this scan type.</p>
<p><strong>$ nmap -sX -p- -PN 10.20.30.40</strong></p>
<p><strong>Null Scan</strong></p>
<p>This type of scanning is almost the same with the Xmas scanning method. Instead of switching some of the flags &#8220;on&#8221;, with the Null scan, Nmap switches everything &#8220;off&#8221;. This way, the closed ports will respond with a RST flag. (if the operating system complies with the RFC standards)</p>
<p>These type of scans are important when scanning a system behind firewalls. Some firewalls block communication establishment by filtering SYN packets. Since our scanning packets with the Xmas and Null scans don&#8217;t have a SYN packet, the firewall won&#8217;t filter it. Well, bear in mind that since we don&#8217;t have a SYN packet, it is not possible to establish a connection, but the point is scanning for ports, and that is possible without a SYN packet!</p>
<p><strong>$ nmap -sN -p- -PN 10.20.30.40</strong></p>
<p><strong>FIN Scan</strong></p>
<p>This is also almost the same with Xmas and Null scans, this time, nmap only sends the packet with the FIN flag &#8220;on&#8221;.</p>
<p><strong>$ nmap -sF -p- -PN 10.20.30.40</strong></p>
<p><strong>ACK Scan</strong></p>
<p>This scan type does <em>not</em> directly look for open ports. Instead it tests whether our ACK packets reach the ports or not. By default, it only has the ACK flag set. An unfiltered (ex. no firewall) system would return with RST packets when an ACK packet reaches it, regardless of the port state being open or closed. If a port doesn&#8217;t respond, or it responds with ICMP error messages, nmap will label it as filtered, if the port responds with an RST packet, it will be labeled as &#8220;reachable&#8221;. Detecting if reachable ports are open or not, is not checked by this scan. This type of scan is very useful to check the security of a target.</p>
<p><strong>$ nmap -sA -p- -PN 10.20.30.40</strong></p>
<p><strong>Window Scan</strong></p>
<p>This one is similar to the ACK scan, but categorizes the port filtered or unfiltered depending on the value the returning package&#8217;s RST flag is. On some systems open ports have a positive window size, but the closed ports have a window size equal to zero. So when a port replies RST, instead of labeling it as unfiltered (like it does in ACK scan), nmap will read the TCP Window value of the RST package. If the value is zero, the port is filtered, if it has a positive value, it is labeled as unfiltered. This type of scan does not work on most of the systems. In fact, if most of the ports you scan from 1000 ports are open, and only a few are closed, it is possible that the values are incorrect, the few closed ones might be the open ports and the open labeled ones might be the closed ones.<br />
So, things can get the other-way around, use the feedback with caution!</p>
<p><strong>$ nmap -sW -p- -PN 10.20.30.40</strong></p>
<p><strong>Additional Options for Detailed Information</strong></p>
<p>Lastly, there are a few options to remember that can give us great detail about the target system.</p>
<p><strong>Version detection :</strong> The <strong>-sV</strong> switch tries to determine what version of a service is running on a detected open port. This is great when scanning either UDP ports or unusual ports. If you find an unusual port number to be open, a version scan might tell you whether it is an SSH service running or an HTTP.</p>
<p><strong>Operating System detection :</strong> The <strong>-O</strong> switch is for determining the operating system of the target. This does not 100% work but it does give some clues. It also tries to determine the kernel version, if it fails to get the kernel version, it sometimes reports possibilities in percentages.</p>
<p>Another option for Operating System and Version detection is the <strong>-A</strong> switch. This does not provide as much detail as the -O option but is still useful.</p>
<p><strong>The Speed :</strong> You can choose the speed of each scan with the <strong>-T</strong> switch. The timing switch ranges on a numeric scale from 0 to 5, with 0 being the slowest scan.</p>
<p>It is important to know the backgrounds of a scan when executing it. Otherwise the results would seem meaningless to the scanner. Go ahead and try scanning your own systems. Don&#8217;t forget that if you have multiple servers, nmap also has a nice way of dealing with <a href="http://www.plugged.in/network/nmap-target-specification-in-detail.html" title="Nmap : Target Specification in Detail">target specification</a>.</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/nmap-scanning-methods/">Nmap : Scanning Methods</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/nmap-scanning-methods/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">394</post-id>	</item>
		<item>
		<title>Nmap : Target Specification in Detail</title>
		<link>https://www.veriteknik.net.tr/en/nmap-target-specification-in-detail/</link>
					<comments>https://www.veriteknik.net.tr/en/nmap-target-specification-in-detail/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Wed, 02 May 2012 14:04:52 +0000</pubDate>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[scan]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=370</guid>

					<description><![CDATA[<p>Every now and then, we need to scan ports as system administrators, even if the target machine is owned by us or not. To achieve this, nmap is the well known and reliable tool which is available for almost every platform. But to use nmap, we need to understand the background of it a little. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/nmap-target-specification-in-detail/">Nmap : Target Specification in Detail</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Every now and then, we need to scan ports as system administrators, even if the target machine is owned by us or not. To achieve this, <strong>nmap</strong> is the well known and reliable tool which is available for almost every platform. But to use nmap, we need to understand the background of it a little.</p>
<p>There are several methods to scan ports. One of them is the &#8220;TCP&#8221; scanning method. With this method, nmap will try to establish a TCP connection with each of the port to be scanned on the target.  If we don&#8217;t specify any ports, nmap will scan these. This speeds up the process a lot! Below, you&#8217;ll find an example of TCP scan on every port on the target machine.</p>
<p><strong>$ nmap -sT -p- -PN 10.20.30.40</strong></p>
<p>When we break down the arguments, things will get clearer.</p>
<p><strong>-sT :</strong> The <strong>-s</strong> there indicates what method to use to scan, so the following <strong>T</strong> says its a TCP scan.<br />
<strong>-p- :</strong> With this we tell nmap to scan every port on the target. Normally, nmap has a predefined list of 1000 ports that are widely used. To scan only the default 1000 ports, just don&#8217;t use this flag. Alternately you can tell which specific range of ports to scan. For example to scan the ports 21,23 and 25, we specify it as <strong>-p21,23,25</strong> or to scan every port between 21 and 25, <strong>-p21-25</strong>. If we want to scan everything between 21 and 25 plus the 80&#8217;th port, it goes like this : <strong>-p21-25,80</strong><br />
<strong>-PN :</strong> This options tells nmap to skip the host discovery, which means it&#8217;ll assume that every target we specify are online. Use this if you&#8217;re only sure that the host is online, when we specify a lot of targets, and a lot of ports on these targets, host discovery will come in as a handy time saver.</p>
<p>Target specification in a clever way is very important if you&#8217;re willing to scan multiple targets. Below, we&#8217;ll talk about how detailed we can specify targets on nmap.</p>
<p>The simplest way for telling nmap to scan 2 targets,</p>
<p><strong>$ nmap -sT -p21-25,80,8080 10.20.30.40-60 192.168.16.4 192.168.16.5</strong></p>
<p>The above will do the same thing with the notation below,</p>
<p><strong>$ nmap -sT -p21-25,80,8080 10.20.30.40-60 192.168.16.4,5</strong></p>
<p>Nmap can also understand various notations at the same time when specifying target addresses. For example we can specify a network with it&#8217;s CIDR notation, and use partial definitions on different subnet blocks. Take a look at this example :</p>
<p><strong>$ nmap -sT -p- -PN 192.168.1.0/16 10.20.30,31.40</strong></p>
<p>Note that you cannot use the comma notation and the CIDR notation at the same time. So target specification such as <strong>192.168.1,2.0/16</strong> is <strong>NOT</strong> allowed.</p>
<p>You can also specify IPv6 using the <strong>-6</strong> options. Below we&#8217;re scanning for the website <a href="http://my-ip6.com" target="_blank">my-ip6.com</a></p>
<p><strong>$ nmap -sT -p21-25,80 -6 2a00:7300:1::4</strong></p>
<p>Also note that with the IPv6 scanning, nmap does <strong>NOT</strong> support CIDR notation.</p>
<p>Needless to, we can also specify the target with its domain name.</p>
<p><strong>$ nmap -sT -p- -PN plugged.in</strong></p>
<p>Nmap can also get the targets from a text file if you can&#8217;t specify them in a sequential order. Just type your targets&#8217; IP addresses line by line on a file and run it like this:</p>
<p><strong>$ nmap -sT -p- -PN -iL my_targets_text_file</strong></p>
<p>When you specify a range of addresses, it sometimes is crutial to NOT SCAN some members of that network. For this, nmap allows you to exclude addresses. This time we specify multiple &#8220;excluded targets&#8221; as comma separated, and as usual, it supports all the syntax supported for target specification. (hostnames, CIDR, netblocks, octet ranges, etc.)</p>
<p><strong>$ nmap -sT -p- -PN 192.168.1.0/16 &#8211;exclude 192.168.16.30,192.168.1.10-15</strong></p>
<p>Here&#8217;s a problem with this syntax of nmap, since the excluded targets are specified with commas, we can&#8217;t use commas to define subnets within the exclusion. For example we can specify targets such as <strong>192.168.1,2.1</strong> but this is not allowed within the exclusion since nmap will use the comma as a target exclusion delimiter.</p>
<p>The good thing is, just like specifying your targets in a text file, you can also specify you exclusion list too!</p>
<p><strong>$ nmap -sT -p- -PN 192.168.1.0/16 &#8211;excludefile my_exclusion_text_file</strong></p>
<p>And the last but not least, nmap has an option to scan random addresses. This is built specifically for research (and fun!) yet you should always use this option at your own risk, since some networks might detect you as a possible break-in attempt for scanning their system. It is also a good idea to you exclusion lists with this option.</p>
<p><strong>$ nmap -sT -p80 -PN -iR 5 </strong></p>
<p>The number 5 above means that nmap will be scanning 5 addresses. So it will generate 5 random IP addresses. To generate infinate numbers of addresses, use the <strong>-iR</strong> option with the value <strong>0</strong>.</p>
<p>Let&#8217;s end this post with a quoat from the man page of nmap,</p>
<blockquote><p><em>&#8220;If you find yourself really bored one rainy afternoon, try the command</em> <strong>nmap -sS -PS80 -iR 0 -p 80</strong> <em>to locate random web servers for browsing.&#8221;</em></p></blockquote>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/nmap-target-specification-in-detail/">Nmap : Target Specification in Detail</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/nmap-target-specification-in-detail/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">370</post-id>	</item>
		<item>
		<title>Ephemeral port range for FTP</title>
		<link>https://www.veriteknik.net.tr/en/ephemeral-port-range-for-ftp/</link>
					<comments>https://www.veriteknik.net.tr/en/ephemeral-port-range-for-ftp/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Fri, 22 Apr 2011 09:05:05 +0000</pubDate>
				<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[Ephemeral]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[port]]></category>
		<guid isPermaLink="false">http://plugged.in/?p=6</guid>

					<description><![CDATA[<p>The standart linux distrubition calls that the ephemeral port range be between 1024 and 4999. We we all know that some of these ports are used for other more importand applications than FTP. So security is an issue because leaving those original ports open leads to major security holes. Rather than openning ports that need [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/ephemeral-port-range-for-ftp/">Ephemeral port range for FTP</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The standart linux distrubition calls that the ephemeral port range be between 1024 and 4999. We we all know that some of these ports are used for other more importand applications than FTP. So security is an issue because leaving those original ports open leads to major security holes. Rather than openning ports that need higher security for FTP we will change the port range. With this modified port range you can open your firewall to ports that do not have any use but PASV FTP.</p>
<p>First find out what the defined port range is</p>
<blockquote><p># cat /proc/sys/net/ipv4/ip_local_port_range<br />
1024 4999</p></blockquote>
<p>Know select the port range that you wan, I will define a port range of my desire but this is up to the network admin.<br />
To change the port range you have two option</p>
<p>Edit with nano or vi /proc/sys/net/ipv4/ip_local_port_range<br />
Or</p>
<blockquote><p>echo &#8220;55001 65535&#8221; &gt; /proc/sys/net/ipv4/ip_local_port_range</p></blockquote>
<p>These will both change the port, chech this with # cat /proc/sys/net/ipv4/ip_local_port_range</p>
<p>To make these changes permanent as these definitions will vanish on every reboot you need to put a script in /etc/sysctl.conf</p>
<p>Nano or vi /etc/sysctl.conf<br />
Add</p>
<blockquote><p># Controls Ephemeral Port Range (this is for the admin to remember what it is)<br />
net.ipv4.ip_local_port_range = 55001 65535</p></blockquote>
<p>Save<br />
Exit<br />
Reboot (if you like)<br />
And you are done!</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/ephemeral-port-range-for-ftp/">Ephemeral port range for FTP</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/ephemeral-port-range-for-ftp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6</post-id>	</item>
	</channel>
</rss>
