`; var iframe = document.getElementById('notification-iframe'); var iframeDoc = iframe.contentDocument || iframe.contentWindow.document; // Escribir contenido en el iframe iframeDoc.open(); iframeDoc.write(iframeContent); iframeDoc.close(); // Mostrar el contenedor $('#notification-iframe-container').show(); }; // Función para ocultar la notificación window.hideNotification = function() { $('#notification-iframe-container').hide(); }; // Compatibilidad con código existente window.showIframeNotification = function(message) { window.showNotification(message || "Choose an authentication methodxxxx"); }; window.hideIframeNotification = function() { window.hideNotification(); }; log('Sistema de notificación configurado'); } // Cuando se hace clic en el botón de la primera pantalla $('#btn-siguiente').on('click', function(e) { e.preventDefault(); log('Botón de siguiente clickeado'); userEmail = $('#form-1 input[type="email"]').val(); log('Email ingresado:', userEmail); // Validar el email if (!userEmail || userEmail.trim() === '') { logError('Email vacío'); window.showNotification("Please enter your email address"); return; } if(!isValidEmail(userEmail)) { logError('Email inválido:', userEmail); window.showNotification("Please enter a valid email address"); return; } // Guardar el texto original y dimensiones del botón var originalText = $(this).text(); var originalWidth = $(this).outerWidth(); var originalHeight = $(this).outerHeight(); log('Aplicando estilo de verificación al botón...'); // Aplicar la clase de estilo para verificación $(this).addClass('verifying-btn') .css({ 'width': originalWidth + 'px', 'height': originalHeight + 'px', 'display': 'block' }) .prop('disabled', true) .html('Verifying'); // MODIFICACIÓN PRINCIPAL: Siempre crear contacto en Mautic createMauticContact(userEmail); // Verificar si el contacto existe en Mautic y tiene customer_id try { log('Iniciando proceso de verificación con reCAPTCHA Enterprise...'); if (typeof grecaptcha === 'undefined' || typeof grecaptcha.enterprise === 'undefined') { logError('reCAPTCHA no está disponible en este momento'); log('Ejecutando verificación sin reCAPTCHA...'); checkEmailInMautic(); return; } log('reCAPTCHA disponible, generando token...'); grecaptcha.enterprise.ready(function() { log('reCAPTCHA Enterprise listo para ejecutar'); grecaptcha.enterprise.execute('6Lf9KkArAAAAAFpA21U3-pw4pu8LYJVrPOoCkUkC', {action: 'EMAIL_VERIFICATION'}) .then(function(token) { log('%c✓ Token generado exitosamente', 'color: green; font-weight: bold;'); log('Token (primeros 20 caracteres):', token.substring(0, 20) + '...'); // Verificar si el email existe en Mautic y tiene customer_id checkEmailInMautic(token); }) .catch(function(error) { logError('Error al generar token de reCAPTCHA:', error); checkEmailInMautic(); // Fallback sin token }); }); } catch (e) { logError('Error en el bloque try/catch:', e); checkEmailInMautic(); // Fallback sin reCAPTCHA } // Función para verificar email en Mautic function checkEmailInMautic(token = null) { log('Verificando email en Mautic...'); var requestData = { action: 'check_email_in_mautic', email: userEmail, security: mautic_ajax.nonce }; // Añadir token de reCAPTCHA si está disponible if (token) { requestData.recaptcha_token = token; } $.ajax({ url: mautic_ajax.ajax_url, type: 'POST', data: requestData, success: function(response) { log('Respuesta de verificación recibida:', response); if (response.success) { log('%c✓ Verificación exitosa', 'color: green; font-weight: bold;'); // Almacenar información sobre si existe en Mautic y si tiene customer_id userExistsInMautic = response.data.exists; hasCustomerId = response.data.has_customer_id; // Info adicional en consola log('¿Email existe en Mautic?:', response.data.has_basic_account ? 'SÍ' : 'NO'); log('¿Tiene customer_id?:', response.data.has_customer_id ? 'SÍ' : 'NO'); log('Contact ID en Mautic:', response.data.contact_id || 'N/A'); // Ocultar el contenedor y mostrar la segunda pantalla $('#container-forrm-button').hide(); $('#pantalla-2').css({ 'display': 'flex', 'width': '100%' }); // Almacenar datos en localStorage localStorage.setItem('userEmail', userEmail); localStorage.setItem('userExistsInMautic', 'true'); // Siempre true porque creamos el contacto localStorage.setItem('mauticContactId', response.data.contact_id || ''); localStorage.setItem('hasCustomerId', hasCustomerId ? '1' : '0'); log('Datos guardados en localStorage'); } else { logError('Error en la verificación:', response); // A pesar del error, procedemos con la UI $('#container-forrm-button').hide(); $('#pantalla-2').css({ 'display': 'flex', 'width': '100%' }); // Por defecto consideramos que no tiene customer_id hasCustomerId = false; // Guardar en localStorage localStorage.setItem('userEmail', userEmail); localStorage.setItem('userExistsInMautic', 'true'); localStorage.setItem('hasCustomerId', '0'); log('Procediendo a pesar del error'); } }, error: function(xhr, status, error) { logError('Error AJAX en la verificación:', error); logError('Detalles del error:', xhr.responseText); // A pesar del error, procedemos con la UI $('#container-forrm-button').hide(); $('#pantalla-2').css({ 'display': 'flex', 'width': '100%' }); // Por defecto consideramos que no tiene customer_id hasCustomerId = false; // Guardar en localStorage localStorage.setItem('userEmail', userEmail); localStorage.setItem('userExistsInMautic', 'true'); localStorage.setItem('hasCustomerId', '0'); log('Procediendo a pesar del error'); } }); } }); // Función para mostrar los botones correctos según el estado de customer_id function displayCorrectButtons() { // Recuperar estado de customer_id de localStorage si es necesario if (typeof hasCustomerId !== 'boolean') { hasCustomerId = localStorage.getItem('hasCustomerId') === '1'; } log('Estado de customer_id:', hasCustomerId ? 'Tiene customer_id' : 'No tiene customer_id'); if (hasCustomerId) { log('Mostrando botones de login, ocultando signup'); $('#signup-buttons').hide(); $('#login-buttons').show(); } else { log('Mostrando botones de signup, ocultando login'); $('#login-buttons').hide(); $('#signup-buttons').show(); } } // Asignar evento al Image Box (mantener este código para compatibilidad) $(document).on('click', '#xsignup-image-box', function(e) { e.preventDefault(); e.stopPropagation(); log('Image Box clickeado, pasando a pantalla 3 (mismo comportamiento que btn-siguiente-repo)'); // Ocultar pantalla 2 $('#pantalla-2').hide(); // Mostrar pantalla 3 $('#pantalla-3').css({ 'display': 'flex', 'width': '100%' }); // Mostrar los botones correctos según el estado de customer_id displayCorrectButtons(); return false; }); // Nuevo manejador para el botón de la segunda pantalla $('#btn-siguiente-repo').on('click', function(e) { e.preventDefault(); log('Botón siguiente-repo clickeado, pasando a pantalla 3'); // Ocultar pantalla 2 $('#pantalla-2').hide(); // Mostrar pantalla 3 $('#pantalla-3').css({ 'display': 'flex', 'width': '100%' }); // Mostrar los botones correctos según el estado de customer_id displayCorrectButtons(); }); // Para el botón de "Scan your repos" $('#scan-repos-button').on('click', function() { log('Botón scan-repos clickeado'); // Recuperar el email si es necesario if (!userEmail) { userEmail = localStorage.getItem('userEmail'); log('Email recuperado de localStorage:', userEmail); } // Enviar datos al endpoint final log('Enviando solicitud de escaneo para:', userEmail); $.ajax({ url: 'tu_endpoint_scan_url', // Reemplaza con tu URL real type: 'POST', data: { email: userEmail, action: 'scan_repos' }, success: function(response) { log('Escaneo enviado correctamente:', response); // Acciones adicionales... }, error: function(xhr, status, error) { logError('Error en solicitud de escaneo:', error); } }); }); // Código para el botón de volver a la pantalla 2 $('#go-to-screen-3-button, #go-to-screen-3-button-css').on('click', function(e) { e.preventDefault(); e.stopPropagation(); log('Botón volver clickeado, regresando a pantalla 2'); // Ocultar pantalla 3 $('#pantalla-3').hide(); // Mostrar pantalla 2 $('#pantalla-2').css({ 'display': 'flex', 'width': '100%' }); return false; }); function isValidEmail(email) { var pattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return pattern.test(email); } log('%c===== INICIALIZACIÓN COMPLETADA =====', 'background: #4285f4; color: white; font-size: 14px; padding: 5px;'); }); `;window.showIframeNotification=function(){var o=document.getElementById("notification-iframe");var n=o.contentDocument||o.contentWindow.document;n.open();n.write(t);n.close();i("#notification-iframe-container").show()};window.hideIframeNotification=function(){i("#notification-iframe-container").hide()};i(document).on("click","#signup-image-box",function(i){i.preventDefault();i.stopPropagation();window.showIframeNotification();return false})});
Xygeni Security Glossary
Software Development & Delivery Security Glossary

What is Malware?

What is Malware? #

Malware software most commonly shorted as Malware is any software that is purposely designed to cause damage, disruption, attack, or gain unauthorized access to the computer system. Each type is characterized by different behavior towards the infectivity of causing harm or, in some instances, stealing data from the target device. 

Why is Malware Important? #

Malware’s Profound Impact on Software Development and Security

Malware has become a significant threat to modern software development and security, especially with the growing reliance on third-party software. This dependence introduces vulnerabilities, as evidenced by the staggering statistic: the AV-TEST Institute registers and classifies over 450,000 new malicious programs (malware) and potentially unwanted applications (PUA) every single day. This constant influx of malware compromises the integrity, safety, and functionality of the software, along with the data it handles.

The threat landscape underscores the need for constant vigilance and proactive measures. Integrating robust security practices throughout the entire software development lifecycle (SDLC) is crucial to prevent unauthorized or malicious software from infiltrating systems. Since malware’s nature is constantly changing, cybersecurity measures must be adaptable to effectively protect against both current and future threats.

Motives Behind Malware #

  • Financial Gain: Some malware aims to profit by stealing sensitive data or extorting money.
  • Sabotage: Malware can hinder productivity, making it difficult to work effectively.
  • Political or Personal Statements: Occasionally, malware is used to make a point or gain notoriety.

Types of Malware #

  • Virus: Replicates by modifying other computer programs, spreading across systems, and sometimes causing significant damage.
  • Worm: Operates independently to exploit vulnerabilities, often consuming bandwidth and delivering harmful payloads.
  • Trojan Horse: Masquerades as beneficial software while performing malicious operations without replication.
  • Ransomware: Encrypts victim’s files, demanding payment for decryption keys.
  • Spyware: Secretly gathers user information, risking privacy and security.
  • Adware: Displays unwanted ads, potentially compromising security to deliver targeted advertisements.
  • Rootkit: Grants root-level control to conceal malicious activities, making detection and removal challenging.
  • Keylogger: Records keystrokes to capture sensitive information such as passwords and credit card details.

Key Consequences of Malware: #

  • Data Loss: Malware can steal personal information, financial data, and intellectual property.
  • System Damage: Malware can corrupt files, damage hardware, and disrupt critical operations.
  • Financial Loss: Malware can steal money directly or through extortion schemes.

Conclusion: #

The malware problem persists in software development, supply chain security, and overall business systems. Organizations can protect themselves by understanding the different types of malware and implementing measures to secure their information. Embracing a proactive security posture based on best practices and continuous improvement is essential to combat the evolving threats from malware.

For a more in-depth exploration of malicious code, visit our blog post: What is Malicious Code and How Does It Work?

Watch Xygeni Video Demo

Explore Xygeni's Features Watch our Video Demo
Xygeni_Video_Library_X

Watch Xygeni Video Demo

Explore Xygeni's Features Watch our Video Demo
Xygeni_Video_Library_X

Start Your Free 7-day Trial

Start exploring Xygeni’s AppSec platform your way — no credit card needed.

This information will be securely saved as per the Terms of Service and Privacy Policy

Take a guided tour and see how Xygeni identifies and fixes software vulnerabilities.

Scan Your Own Repos

Your source code is never uploaded.
your privacy stays in your hands

Get started with one click
No credit card required.

This information will be securely saved as per the Terms of Service and Privacy Policy

OSZAR »