Skip to content

Instantly share code, notes, and snippets.

@OSConsumer
Last active December 22, 2015 23:39
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OSConsumer/6548433 to your computer and use it in GitHub Desktop.
Save OSConsumer/6548433 to your computer and use it in GitHub Desktop.
Micromax 400R ads Remover.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="js/jquery1.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/lct_gilob_function.js"></script>
<script type="text/javascript">
function init()
{
E("which_op").value = "not_show";
$.ajax({
url: '/cgi-bin/ajax.cgi',
data: $('#ads_form').serialize(),
type: 'post',
cache: false,
dataType: 'html',
complete: function (xhr) {
// if(xhr.responseText == "ok")
{
var url = location.href;
var dex = getParameter("url",url.replace(/%20/g," ").replace(/%2f/g,"/"));
var sid = dex.split("=")[1];
if(dex != "")
{
window.location=decodeURIComponent(sid);
}
else
{
window.location = "http://www.google.com";
}
}
}
});
}
</script>
<title>Page Redirection</title>
</head>
<body onload="init();">
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the <a href='http://example.com'>link to example</a>
<form id="ads_form" name="ads_form" method="post">
<input type="hidden" name="which_cgi" value="ajax_ads_op">
<input type="hidden" id="which_op" name="which_op" value="">
</form>
</body>
</html>
<!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=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<title>Setup</title>
<link href="style/style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/jquery1.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/lct_gilob_function.js"></script>
<script>
var xmlfile = "../language/xml/ads.xml";
function vv(){}
nvram = {
http_id: '<% get_ssid(); %>',
modem_status: '<% wan_get_modems_status(); %>',
connected: '<% asp_get_wan_get_connected(); %>'
};
function init()
{
var language = '<% asp_get("web_language_select"); %>';
if(language !="" || language != undefined)
change_language(xmlfile,language);
}
</script>
</head>
<body onload="init();" style="background:#626262;">
<!--wrappetr div start-->
<div id="wrapper_setup">
<!--header div start-->
<div id="headerinner">
<div class="logo"><img src="images/banner.png" alt="" width="433px" height="90px" border="0" id="logo_image"/></div>
<!--header div end-->
</div>
<!--container div start-->
<div id="darkcontainer">
<div class="sbmitandsetuppage2">
<table border="0" cellpadding="0" cellspacing="0" width="90%">
<tr>
<td valign="top" height="10"><p style="font-size:12pt; color:#ffffff; padding-left:10px;"><span id="r_title"></span></p></td>
</tr>
<tr>
<td height="18" align="left">
<p style="font-size:12pt; color:#ffffff; padding-left:5px;">&nbsp;</p>
<p style="font-size:12pt; color:#ffffff; padding-left:5px;">&nbsp;</p>
<p style="font-size:12pt; color:#ffffff; padding-left:5px;">&nbsp;</p></td>
</tr>
<tr>
<td>
<p style="padding-left:70px;">
<table width="674" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="87" valign="top" height="110" >&nbsp;<img src="images/apps.gif" alt="" width="70" height="70" border="0"/></td>
<td width="502" valign="top">
<table width="500" border="0" cellpadding="0" cellspacing="0" style="padding-top:25px;">
<tr>
<td width="500" class="link"><a href="javascript:vv()" style="position:relative;color:#ffffff" onclick="get_chmore();">Enter M! Apps - Micromax Web store </a></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top" height="100"><img src="images/close.png" alt="" width="80" height="80" border="0"/></td>
<td valign="top"><table border="0" cellspacing="0" cellpadding="0" style="padding-top:20px;">
<tr>
<td width="500" class="link"><a href="javascript:vv()" style="position:relative;color:#ffffff" onclick="not_install();" > Don’t show this page</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</p>
</td>
</tr>
<tr>
<td height="25" align="center"></td>
</tr>
</table>
<!--wrapper div end-->
</div>
</div>
</div>
</div>
</div>
<form id="ads_form" name="ads_form" method="post">
<input type="hidden" name="which_cgi" value="ajax_ads_op">
<input type="hidden" id="which_op" name="which_op" value="">
</form>
<script>
function check_wan_start()
{
var glob_connect_status =0;
var status_s = (nvram.connected).split('*');
glob_connect_status = status_s[0]*1;
if(nvram.modem_status != "2" && nvram.modem_status != "3" )
{
return false;
}
if(glob_connect_status != 1)
{
return false;
}
return true;
}
function get_chmore()
{
E("which_op").value = "install";
if(check_wan_start())
{
$.ajax({
url: '/cgi-bin/ajax.cgi',
data: $('#ads_form').serialize(),
type: 'post',
cache: false,
dataType: 'html',
complete: function (xhr)
{
window.location = "http://miapps.micromaxinfo.com/";
}
});
}
else
{
alert("Please check your Sim card or your network.");
}
}
function not_install()
{
E("which_op").value = "not_install";
$.ajax({
url: '/cgi-bin/ajax.cgi',
data: $('#ads_form').serialize(),
type: 'post',
cache: false,
dataType: 'html',
complete: function (xhr) {
//if(xhr.responseText == "ok")
{
var url = location.href;
var dex = getParameter("url",url.replace(/%20/g," "));
var sid = dex.split("=")[1];
if(dex != "")
{
window.location=decodeURIComponent(sid);
}
else
{
window.location = "http://www.google.com";
}
}
}
});
}
function not_show()
{
E("which_op").value = "not_show";
$.ajax({
url: '/cgi-bin/ajax.cgi',
data: $('#ads_form').serialize(),
type: 'post',
cache: false,
dataType: 'html',
complete: function (xhr) {
// if(xhr.responseText == "ok")
{
var url = location.href;
var dex = getParameter("url",url.replace(/%20/g," "));
var sid = dex.split("=")[1];
if(dex != "")
{
window.location=decodeURIComponent(sid);
}
else
{
window.location = "http://www.google.com";
}
}
}
});
}
</script>
</body>
</html>
Files to replace the annoying ads.html in Micromax 400R mifi router. Thanks to http://motyar.blogspot.in/2013/02/hacking-micromax-400r-mi-fi.html for tips.
Usage :
1. Download the files. Make sure you have enabled "Web Sharing" in the administrator page. Factory setting is only usb for this.
2. Open upload.html in your browser while being connected to your Micromax 400R
3. Choose ads.html in the form and upload.
4. See if the response is "ok"
5. DONE, PROFIT!!!!!
If you face a problem / would like to see the old ads, rename the backup_ads.html to ads.html and upload using upload.html, you are back to factory setting.
<html>
<head>
<title>Micromax 400R ads Upload File</title>
</head>
<body>
<form action="http://192.168.1.1/cgi-bin/upfile.cgi" enctype="multipart/form-data" method="post">
<input type="text" name="current_folder_dir" value="longcheer_w>/../../../mnt/resource/webpage>"/>
<br/>
<br/>
Please specify a file, or a set of files:
<input type="file" name="lc_upfile" size="40">
<input type="submit" value="Upload">
</form>
</body>
</html>
@animesh1992
Copy link

thanks for the help..!! is there any way i could bypass the whole page itself..? thanks

@OSConsumer
Copy link
Author

@animesh1992 Yes, this will not show the ads.html on your screen (Unless you have very slow browser / PC) This will download ads.html but onload the browser will automatically redirect properly without showing it on screen. I was able to test even android phones which got connected and got updates without opening browser. Some Symbian / Nokia phones which may not have Javascript support may not get connected automatically, hence you may need open browser atleast once after connecting to WiFi, even then you need not click anything with this script.

@cadburys
Copy link

thanks for all your efforts but it is not working for me.

Getting response as "Error" and the URL changes to 'http://192.168.1.1/cgi-bin/upfile.cgi'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment