<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-11871043</id><updated>2011-06-07T23:28:09.565-07:00</updated><title type='text'>Secure Programming</title><subtitle type='html'>With the FireWalls &amp; a mammoth lock on gate, do you think the fort is secure?
No. The walls are weak and the daemons standing on gates are gullible.
We are here to learn breaking the walls and tricking the deamons, and to learn making them secure.
It not about certification bullshit.It's just about CODE. Lets start the drill.&lt;br&gt;
"If you know the enemy and know yourself, your victory will not stand in doubt; if you know Heaven and know Earth, you may make your victory complete"
-Art of War</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11871043.post-116920136348735157</id><published>2007-01-19T02:06:00.000-08:00</published><updated>2007-01-19T02:09:23.496-08:00</updated><title type='text'>Quicksort bug</title><content type='html'>Any ideas, what may be the possible bug in the following code:&lt;br /&gt;&lt;br /&gt;1:     public static int binarySearch(int[] a, int key) {&lt;br /&gt;2:         int low = 0;&lt;br /&gt;3:         int high = a.length - 1;&lt;br /&gt;4: &lt;br /&gt;5:         while (low &lt;= high) {&lt;br /&gt;6:             int mid = (low + high) / 2;&lt;br /&gt;7:             int midVal = a[mid];&lt;br /&gt;8:&lt;br /&gt;9:             if (midVal &lt; key)&lt;br /&gt;10:                 low = mid + 1;&lt;br /&gt;11:             else if (midVal &gt; key)&lt;br /&gt;12:                 high = mid - 1;&lt;br /&gt;13:             else&lt;br /&gt;14:                 return mid; // key found&lt;br /&gt;15:         }&lt;br /&gt;16:         return -(low + 1);  // key not found.&lt;br /&gt;17:     }&lt;br /&gt;&lt;br /&gt;Note: It is standard algo implemented in Java to sort ArrayList&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Sandeep&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-116920136348735157?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/116920136348735157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=116920136348735157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/116920136348735157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/116920136348735157'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2007/01/quicksort-bug.html' title='Quicksort bug'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-112651769076506344</id><published>2005-09-12T02:33:00.000-07:00</published><updated>2005-09-12T02:34:50.770-07:00</updated><title type='text'>SIX DUMBEST IDEAS IN COMPUTER SECURITY.</title><content type='html'>&lt;a href="http://www.ranum.com/security/computer_security/editorials/dumb/"&gt;http://www.ranum.com/security/computer_security/editorials/dumb/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-112651769076506344?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/112651769076506344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=112651769076506344' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112651769076506344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112651769076506344'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/09/six-dumbest-ideas-in-computer-security.html' title='SIX DUMBEST IDEAS IN COMPUTER SECURITY.'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-112298106534674899</id><published>2005-08-02T04:10:00.000-07:00</published><updated>2005-08-02T04:11:05.346-07:00</updated><title type='text'>Simple Yet Common Again</title><content type='html'>int catvars(char *buf1, char *buf2, unsigned int len1,&lt;br /&gt;                unsigned int len2){&lt;br /&gt;        char mybuf[256];&lt;br /&gt;&lt;br /&gt;        if((len1 + len2) &gt; 256){   &lt;br /&gt;            return -1;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        memcpy(mybuf, buf1, len1);      &lt;br /&gt;        memcpy(mybuf + len1, buf2, len2);&lt;br /&gt;&lt;br /&gt;        do_some_stuff(mybuf);&lt;br /&gt;&lt;br /&gt;        return 0;&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-112298106534674899?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/112298106534674899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=112298106534674899' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112298106534674899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112298106534674899'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/08/simple-yet-common-again.html' title='Simple Yet Common Again'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-112298098674686112</id><published>2005-08-02T04:08:00.000-07:00</published><updated>2005-08-02T04:11:27.860-07:00</updated><title type='text'>Simple Yet Common</title><content type='html'>int myfunction(int *array, int len){&lt;br /&gt;        int *myarray, i;&lt;br /&gt;&lt;br /&gt;        myarray = malloc(len * sizeof(int));    &lt;br /&gt;        if(myarray == NULL){&lt;br /&gt;            return -1;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        for(i = 0; i &lt; len; i++){              &lt;br /&gt;            myarray[i] = array[i];&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return myarray;&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-112298098674686112?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/112298098674686112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=112298098674686112' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112298098674686112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112298098674686112'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/08/simple-yet-common.html' title='Simple Yet Common'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-112180846380789600</id><published>2005-07-19T14:24:00.000-07:00</published><updated>2005-07-19T14:29:09.136-07:00</updated><title type='text'>Spot the bug</title><content type='html'>Microsoft's guy is also hosting a blog where he will be posting the code and you have to find a bug.&lt;br /&gt;Check this out: &lt;a href="http://blogs.msdn.com/rsamona/"&gt;http://blogs.msdn.com/rsamona/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;Sandeep&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-112180846380789600?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/112180846380789600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=112180846380789600' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112180846380789600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112180846380789600'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/07/spot-bug.html' title='Spot the bug'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-112056793873557550</id><published>2005-07-05T05:50:00.000-07:00</published><updated>2005-07-05T05:53:32.003-07:00</updated><title type='text'>Games</title><content type='html'>Ever played hacking games??&lt;br /&gt;&lt;br /&gt;Check: &lt;a href="http://quiz.ngsec.com/"&gt;http://quiz.ngsec.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is pretty trivial..&lt;br /&gt;&lt;br /&gt;Once you are done with it..Dont miss &lt;a href="http://hackerslab.org"&gt;http://hackerslab.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Amazing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-112056793873557550?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/112056793873557550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=112056793873557550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112056793873557550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/112056793873557550'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/07/games.html' title='Games'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-111354853764072309</id><published>2005-04-15T00:01:00.000-07:00</published><updated>2005-06-18T16:15:32.756-07:00</updated><title type='text'>The temporary one!</title><content type='html'>void main()&lt;br /&gt;{&lt;br /&gt; FILE *fh = fopen("/tmp/ABC_my_junk_spot", "w+");&lt;br /&gt; fprintf(fh, "hello..what are you looking at?");&lt;br /&gt; fclose(fh);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Find out what is wrong with this piece of code?&lt;br /&gt;How would you exploit this to gain root access if this code runs as root?&lt;br /&gt;&lt;br /&gt;PS: The bar girls are like /tmp because &lt;br /&gt; 1. They are public property 2.They talk too much&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-111354853764072309?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/111354853764072309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=111354853764072309' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111354853764072309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111354853764072309'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/04/temporary-one.html' title='The temporary one!'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-111347503787306020</id><published>2005-04-14T03:31:00.000-07:00</published><updated>2005-04-14T03:38:09.473-07:00</updated><title type='text'>A unix teaser</title><content type='html'>I was no God.&lt;br /&gt;I told her my password. &lt;br /&gt;She ran to a unix terminal. &lt;br /&gt;She logged in to my account.&lt;br /&gt;Using 'passwd' she changed my password to whatever she wanted.&lt;br /&gt;she checked if the password was changed. It really was.&lt;br /&gt;When she came back, she fainted when she saw me using different password.&lt;br /&gt;&lt;br /&gt;How could I do that?&lt;br /&gt;&lt;br /&gt;TIP: It was a race condition&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-111347503787306020?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/111347503787306020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=111347503787306020' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111347503787306020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111347503787306020'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/04/unix-teaser.html' title='A unix teaser'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-111329174134086369</id><published>2005-04-12T00:41:00.000-07:00</published><updated>2005-04-12T00:50:00.356-07:00</updated><title type='text'>No long names allowed.</title><content type='html'>#include &amp;lt;string.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main(int argc, char *argv[]){&lt;br /&gt;  unsigned short s;&lt;br /&gt;  int i;&lt;br /&gt;  char buf[80];&lt;br /&gt;&lt;br /&gt;  if(argc &amp;lt; 3){&lt;br /&gt;    return -1;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  i = atoi(argv[1]);&lt;br /&gt;  s = i;&lt;br /&gt;&lt;br /&gt;  if(s &amp;gt;= 80){&lt;br /&gt;    printf("We dont allow big names.\n");&lt;br /&gt;    return -1;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  strncpy(buf, argv[2], i);&lt;br /&gt;  printf("%s\n", buf);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;After compiling, execute it following way:&lt;br /&gt;$ ./a.out 81  alpha0&lt;br /&gt;We dont allow big names.&lt;br /&gt;$./a.out 79 alpha0&lt;br /&gt;alpha0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-111329174134086369?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/111329174134086369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=111329174134086369' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111329174134086369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111329174134086369'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/04/no-long-names-allowed_12.html' title='No long names allowed.'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-111286352504353844</id><published>2005-04-07T01:43:00.000-07:00</published><updated>2005-04-07T01:47:12.746-07:00</updated><title type='text'>Lady, tell me the time.</title><content type='html'>This program is a SUID program (see my previous post).&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;System("date");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;What does it do?&lt;br /&gt;It basically executes command called "date".&lt;br /&gt;&lt;br /&gt;Now, what is problem with it?&lt;br /&gt;&lt;br /&gt;PS: Lady seems to be blonde&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Sandeep&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-111286352504353844?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/111286352504353844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=111286352504353844' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111286352504353844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111286352504353844'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/04/lady-tell-me-time.html' title='Lady, tell me the time.'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-111286339733101208</id><published>2005-04-07T01:33:00.000-07:00</published><updated>2005-04-08T06:30:24.833-07:00</updated><title type='text'>What are SUID programs?</title><content type='html'>It is unix term which means "the programs which while running assume someone else's credentials." Generally if a user runs a program the program has same previleges as user has.&lt;br /&gt;So, program can access same resources (files, memory etc..) what user can.&lt;br /&gt;Lets take an example,&lt;br /&gt;When you change your password the password file is modified by the command that changes the password. On the other hand you can edit the password file yourself.&lt;br /&gt;So this command for changing the password runs with the administrator previleges.&lt;br /&gt;&lt;br /&gt;This special previleged programs like daemons (See the gatekeepers in the first post) need to be secured because if a user tricks them into executing any other command, the seurity is defeated.&lt;br /&gt;&lt;br /&gt;They ought to do what they are supposed to do.&lt;br /&gt;To find all such programs on unix system you can use the following command:&lt;br /&gt;    &lt;span style="font-style: italic;"&gt;find / -perm -4000 -o -perm -2000  2&gt;/dev/null&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Alpha0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-111286339733101208?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/111286339733101208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=111286339733101208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111286339733101208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111286339733101208'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/04/what-are-suid-programs.html' title='What are SUID programs?'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-111265046521977103</id><published>2005-04-04T14:28:00.000-07:00</published><updated>2005-04-04T14:39:11.233-07:00</updated><title type='text'>The monk is culprit</title><content type='html'>While going through the SunOS strcat manual, I was stuck by the following lines.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;Buffer overflow can be checked as  follows:&lt;br /&gt;   if (strlcat(dst, src, dstsize) &gt;= dstsize)&lt;br /&gt;           return -1;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is wrong with it?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-111265046521977103?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/111265046521977103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=111265046521977103' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111265046521977103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111265046521977103'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/04/monk-is-culprit.html' title='The monk is culprit'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-111265012374758663</id><published>2005-04-04T14:03:00.000-07:00</published><updated>2005-04-04T14:28:43.746-07:00</updated><title type='text'>Dying of oppulance</title><content type='html'>It is a story of a programmer who is dead by the deadlines.&lt;br /&gt;He writes the code quickly to meet the deadline just to get another deadline.&lt;br /&gt;One day someone told his boss a tale about the devilish buffer overflow. Boss gives orders to apply fixes to all the bufferoverflows by using strlcat instead of strcat and run a code-checker over the code.:)&lt;br /&gt;The poor programmer got yet another dead-line. He obeys the boss and here is the code he wrote:&lt;br /&gt;&lt;br /&gt;#define BUFSIZ 100&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;   char * response;&lt;br /&gt;   response = (char *) malloc (sizeof(char) * BUFSIZ);&lt;br /&gt;   char input[50];&lt;br /&gt;   &lt;br /&gt;   printf("Enter your first name:"&lt;br /&gt;   scanf("%49s",input);&lt;br /&gt;    strlcat(response, input, BUFSIZ);&lt;br /&gt;&lt;br /&gt;   printf("Enter your middle name:"&lt;br /&gt;   scanf("%49s",input);&lt;br /&gt;   strlcat(response, input, BUFSIZ);&lt;br /&gt;&lt;br /&gt;   printf("Enter your last name:"&lt;br /&gt;   scanf("%49s",input);&lt;br /&gt;   strlcat(response, input, BUFSIZ);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Do you think this guy needs to be corrected?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-111265012374758663?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/111265012374758663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=111265012374758663' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111265012374758663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111265012374758663'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/04/dying-of-oppulance.html' title='Dying of oppulance'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-111244228093823204</id><published>2005-04-02T03:40:00.000-08:00</published><updated>2005-04-02T03:44:40.940-08:00</updated><title type='text'>A simple C code.</title><content type='html'>I asked an interviewee to write a code that should take a string from user and print it back.&lt;br /&gt;&lt;br /&gt;He scribbled it in a fraction of second:&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;   char name[100];&lt;br /&gt;   scanf("%s", name);&lt;br /&gt;   printf(name);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Do you think this code is secure? If not, how many bugs does it have?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-111244228093823204?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/111244228093823204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=111244228093823204' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111244228093823204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111244228093823204'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/04/simple-c-code.html' title='A simple C code.'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11871043.post-111244153767223020</id><published>2005-04-02T03:32:00.000-08:00</published><updated>2005-04-02T03:35:33.460-08:00</updated><title type='text'>Any Interpretations?</title><content type='html'>&lt;a href='http://photos1.blogger.com/img/190/4394/640/unix-kingdom.jpg'&gt;&lt;img border='0' style='border:1px solid #000000; margin:2px' src='http://photos1.blogger.com/img/190/4394/320/unix-kingdom.jpg'&gt;&lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11871043-111244153767223020?l=secureprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://secureprogramming.blogspot.com/feeds/111244153767223020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11871043&amp;postID=111244153767223020' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111244153767223020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11871043/posts/default/111244153767223020'/><link rel='alternate' type='text/html' href='http://secureprogramming.blogspot.com/2005/04/any-interpretations.html' title='Any Interpretations?'/><author><name>Alpha0</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
