Tailoring exploits
Buffer overflow is one of the most famous, powerful and frequently used attacks used to exploit applications. Buffer overflow attacks can provide attackers access to execute commands or customize shell codes in a system. Once you have access to a targeted machine, you could add accounts, access a command prompt, remotely control the GUI, and alter the system's configuration.
When I say buffer memory, I am referring to random-access memory (RAM) used to hold data temporarily before it passes to a desired application. Every application on the system has a fixed size data buffer (memory allocated from a common pool). Attackers use techniques to fill a buffer with data until there is no buffer space left—this is known as buffer overflow. It is important to know or detect the actual operating system before you try to execute such scripts to exploit vulnerabilities. Use OS detection first, or you may end up sending Linux shellcode to a FreeBSD server.