Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
04-30-2012, 03:53 AM
#1
Member
Registered: Jun 2011
Posts: 82
Rep:
cmdline login to a webpage to connect to internet
i have tikona internet connection. to connect to internet i go to
https://login.tikona.in/userportal/login.do 1.254.254.254 which then again redirects me to something like
https://login.tikona.in/userportal/l....255*&act=null (where * == 15|16 chars string) and then i enter username and pass to login and only then internet would work xor it would redierct every page to login page.
there have been occasions where i would want to connect to internet without using X. even links would not help.
so how can i do everything above using wget or curl ?
Last edited by ununun; 05-03-2012 at 03:19 AM .
04-30-2012, 05:45 AM
#2
Moderator
Registered: May 2001
Posts: 29,415
Start by checking the page(s) source if Javascript is required to function, if the form(s) use(s) GET or POST and what form field names and values need to be filled in?
04-30-2012, 06:21 AM
#3
Member
Registered: Jun 2011
Posts: 82
Original Poster
Rep:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>Tikona Digital Networks</title>
<link rel="stylesheet" type="text/css" href="/userportal/pages/css/style.css" />
<link rel="stylesheet" type="text/css" href="/userportal/pages/css/keyboard.css" />
<script language="JavaScript" type="text/javascript" src="/userportal/pages/js/cookie.js"></script>
<script language="JavaScript" type="text/javascript" src="/userportal/pages/js/common.js"></script>
<script language="javascript" type="text/javascript" src="/userportal/pages/js/getmsg.js"></script>
<script language="javascript" type="text/javascript" src="/userportal/pages/js/keyboard.js" charset="UTF-8"></script>
<script>
function onLoginPageLoad()
{
var rememberme=readCookie('rememberme');
var uname=readCookie('msgusername');
if(uname!=null)
{
loadContent(uname);
}
if(rememberme) {
document.forms[0].username.value=readCookie('rmusername');
document.forms[0].password.value=readCookie('rmpassword');
document.forms[0].rememberme.checked=true;
}
}
function saveRememberMeOptions()
{
if(document.forms[0].rememberme.checked) {
createCookie('rememberme','1',365);
createCookie('rmusername',document.forms[0].username.value,365);
createCookie('rmpassword',document.forms[0].password.value,365);
} else {
createCookie('rememberme','',-1);
createCookie('rmusername','',-1);
createCookie('rmpassword','',-1);
}
return true;
}
</script>
</head>
<body onload="onLoginPageLoad()">
<form name="form1" onsubmit="saveRememberMeOptions()">
<div id="wrap">
<div class="background_login">
<div class="logo_header">
<div class="logoimg"><img src="/userportal/pages/images/logo.jpg" alt="Tikona Digital Networks" /></div>
<div class="sitelink"><a href="http://www.tikona.in" target="_blank">www.tikona.in</a></div>
</div>
<div class="clear"></div>
<div class="login_box">
<div id="right_curved_block">
<div class="blue_head">
<div class="blue_head_right">
<div class="blue_head_left"> </div>
<div class="hdng">Login</div>
</div>
</div>
<div class="clear"></div>
<div class="block_content">
<div class="form">
<table height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="126"><label>Service Type</label></td>
<td width="200" align="left" valign="middle">
<select name="type"><option value="1">Check Account Details</option>
<option value="2" selected="selected">Internet Access</option></select>
</td>
</tr>
<tr>
<td width="126"><label>User Name</label></td>
<td width="200" align="left" valign="middle"><input type="text" name="username" value="" onblur="loadContent(this.value);" class="logintext">
</td>
</tr>
<tr>
<td width="126"><label>Password</label></td>
<td width="200" align="left" valign="middle"><input type="password" name="password" value="" class="keyboardInput"></td>
</tr>
<tr>
<td width="35%"><label>Remember me</label></td>
<td width="200" align="left" valign="middle"><div style=" width:30%; float:left;"><input name="rememberme" id="rememberme" type="checkbox" class="checkbox" onchange="saveRememberMeOptions()"/></div>
<div style=" width:70%; float:right;"><a href="javascript :savesettings()"><img src="/userportal/pages/images/login.gif" alt="LOGIN" width="117" height="30" hspace="0" vspace="0" border="0" align="right" /></a></div></td>
</tr>
<tr>
<td align="left" ><a href="https://selfcare.tikona.in/selfcare/faces/ss/base/um/person/PersonalPasswordReset.jspx?sitex=:en_US" target="_blank">Change Password</a></td>
<td align="center" ><a href="https://selfcare.tikona.in/selfcare/faces/ss/base/tikona/payment/TdnVoucherTopup.jspx?sitex=:en_US" target="_blank">Account Recharge </a> </td>
</tr>
</table>
</div>
</div>
<div class="clear"> </div>
<div class="white_bottom">
</div>
</div>
</div>
<div class="tips_box">
<div class="v_box">
<div id="tips_block">
<div class="white_head_v">
<div class="blue_head_right">
<div class="white_head_left_v"> </div>
<div class="wbs_version"> </div>
</div>
</div>
<div class="clear"></div>
<div class="block_content">
<div id="msg" class="scrol">
<!-- change your heading text here -->
<h1>'Remember me' Functionality</h1>
<!-- End heading -->
<!-- change your sub heading text here -->
<font color="blue">Do you often forget the username & password of your Tikona Wi-Bro account?</font><br />
<br />
<!-- End sub heading -->
<!-- change your sub heading text here -->
<li>Tikona Wi-Bro has introduced 'Remember Me' functionality for <font color="white">****</font>subscribers,who login through Tikona login portal.</font></li>
<li>This functionality saves your username & password in the browser and <font color="white">****</font>hence you are not required to enter these details each time you <font color="white">****</font>login.</li>
<li>In order to implement this functionality, enter your username and <font color="white">****</font>password in the Tikona login portal and click on the check box <font color="white">****</font>labelled 'Remember Me'. On click, a tick mark sign appears which <font color="white">****</font>indicates the credentials are saved. </li>
<li>If you are logging in through Tikona Wi-Bro dialer,save your username <font color="white">****</font>and password by ticking the 'Save Password' check box. </li>
<!-- End sub heading -->
<!-- End text -->
<br />
</div>
</div>
<div class="clear"> </div>
<div class="white_bottom"> </div>
</div>
</div>
</div>
<div style="padding:110px 0 0 0; float:left; width:100%;">
<div class="helpline">
Tikona Care: 1800 20 94276 | <a href="mailto:customercare@tikona.in">customercare@tikona.in</a> </div>
</div>
<div class="footer_line"> </div>
<div class="footer_blueline"></div>
<div class="footer">
Copyright © 2009. Tikona Digital Networks. All right Reserved.
</div>
</div>
</div>
<input type="hidden" name="act" value="null" />
</form>
</body>
</html>
i dont see any GET or POST here.
the fields are
logintext for username
loginpassword for password
05-01-2012, 09:01 AM
#4
Moderator
Registered: May 2001
Posts: 29,415
You want curl to submit something like "form1?type=2&username=*****&password=******":
Code:
curl -A "Mozilla/5.0 (compatible; MSIE 7.01; Windows NT 5.0)" -L -e https://login.tikona.in -d "form1?type=2&username=*****&password=******"' https://login.tikona.in/userportal/login.do
* If this doesn't work run it but add "-v" for more verbose output, scrub your personal details and post it. Another problem may be it needs
multipart/form-data instead of
application/x-www-form-urlencoded in which case you could try -F "type=2" -F "username=****" -F "password=****" -instead of using "-d".
05-03-2012, 03:53 AM
#5
Member
Registered: Jun 2011
Posts: 82
Original Poster
Rep:
sorry for the delay i was away.
the first page that go to is
https://login.tikona.in/userportal/login.do 1.254.254.254. (sorry)
exactly same
Code:
curl -A "Mozilla/5.0 (compatible; MSIE 7.01; Windows NT 5.0)" -L -e https://login.tikona.in -d "form1?type=2&username=*****&password=******"' 1.254.254.254
>
exactly same except that '
Code:
curl -A "Mozilla/5.0 (compatible; MSIE 7.01; Windows NT 5.0)" -L -e https://login.tikona.in -d "form1?type=2&username=*****&password=******"' 1.254.254.254
#same redirection page
i also tried
Code:
wget 1.254.254.254 --save-cookies cookies
then copy redirectto url
Code:
curl -A "Mozilla/5.0 (compatible; MSIE 7.01; Windows NT 5.0)" -b cookies -d "form1?type=2&username=****&password=****" $REDIRECTTO_URL
<html>
<head>
<title>Powered by Inventum</title>
<SCRIPT>
function moveToLogin() {
setTimeout("loadForm()",500);
}
function loadForm(){
document.forms[0].action="login.do?requesturi=http%3A%2F%2F1.254.254.254%2F&act=null";
document.forms[0].method="post";
document.forms[0].submit();
}
</SCRIPT>
</head>
<body onload="moveToLogin();">
<FORM>
Loading the login page...
</FORM>
</body>
</html>
so still cant login.
thanks
All times are GMT -5. The time now is 03:30 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News