Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added blog post for Buffer-Overflows #80

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

abhiyad
Copy link

@abhiyad abhiyad commented Aug 8, 2017

Working fine on Local host.No Bugs.

* Read more about buffer overflows [Blog of Dhaval Kapil](https://dhavalkapil.com/blogs/Buffer-Overflow-Exploit/).
* Read about [ASLR](https://en.wikipedia.org/wiki/Address_space_layout_randomization) and [canaries](https://en.wikipedia.org/wiki/Stack_buffer_overflow#Stack_canaries), They are defense mechanisms to prevent Buffer Overflows.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Care to trim trailing whitespaces ? 😛

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad 👍

Copy link
Collaborator

@milindl milindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good overall. I don't know specifics about buffer overflows, but this article looks OK.

Some grammar changes need to be made overall!

@@ -0,0 +1,125 @@
---
layout: post
title: "Buffer Overflows from scratch"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix capitalization of "scratch".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will surely fix all those linguistic error 👍
I wanted to extend the article , but then it requires good enough use of GDB so I preferred not to.
If you say , I will extend the post to a point of redirecting the flow of control to a completely "uncalled" function, for now it just demonstrates compromising a value stored in some variable.

---
### What is a Buffer and What are Buffer overflows ?

To keep it simple ; Buffer is a memory used temporarily to store output or input data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's follow a consistent punctuation scheme, like

this; is a word

instead of

this ; is a word

Also, I think it should be "a buffer is memory used temporarily"

This should be applied everywhere (for commas, full stops etc) all throughout the post.


To keep it simple ; Buffer is a memory used temporarily to store output or input data
while it is transferred.
From naive perspective, Buffer is just an array of a particular data type.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a buffer.

Every function ( even main() ) has a Stack frame in the memory.
When some function is called it creates a new stack frame just below
the stack frame of the previous function.
Lets take an example by considering a simple source code in C :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's

Moreover there is a sequential allocation of memory to the variables onto the stack.
The variable which is declared earlier is at higher memory address and the one which
is declared after is at lower memory address
### Lets get some hands-on
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's

Also, the "some" can be eliminated :)


### A deeper look at the stack layout

Lets look at the stack layout once more:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's

* Return address : it has the address to which the current function has to return after it complete its execution .
* old EBP : It has the base pointer of the function which called the current function.
* Exception Handler : Dont worry about this for now :P
* Local Variable : It has the values of all local variables being stored onto th stack.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

th -> the

@abhiyad
Copy link
Author

abhiyad commented Aug 18, 2017

Fixed errors as mentioned for post Buffer_Overflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants