Any computer security experts out there?

I’ve been reading on computer security recently and I have a hard time figuring out which attacks affect which architectural layer. Let me give you an example.

Let’s say someone uses a flaw in a CGI, ASP or similar and gains access to restricted information on some database (by pasting some malicious string on a browser for example). Since the attack targets a webapp, I’d be inclined to say this is an application layer attack. However, since the database is compromised, isn’t it also an attack on the DBMS (database management system) layer? Or is it both?

What about a virus or a worm? Would those be attacks on the application layer or the OS layer? I’m guessing application layer since the OS was not attacked directly. Then again, this gives an attacker control over the OS so, once again, does it affect both?

I’m confused. if anyone can shed some light on this, it’d be great.

Thanks for your time,

/gozu

In your first example, the target is the DB but the exploit was in an application.

In the second, it depends on what the exploit is doing. Does the trojan target the OS or the firewall (something like iptables or ipsec) opening access in? If firewall, then it’s application. The target is the OS but the fault was something else.

BUT… that last example is sort of gray because iptables and ipsec are often considered part of the OS because those elements install with the networking of the OS.