Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.09 KB | None | 0 0
  1. <script type="text/javascript">
  2. window.history.forward();
  3. function noBack() { window.history.forward(); }
  4. //<![CDATA[
  5. function disable_fields(theForm)
  6. {
  7. var len = theForm.elements.length;
  8. for (var i = 0; i < len; i++) {
  9. // Don't disable "hidden" fields.
  10. // Don't disable the input elem "user", to compatible with Safari and Opera
  11. // which execute this function before form submit() method.
  12. if((theForm.elements[i].type.toLowerCase() != "hidden") &&
  13. (theForm.elements[i].name != "user"))
  14. theForm.elements[i].disabled = 1;
  15. }
  16. }
  17.  
  18. function setLanguage(langCode)
  19. {
  20. document.langSelect.elements[0].value = langCode;
  21. document.langSelect.submit();
  22. disable_fields(document.langSelect);
  23. }
  24.  
  25. //----RTL GUI support start----
  26. function traversingDOMNode(rootNode, callback)
  27. {
  28. var currentNode = rootNode.childNodes;
  29. for (var i = 0; i < currentNode.length; i++){
  30. callback(currentNode[i]);
  31. traversingDOMNode(currentNode[i], callback);
  32. }
  33. }
  34.  
  35. function alignByClassFlag(node)
  36. {
  37. if (node.className && node.className != "") {
  38. if (node.className.search(/js_right/i)!=-1) {
  39. node.style.textAlign = "right";
  40. }
  41. else if (node.className.search(/js_left/i)!=-1) {
  42. node.style.textAlign = "left";
  43. }
  44. }
  45. }
  46.  
  47. function getLanguageDirection(lang_code)
  48. {
  49. var dir = "ltr";
  50. var rtlLangSet = new Array()
  51. rtlLangSet[0] = "ar"
  52.  
  53. for (var i=0; i<rtlLangSet.length; i++) {
  54. if (lang_code && (lang_code.toLowerCase() == rtlLangSet[i])) {
  55. dir = "rtl";
  56. break;
  57. }
  58. }
  59. return dir;
  60. }
  61.  
  62. function js_dir_rtl()
  63. {
  64. document.documentElement.dir = "rtl";
  65. traversingDOMNode(document.documentElement, alignByClassFlag);
  66. }
  67. //----end----
  68. function noenter(e) {
  69. var keycode;
  70.  
  71. if (window.event)
  72. keycode = window.event.keyCode;
  73. else if (e)
  74. keycode = e.which;
  75. else
  76. return true;
  77.  
  78. if (keycode == 13)
  79. return false;
  80. else
  81. return true;
  82. }
  83.  
  84. // NOTE: Chrome and Safari will ignore this function and submit form directly,
  85. // when press "ENTER".
  86. function enter_submit(e) {
  87. var keycode;
  88.  
  89. if (window.event)
  90. keycode = window.event.keyCode;
  91. else if (e)
  92. keycode = e.which;
  93. else
  94. return true;
  95.  
  96. if (keycode == 13) {
  97. submitAuthentication();
  98. return false;
  99. }
  100.  
  101. return true;
  102. }
  103.  
  104. var hex_chr = "0123456789abcdef";
  105. function rhex(num)
  106. {
  107. str = "";
  108. for(j = 0; j <= 3; j++)
  109. str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) +
  110. hex_chr.charAt((num >> (j * 8)) & 0x0F);
  111. return str;
  112. }
  113.  
  114. /*
  115. * Convert a string to a sequence of 16-word blocks, stored as an array.
  116. * Append padding bits and the length, as described in the MD5 standard.
  117. */
  118. function str2blks_MD5(str)
  119. {
  120. nblk = ((str.length + 8) >> 6) + 1;
  121. blks = new Array(nblk * 16);
  122. for(i = 0; i < nblk * 16; i++) blks[i] = 0;
  123. for(i = 0; i < str.length; i++)
  124. blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8);
  125. blks[i >> 2] |= 0x80 << ((i % 4) * 8);
  126. blks[nblk * 16 - 2] = str.length * 8;
  127. return blks;
  128. }
  129.  
  130. /*
  131. * Add integers, wrapping at 2^32. This uses 16-bit operations internally
  132. * to work around bugs in some JS interpreters.
  133. */
  134. function add(x, y)
  135. {
  136. var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  137. var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  138. return (msw << 16) | (lsw & 0xFFFF);
  139. }
  140.  
  141. /*
  142. * Bitwise rotate a 32-bit number to the left
  143. */
  144. function rol(num, cnt)
  145. {
  146. return (num << cnt) | (num >>> (32 - cnt));
  147. }
  148.  
  149. /*
  150. * These functions implement the basic operation for each round of the
  151. * algorithm.
  152. */
  153. function cmn(q, a, b, x, s, t)
  154. {
  155. return add(rol(add(add(a, q), add(x, t)), s), b);
  156. }
  157. function ff(a, b, c, d, x, s, t)
  158. {
  159. return cmn((b & c) | ((~b) & d), a, b, x, s, t);
  160. }
  161. function gg(a, b, c, d, x, s, t)
  162. {
  163. return cmn((b & d) | (c & (~d)), a, b, x, s, t);
  164. }
  165. function hh(a, b, c, d, x, s, t)
  166. {
  167. return cmn(b ^ c ^ d, a, b, x, s, t);
  168. }
  169. function ii(a, b, c, d, x, s, t)
  170. {
  171. return cmn(c ^ (b | (~d)), a, b, x, s, t);
  172. }
  173.  
  174. /*
  175. * Take a string and return the hex representation of its MD5.
  176. */
  177. function MD5(str)
  178. {
  179. x = str2blks_MD5(str);
  180. var a = 1732584193;
  181. var b = -271733879;
  182. var c = -1732584194;
  183. var d = 271733878;
  184.  
  185. for(i = 0; i < x.length; i += 16)
  186. {
  187. var olda = a;
  188. var oldb = b;
  189. var oldc = c;
  190. var oldd = d;
  191.  
  192. a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);
  193. d = ff(d, a, b, c, x[i+ 1], 12, -389564586);
  194. c = ff(c, d, a, b, x[i+ 2], 17, 606105819);
  195. b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);
  196. a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);
  197. d = ff(d, a, b, c, x[i+ 5], 12, 1200080426);
  198. c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);
  199. b = ff(b, c, d, a, x[i+ 7], 22, -45705983);
  200. a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
  201. d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);
  202. c = ff(c, d, a, b, x[i+10], 17, -42063);
  203. b = ff(b, c, d, a, x[i+11], 22, -1990404162);
  204. a = ff(a, b, c, d, x[i+12], 7 , 1804603682);
  205. d = ff(d, a, b, c, x[i+13], 12, -40341101);
  206. c = ff(c, d, a, b, x[i+14], 17, -1502002290);
  207. b = ff(b, c, d, a, x[i+15], 22, 1236535329);
  208.  
  209. a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);
  210. d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
  211. c = gg(c, d, a, b, x[i+11], 14, 643717713);
  212. b = gg(b, c, d, a, x[i+ 0], 20, -373897302);
  213. a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);
  214. d = gg(d, a, b, c, x[i+10], 9 , 38016083);
  215. c = gg(c, d, a, b, x[i+15], 14, -660478335);
  216. b = gg(b, c, d, a, x[i+ 4], 20, -405537848);
  217. a = gg(a, b, c, d, x[i+ 9], 5 , 568446438);
  218. d = gg(d, a, b, c, x[i+14], 9 , -1019803690);
  219. c = gg(c, d, a, b, x[i+ 3], 14, -187363961);
  220. b = gg(b, c, d, a, x[i+ 8], 20, 1163531501);
  221. a = gg(a, b, c, d, x[i+13], 5 , -1444681467);
  222. d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);
  223. c = gg(c, d, a, b, x[i+ 7], 14, 1735328473);
  224. b = gg(b, c, d, a, x[i+12], 20, -1926607734);
  225.  
  226. a = hh(a, b, c, d, x[i+ 5], 4 , -378558);
  227. d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);
  228. c = hh(c, d, a, b, x[i+11], 16, 1839030562);
  229. b = hh(b, c, d, a, x[i+14], 23, -35309556);
  230. a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
  231. d = hh(d, a, b, c, x[i+ 4], 11, 1272893353);
  232. c = hh(c, d, a, b, x[i+ 7], 16, -155497632);
  233. b = hh(b, c, d, a, x[i+10], 23, -1094730640);
  234. a = hh(a, b, c, d, x[i+13], 4 , 681279174);
  235. d = hh(d, a, b, c, x[i+ 0], 11, -358537222);
  236. c = hh(c, d, a, b, x[i+ 3], 16, -722521979);
  237. b = hh(b, c, d, a, x[i+ 6], 23, 76029189);
  238. a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);
  239. d = hh(d, a, b, c, x[i+12], 11, -421815835);
  240. c = hh(c, d, a, b, x[i+15], 16, 530742520);
  241. b = hh(b, c, d, a, x[i+ 2], 23, -995338651);
  242.  
  243. a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);
  244. d = ii(d, a, b, c, x[i+ 7], 10, 1126891415);
  245. c = ii(c, d, a, b, x[i+14], 15, -1416354905);
  246. b = ii(b, c, d, a, x[i+ 5], 21, -57434055);
  247. a = ii(a, b, c, d, x[i+12], 6 , 1700485571);
  248. d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);
  249. c = ii(c, d, a, b, x[i+10], 15, -1051523);
  250. b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);
  251. a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
  252. d = ii(d, a, b, c, x[i+15], 10, -30611744);
  253. c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);
  254. b = ii(b, c, d, a, x[i+13], 21, 1309151649);
  255. a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);
  256. d = ii(d, a, b, c, x[i+11], 10, -1120210379);
  257. c = ii(c, d, a, b, x[i+ 2], 15, 718787259);
  258. b = ii(b, c, d, a, x[i+ 9], 21, -343485551);
  259.  
  260. a = add(a, olda);
  261. b = add(b, oldb);
  262. c = add(c, oldc);
  263. d = add(d, oldd);
  264. }
  265. return rhex(a) + rhex(b) + rhex(c) + rhex(d);
  266. }
  267.  
  268. var realm;
  269. var nonce;
  270. var qop;
  271. var uri = "/login.lp";
  272.  
  273. function submitAuthentication()
  274. {
  275. var user = document.getElementById("user").value;
  276. var pwd = document.getElementById("password").value;
  277. document.getElementById("password").disabled = true;
  278. $.get("login.lp?get_preauth=true",function(res){
  279. res = res.split("|");
  280. $("#rn").val(res[0]);
  281. realm = res[1];
  282. nonce = res[2];
  283. qop = res[3];
  284. var HA1 = MD5(user + ":" + realm + ":" + pwd);
  285. var HA2 = MD5("GET" + ":" + uri);
  286. document.getElementById("hidepw").value = MD5(HA1 + ":" + nonce +
  287. ":" + "00000001" + ":" + "xyz" + ":" + qop + ":" + HA2);
  288. document.authform.submit();
  289. disable_fields(document.authform);
  290. })
  291. }
  292.  
  293. function cancelLogin()
  294. {
  295. if (window.opener || window.name == "userpage")
  296. window.close(); // Close pop-up login window
  297. else
  298. location.href="/";
  299. }
  300. //]]>
  301. </script>
  302. <br/><br/><br/><br/>
  303.  
  304. <script type="text/javascript">
  305. var g_dir = getLanguageDirection("it");
  306. </script>
  307.  
  308. <script type="text/javascript">
  309.  
  310. </script>
  311.  
  312. <tr>
  313. <td class="page" width="760">
  314. <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
  315. <tr>
  316. <td>
  317. <table cellspacing="0" cellpadding="0" border="0" width="100%">
  318. <tr>
  319. <td>
  320. <div class="row-fluid">
  321.  
  322. <hr/>
  323. <div class='contentitem' style="margin-top:100px;">
  324. <table cellspacing='0' cellpadding='0' width='100%'>
  325.  
  326. <tr><td colspan='2'>
  327.  
  328. </div><br/>
  329.  
  330. <p align = "center" ><b>Inserire il nome utente e la password per accedere a TIM Modem.</b></p><br>
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. <form method="post" action="login.lp" name="authform" id="authform">
  338. <input type="hidden" name="rn" id="rn"/>
  339. <input type="hidden" name="hidepw" id="hidepw" value=""/>
  340.  
  341. <table width='100%' cellspacing='0' cellpadding='0'>
  342. <tr><td width="500" valign="top"></td>
  343. <td valign="top">
  344. <table width='100%' class="datatable" cellspacing='0' cellpadding='0' align = "center">
  345. <tr><td></td><td width=''></td><td width=''></td><td width=''></td></tr>
  346. <tr><td colspan='4' height='7'></td></tr>
  347. <tr>
  348. <td width='120px'><b>Nome utente:</b></td>
  349. <td colspan='3'><select id = "user" name = "user" style="width: 160px;color: rgb(51, 51, 51);" ><option selected="selected" value = "Administrator">Administrator</option></select></td>
  350.  
  351. </tr>
  352. <tr><td colspan='4' height='7'></td></tr>
  353. <tr>
  354. <td width='120px'><b>Password:</b></td>
  355. <td colspan='3'><input type="password" name="password" id="password" maxlength="64" style="width: 150px;" onkeypress="return enter_submit(event);" /></td></td>
  356. </tr>
  357. <tr><td colspan='4' height='7'></td></tr>
  358. <tr>
  359. <td colspan="4" style="padding-left:153px;">
  360. <input style="color: rgb(255, 255, 255);" name="ok" class="btn btn-primary" type="button" value="Accedi" onclick='submitAuthentication()' />
  361. </td>
  362. </tr>
  363. </table>
  364. </td></tr>
  365. </table>
  366.  
  367. </form>
  368. </td></tr></table>
  369. </td></tr></table>
  370. </div>
  371.  
  372. <script type="text/javascript">
  373. //<![CDATA[
  374. document.authform.user.focus();
  375. if (g_dir == "rtl")
  376. js_dir_rtl();
  377. //]]>
  378. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement