Malicious web programming

Discuss the many weaknesses of browser security and ways to mitigate the threat

Malicious web programming

Post by ampakine on Wed Jun 01, 2011 5:01 pm
([msg=58002]see Malicious web programming[/msg])

Malicious isn't the right word as it implies causing harm, what I mean is creating web applications capable of hacking site visitors. I often hear about "malicious web sites" and sometimes get warnings from firefox to avoid a particular site and I'd like to learn about how all this works. I know a fair bit of PHP and although I know very little javascript, I've been meaning to learn it for a long time so I'll gladly use this as an excuse. I really have little or no knowledge about how a website can hack the visitors so I don't even know where to begin asking questions. Do these "malicious websites" target the browsers or something? If so is this all the domain of javascript or can PHP be used to do it? I want to play around with building these "malicious sites" on my apache server and use myself as a guinea pig, that way I'll learn rapidly. Can anyone suggest a good place to start given that the only programming language I know so far is PHP?
ampakine
Experienced User
Experienced User
 
Posts: 65
Joined: Tue May 31, 2011 5:21 pm
Blog: View Blog (0)


Re: Malicious web programming

Post by Goatboy on Wed Jun 01, 2011 5:37 pm
([msg=58005]see Re: Malicious web programming[/msg])

Generally a website is labeled as malicious if it tries to exploit a vulnerability in either the browser or some application connected to it. These might be the Java VM that runs some web-apps, might be Flash, might be ActiveX for IE. Might be many things other than the browser itself. And these are usually patched pretty quickly once they have been used, so you'd need some fresh 0-day to really get any benefit.

As for just using PHP, the best you can do is probably log their IP or steal cookies. I suppose you could be annoying about it and redirect them to a shock site, but that's not what I would consider malicious.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2815
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Malicious web programming

Post by ampakine on Wed Jun 01, 2011 5:47 pm
([msg=58006]see Re: Malicious web programming[/msg])

Can you elaborate on stealing cookies? Can you steal cookies set by other websites?
ampakine
Experienced User
Experienced User
 
Posts: 65
Joined: Tue May 31, 2011 5:21 pm
Blog: View Blog (0)


Re: Malicious web programming

Post by Goatboy on Wed Jun 01, 2011 6:22 pm
([msg=58012]see Re: Malicious web programming[/msg])

ampakine wrote:Can you elaborate on stealing cookies?

Basically you discover a XSS vulnerability on a site and use that to generate a link to your site containing the cookie info, which you log. XSS is when something is typed in and then displayed on the site without being properly sanitized first. This means you can type JavaScript code and have it be executed.

ampakine wrote:Can you steal cookies set by other websites?

Only if the ste in question is vulnerable, as above.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2815
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Malicious web programming

Post by Okeymaker on Sun Jun 12, 2011 4:27 pm
([msg=58407]see Re: Malicious web programming[/msg])

Some easy ways to actually HARM a visitor would be through javascript and vbscript (in IE). Vbscript is not as powerful as it was, because of several reasons. One is that all advanced Active X operations are prompted multiple times by IE nowdays. But still it has potential to really harm someone foolish enough.
I have some knowledge in vbscript but I am not going to show any "hardcore" harmful scripts, because they would most probaly be censored. But I CAN show you some "malicious" javascript. Actually I don't know javascript very well, but an EXTREMELY simple way to mess aound and crasch someones browser session would be to place this code in the head section:
Code: Select all
<script type="text/javascript">
while(1) {
        alert("EVIL CODE!");
}

</script>
~SEEK AND HEAL~ Failure
User avatar
Okeymaker
Experienced User
Experienced User
 
Posts: 59
Joined: Tue Jan 04, 2011 11:22 am
Blog: View Blog (0)



Return to Web

Who is online

Users browsing this forum: No registered users and 0 guests