A perfect example of this is XSS and BeEF. To find out if a Web application is vulnerable to XSS, a pen tester (or attacker) will usually insert a JavaScript alert statement into a search field. If the returned page results in a pop-up alert box, then the Web app is vulnerable. An alert box is pretty harmless, so using the alert method as an example during a meeting with the client elicits very little alarm.
Now for BeEF: Take the same scenario and, instead of a JavaScript alert statement, insert a script tag that includes the source tag pointing to your Web server where BeEF is installed (it's a PHP application that requires very little initial configuration). As soon as a client browses to the page you've attacked, BLAM! -- they are hooked and now a zombie under your control within the BeEF Web interface.
While this is a very simple example, it illustrates the fine line between determining whether a Web vulnerability exists, and exploiting it to take control of a user's Web browser. SQL injection is another vulnerability where the same blurriness exists. Inputting a single quote in a login field could cause the back-end SQL query to error out, while adding a few hyphens, ones, and equals sign means you could slip right past the authentication.
Meantime, BeEF is a wonderful tool, and the latest version adds some awesome features, including integration with the Metasploit Framework, the ability to exploit extensions in Mozilla, better detection of the victim's browser, and tiered logging (so report writing is a little easier because you know exactly what happened). If you haven't used it before, then take a look -- it's a seriously powerful tool and should be part of any Web app pen tester's toolkit.
John H. Sawyer is a senior security engineer on the IT Security Team at the University of Florida. The views and opinions expressed in this blog are his own and do not represent the views and opinions of the UF IT Security Team or the University of Florida. When John's not fighting flaming, malware-infested machines or performing autopsies on blitzed boxes, he can usually be found hanging with his family, bouncing a baby on one knee and balancing a laptop on the other. Special to Dark Reading.
| To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy. |