Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    WA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Local address change with JS?

    I would like to know if there's a code that would write a url into the address bar which would replace the current one.
    Example:
    I created my own homepage locally and on it included the sign-in form for Hotmail. Trouble is, it won't work unless it has a referrer so I need to replace c:\home.html with http://www.hotmail.com

    It's also possible that I just might only need to replace or remove certain parts of the JS so here's the code I'm using:
    (I worked on this for a week and couldn't figure it out)
    Code:
    <html>
    <body>
    	<!-- INSERT HOTMAIL LOGIN HERE //-->
    <script language="JavaScript"><!-- //
    var CBSigninTxt1 = "", CBSigninTxt2 = "";
    var CBLoginHead = "", CBLoginBody = "", CBLoginOnLoad = "";
    var PPCBBodyPre = "", PPCBBodyPost = "";
    function MPS_BodyOnload() { if (CBLoginOnLoad != "") { eval(CBLoginOnLoad); } }
    function MPS_NormalizeURL(szURL) {
      var szNURL = szURL;
      if (window.location.protocol == "http:"){
       if (szURL.substring(0,5).toLowerCase() == "https")
        szNURL = "http" + szURL.substring(5, szURL.length);}
      return(szNURL);
    }
    // --></script>
    <script language="JavaScript" src="http://cb.msn.com/passport/cbhm_js.ashx?PP_SERVICE=login&PP_PAGE=ppBadPswd&lid=1033"></script>
    
    <script language="JavaScript"><!-- //
    if (CBLoginHead) { document.write(CBLoginHead); }
    // --></script>
    <script language="JavaScript">
    <!-- //
    	if (top != self) 
    	{
    		top.location.replace(self.location.href.toLowerCase());
    	}
    function email2domain(sName)
    {
    	var len = sName.length;
    	var iAt = sName.indexOf('@');
    	var outName = "passport_com";
    	var inDomain = sName.substr(iAt+1, len);
    	var DomainSplit = "charter.com;compaq.net;default;hotmail.com;msn.com;passport.com;webtv.net";
    	DomainSplit = DomainSplit.split(";");
    	var i;
    	for (i = 0; i < DomainSplit.length; i++)
    	{
    		if (DomainSplit[i].toLowerCase() == inDomain.toLowerCase() )
    		{
    			
    			
    			outName = "";
    			var tmp = DomainSplit[i];
    			var x = 0;
    			var ch;
    			for( x = 0; x < tmp.length; x++)
    			{
    				ch = tmp.charAt(x);
    				if((ch == '.') || (ch=='-'))
    					ch = '_';
    				outName = outName + ch;
    			}
    			break;
    		}
    	}
    	return outName;
    }
    function email2login(sName)
    {
    	if( !sName )
    		return null;
    	
    	var outName = sName;
    	
    	var len = sName.length;
    	var iAt = sName.indexOf('@');
    	var inDomain = sName.substr(iAt+1, len);
    	var DomainSplit = "charter.com;compaq.net;default;hotmail.com;msn.com;passport.com;webtv.net";
    	DomainSplit = DomainSplit.split(";");
    	var i;
    	for (i = 0; i < DomainSplit.length; i++)
    	{
    		if (DomainSplit[i].toLowerCase() == inDomain.toLowerCase() )
    		{
    			
    			
    			outName = sName.substr(0, iAt);
    			break;
    		}
    	}
    	return outName;
    }
    function OnOtherSubmitEventHandler()
    {
      DoOtherSubmit();
      return false;
    }
    function OnLoginSubmitEventHandler()
    {
      return DoSubmit();
      return false;
    }
    function DoOtherSubmit()
    {
    	document.form1.submit();
    }
    function DoSubmit()
    {
    	var actionform, selectIndex, lvalue;
    	lvalue = document.form1.login.value
    	if (!lvalue)
    	{
    		alert("Please type your e-mail address.");
    		return false;
    	}
    	if(lvalue.charAt(0) > '~')
    	{
    		alert("Please switch your Input Method Editor(IME) to the Half-Width ASCII setting and retype your e-mail address.");
    		return false;
    	}
    	if((lvalue.indexOf('@') == -1) || (lvalue.indexOf('.') == -1))
    	{
    		alert("Please type your complete e-mail address. Example: someone@microsoft.com.");
    		return false;
    	}
    	if(!document.form1.passwd.value)
    	{
    		alert("Please type your password.");
    		return false;
    	}
    	eval("actionform = document." + email2domain(lvalue));
    	var loginName = email2login(lvalue);
    	
    	if( typeof(actionform) == "undefined")
    		actionform = document.form1;
    			actionform.login.value = loginName;
    			actionform.passwd.value = document.form1.passwd.value;
    			actionform.sec.value = document.form1.sec.checked ? document.form1.sec.value : "";
    			actionform.mspp_shared.value = document.form1.mspp_shared.checked ? document.form1.mspp_shared.value : "";
    		actionform.submit();
    			return false;
    }
    function HMConcatenate()
    {
    	var sLogin=document.form1.login.value;
    	if (sLogin.indexOf('@') == -1)
    	{
    		document.form1.login.value = document.form1.login.value + "@hotmail.com";
    	}
    }
    // -->
    </script>
    
    <script language="JavaScript"><!-- //
    if (PPCBBodyPost) { document.write(PPCBBodyPost); }		
    // -->
    </script>
    
    <table border="1" bgcolor="#ccccff" cellpadding="3" cellspacing="3" bordercolor="#cc00ff" style="margin-top:8px;">
    <tr><td align="center" valign="middle">
    <form target="_self" name="form1" action="https://login.passport.com/ppsecure/post.srf?lc=1033&id=2&ru=http://www.hotmail.msn.com/cgi-bin/sbox&tw=20&cbid=24325&da=passport.com&kpp=2&svc=mail&msppjph=1" method="post">
    <input type="hidden" name="notinframe" value="1">
    <table bgcolor="#ccccff" border="1" bordercolor="#0000bb" cellpadding="1" cellspacing="1" width="200" height="150" style="margin-top:0px;">
    <tr><td align="center" background="http://www.littleariel.com/hotmail.jpg">
    <table border="0" cellpadding="1" cellspacing="1" bordercolor="#550000">
    <tr><td align="center">
    
    </td>
    </tr><tr>
    <td align="center" valign="bottom"><div align="center" style="margin-top:25px;"><label for="loginid"><img src="http://www.littleariel.com/email.jpg" border="1" width="46" height="14" />&nbsp;&nbsp;</label><input type="text" onBlur="HMConcatenate();" name="login" id="loginid" tabindex="1" maxlength="129" size="15" value="User Name" autocomplete="OFF" onClick="SelText();"></div>
    </td>
    </tr><tr>
    <td align="center" valign="bottom"><div align="center" style="margin-top:4px;"><img src="http://www.littleariel.com/pass.jpg" border="1" width="46" height="14" />&nbsp;&nbsp;<input type="password" name="passwd" maxlength="15" size="15" tabindex="2" autocomplete="OFF"></div>
    </td>
    </tr><tr>
    <td><div align="center" style="margin-top:6px;"><input class="a" type="submit" onfocus="this.blur();" tabindex="4" value=" Sign In " id="submit1" name="submit1"></div>
    
    </form>
    </td></tr></table>
    </td></tr></table>
    </td></tr></table>
    	<!-- END HOTMAIL LOGIN //-->
    
    </body>
    </html>
    Thanks much in advance for the assistance
    Have a GREAT Ariel day!!
    Mike
    LittleAriel.com

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    The point of hotmail using the referrer is so that people can't make their own login forms for hotmail. I am sure you probably have completely honest intentions in creating your own personal login for hotmail however it would be an obvious security risk to show any ways of getting around hotmails security measures. Others could take that knowledge and create publicly available hotmail login forms with the intention of stealing login information.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    WA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ?

    Originally posted by Spookster
    The point of hotmail using the referrer is so that people can't make their own login forms for hotmail. I am sure you probably have completely honest intentions in creating your own personal login for hotmail however it would be an obvious security risk to show any ways of getting around hotmails security measures. Others could take that knowledge and create publicly available hotmail login forms with the intention of stealing login information.
    ???
    Wheather I use the form from my desktop or the from from Hotmail, I still need a username and password.
    I'm not trying to overcome and security as I'm sure you know.
    I'm just trying to make it easier for myself to access the login page and login
    Did I maybe explain my intentions wrongly?
    Have a GREAT Ariel day!!
    Mike
    LittleAriel.com

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    You didn't explain your intentions wrong. I completely understand what you want to do. You want to be able to not have to go to the hotmail site to log in but instead create your own personal default homepage for your browser which would contain a form to be able to login to hotmail.

    What I said was hotmail implements those security measures so that people cannot login to hotmail from any form that does not reside on their servers.

    If we discuss here in this public forum how to circumvent those security measures so that you will be able to login from your own personal local default page, other people could use that knowledge to create login forms on their public servers that will interecept peoples login information before it ever reaches the hotmail servers.

    Did I explain it more clearly this time?
    Last edited by Spookster; 03-27-2003 at 05:36 AM.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #5
    New Coder
    Join Date
    Aug 2002
    Location
    WA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Spooks,
    I very much apprciate your candor.
    I'm also glad that I was able to explain it right the first time.
    I admit to being a little disappointed that I will be unable to
    create this form, but I didn't realize that there could be ANY
    security risk.
    Since you've explained it very well, I now understand... and
    will no longer pursue this endeavor.
    Thanks again for your help
    Have a GREAT Ariel day!!
    Mike
    LittleAriel.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •