My mission - Javascript

This is the place for ALL of the user submitted challenges. If you create a little challenge/mission/riddle/whatever, post it here.
Forum rules
Do not post missions that you did NOT create without proper citing.

My mission - Javascript

Post by specu14 on Thu May 22, 2014 4:33 pm
([msg=80901]see My mission - Javascript[/msg])

Hi! It's a javascript mission
That's what you have to bypass:

JS functions
Code: Select all
function _trim(v){v=v.replace(/^\s+/,"");v=v.replace(/\s+$/,"");v=v.replace(/\s+/g," ");return v;}
function checkform(f){ 
   var p = f.login;
   p.value = _trim(p.value);
   if(p.value == ""){alert("login"); p.focus(); return false;}
   p = f.password;
   p.value = _trim(p.value);
   if(p.value == ""){alert("password"); p.focus(); return false;}
   p.value=hex_md5(p.value);
   p = f.cmd_submit;
   p.blur();
   p.value = "Wait...";
   p.disabled = true;
   return true;
}


Page source:
Code: Select all
<html>
<head>
<title>Login form</title>
<META HTTP-EQUIV="Expires" CONTENT="0">
<!--<META HTTP-EQUIV="Cache-Control" CONTENT="no-store, no-cache, must-revalidate">-->
<!--<META HTTP-EQUIV="Cache-Control" CONTENT="post-check=0, pre-check=0">-->
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<style type="text/css">
body, div, input, table, td {font-family:Verdana,Tahoma,Arial; font-size:10px;}
.msg {margin:20px; color:red; font-weight:bold; font-size:13px;}
</style>
<script type="text/javascript" language="javascript" src="md5.js"></script>
<script type="text/javascript" language="javascript">
function _trim(v){v=v.replace(/^\s+/,"");v=v.replace(/\s+$/,"");v=v.replace(/\s+/g," ");return v;}
function checkform(f){ 
   var p = f.login;
   p.value = _trim(p.value);
   if(p.value == ""){alert("login"); p.focus(); return false;}
   p = f.password;
   p.value = _trim(p.value);
   if(p.value == ""){alert("password"); p.focus(); return false;}
   p.value=hex_md5(p.value);
   p = f.cmd_submit;
   p.blur();
   p.value = "Wait ...";
   p.disabled = true;
   return true;
}
</script>
<script type="text/javascript" language="javascript">if(self!=parent){parent.location.replace(self.location.href);}</script>
</head>
<body bgcolor="#f0ece0"><center>
   
<form action="/site/panel/login.php" method="post" onsubmit="return checkform(this);" style="margin:0;">
<input type="hidden" name="token" value="4cafd07e745fba76d9c36b1b812ca38c">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td align="center">
<div class="msg">Login or password are invalid.</div>
   <table width="350" border="0" cellspacing="2" cellpadding="2" bgcolor="#f7f5c9" style="border:1px solid #890000;">
   <tr bgcolor="#890000"><td colspan="2" height="25" align="center" style="color:#ffffff;"><b>login to panel</b></td></tr>
   <tr><td width="20%" height="30" align="right">login:</td><td width="80%"><input type="text" name="login" maxlength="20" style="width:100%;"></td></tr>
   <tr><td width="20%" height="30" align="right">hasło:</td><td width="80%"><input type="password" name="password" style="width:100%;"></td></tr>
   </table><br>
   <div><input type="submit" name="cmd_submit" value="LOG IN" style="width:120px;"></div>
   <br><br><br><br><br><br><br><br><br>
   
</td></tr></table>
</form>
   </center></body></html>
Last edited by specu14 on Thu May 22, 2014 4:50 pm, edited 4 times in total.
specu14
New User
New User
 
Posts: 1
Joined: Thu May 22, 2014 4:30 pm
Blog: View Blog (0)


Re: My mission - Javascript

Post by tremor77 on Thu May 22, 2014 4:43 pm
([msg=80903]see Re: My mission - Javascript[/msg])

Without the context of the webpage this script resides in, it is absolutely useless and does nothing.
Last edited by tremor77 on Fri May 23, 2014 12:06 pm, edited 2 times in total.
Image
User avatar
tremor77
Contributor
Contributor
 
Posts: 911
Joined: Wed Mar 31, 2010 12:00 pm
Location: New York
Blog: View Blog (0)


Re: My mission - Javascript

Post by pretentious on Fri May 23, 2014 9:32 am
([msg=80919]see Re: My mission - Javascript[/msg])

bump because user submitted missions need to be encouraged.
Taking a look. Too bad I suck at javascript
Goatboy wrote:Oh, that's simple. All you need to do is dedicate many years of your life to studying security.

IF you feel like exchanging ASCII arrays, let me know ;)
pretentious wrote:Welcome to bat country
User avatar
pretentious
Contributor
Contributor
 
Posts: 705
Joined: Wed Mar 03, 2010 12:48 am
Blog: View Blog (0)


Re: My mission - Javascript

Post by tremor77 on Fri May 23, 2014 12:10 pm
([msg=80925]see Re: My mission - Javascript[/msg])

I see you added the page source... well, this still does nothing. Your form post is going to a relative path PHP form processor that doesn't exist.

Code: Select all
<form action="/site/panel/login.php" method="post" onsubmit="return checkform(this);" style="margin:0;">


I get the idea that you're trying to actually use the mission post area as an attempt to get us to help you hack into an actual site or login page somewhere. :evil:
Image
User avatar
tremor77
Contributor
Contributor
 
Posts: 911
Joined: Wed Mar 31, 2010 12:00 pm
Location: New York
Blog: View Blog (0)


Re: My mission - Javascript

Post by cyberdrain on Fri May 23, 2014 5:49 pm
([msg=80937]see Re: My mission - Javascript[/msg])

OP, would you be so kind as to upload it to a free hosting site? It would probably help people trying to figure it out. More importantly: good job on making a mission! Please keep it up / improve on it if you want :D
Free your mind / Think clearly
I use the sarcasm color for both sarcasm and irony
User avatar
cyberdrain
Addict
Addict
 
Posts: 1502
Joined: Sun Nov 27, 2011 1:58 pm
Blog: View Blog (0)



Return to User Submitted

Who is online

Users browsing this forum: No registered users and 0 guests