[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 591
  • Last Modified:

Javascript Syntax Error after decoding

I'm trying to customize a page we have running here, However I did not build the page.
It's an open source plug-in for running a hotspot.

I just want too add some text to it but it seems to be encrypted in Hex.

I managed to decrypt it online but now it doesn't work properly. (See Pics)
I think it's just a simple syntax problem but I'm not sure.

None of the JS files referenced in the code have been decrypted or modified.

My HTML work has been in frontpage guess I'm spoiled lol

I'd appreciate any help.
ORIGINAL PAGE-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	
<script>
<!--
document.write(unescape("%3Chead%3E%0D%0A%09%09%3Cp%20align%3D%22center%22%3E%3Cb%3E%3Cfont%20face%3D%22Arial%22%20size%3D%222%22%3E%0D%0A%09%09WWW.INSIDESTORE.EU%3C/a%3E%20-%20%0D%0A%09%09%3Cfont%20color%3D%22%231B7615%22%3EEVERYTHING%20FOR WIFI%2CWLAN%2C...%20%3C/font%3E%3C/font%3E%3C/b%3E%3C/p%3E%0D%0A%09%09%3Cp%20align%3D%22center%22%3E%3Cimg%20src%3D%22dostop.jpg%22%20alt%3D%22%22%20width%3D%22480%22%20height%3D%22295%22%20/%3E%3C/p%3E%0D%0A%0D%0A%09%09%09%09%3C/div%3E%0D%0A%09%09%09%09%3C/div%3E%0D%0A%09%09%3Ctitle%3EMembers-only%20area%3C/title%3E%0D%0A%09%09%3Cmeta%20name%3D%22Content-Type%22%20content%3D%22text/html%3B%20charset%3Dutf-8%22%3E%0D%0A%09%09%3Clink%20rel%3D%22stylesheet%22%20href%3D%22stylesheets/login.css%22%20type%3D%22text/css%22%3E%0D%0A%09%09%3Cscript%20type%3D%22text/javascript%22%20src%3D%22javascripts/mootools.v1.00.js%22%3E%3C/script%3E%0D%0A%09%09%3Cscript%20type%3D%22text/javascript%22%20src%3D%22javascripts/dollarb.js%22%3E%3C/script%3E%0D%0A%09%09%3Cscript%20type%3D%22text/javascript%22%20src%3D%22javascripts/encription.js%22%3E%3C/script%3E%0D%0A%09%09%3Cscript%20type%3D%22text/javascript%22%20src%3D%22javascripts/login.js%22%3E%3C/script%3E%0D%0A%09%3C/head%3E%0D%0A"));
//-->
</script>
	<body>
		<noscript>
			
<h1>We're sorry</h1>
			<p>
				Proceeding requires javascript and it seems it isn't supported or
				enabled in your browser.
			</p>
		</noscript>
		<div id="login-wrapper"></div>
		<form id="login-data">
			<input type="hidden" value="$redirect" id="login-data-redirect">
			<input type="hidden" value="$action" id="login-data-action">
		</form>
	</body>
</html>
 
 __________________________________________________________________________________________
 
 
PAGE AFTER DECODING-
 
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
	\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html>
	
<script>
<!--
document.write(unescape(\"<head>
		<p align="center"><b><font face="Arial" size="2">
		WWW.INSIDESTORE.EU</a> - 
		<font color="#1B7615">EVERYTHING FOR WIFI,WLAN,... </font></font></b></p>
		<p align="center"><img src="dostop.jpg" alt="" width="480" height="295" /></p>
 
				</div>
				</div>
		<title>Members-only area</title>
		<meta name="Content-Type" content="text/html; charset=utf-8">
		<link rel="stylesheet" href="stylesheets/login.css" type="text/css">
		<script type="text/javascript" src="javascripts/mootools.v1.00.js"></script>
		<script type="text/javascript" src="javascripts/dollarb.js"></script>
		<script type="text/javascript" src="javascripts/encription.js"></script>
		<script type="text/javascript" src="javascripts/login.js"></script>
	</head>
\"));
//-->
</script>
	<body>
		<noscript>
			
<h1>We\'re sorry</h1>
			<p>
				Proceeding requires javascript and it seems it isn\'t supported or
				enabled in your browser.
			</p>
		</noscript>
		<div id=\"login-wrapper\"></div>
		<form id=\"login-data\">
			<input type=\"hidden\" value=\"$redirect\" id=\"login-data-redirect\">
			<input type=\"hidden\" value=\"$action\" id=\"login-data-action\">
		</form>
	</body>
</html>

Open in new window

Before.JPG
After.JPG
0
ken82m
Asked:
ken82m
  • 3
  • 3
1 Solution
 
hieloCommented:
instead of:
unescape(\"...\")

try:
unescape('...')
0
 
ken82mAuthor Commented:
same thing
0
 
hieloCommented:
if you decode the encoded string you just get:
<head>
		<p align="center"><b><font face="Arial" size="2">
		WWW.INSIDESTORE.EU</a> - 
		<font color="#1B7615">EVERYTHING FOR WIFI,WLAN,... </font></font></b></p>
		<p align="center"><img src="dostop.jpg" alt="" width="480" height="295" /></p>
 
				</div>
				</div>
		<title>Members-only area</title>
		<meta name="Content-Type" content="text/html; charset=utf-8">
		<link rel="stylesheet" href="stylesheets/login.css" type="text/css">
		<script type="text/javascript" src="javascripts/mootools.v1.00.js"></script>
		<script type="text/javascript" src="javascripts/dollarb.js"></script>
		<script type="text/javascript" src="javascripts/encription.js"></script>
		<script type="text/javascript" src="javascripts/login.js"></script>
	</head>
 
 
So ultimately, your page should be:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
		<p align="center"><b><font face="Arial" size="2">
		WWW.INSIDESTORE.EU</a> - 
		<font color="#1B7615">EVERYTHING FOR WIFI,WLAN,... </font></font></b></p>
		<p align="center"><img src="dostop.jpg" alt="" width="480" height="295" /></p>
 
				</div>
				</div>
		<title>Members-only area</title>
		<meta name="Content-Type" content="text/html; charset=utf-8">
		<link rel="stylesheet" href="stylesheets/login.css" type="text/css">
		<script type="text/javascript" src="javascripts/mootools.v1.00.js"></script>
		<script type="text/javascript" src="javascripts/dollarb.js"></script>
		<script type="text/javascript" src="javascripts/encription.js"></script>
		<script type="text/javascript" src="javascripts/login.js"></script>
	</head>
	
	<body>
		<noscript>
			
<h1>We're sorry</h1>
			<p>
				Proceeding requires javascript and it seems it isn't supported or
				enabled in your browser.
			</p>
		</noscript>
		<div id="login-wrapper"></div>
		<form id="login-data">
			<input type="hidden" value="$redirect" id="login-data-redirect">
			<input type="hidden" value="$action" id="login-data-action">
		</form>
	</body>
</html>
 
 
even though the encoded string incorrectly contains <p> tags within the <head> element.

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ken82mAuthor Commented:
Great! Thank you very much :)

What did you use to decode it?  Or did you just fix what I had already decoded?
0
 
hieloCommented:
>>What did you use to decode it?
I just copied the script block of your original post (the one that works) and changed the document.write to alert() to see what's the expected result.
0
 
ken82mAuthor Commented:
Again, thanks alot for the help :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now