Ceh: Attack Phases: Understand penetration testing and the various methodologies used


CEH: Threats and Defense Mechanisms: Understand steps for Testing Stack Overflow in OllyDbg Debugger



Download 116.15 Kb.
Page4/4
Date31.01.2017
Size116.15 Kb.
#12833
1   2   3   4

CEH: Threats and Defense Mechanisms: Understand steps for Testing Stack Overflow in OllyDbg Debugger

OllyDBG is an open source dissembler. It allows a programmer to see the actually make up of a binary file and monitor critical elements like register values as the program runs step by step. To trace a stack based buffer overflow the researcher must run the executable in the disassembler and when input is requested, monitor the EIP register that contains the address of the next instruction. This register is not supposed to be directly accessible to the programmer but if a larger input than could be handled was giving to a variable the EIP register can be overwritten.

“Fuzzing” applications test for this condition in order to show the robustness of an application but they don’t check for deliberate overflows. OllyDBG can be used to test for buffer overflows put the commercial tool “IDA Pro” is often preferred.



CEH: Threats and Defense Mechanisms: Understand Buffer Overflow Pen Testing
There are a few basic things to look out for when considering buffer overflow vulnerabilities. These include:

Requirements of design

Any application development project should be managed in accordance with relevant standards for the industry in which the application will be used. Although project management, testing, development, and maturity models are outside of the scope of CEH, they play an important role in the development community.

At the very least, make sure every application meets these criteria:

No bypass of authentication is possible

No input from users that can exploit vulnerabilities

No “shrink wrap code” vulnerabilities

Shrink wrap code refers to shared program libraries and possibly to entire applications that are utilized in the creation of new products.

Dangerous functions

The most important technique in defending against buffer overflow vulnerabilities is to observe the best possible secure coding practices in the first place. In the language “C” strcpy() and strncpy() are considered vulnerable functions. Compilers exist that will root out the use of this and similar code; however, when programmers are used to a particular compiler they have worked with for 20 years and know how to keep it happy, it can be a hard political battle to get them to change. To be truthful, there must be a strong business case to even ask them; otherwise, the project deadline will be the priority.



Bounds checking

“Bounds checking” or “input sanitizing” is the detail of making sure that a user’s first name should not be entered as 300 bytes (referring to our example). Whenever input is requested, codethat checks to see if the input meets certain criteria must be enforced . “Clean input” is defined as meeting certain constraints such as not being larger than what the malloc() (Memory allocation) function was that set up the variable size in the first place. Special characters must be properly rejected or escaped as well, meaning they are not to be processed by the interpreter but rather ignored or seen literally as just characters.



Canary bytes

Canary bytes are placed by the programmer in the last four bytes of the variable space, also called the “stack frame.” These are checked to see if an attempt has been made to overwrite them, which would be the case in a buffer overflow exploit. This technique could also be used as a troubleshooting measure when debugging code.



IDS signatures

Intrusion detection systems (IDS) can look for NOP sleds. However, there are many ways that a skilled and creative programmer can cause an application to do nothing for a while. The CEH exam will likely stick with 0x90 and not expect intricate knowledge of assembly bytes for various platforms, but in the real world it is important to note there is a constant game being played in this area between the good guys and bad guys. Automatic penetration testing tools have built-in noop generators for IDS evasion.

The CEH exam does not require you to be a programmer but it could show you some source code and ask about a few basics. Just to be sure, try to run the following example and look at the code carefully. If you have never written a line of C before, see if you can guess what each line means.


CEH: Secure Network Infrastructures: Gain insights on Advanced Encryption Standard (AES)




AES is used commonly found in Wireless networks (802.11 a/b/g/n) and that configuration is known as WPA2-Personal. Or WPA2-Enterprise if RADIUS and or other authentication and identity management technologies are also in place. The encryption algorithm that was chosen for the standard in most cases is Rijndael.

The opportunity from the point of view of the attacker is that clients often just accept a password from which the AES key material will be created. No matter how strong the AES implementation is, if a client application asks for a password that can be guessed then the attacker will have access.






CEH: Attack Phases: Understand Penetration Testing Roadmap

The best way to view the process of a penetration test is to modify the CEH methodology of attacks to fit a format penetration test. Here is a quick refresher with the extra steps we discuss in this chapter.

  1. Initiating the engagement

  2. Project scope and charter

  3. Reconnaissance

  4. Scanning

  5. Unearth initial information

  6. Locate the network range

  7. Ascertain active machines

  8. Discover open ports and access points

  9. Detect operating systems

  10. Uncover services on ports

  11. Map the network

  12. Vulnerability assessment

  13. Gaining access

  14. STOP!!

It is almost always unacceptable to maintain access or gain complete control of a system when performing a defense-oriented test. This is, of course, always a matter of negotiation with the client and expectations must be clear and in writing.

The steps change slightly depending on the type of test that has been ordered. The most important thing is not to breach the rules of engagement, test systems you do not have permission to test, or violate the confidentiality of data. We also make a best effort to avoid denial of service although this is an inherent risk that the client must be made aware of and will agree to in writing. The point is to prove the vulnerability is there and to document supporting facts that explain how it was discovered, why it matters, and what can be done about it.



An example would be a XSS attack. Once a proof of concept “Hello There!” type alert() box can be delivered across the vulnerability, the problem is proven. The rest is simply a matter of the skill an attacker would have with JavaScript to do more damage. Take a screen shot of the alert() box in the middle of the vulnerable page and provide it in the final report along with the URL that contains the code. Then move on.

Download 116.15 Kb.

Share with your friends:
1   2   3   4




The database is protected by copyright ©ininet.org 2024
send message

    Main page