TrustScan Update

Update for Hackforums Trust Scan

  1. // ==UserScript==
  2. // @name TrustScan Update
  3. // @namespace http://www.hackforums.net/member.php?action=profile&uid=1769039
  4. // @version 1.0
  5. // @description Update for Hackforums Trust Scan
  6. // @author LazySoftware
  7. // @match http://www.hackforums.net/trustscan.php?uid=*
  8. // ==/UserScript==
  9.  
  10. // ======== Fix Table ======== \\
  11.  
  12. document.getElementsByClassName("thead")[1].colSpan = "3";
  13. document.getElementsByClassName("tborder")[1].insertRow(1).innerHTML = "<td class='tcat' colspan='1' width='76%'><span class='smalltext'><strong><a href=''>Information</a> </strong></span></td><td class='tcat' align='center' ><span class='smalltext'><strong><a href='' rel='nofollow'>Result</a> </strong></span></td><td class='tcat' align='center' width='7%''><span class='smalltext'><strong><a href='' rel='nofollow'>Score</a> </strong></span></td>";
  14. document.getElementsByClassName("tborder")[1].insertRow(document.getElementsByClassName("tborder")[1].rows.length).innerHTML = "<td class='trow1' width='80%'>Trust Score:</td><td class='trow1' align='center'>0%</td><td class='trow1' align='center'>0/0</td>";
  15.  
  16. for (i=2;i<13;i++){
  17. var newCell = document.getElementsByClassName("tborder")[1].rows[i].insertCell(2);
  18. newCell.innerHTML = "<td class='trow1' align='center'>0/0</td>";
  19. newCell.className = "trow1";
  20. newCell.align = "center";
  21. }
  22.  
  23. // ======== Gather all data ======== \\
  24.  
  25. var TrustScan_Header = document.getElementsByClassName("tborder")[1].rows[0];
  26. var Information_Header = document.getElementsByClassName("tborder")[1].rows[1];
  27. var Gauth_Data = document.getElementsByClassName("tborder")[1].rows[2];
  28. var LastEmail_Data = document.getElementsByClassName("tborder")[1].rows[3];
  29. var CountryLogins_Data = document.getElementsByClassName("tborder")[1].rows[4];
  30. var LoginIPs_Data = document.getElementsByClassName("tborder")[1].rows[5];
  31. var UniqueISPs_Data = document.getElementsByClassName("tborder")[1].rows[6];
  32. var MatchingRegistration_Data = document.getElementsByClassName("tborder")[1].rows[7];
  33. var MatchingRegion_Data = document.getElementsByClassName("tborder")[1].rows[8];
  34. var IPMatching_Data = document.getElementsByClassName("tborder")[1].rows[9];
  35. var DealDisputes_Data = document.getElementsByClassName("tborder")[1].rows[10];
  36. var PasswordReset_Data = document.getElementsByClassName("tborder")[1].rows[11];
  37. var IPChangeDate_Data = document.getElementsByClassName("tborder")[1].rows[12];
  38. var TrustScore_Data = document.getElementsByClassName("tborder")[1].rows[13];
  39.  
  40. // ======== Trust Score Editting ======== \\
  41.  
  42. function updateScore(rowData, updatedScore, scoreMax) {
  43. rowData.getElementsByTagName("td")[2].innerHTML = updatedScore + "/" + scoreMax;
  44. }
  45.  
  46. function getData(rowData) {
  47. return rowData.getElementsByTagName("td")[1].innerHTML;
  48. }
  49.  
  50. // ======== Trust Score Calcularor ======= \\
  51.  
  52. var totalTrustScore = 0;
  53. var checkHacked = 0;
  54.  
  55. // Gauth/2FA activation date:
  56. if (getData(Gauth_Data) == "Not Activated") {
  57. updateScore(Gauth_Data, 0, 20);
  58. } else {
  59. updateScore(Gauth_Data, 20, 20);
  60. totalTrustScore += 20;
  61. }
  62.  
  63. // Last Email Change:
  64. if (getData(LastEmail_Data) == "No Changes") {
  65. updateScore(LastEmail_Data, 10, 10);
  66. totalTrustScore += 10;
  67. } else {
  68. updateScore(LastEmail_Data, 5, 10);
  69. totalTrustScore += 5;
  70. checkHacked += 1;
  71. }
  72.  
  73. // Number of Unique Country Logins:
  74. if (getData(CountryLogins_Data) == "1") {
  75. updateScore(CountryLogins_Data, 20, 20);
  76. totalTrustScore += 20;
  77. } else if (getData(CountryLogins_Data) == 2) {
  78. updateScore(CountryLogins_Data, 10, 20);
  79. totalTrustScore += 10;
  80. } else if (getData(CountryLogins_Data) > 2) {
  81. updateScore(CountryLogins_Data, 0, 20);
  82. checkHacked += 1;
  83. }
  84.  
  85. // Number of Unique Login IP's:
  86. updateScore(LoginIPs_Data, "N", "A");
  87.  
  88. // Number of Unique ISP's:
  89. if (getData(UniqueISPs_Data) == "1") {
  90. updateScore(UniqueISPs_Data, 20, 20);
  91. totalTrustScore += 20;
  92. } else if (getData(UniqueISPs_Data) == 2) {
  93. updateScore(UniqueISPs_Data, 10, 20);
  94. totalTrustScore += 10;
  95. } else if (getData(UniqueISPs_Data) > 2) {
  96. updateScore(UniqueISPs_Data, 0, 20);
  97. checkHacked += 1;
  98. }
  99.  
  100. // Matching registration and last IP:
  101. updateScore(MatchingRegistration_Data, "N", "A");
  102.  
  103. // Matching region of registration and latest IP:
  104. updateScore(MatchingRegion_Data, "N", "A");
  105.  
  106. // Latest IP Matching Other Members:
  107. if (getData(IPMatching_Data) > 0) {
  108. updateScore(IPMatching_Data, 0, 30);
  109. checkHacked += 5;
  110. } else {
  111. updateScore(IPMatching_Data, 30, 30);
  112. totalTrustScore += 30;
  113. }
  114.  
  115. // Deal Disputes (Claimant/Defendant):
  116. if (getData(DealDisputes_Data).split('/')[1] > 0) {
  117. updateScore(DealDisputes_Data, 0, 100);
  118. } else {
  119. updateScore(DealDisputes_Data, 100, 100);
  120. totalTrustScore += 100;
  121. }
  122.  
  123. // Password Reset in Last Week:
  124. if (getData(PasswordReset_Data) == "No") {
  125. updateScore(PasswordReset_Data, 50, 50);
  126. totalTrustScore += 50;
  127. } else {
  128. updateScore(PasswordReset_Data, 0, 50);
  129. checkHacked += 5;
  130. }
  131.  
  132. // Last Login IP Change Date:
  133. updateScore(IPChangeDate_Data, "N", "A");
  134.  
  135. // Update Trust Score:
  136. updateScore(TrustScore_Data, totalTrustScore, 250);
  137. TrustScore_Data.getElementsByTagName("td")[1].innerHTML = totalTrustScore / 250 * 100 + "%";
  138.  
  139.  
  140. // ======== Deal Disputes Warning ======== \\
  141.  
  142. var DealDisputesCount = getData(DealDisputes_Data).split('/')[1];
  143.  
  144. if (DealDisputesCount > 0) {
  145. document.getElementsByClassName("tborder")[1].insertAdjacentHTML("beforeBegin", "<div class='red_alert'><b>WARNING:</b>This user has open scam reports!<br></div>");
  146. }
  147.  
  148. // ======== Add Pro/Con Table ======== \\
  149.  
  150. document.getElementsByClassName("tborder")[1].insertAdjacentHTML("afterend", "<br><table border='0' cellspacing='1' cellpadding='4' class='tborder'><tbody><tr><td class='thead'><strong>More Information</strong></td></tr><tr><td class='trow1'>Pros;<span style='color: white;'><ul id='pros'></ul></span>Cons;<span style='color: white;'><ul id='cons'></ul></span></td></tr></tbody></table>");
  151.  
  152. if ((totalTrustScore / 250 * 100) < 70) {
  153. document.getElementById("cons").innerHTML += "This users trust score is below 70%!<br>";
  154. } else {
  155. document.getElementById("pros").innerHTML += "This users trust score is above 70%<br>";
  156. }
  157.  
  158. if (DealDisputesCount > 0) {
  159. document.getElementById("cons").innerHTML += "This user has an open scam report!<br>";
  160. } else {
  161. document.getElementById("pros").innerHTML += "This user has no open scan reports.<br>";
  162. }
  163.  
  164. if (checkHacked > 3) {
  165. document.getElementById("cons").innerHTML += "This user may have been hacked recently! (Scored: " + checkHacked + "/18)<br>";
  166. } else {
  167. document.getElementById("pros").innerHTML += "This user seems to have not been hacked.<br>";
  168. }