When a company’s systems suddenly become locked and a message appears demanding money in exchange for restoring access to files, panic is the first reaction. However, acting correctly in the first few hours after a ransomware attack can make the difference between restoring operations within days and losing critical information forever. In Barcelona, where business activity is particularly intense and corporate data has enormous strategic value, this type of incident has become an everyday threat.
At Barcelona Penal, a criminal law firm based in Barcelona, we advise companies affected by cybercrime from the outset, helping them manage the legal implications of the incident, file the relevant reports and bring a private prosecution against those responsible where they can be identified.
What is a ransomware attack and how does it work in business environments?
Ransomware is a type of malware that encrypts the files on an infected system and demands payment of a ransom —usually in cryptocurrencies— in exchange for providing the decryption key. In corporate environments, the sophistication of these attacks has grown exponentially in recent years.
How ransomware enters a company’s systems
The most common entry vectors are email phishing, malicious attachments, compromised remote access credentials (especially RDP) and unpatched vulnerabilities in outdated software.
The exploitation of internet-facing services without adequate protection is also common. In many cases documented at companies in Barcelona and its metropolitan area, the initial access takes place weeks before encryption, during which attackers map the network and silently escalate their privileges.
This latency period is particularly dangerous because, by the time the ransomware visibly activates, cybercriminals have already had time to identify and compromise backups as well.
The double-extortion model: encryption and data exfiltration
Modern ransomware groups no longer limit themselves to encrypting files. The current tactic combines encryption with the prior exfiltration of sensitive data. If the company does not pay, they threaten to publish that information on dark web leak sites.
This double extortion is particularly serious for companies that handle customer data, financial information or trade secrets, as the reputational and legal damage can be devastating even if systems are technically restored.
Groups such as LockBit, BlackCat/ALPHV and Cl0p have attacked medium-sized and large companies in Spain using precisely this model. Notification to the Spanish Data Protection Agency (AEPD) may be mandatory in these cases.
The first few hours: the immediate response protocol for ransomware
When active encryption is detected on systems, every minute counts. A well-executed response protocol in the first few hours can limit the extent of the damage and preserve essential evidence for the subsequent legal investigation.
Step 1: isolate affected systems immediately
The first objective is to stop the spread of the malware. To do this, it is essential to disconnect affected devices from the network immediately: disable WiFi connections, unplug network cables and, where possible, segment the network to contain the infection.
Devices should not be hastily powered off physically, as this may destroy volatile digital evidence (processes in memory, active connections) that IT forensic experts may need for subsequent forensic analysis.
It is essential not to attempt to decrypt or remove the malware without specialist assistance, as some actions may trigger mechanisms that permanently destroy the data.
Step 2: activate the incident response team
If the company has an incident response plan (IRP), this is the time to activate it. If not, the internal or external IT team, management and, in parallel, legal advisers specialising in cybersecurity and criminal law must be convened urgently.
Internal communication must be controlled from the outset. Not all employees need to know every detail of the incident, especially if there is a possibility that the entry vector was an insider or if there is a risk that information about the status of the attack could reach the cybercriminals.
Step 3: document and preserve digital evidence
From the outset, it is crucial to document everything observed: screenshots of the ransomware message, system records (logs), prior suspicious emails and any communication with the attackers.
This documentation has essential evidential value if a criminal complaint is subsequently filed. At Barcelona Penal, we regularly work with IT forensic experts to ensure that the chain of custody for digital evidence is correct and admissible in court.
A very common mistake made by companies that have suffered ransomware is restoring systems before preserving the evidence. This can completely invalidate any subsequent criminal action.
Step 4: assess the true scope of the attack
Once the spread has been contained, the technical team must determine which systems have been affected, what data has been encrypted and, in particular, whether information has been exfiltrated before encryption.
This assessment is decisive in determining the next steps, both technically and legally. If personal data has been compromised, the 72-hour deadline for notifying the AEPD has already started to run.
Has your business suffered a ransomware attack and you do not know how to respond? Every minute counts: contact our criminal lawyers specialising in cybercrime now and protect your rights from the outset.
Should you pay the ransom? The legal and practical implications
This is the question every affected company inevitably asks itself. The answer is not straightforward and depends on multiple technical, operational and legal factors.
Why authorities and experts advise against paying
Organisations such as INCIBE (the Spanish National Cybersecurity Institute), Europol and the FBI consistently recommend not paying the ransom for several compelling reasons.
First, payment does not guarantee data recovery. A significant percentage of companies that pay do not receive a working decryption key, or receive one that works only partially. Cybercriminals have no contractual obligation or genuine incentive to honour their side of the deal.
Second, paying fuels the ransomware criminal ecosystem. Every ransom paid funds further operations and confirms to attackers that their business model is profitable, perpetuating attacks on other companies.
The legal implications of payment in Spain
Although Spain has no express legal prohibition on paying a ransom, payment can give rise to complex legal consequences. If the ransomware group is included on European Union or international sanctions lists, the transfer of funds could constitute a breach of rules on economic sanctions.
Furthermore, payment may be interpreted as an implicit acknowledgement that the exfiltrated data has value, which may influence subsequent civil liability proceedings. Consulting a criminal lawyer before making any payment decision is absolutely essential.
At Barcelona Penal, we analyse each case individually, assessing the specific legal risks that payment would entail before the company makes any financial decision in response to the attackers.
When payment may be considered a last resort
There are exceptional circumstances in which payment may be considered as an option: where the encrypted data is absolutely critical to business continuity or even to people’s lives (for example, in the healthcare sector), where no recoverable backups exist and where the company is certain that the cybercriminal group has a track record of providing functional decryption keys.
Even in these cases, negotiation with the attackers must always take place with the support of incident response experts and simultaneous legal advice. You should never negotiate directly without specialist support.
Legal obligations of the victim company: what Spanish law requires
Suffering a ransomware attack does not automatically make the company a passive party without responsibilities. Spanish and European legislation imposes a series of specific obligations that must be met within very strict deadlines.
Notification to the AEPD: the 72-hour deadline
If the ransomware has compromised personal data —as happens in virtually all attacks on companies—, the General Data Protection Regulation (GDPR) requires the security breach to be reported to the Spanish Data Protection Agency within a maximum of 72 hours of becoming aware of the incident.
This notification must include information about the nature of the breach, the categories and approximate number of data subjects affected, the measures taken or proposed to mitigate the effects and the contact details of the Data Protection Officer (DPO), if there is one.
Failure to comply with this obligation can lead to very significant financial penalties: up to 10 million euros or 2% of total worldwide annual turnover, depending on the type of infringement. The AEPD has significantly increased its enforcement activity in this area in recent years.
Notification to affected data subjects
Where the breach poses a high risk to the rights and freedoms of natural persons whose data has been compromised, the GDPR also requires those individuals to be notified individually. The communication must be clear, describe the nature of the incident and offer recommendations to mitigate potential harm.
Managing this communication incorrectly or late may aggravate the company’s legal liability and generate additional claims from affected customers or employees.
Criminal complaint to the authorities
Filing a complaint with the Guardia Civil’s Cybercrime Group or the National Police’s Central Technological Investigation Brigade is not only a right, but also a key tool for initiating an investigation into the offence.
Although the rate of identification and conviction of those responsible for ransomware remains low, it has improved considerably in recent years thanks to international police cooperation. Europol coordinates joint operations that have dismantled groups such as LockBit and Emotet.
At Barcelona Penal, we prepare and file the complaint with all the necessary technical and expert documentation so that the judicial investigation can begin on the strongest possible footing.
The technical recovery process: how to restore systems
Technical recovery after a mass encryption attack is a complex process that must be carried out methodically and without haste, as mistakes at this stage can worsen the situation.
Assessing available backups
The first technical step towards recovery is to verify the integrity and availability of backups. This is where many companies discover that their backups have also been compromised or were not as up to date as they believed.
Backups isolated from the main network (offline or air-gapped) are the only ones that can be considered secure against a well-executed ransomware attack. If they exist and are in good condition, recovery is far more streamlined and does not depend on the attackers at all.
Free decryption tools: the No More Ransom project
Before assuming that data cannot be recovered without payment, it is essential to consult the No More Ransom project, an initiative by Europol, the Dutch National Police and cybersecurity companies such as Kaspersky and McAfee.
This repository contains free decryption tools for hundreds of known ransomware variants. In some cases, where researchers have obtained the keys from a dismantled group, it is possible to recover encrypted files without paying any ransom.
Correctly identifying the ransomware variant —through the attacker’s message, the extension of encrypted files or platforms such as ID Ransomware— is the first step in determining whether a decryption tool is available.
Rebuilding systems and strengthening security
Once the data has been recovered, the company cannot simply reactivate its systems as if nothing had happened. It is essential to identify and close the entry vector that enabled the attack, otherwise it could happen again within weeks.
The process includes a full vulnerability audit, a review of compromised credentials, the implementation of multi-factor authentication (MFA), network segmentation and the updating of all systems and software. Post-incident cybersecurity must be considerably more robust than it was before.
A ransomware attack is not just a technical issue; it also has criminal and legal consequences you need to understand. Request an initial assessment from Barcelona Penal and take action with the right legal strategy.
Criminal implications: the offences committed by attackers and how to pursue them
A ransomware attack is not just a technical issue. It is a set of offences defined under the Spanish Criminal Code that can be pursued through the courts and deserve a firm legal response.
Cybercrime offences applicable to ransomware
The Spanish Criminal Code includes several offences that directly apply to this type of attack:
- Articles 197 bis and ter: unauthorised access to computer systems and interception of data transmissions.
- Article 264: computer damage, punishable by prison sentences of 6 months to 3 years, which may be increased where the attack affects critical infrastructure or essential services.
- Article 243: extortion, due to the demand for ransom payment under the threat of maintaining the encryption or publishing the exfiltrated data.
- Articles 197 et seq.: offences against privacy and the protection of personal data, where private information is exfiltrated.
The occurrence of several of these criminal offences in the same incident is common, which can significantly increase the penalties applicable to those responsible.
Bringing a private prosecution by the victim company
The affected company has the right to appear as a private prosecutor in criminal proceedings brought against those responsible. This allows it to participate actively in the investigation, request investigative measures, access procedural records and claim the civil liability arising from the offence.
Private prosecution is particularly relevant in these cases because it allows the company to ensure that its interests are properly represented in the proceedings, beyond the action taken by the Public Prosecutor’s Office.
At Barcelona Penal, we handle private prosecutions in cybercrime cases, representing companies in Barcelona and throughout Spain that have suffered ransomware attacks or other cybercrimes.
Prevention: how to drastically reduce the risk before it happens
By far, the best strategy against ransomware remains prevention. Although no measure guarantees absolute protection, a combination of sound technical and legal practices reduces the risk very significantly.
Essential technical measures for companies
From a technical standpoint, the most effective measures are:
- Maintaining regular, isolated backups, with periodic verification of their integrity and recoverability.
- Implementing multi-factor authentication
- on all remote access points, especially RDP connections, VPNs and administration panels.
- Segmenting the internal network to limit the malware’s lateral movement in the event of infection.
- Systematically applying security patches and updates to operating systems, applications and network device firmware.
- Using endpoint detection and response (EDR) solutions, which are more effective than traditional antivirus software against modern ransomware.
- Restricting access in line with the principle of least privilege: each user and process should have only the permissions strictly necessary for its function.
None of these measures alone is sufficient. Real ransomware security is built in layers, so that if one control fails, the next ones continue to provide protection.
Staff training and awareness
The human factor remains the weakest link in any cybersecurity strategy. The vast majority of ransomware attacks begin when an employee opens a malicious attachment or clicks on a phishing link.
Regular cybersecurity training and awareness programmes, combined with phishing simulations, demonstrably reduce the success rate of these attacks. This training must reach every level of the organisation, including management.
An employee who can recognise a sophisticated phishing email or understands why they should not plug in an unknown USB device can prevent an incident that costs millions of euros in damage and reputational loss.
Preventive organisational and legal measures
Beyond technology, there are organisational measures that strengthen a company’s resilience in the event of an attack:
- Developing and keeping up to date an Incident Response Plan (IRP) specifically for ransomware, with clearly assigned roles and defined procedures.
- Appointing a Data Protection Officer (DPO) or ensuring that someone in the organisation understands AEPD notification obligations.
- Taking out cybersecurity insurance that covers incident response costs, loss of income from business interruption and potential third-party claims.
- Conducting regular audits and penetration tests to identify vulnerabilities before attackers do.
From a legal perspective, having preventive advice on criminal law and data protection allows the company to know exactly what it must do and within what deadlines if an incident occurs, avoiding costly mistakes at the worst possible time.
When private prosecution comes into play and what can be claimed
One of the least understood aspects for companies that are victims of ransomware is the actual scope of the legal action they can take. It is not limited to filing a complaint and waiting.
Claiming civil liability arising from the offence
In criminal proceedings, the company can claim civil liability arising from the offence, including compensation for all damage and losses caused by the attack: technical recovery costs, expert fees, lost profits due to business interruption, reputational damage and any administrative penalty incurred as a result of the incident.
This claim is made within the criminal proceedings themselves, which is more efficient than starting separate civil proceedings. If those responsible are identified and convicted, the judgment may directly include an obligation to compensate the victim company.
Cooperation with police and judicial authorities
A victim company acting as a private prosecutor can request investigative measures before the investigating judge: IT forensic examinations, requests for information from internet service providers, international letters rogatory to obtain information from foreign jurisdictions, or cooperation with Europol and equivalent bodies.
This active participation in the investigation is fundamental in ransomware cases, where attackers often operate from third countries and digital trails are the only way to identify them. The quality of the evidence submitted at the initial stage can determine the success or failure of the entire investigation.
What happens when attackers cannot be identified
In a significant proportion of cases, those responsible for ransomware are not identified or are located in countries without extradition agreements with Spain. In these situations, criminal proceedings may remain at the investigation stage without reaching trial.
However, this does not mean that the company has no options. The documented court proceedings may be useful to evidence the incident to insurers, demonstrate due diligence to the AEPD in the event of enforcement proceedings and support any civil claim against third parties that may have contributed to the damage.
If your company’s systems have been encrypted and you are being asked to pay a ransom, you have legal options available. Our team of criminal lawyers in Barcelona will support you throughout the process, from filing the complaint to resolving the case.
Most common mistakes companies make after a ransomware attack
Experience in the legal management of incidents of this kind reveals a number of recurring mistakes that unnecessarily worsen the situation for the victim company.
Restoring systems before preserving evidence
It has already been mentioned, but deserves particular emphasis: the costliest mistake from a legal standpoint is rushing to restore systems without first creating a forensic image of affected devices and preserving attack logs.
Once systems are cleaned and restored, the digital evidence that could have identified the attackers may be lost forever. This mistake closes the door to criminal action in many cases that would otherwise have had real prospects of success.
Failing to notify the AEPD on time
In the chaos of the first few hours, many companies are unaware that the 72-hour deadline for notifying the AEPD starts running from the moment they detect the incident. Once that deadline has passed, the company is exposed to enforcement proceedings for breaching the GDPR, regardless of the fact that it is a victim of the attack.
The initial notification can be made with preliminary information and completed later. The important thing is to meet the deadline, even if the full assessment of the scope is still ongoing.
Communicating the incident publicly without a strategy
Managing the external communication of the incident on an improvised basis can cause significant additional damage. Hasty statements to the media, poorly drafted customer notifications or uncontrolled social media posts can aggravate reputational damage and create new legal exposure.
Before making any public communication, the company must have legal and communications advice. The narrative surrounding the incident has direct implications for how regulators, customers and potential claimants perceive it.
Negotiating with attackers without specialist advice
Making direct contact with cybercriminals without professional support is one of the most serious mistakes. Attackers are experienced negotiators who use psychological pressure tactics. Without the support of incident response experts, the company may reveal valuable information about its assets or insurance, weakening its negotiating position.
There are companies specialising in negotiating with ransomware groups that act as intermediaries, combining their technical expertise with the legal support needed to ensure every step is legally covered.
Conclusion
Suffering a ransomware attack at your company is a crisis that unfolds simultaneously on several levels: technical, operational, legal and reputational. Acting correctly on each of them, especially in the first few hours, is what makes the difference between an orderly recovery and a disaster with lasting consequences.
As an affected company, you have strict legal obligations to meet within very short deadlines, but you also have rights to exercise against those responsible for the attack. Criminal complaints, private prosecution and claims for civil liability are real tools that can result in effective compensation if the proceedings are handled rigorously from the outset.
Prevention remains by far the most cost-effective investment. A well-designed response protocol, isolated backups and trained staff can turn what would otherwise be a catastrophe into a manageable incident. But if the attack has already occurred, the most important thing is to avoid the mistakes that destroy the legal and technical options available.
Contact Barcelona Penal, cybercrime experts in Barcelona
Barcelona Penal is a law firm based in Barcelona dedicated exclusively and specifically to criminal law. The firm provides comprehensive services both for the defence of individuals under investigation or accused and for bringing private prosecutions on behalf of crime victims, covering every stage of criminal proceedings, from the first procedural step through to final resolution and the filing of appeals.
If your company has suffered a ransomware attack or any other type of cybercrime in Barcelona or anywhere else in Spain, at Barcelona Penal we can help: from preserving evidence and filing the complaint to bringing a private prosecution and claiming compensation for all damages suffered. Contact Barcelona Penal as soon as possible to receive specialist advice from the outset.
