View Full Version : Auto-logon script for M1 Fixed BB
soyabeanmilkdrink
27-07-2009, 08:17 PM
Anyone care to discuss or share ways to log on automatically with M1 Fixed Broadband? I know it's just a single click to login (if the username and password are saved), but for usability and convenience, it is still one click too many! =:p
System startup script would likely be impossible to do, so the closest thing would probably be a GreaseMonkey script?
zoneguard
27-07-2009, 10:25 PM
Anyone care to discuss or share ways to log on automatically with M1 Fixed Broadband? I know it's just a single click to login (if the username and password are saved), but for usability and convenience, it is still one click too many! =:p
System startup script would likely be impossible to do, so the closest thing would probably be a GreaseMonkey script?
Windows Powershell?
From http://waynes-world-it.blogspot.com/2008/05/reading-web-content-with-powershell.html
To modify the URL, username , password HTML parameters
$user = $env:username
$pwd = Read-Host "Password?" -assecurestring
# -- Method 1 - DownloadData -- #
$url = "http://m1url"
$wc = new-object system.net.WebClient
$webpage = $wc.DownloadData($url)
$string = [System.Text.Encoding]::ASCII.GetString($webpage)
# -- Method 2 - DownloadData (QueryString) -- #
$url = "http://m1url"
$col = new-object System.Collections.Specialized.NameValueCollection
$col.Add("user","stats")
$col.Add("pass","s451qaz2WSX")
$wc = new-object system.net.WebClient
$wc.QueryString = $col
$webpage = $wc.DownloadData($url)
$string = [System.Text.Encoding]::ASCII.GetString($webpage)
# -- Method 3 - UploadData (POST) -- #
$url = "http://m1url"
$wc = new-object system.net.WebClient
$postData = "u=username&password=s451qaz2wsx"
$wc.Headers.Add("Content-Type","application/x-www-form-urlencoded")
[byte[]]$byteArray = [System.Text.Encoding]::ASCII.GetBytes($postData)
$webpage = $wc.UploadData($url,"POST",$byteArray);
$string = [System.Text.Encoding]::ASCII.GetString($webpage)
# -- Method 4 - GetResponse Stream -- #
$url = "http://m1url/?a=stats&s=s451qaz2wsx"
$wr = [System.Net.WebRequest]::Create($url)
$wresponse=$wr.GetResponse()
$requestStream = $wresponse.GetResponseStream()
$readStream = new-object System.IO.StreamReader $requestStream
$wrs = $readStream.ReadToEnd()
$readStream.Close()
$wresponse.Close()
# -- Method 5 - UploadValues -- #
$url = "http://m1url"
$wc = new-object system.net.WebClient
$col = new-object System.Collections.Specialized.NameValueCollection
$col.Add("a","stats")
$col.Add("s","s451qaz2WSX")
$wc.QueryString = $col
$webpage = $wc.UploadValues($url, "POST", $col)
$string = [System.Text.Encoding]::ASCII.GetString($webpage)
From Linux (assuming router or NAS runs that), curl or wget
monoblue
28-07-2009, 09:21 PM
support! even best if we can add this script in to linksys router
waiken
28-07-2009, 09:23 PM
yah support oso! :D
monoblue
28-07-2009, 09:29 PM
I try
h ttp://broadband.mobileone.net.sg/login/index.php?act=login&userid=***&password=***
cannot work... any web programmer pro?
zoneguard
28-07-2009, 10:22 PM
method=post or method=get in the html source code of the index.php? Better still dump the whole html code here, lol
monoblue
29-07-2009, 01:38 PM
Seen like using post method...
<form action="/login/index.php" method="POST" id="FA-010A">
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="72">User ID:</td>
<td width="391"><span class="tableContentRowOdd">
<input maxlength="20" size="24" name="userid" id="MSA-0011" value="" />
<input type="hidden" name="act" value="login" />
</span></td>
</tr>
<tr>
<td>Password:</td>
<td><span class="tableContentRowOdd">
<input name="password" type="password" size="24" maxlength="20" id="ORX-013" value="" />
</span></td>
</tr>
<tr>
<td> </td>
<td><label>
<span id="MSZ-006">
<input type="image" name="imageField" id="imageField" src="img/btn_submit.gif" onclick="return loginSubmit();" />
<input type="image" name="imageField2" id="imageField2" src="img/btn_clear.gif" onclick="return resetForm();" />
</span>
<span id="MSZ-010" style="display: none;">Please wait while we log you in...</span>
</label></td>
</tr>
<tr>
<td> </td>
<td><input type="checkbox" name="remember" id="RX-78-2" value="1" checked="checked" onclick="toggleCookie();" />
Remember me<br>
<input type="checkbox" name="rememberPwd" id="RX-93" value="1" checked="checked" />
Remember my password</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">Please call 1627, if you have forgotten your password or fail to log in.</td>
</tr>
</table>
</form>
soyabeanmilkdrink
29-07-2009, 06:01 PM
The login info is submitted via a secure page using https, if that matters.
The exact address is https://broadband.mobileone.net.sg/login/?.intl=sg
zoneguard
29-07-2009, 09:46 PM
Try this:
# -- Method 5 - UploadValues -- #
$url = "https://broadband.mobileone.net.sg/login/?.intl=sg"
$wc = new-object system.net.WebClient
$col = new-object System.Collections.Specialized.NameValueCollection
$col.Add("userid","changethistoyouruserid")
$col.Add("password","changethistoyourpassword")
$col.Add("act","login")
$wc.QueryString = $col
$webpage = $wc.UploadValues($url, "POST", $col)
$string = [System.Text.Encoding]::ASCII.GetString($webpage)
Save as .ps1 extension
I don't have M1FBB so I can't test this =:p
Also read this:
http://www.realtime-vista.com/administration/2007/01/running_powershell_scripts.htm
on how to run this.
monoblue
29-07-2009, 09:59 PM
The login info is submitted via a secure page using https, if that matters.
The exact address is https://broadband.mobileone.net.sg/login/?.intl=sg
kekeke this is wat i looking for... just dunno how to get it
trying later show result i got
zoneguard
29-07-2009, 10:02 PM
Try this:
Also read this:
http://www.realtime-vista.com/administration/2007/01/running_powershell_scripts.htm
on how to run this.
Read this too: http://www.computerperformance.co.uk/powershell/powershell_profile_ps1.htm
monoblue
29-07-2009, 10:32 PM
You have successfully logged in.
very funny le i use a fake password also can login
zoneguard
30-07-2009, 10:21 PM
=:p Got logout before that rite? Wrong password but login liao can surf anot?
Should I do the curl version for linux - router/NAS as well? ;)
monoblue
30-07-2009, 11:07 PM
=:p Got logout before that rite? Wrong password but login liao can surf anot?
Should I do the curl version for linux - router/NAS as well? ;)
offically tested this working... but but... have to wait for window to finish loading and connect to m1 than can work... mean put in startup will not work sometime so in the end nid to manually click lol
errr... i got a wrt54g tofu router is there any script out there to make http request?
zoneguard
31-07-2009, 08:07 PM
offically tested this working... but but... have to wait for window to finish loading and connect to m1 than can work... mean put in startup will not work sometime so in the end nid to manually click lol
errr... i got a wrt54g tofu router is there any script out there to make http request?
If add a delay in the script, will help or make it worst?
for linux based router,
wget command can be used for dd-wrt or tomata, not familiar with tofu firmware, the syntax will be something like this:
wget --post-data 'userid=yourid&password=yourpassword&act=login' https:////broadband.mobileone.net.sg/login/?.intl=sg
dd-wrt got startup script but I not sure for tomata or tofu.
fullerms
01-08-2009, 10:37 AM
If add a delay in the script, will help or make it worst?
for linux based router,
wget command can be used for dd-wrt or tomata, not familiar with tofu firmware, the syntax will be something like this:
wget --post-data 'userid=yourid&password=yourpassword&act=login' https:////broadband.mobileone.net.sg/login/?.intl=sg
dd-wrt got startup script but I not sure for tomata or tofu.
I tried this on my wrt54g running dd-wrt micro, getting this error
wget: unrecognized option `--post-data'
Can someone test this on dd-wrt micro and share the results?
zoneguard
01-08-2009, 10:57 AM
The post-data is only available from gnu wget and you will need to install optware (with some hardware prerequisites , see this:http://www.dd-wrt.com/wiki/index.php/Optware
Think better off doing it from the PC, unless your router is a dd-wrt supported one with USB support.
And SSL support for the https will increase the space required, also dunno can or not.
monoblue
02-08-2009, 12:05 AM
got the following error
wget: unrecognized option `--post-data'
BusyBox v1.01 (2006.02.08-03:16+0000) multi-call binary
Usage: wget [-c|--continue] [-q|--quiet] [-O|--output-document file]
[--header 'header: value'] [-Y|--proxy on/off] [-P DIR] url
wget retrieves files via HTTP or FTP
Options:
-c continue retrieval of aborted transfers
-q quiet mode - do not print
-P Set directory prefix to DIR
-O save to filename ('-' for stdout)
-Y use proxy ('on' or 'off')
---
monoblue
02-08-2009, 12:09 AM
anyone can try this see if it works?
wget --header 'header: userid=yourid&password=yourpassword&act=login' https://broadband.mobileone.net.sg/login/?.intl=sg
monoblue
02-08-2009, 12:30 AM
not working
wget --header 'header: userid=yourid&password=yourpassword&act=login' https://broadband.mobileone.net.sg/login/?.intl=sg
wget: not an http or ftp url: https://broadband.mobileone.net.sg/login/?.intl=sg
soyabeanmilkdrink
06-08-2009, 09:42 PM
The powershell script method is working well for me so far. Thanks for the heads up, zoneguard! Now I don't have to connect manually! :D
I don't use a router, so I can't test out those wget commands. Hope more users would contribute and help to test it out. Cheers!
zoneguard
06-08-2009, 10:03 PM
Thanks for the feedback glad you like it and can work - soyabeanmilkdrink :s13: , the wget command should work for higher specs (more ram or have usb port) routers that are supported in dd-wrt and can run optware. I have an alternative, the curl command but with similar requirements. Wait for BrainSlayer to update the busybox in dd-wrt lor , hehee.
curl -d "userid=yourid&password=yourpassword&act=login" https://broadband.mobileone.net.sg/login/?.intl=sg
waiken
06-08-2009, 10:31 PM
The powershell script method is working well for me so far. Thanks for the heads up, zoneguard! Now I don't have to connect manually! :D
I don't use a router, so I can't test out those wget commands. Hope more users would contribute and help to test it out. Cheers!
how to get powershell running on xp pro sp3? dun understand leh...
soyabeanmilkdrink
07-08-2009, 10:23 AM
Here are the steps to get it working:
1. Download and install Windows Powershell (http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx) for your respective OS.
2. Paste the following codes into Notepad, edit your username/password and save it as "login.ps1"
$url = "https://broadband.mobileone.net.sg/login/?.intl=sg"
$wc = new-object system.net.WebClient
$col = new-object System.Collections.Specialized.NameValueCollection
$col.Add("userid","changethistoyouruserid")
$col.Add("password","changethistoyourpassword")
$col.Add("act","login")
$wc.QueryString = $col
$webpage = $wc.UploadValues($url, "POST", $col)
$string = [System.Text.Encoding]::ASCII.GetString($webpage)
3. Place the file you created above in the folder C:\WINDOWS\system32\windowspowershell\v1.0
4. Launch the Windows Powershell command window, and type in the following line
Set-ExecutionPolicy RemoteSigned
4. Paste the following line into Notepad, and save it as "start.cmd"
powershell login.ps1
5. Place the file you created above in the folder C:\Documents and Settings\[username]\Start Menu\Programs\Startup
Now everytime you boot up, the script would login for you automatically! ;)
waiken
08-08-2009, 02:49 PM
thanks soyabeanmilkdrink for the spoon feeding :D
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.