<?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>Sec &#34;IP&#34; nix &#187; http frame</title>
	<atom:link href="http://www.ugurengin.com/blog/tag/http-frame/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ugurengin.com/blog</link>
	<description>Uğur Engin</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:00:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>HTTP Protokolü nasıl çalışır?</title>
		<link>http://www.ugurengin.com/blog/http-protokolu-nasil-calisir.html</link>
		<comments>http://www.ugurengin.com/blog/http-protokolu-nasil-calisir.html#comments</comments>
		<pubDate>Sun, 18 Apr 2010 01:03:41 +0000</pubDate>
		<dc:creator>Uğur Engin</dc:creator>
				<category><![CDATA[TCP/IP]]></category>
		<category><![CDATA[http capture]]></category>
		<category><![CDATA[http frame]]></category>
		<category><![CDATA[http protocol]]></category>
		<category><![CDATA[Identification]]></category>
		<category><![CDATA[tcp session]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://ugurengin.com/blog/?p=630</guid>
		<description><![CDATA[&#8220;Software Identification&#8221; tekniginin öncüsü, OSI Modelinin 7.Katmanın da bulununan http protokolü&#8217;nün arkasında saniseler içerisinde dönen trafigi capture edip ilgili protokolun çalışma mantığı ve yapısı hakkında derinlemesine bilgi sahibi olmaya çalışacağız. Client tarafından 80. port aracılığıyla yapılan her  request&#8217;e karşılık http protokolu bir response field döner. securityfocus isimli  sunucuya test amaçlı  yapilan bir request ve dönen [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Software Identification&#8221; tekniginin öncüsü, OSI Modelinin 7.Katmanın da bulununan http protokolü&#8217;nün arkasında saniseler içerisinde dönen trafigi capture edip ilgili protokolun çalışma mantığı ve yapısı hakkında derinlemesine bilgi sahibi olmaya çalışacağız. Client tarafından 80. port aracılığıyla yapılan her  request&#8217;e karşılık http protokolu bir response field döner.</p>
<p>securityfocus isimli  sunucuya test amaçlı  yapilan bir request ve dönen response içeriğini asağida görebilirsiniz.<br />
Dikkat ederseniz dönen response içeriğinde gereginden fazla bilgi var ki bunlar gereksiz.</p>
<p><span style="color: #008000;">=== REQUEST ===</span></p>
<p><span style="color: #008000;">GET / HTTP/1.1<br />
Host: www.securityfocus.com<br />
Accept-Encoding: gzip<br />
Connection: keep-alive<br />
User-Agent: Mozilla/5.0 SF/1.26b<br />
Range: bytes=0-199999<br />
Referer: http://www.securityfocus.com/</span></p>
<p><span style="color: #008000;">=== RESPONSE ===</span></p>
<p><span style="color: #008000;">HTTP/1.1 200 Partial Content<br />
Date: Tue, 13 Apr 2010 20:08:42 GMT<br />
Server: Apache/1.3.41 (Unix) mod_perl/1.29 mod_ssl/2.8.31 OpenSSL/0.9.8g<br />
Last-Modified: Tue, 13 Apr 2010 20:00:13 GMT<br />
ETag: &#8220;b339d9-4d9b-4bc4cd4d&#8221;<br />
Accept-Ranges: bytes<br />
Content-Length: 19867<br />
Content-Range: bytes 0-19866/19867<br />
Keep-Alive: timeout=4, max=500<br />
Connection: Keep-Alive<br />
Content-Type: text/html</span></p>
<p><span style="color: #008000;"> </span></p>
<h2><span style="color: #008000;"><span style="color: #000000;">HTTP Protokolü Request ve Response istek yapıları.</span><br />
</span></h2>
<p><span style="text-decoration: underline;"><span style="color: #008000;">Http Response Field Yapısı.</span></span></p>
<pre><span style="color: #ff0000;"><strong>Request = Status-Line 	;
	*(( gener&lt;al-header 	;
	| response-header 	;
	| entity-header ) CRLF) ;
	CRLF
	[ message-body ] 	;</strong></span></pre>
<p><span style="text-decoration: underline;"><span style="color: #008000;">Http Response Header Listesi:</span></span></p>
<p><span style="color: #008000;"><strong>&#8220;Informational,Succes,Redirection,Client Error, Server Error&#8221;</strong></span></p>
<p><span style="text-decoration: underline;"><span style="color: #008000;">Http Request Field Yapısı.</span></span></p>
<pre><strong><span style="color: #ff0000;">Request = Request-Line 	;
	*(( general-header 	;
	| request-header 	;
	| entity-header ) CRLF) ;
	CRLF
	[ message-body ] </span></strong>
</pre>
<p><span style="color: #008000;"><span style="text-decoration: underline;"><span style="color: #ff0000;"><span style="color: #008000;">Başlıca</span> </span>Http Request Header Listesi:</span></span></p>
<p><strong><span style="color: #008000;">options,get,head,post,put,delete,trace,connect,host,user-agent,date,referer</span></strong></p>
<h3>TCP Session nasıl açılır ve HTTP isteği nasıl gerçekleşir ?</h3>
<p>Aşağıda &#8220;Source&#8221; bölümü karşışında  belirtilmiş olan IP adresi, sunucumuza istekde bulunan client&#8217;in adresidir. Destination ise, sunucumuzun IP adresi olsun.Client makine, hedef sunucuya  doğru her request de farkli bir port aracılığıyla ilgili session&#8217;un  açılmasında rol üstleniyor.Dolayısıyla karşı sunucuya yapılan her request  aynı zamanda  client makine tarafında farkli bir <strong>source port&#8217;un</strong> Tcp Sessiona dahil olmasını ve  aradaki bağlantının açılmasını sağlıyor.</p>
<p><strong>Source IP</strong>: 10.0.0.2<br />
<strong>Source Port</strong>: 46949<br />
<strong>Destination IP</strong>: 205.206.231.12<br />
<strong>Destination Port</strong>: 80</p>
<p>Şimdi, client makine&#8217;de  205.206.231.12 nolu IP adresine doğru yapılan  requestleri wireshark ile capture edelim amacımız paketleri detaylıca incelemek fakat öncelikle shell de netstat  -ant parametresiyle bağlantı sağlanmış basit bir tcp session çıktısını görelim.</p>
<p>netstat -ant | grep &#8217;46949&#8242; &gt; http_session.txt</p>
<p>Active Internet connections (servers and established)<br />
Proto Recv-Q Send-Q Local Address           Foreign Address         State</p>
<p>tcp        0      0 <strong>10.0.0.2:46949          205.206.231.12:8</strong>0       ESTABLISHED</p>
<p><span style="color: #ff0000;">&#8220;Established&#8221; statusu bizlere TCP bağlantıların da üçlü el sıkışma olarak adlandırdıgımız aksiyonun gercekleştiğini ve hedef makine ile iletisim kurulabileceğini gösteriyor.</span></p>
<h3><strong>3&#8242;lü el sıkışma</strong> nasıl gerçekleşiyor?</h3>
<p>Client  &#8220;Syn&#8221; &gt;   Sunucu  (A)<br />
Sunucu  &#8220;Ack+Syn&#8221; &gt; Client (A+1)<br />
Client  +Ack  &gt; Sunucu (B+1)</p>
<p style="text-align: center;"><a href="http://ugurengin.com/blog/img/TCP/http1.JPG" rel="lightbox[630]"><img class="aligncenter" src="http://ugurengin.com/blog/img/TCP/http1.JPG" alt="" width="992" height="91" /></a></p>
<p>TCP bağlantısı gerçekleştikten sonra 205.206.231.12 nolu IP adresine  1 bit&#8217;lik PSH ve ACK isimli tcp bayrakları gönderiliyor dolayısıyla request ettiğimiz sayfanın içeriğini görüntüleyebiliyoruz.</p>
<p>Client  &#8220;Syn&#8221; &gt;   Sunucu<br />
Sunucu  &#8220;Ack+Syn&#8221; &gt; Client<br />
Client  +Ack  &gt; Sunucu<br />
Client  Psh + Ack  &gt; Sunucu</p>
<p style="text-align: left;"><a href="http://ugurengin.com/blog/img/TCP/http2.JPG" rel="lightbox[630]"><img class="aligncenter" src="http://ugurengin.com/blog/img/TCP/http2.JPG" alt="" width="1026" height="302" /></a></p>
<p style="text-align: left;">Biraz teknik bir anlatm oldu.<br />
Apache sunucularda güvenlik sebebiyle özellikle Software Identification analizleri&#8217;ni engellemek için dönen response içeriklerini minimize edip filtreleyebiliriz fakat bunlar bir başka entry&#8217;nin konusu olsun.</p>
<p style="text-align: center;">
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.ugurengin.com%2Fblog%2Fhttp-protokolu-nasil-calisir.html&amp;t=HTTP%20Protokol%C3%BC%20nas%C4%B1l%20%C3%A7al%C4%B1%C5%9F%C4%B1r%3F" id="facebook_share_both_630" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; padding:2px 0 0 20px; height:16px; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top left;">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_630') || document.getElementById('facebook_share_icon_630') || document.getElementById('facebook_share_both_630') || document.getElementById('facebook_share_button_630');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_630') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.ugurengin.com/blog/http-protokolu-nasil-calisir.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

