LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-30-2012, 03:53 AM   #1
ununun
Member
 
Registered: Jun 2011
Posts: 82

Rep: Reputation: Disabled
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.
 
Old 04-30-2012, 05:45 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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?
 
Old 04-30-2012, 06:21 AM   #3
ununun
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
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">&nbsp;</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">&nbsp;</div>
				<div class="wbs_version">&nbsp;</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">&nbsp;</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">&nbsp;</div>
<div class="footer_blueline"></div>

<div class="footer">
	Copyright &copy; 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
 
Old 05-01-2012, 09:01 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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".
 
Old 05-03-2012, 03:53 AM   #5
ununun
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
webpage login by shell script fortran Linux - General 1 01-24-2012 09:29 AM
How connections to my wireless network go to a webpage login form? Airport/Hotel abefroman Linux - Networking 1 08-14-2009 10:04 PM
Webpage login issues Ishkabibble Linux - General 5 02-06-2008 09:04 PM
connect to internet trough wireless others connect to me with lan Amir Menesy Linux - Wireless Networking 1 11-13-2007 08:28 PM
Can't login to banking webpage Xswitch Linux - General 5 12-20-2003 05:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration