<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Otros</title>
        <link>http://geekswithblogs.net/apopovsky/category/9996.aspx</link>
        <description>Otros</description>
        <language>es-AR</language>
        <copyright>Ariel Popovsky</copyright>
        <managingEditor>apopovsky@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Finding an alert in the middle of your javascript</title>
            <link>http://geekswithblogs.net/apopovsky/archive/2011/03/11/finding-an-alert-in-the-middle-of-your-javascript.aspx</link>
            <description>&lt;p&gt;I was debugging a script injection issue the other day using some sample code with an alert in it. The alert was popping out meaning the code got executed leaving open the possibility for a hacker to put there some nasty malicious code. I knew my alert was being executed but didn’t know how. So I tried something that worked perfectly for this problem, replaced the native alert function with my own one.&lt;/p&gt;  &lt;p&gt;All I had to do in Chrome was open the javascript console and type:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;alert = function(msg){ console.log(msg); console.trace(); };&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The next time the malicious code was executed, instead of the regular alert I got something similar to this:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;alert("testing")&lt;/p&gt;    &lt;p&gt;testing&lt;/p&gt;    &lt;p&gt;console.trace()&lt;/p&gt;    &lt;p&gt;alert&lt;a href="chrome-devtools://devtools/devtools.html?docked=true&amp;amp;toolbar_color=rgba(194,217,122,1)&amp;amp;text_color=rgba(0,0,0,1)"&gt;:2&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;(anonymous function)&lt;a href="chrome-devtools://devtools/devtools.html?docked=true&amp;amp;toolbar_color=rgba(194,217,122,1)&amp;amp;text_color=rgba(0,0,0,1)"&gt;:2&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;InjectedScript._evaluateOn&lt;a href="chrome-devtools://devtools/devtools.html?docked=true&amp;amp;toolbar_color=rgba(194,217,122,1)&amp;amp;text_color=rgba(0,0,0,1)"&gt;:312&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;InjectedScript._evaluateAndWrap&lt;a href="chrome-devtools://devtools/devtools.html?docked=true&amp;amp;toolbar_color=rgba(194,217,122,1)&amp;amp;text_color=rgba(0,0,0,1)"&gt;:294&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;InjectedScript.evaluate&lt;a href="chrome-devtools://devtools/devtools.html?docked=true&amp;amp;toolbar_color=rgba(194,217,122,1)&amp;amp;text_color=rgba(0,0,0,1)"&gt;:288&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;undefined&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In my case I was able to see what was going on and find the offending function.&lt;/p&gt;  &lt;p&gt;This was tested on Firebug in Firefox and it works as.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/apopovsky/aggbug/144319.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ariel Popovsky</dc:creator>
            <guid>http://geekswithblogs.net/apopovsky/archive/2011/03/11/finding-an-alert-in-the-middle-of-your-javascript.aspx</guid>
            <pubDate>Fri, 11 Mar 2011 21:40:22 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/apopovsky/comments/144319.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/apopovsky/archive/2011/03/11/finding-an-alert-in-the-middle-of-your-javascript.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/apopovsky/comments/commentRss/144319.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/apopovsky/services/trackbacks/144319.aspx</trackback:ping>
        </item>
    </channel>
</rss>
