Hola, soy nuevo por aqui y queria ver si alguien me puede echar una mano.
Tengo una wifi abierta que cuando te conectas te asigna una ip del rango 10.240.1.0 y al abrir el navegador te lleva a un portal cautivo (captive portal) en la ip 10.240.1.253 donde te pide usuario y pass. Como es obvio ya probé sin resultado varios logins.
La pregunta es si habrá algun modo de saltarse el portal cautivo o de encontrar algun bug o intentar explotar, no se si con sql injection otro tipo de exploits.
Revisando el codigo fuente de la pagina de login:
<!-- ret_code:0 -->
<html>
<head>
<title>Captive Portal</title>
<link rel="stylesheet" type="text/css" href="portal.css">
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
</head>
<body style="width: 100%; height: 100%; text-align:center; ">
<form method="post" action="authUser.php">
<!-- hidden variables -->
<input type="hidden" name="wlan" value="3">
<input type="hidden" name="cp_type" value="5">
<input type="hidden" name="hFromPage" id="hFromPage" value="login.php">
<input type="hidden" name="hURL" id="hURL" value="127.0.0.1">
<input type="hidden" name="hToken" id="hToken" value="BPd8x6_Iz1EQyZMKhAVh1Q!!">
<input type="hidden" name="dest" id="dest" value="www.google.es/">
<input type="hidden" name="useIndex" id="useIndex" value="0">
<!-- end of hidden variables
-->
<!-- panel -->
<div style="position:relative; width: 800px; margin: 0px auto; ">
<div style="width:790px;height:550px;text-align:left; margin: 0px auto; ">
<div style="text-align:center;margin-bottom: 5px;top:100px;left:0px;width:790px;overflow: hidden; position:absolute;display:none;"></div>
<div id="" style="top:150px;left:0px;width:790px;height:100px;z-index:1000;overflow: hidden; position:absolute;">
<table width="100%" align="center">
<tr><td width="50%" align="right" style="font-weight:bold;"><span id="loginLabel" style="">Login:</span></td>
<td><input id="uName" name="uName" type="text" size="20" maxlength="255"></td>
<td width="50%"></td>
</tr>
<tr><td align="right" style="font-weight:bold;"><span id="passwordLabel">Password:</span></td>
<td><input id="uPwd" name="uPwd" type="password" size="20" maxlength="255"></td>
<td></td>
</tr>
<tr><td></td>
<td align="center"><input name="subBtn" id="subBtn" type="submit" value="Submit" onclick="return goLogin();"></td>
<td></td>
</tr>
</table>
</div>
</div>
</div>
<!-- client scripts -->
<script language="javascript">
window.onload = function()
{
if(document.getElementById("uName") && document.getElementById("uName").style.display=="") {
document.getElementById("uName").focus();
} else if(document.getElementById("subBtn")&& document.getElementById("subBtn").style.display=="") {
document.getElementById("subBtn").focus();
}
}
/* ======================================================================== */
function goLogin()
{
var userInput = document.getElementById("uName");
if(userInput && userInput.style.display=="" && userInput.value=="") {
var userLabel = document.getElementById("loginLabel") ? document.getElementById("loginLabel").innerHTML : "User";
alert(userLabel+ " is required");
return false;
}
if(document.getElementById("subBtn") && document.getElementById("subBtn").style.display=="") {
document.getElementById("subBtn").style.cursor = "wait";
document.getElementById("subBtn").disabled = true;
}
document.forms[0].submit();
}
/* ======================================================================== */
function popURL(strURL)
{
window.name = "firstChantryPortalPage";
var strFeat = "height=300,width=300,top=150,left=250,resizable=no,scrollbars=no,menubar=no,toolbar=no,location=no,status=no";
window.location.href = strURL;
var newPopWin = window.open("popLogin.php?ow=firstChantryPortalPage","ChantryPopupLogin",strFeat);
newPopWin.focus();
}
</script>
</form>
</body>
</html>
Me encuentro con authUser.php que accedo a el mediante 10.240.1.253/authUser.php me lleva a otra pagina que me dice Portal central y puedo ver mi tiempo en la pagina y me dice que no hay limite de tiempo para mi sesion, sin embargo no consigo navegar.
Os dejo el codigo fuente de authUser.php por si a alguien le dice algo mas, de donde conseguir una BBDD de usuarios/pass o algo por el estilo.
<html>
<head>
<title>Captive Portal</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
</head>
<body style="width: 100%; height: 100%; text-align:center; ">
<div style="position:relative; width: 800px; margin: 0px auto; ">
<form id="indexForm" name="indexForm" method="post" action="index.php">
<input type="hidden" name="wlan" value="0">
<input type="hidden" name="dest" value="">
<input type="hidden" name="act" value="">
<div style="width:790px;height:550px; text-align:left; margin: 0px auto;">
<div style=";top:45px;left:10px;width:130px;height:30px;overflow: hidden; position:absolute;"><font style='font-size: 12pt; font-weight: bold;'>Portal Central</font></div>
<div style=";top:100px;left:150px;width:130px;height:25px;overflow: hidden; position:absolute; "><input type='button' onclick='submitForm("logoff")' value='Logoff session' style='width:130;height:25; ' ></div>
<div style="text-align:left;top:130px;left:150px;width:600px;height:50px;overflow: hidden; position:absolute;"></div>
<div style=";top:185px;left:150px;width:130px;height:25px;overflow: hidden; position:absolute; "><input type='button' onclick='submitForm("status")' value='Get current status' style='width:130;height:25; ' ></div>
<div style="text-align:left;top:230px;left:150px;width:600px;height:50px;overflow: hidden; position:absolute;"></div>
<div style
=";top:310px;left:150px;width:600px;height:45px;overflow: hidden; position:absolute;">Warning
: If you have javascript enabled and your popup blocker turned off then leaving
, reloading or closing this window will
log you off automatically
.<BR
><HR align
=left SIZE
=1 width
='100%'></div
> <div style=";top:400px;left:150px;width:170px;height:22px;overflow: hidden; position:absolute;">Click URL for Site:</div>
<div style="text-align:left;top:400px;left:324px;width:428px;height:22px;display:inline;position:absolute;"><a href='http://' target='_blank'></a></div>
</div>
</form>
<!-- client scripts -->
<script language="javascript" type="text/javascript"><!--
var intent = false;
function unload(ret)
{
if (!intent) {
alert("If your popup blocker is disabled (or is not installed) you will be logged out when you press OK");
w=window.open('auto_logoff.php','','width=300,height=200,scrollbars,resizable=yes');
if(!w) {
var m='We were unable to log you off. This may have been caused by a popup blocker.';
if(ret) return m+' Please click Cancel and then click the Logout button.';
alert(m+' Your session will terminate when it times out.'); // if not firefox/mozilla/netscape or IE
}
}
}
window.onbeforeunload = function() {
return unload(1); // IE
}
function submitForm(action) {
var form = document.getElementById("indexForm");
if(form) {
intent=true;
form.act.value = action;
form.submit();
}
}
//-->
</script>
</div>
</body>
</html>
Tenia pensado subir unas imagenes para que os hicierais a la idea de la presentacion que tiene, pero no se como se suben imagenes.
Un saludo.