Buffer overflow for Beginners

935 views

Published on

Buffer Overflow for Beginners

Published in: Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
935
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
27
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Buffer overflow for Beginners

  1. 1. Buffer Overflow for Beginners Ajin Abrahamwww.keralacyberforce.in
  2. 2. Buffer: it is a block of memoryWhat is Buffer Overflow?Buffer overflow is caused when toomuch data is inserted into a bufferthan it can handle. So this may lead tothe executing of arbitrary code if acertain memory pointer isoverwritten.
  3. 3. Buffer Overflow for Beginner152903854128 + 6 bytes Command15290372010 + 6 bytes Name152903704
  4. 4. Buffer Overflow for BeginnerCommand {with system() function execute the contents of the variable command} system(command);Name {Read to Name Variable and Print the contents of name variable} gets(name); printf(“Hello %sn”,name);
  5. 5. Buffer Overflow for Beginner When you give an input, saywww.keralacyberforce.in What happens?
  6. 6. Buffer Overflow for Beginner152903832128 + 6 bytes commandorce.in10 + 6 bytes (10)namewww.kerala (6)malloccyberf152903704 It will be assigned to the memory like this.
  7. 7. Buffer Overflow for Beginner This buffer overflow is caused because the gets() function doesntlimit’s the length of the input
  8. 8. Buffer Overflow for Beginner To overrule this buffer overflow you can use fgets(name, 10, stdin);where it will read a maximum of 10 characters from the input.

×