Leonardo AI Token Unlocker

Tests Leonardo AI token system for vulnerabilities by attempting to unlock premium token limits

  1. // ==UserScript==
  2. // @name Leonardo AI Token Unlocker
  3. // @namespace leonardoai.test
  4. // @version 1.0.0
  5. // @description Tests Leonardo AI token system for vulnerabilities by attempting to unlock premium token limits
  6. // @author EthicalHacker
  7. // @match https://app.leonardo.ai/*
  8. // @icon https://app.leonardo.ai/favicon.ico
  9. // @require https://greasyfork.org/scripts/455943-ajaxhooker/code/ajaxHooker.js?version=1124435
  10. // @run-at document-start
  11. // @grant GM_setValue
  12. // @grant GM_getValue
  13. // @license none
  14. // ==/UserScript==
  15.  
  16. /* global ajaxHooker */
  17. (function() {
  18. 'use strict';
  19.  
  20. // Configuration
  21. const CONFIG = {
  22. debug: true, // Enable for detailed console logging
  23. notificationDuration: 5000, // Duration for status notifications (ms)
  24. targetTokenCount: 10000, // Token count to test
  25. theme: {
  26. primary: "#4CAF50", // Green for success
  27. text: "#333333",
  28. background: "#f9f9f9",
  29. shadow: "0 2px 5px rgba(0, 0, 0, 0.1)"
  30. },
  31. testedFeatures: [
  32. "Token Balance",
  33. "Image Generation",
  34. "Model Training",
  35. "Premium Features"
  36. ]
  37. };
  38.  
  39. // Logger utility
  40. const logger = {
  41. log: (message) => CONFIG.debug && console.log(`[LeonardoAIUnlocker] ${message}`),
  42. success: (message) => CONFIG.debug && console.log(`[LeonardoAIUnlocker] %c${message}`, "color: green"),
  43. error: (message, err) => CONFIG.debug && console.error(`[LeonardoAIUnlocker] ${message}`, err)
  44. };
  45.  
  46. // API interceptor module
  47. const apiInterceptor = {
  48. init: () => {
  49. try {
  50. ajaxHooker.hook((request) => {
  51. // Intercept user info endpoint (token balance)
  52. if (request.url.includes("/api/rest/v1/user/self")) {
  53. logger.log("Intercepting user info request");
  54.  
  55. request.response = (response) => {
  56. try {
  57. const responseData = JSON.parse(response.responseText);
  58. const userData = "data" in responseData ? responseData.data : responseData;
  59.  
  60. // Attempt to manipulate token balance
  61. if (userData) {
  62. userData.subscription_tokens = CONFIG.targetTokenCount;
  63. userData.subscription_tokens_used = 0;
  64. userData.subscription_plan = "premium_pro";
  65. userData.is_premium = true;
  66. }
  67.  
  68. // Update response
  69. response.responseText = JSON.stringify(
  70. "data" in responseData ? ((responseData.data = userData), responseData) : userData
  71. );
  72.  
  73. logger.success(`Set token balance to ${CONFIG.targetTokenCount}`);
  74. uiManager.showStatusNotification("Token balance manipulation attempted!");
  75. } catch (err) {
  76. logger.error("Error processing user info response", err);
  77. uiManager.showStatusNotification("Error manipulating token balance");
  78. }
  79. };
  80. }
  81.  
  82. // Intercept generation endpoint
  83. if (request.url.includes("/api/rest/v1/generations")) {
  84. logger.log("Intercepting generation request");
  85.  
  86. request.response = (response) => {
  87. try {
  88. const responseData = JSON.parse(response.responseText);
  89. // Ensure generation proceeds without token deduction
  90. if (responseData) {
  91. responseData.status = "success";
  92. responseData.token_cost = 0; // Attempt to bypass token cost
  93. }
  94.  
  95. response.responseText = JSON.stringify(responseData);
  96. logger.success("Generation request processed with zero token cost");
  97. } catch (err) {
  98. logger.error("Error processing generation response", err);
  99. }
  100. };
  101. }
  102.  
  103. // Intercept subscription or billing endpoints
  104. if (request.url.includes("/billing/") || request.url.includes("/subscription/")) {
  105. logger.log("Intercepting subscription endpoint");
  106.  
  107. request.response = (response) => {
  108. try {
  109. response.responseText = JSON.stringify({
  110. success: true,
  111. data: {
  112. has_premium_access: true,
  113. subscription_plan: "premium_pro",
  114. token_balance: CONFIG.targetTokenCount,
  115. status: "active"
  116. }
  117. });
  118. logger.success("Premium subscription access granted");
  119. } catch (err) {
  120. logger.error("Error processing subscription response", err);
  121. }
  122. };
  123. }
  124. });
  125. logger.success("API interceptors initialized");
  126. } catch (err) {
  127. logger.error("Failed to initialize API interceptors", err);
  128. uiManager.showStatusNotification("Failed to initialize token unlocker");
  129. }
  130. }
  131. };
  132.  
  133. // UI Manager for notifications
  134. const uiManager = {
  135. showStatusNotification: (message) => {
  136. if (document.body) {
  137. const notification = document.createElement("div");
  138. notification.style.position = "fixed";
  139. notification.style.bottom = "20px";
  140. notification.style.right = "20px";
  141. notification.style.padding = "10px 15px";
  142. notification.style.backgroundColor = CONFIG.theme.background;
  143. notification.style.color = CONFIG.theme.text;
  144. notification.style.border = "1px solid #ccc";
  145. notification.style.borderLeft = `4px solid ${CONFIG.theme.primary}`;
  146. notification.style.borderRadius = "4px";
  147. notification.style.boxShadow = CONFIG.theme.shadow;
  148. notification.style.fontFamily = "Arial, sans-serif";
  149. notification.style.fontSize = "14px";
  150. notification.style.zIndex = "10000";
  151.  
  152. notification.textContent = message;
  153.  
  154. document.body.appendChild(notification);
  155.  
  156. setTimeout(() => {
  157. if (notification.parentNode) {
  158. notification.parentNode.removeChild(notification);
  159. }
  160. }, CONFIG.notificationDuration);
  161. }
  162. },
  163.  
  164. showInfoPopup: () => {
  165. const popup = document.createElement("div");
  166. popup.style.position = "fixed";
  167. popup.style.bottom = "20px";
  168. popup.style.right = "20px";
  169. popup.style.padding = "15px";
  170. popup.style.backgroundColor = CONFIG.theme.background;
  171. popup.style.boxShadow = CONFIG.theme.shadow;
  172. popup.style.border = "1px solid #ccc";
  173. popup.style.borderRadius = "8px";
  174. popup.style.zIndex = "10000";
  175. popup.style.fontFamily = "Arial, sans-serif";
  176. popup.style.color = CONFIG.theme.text;
  177. popup.style.width = "280px";
  178.  
  179. const header = document.createElement("h3");
  180. header.textContent = "Leonardo AI Token Unlocker";
  181. header.style.margin = "0 0 10px";
  182. header.style.color = CONFIG.theme.primary;
  183. header.style.fontSize = "16px";
  184.  
  185. const featuresHeader = document.createElement("p");
  186. featuresHeader.textContent = "Tested features:";
  187. featuresHeader.style.margin = "10px 0 5px";
  188. featuresHeader.style.fontWeight = "bold";
  189.  
  190. const featuresList = document.createElement("ul");
  191. featuresList.style.margin = "0 0 15px";
  192. featuresList.style.paddingLeft = "20px";
  193.  
  194. CONFIG.testedFeatures.forEach(feature => {
  195. const item = document.createElement("li");
  196. item.textContent = feature;
  197. item.style.margin = "3px 0";
  198. featuresList.appendChild(item);
  199. });
  200.  
  201. const closeButton = document.createElement("button");
  202. closeButton.textContent = "×";
  203. closeButton.style.position = "absolute";
  204. closeButton.style.top = "5px";
  205. closeButton.style.right = "5px";
  206. closeButton.style.background = "none";
  207. closeButton.style.border = "none";
  208. closeButton.style.cursor = "pointer";
  209. closeButton.style.fontSize = "18px";
  210. closeButton.style.color = "#666";
  211.  
  212. closeButton.addEventListener("click", () => {
  213. if (popup.parentNode) {
  214. document.body.removeChild(popup);
  215. }
  216. });
  217.  
  218. popup.appendChild(header);
  219. popup.appendChild(featuresHeader);
  220. popup.appendChild(featuresList);
  221. popup.appendChild(closeButton);
  222.  
  223. document.body.appendChild(popup);
  224.  
  225. setTimeout(() => {
  226. if (popup.parentNode) {
  227. document.body.removeChild(popup);
  228. }
  229. }, 15000);
  230. }
  231. };
  232.  
  233. // Initialize the unlocker
  234. (function init() {
  235. apiInterceptor.init();
  236.  
  237. window.addEventListener("load", () => {
  238. setTimeout(() => {
  239. uiManager.showInfoPopup();
  240. }, 2000);
  241. });
  242.  
  243. logger.log("Leonardo AI Token Unlocker initialized");
  244. })();
  245. })();