Skip to content
Home » Breach & Incident Response » Your Server Is Sending Spam: What to Do and Who Is Liable

Your Server Is Sending Spam: What to Do and Who Is Liable

Compromised server being used to send spam emails with legal consequences shown through gavel, handcuffs, and “blacklisted” warning.

The first sign is often small. Bounce messages for emails nobody in the office wrote. A client asking why “you” sent them a payment link. Your email provider suspending the account, or your internet provider warning about traffic from your connection. A hacked server sending spam does not look broken; Tally still opens and the shares still work. This post covers how to confirm it, how to stop it, and what Indian law says about your responsibility.

Not legal advice. The legal section reflects the IT Act, the CERT-In Directions and the DPDP Act as of October 2026. Ask a legal advisor how they apply to your firm.

Why attackers want your server, not just your data

An office server is an always-on Windows machine with a clean Indian internet connection and, often, a trusted email domain. Once someone has an administrator login, they can use it to send spam and phishing, to attack other networks, to mine cryptocurrency on your electricity, or as a quiet base for a later ransomware attack. The mail goes out from your IP address, and if they use your mail account, from your domain. Your clients trust that domain.

Confirm it: four checks

Run these on the server in PowerShell opened with Run as administrator. If you are not comfortable doing so, hand this page to your IT vendor.

1. Is anything sending mail right now?

A normal office server that is not your mail server has no reason to hold connections to mail ports (25, 465, 587). This lists any that are open and the program behind each one:

Get-NetTCPConnection -State Established -RemotePort 25,465,587 -ErrorAction SilentlyContinue |
  Select-Object RemoteAddress, RemotePort, OwningProcess,
    @{Name='Process'; Expression={ (Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).Path }}

No output is good. Some legitimate software, such as an accounting package emailing invoices, uses port 587 through Gmail or Microsoft 365, so check every program it names. A program in a temp folder or under a user’s AppData that you do not recognise is a strong warning.

2. Is your IP address on a blocklist?

Find the office’s public IP address:

Invoke-RestMethod -Uri 'https://api.ipify.org'

Then check it, and your domain, on the Spamhaus reputation checker and the MXToolbox blacklist check. A listing tells you mail from that address was seen as spam; it also explains why your firm’s genuine emails may have started landing in clients’ junk folders. If your office shares an address with other customers (common on consumer broadband connections behind CGNAT), a listing may not be your doing, so treat this check together with the others.

3. Did anyone create accounts or add administrators?

Event 4720 is logged when a user account is created, and 4732 when someone is added to a local group such as Administrators. This shows the last 30 days:

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4720,4732; StartTime=(Get-Date).AddDays(-30)} -ErrorAction SilentlyContinue |
  Format-List TimeCreated, Id, Message
Get-LocalGroupMember -Group Administrators

Every name in the Administrators group should be someone you can point to. More on reading these events is in how to tell if someone is trying to break into your server.

4. Did anyone install a service or a scheduled task?

Attackers often install a service (event 7045, in the System log) or a scheduled task so their program restarts after a reboot:

Get-WinEvent -FilterHashtable @{LogName='System'; Id=7045; StartTime=(Get-Date).AddDays(-30)} -ErrorAction SilentlyContinue |
  Format-List TimeCreated, Message
Get-ScheduledTask | Where-Object { $_.TaskPath -notlike '\Microsoft\*' } |
  Select-Object TaskPath, TaskName, State

Look for services pointing to odd folders and tasks with random-looking names. Remote-support tools that nobody in the office installed deserve the same suspicion.

Stop it

  1. Disconnect the server from the network; do not switch it off. Shutting down destroys evidence in memory.
  2. Write down the time and report to CERT-In within six hours (see below).
  3. Save the logs before anyone changes anything. Our incident response guide has the commands and the full order of steps.
  4. Disable unknown accounts, remove unknown services and tasks, and reset passwords from a different, clean computer, including the email account if spam went out through it.
  5. Close the way in. In most small offices that is Remote Desktop open to the internet with a guessable password. Remove the router’s port-forward, and give staff a private route instead: Prixl Guard, a VPN or RD Gateway.
  6. Block outbound port 25 on servers that are not mail servers, so a future infection cannot send mail directly. Leave 587 alone until you know which programs use it.
New-NetFirewallRule -DisplayName 'Block outbound SMTP 25' -Direction Outbound -Protocol TCP -RemotePort 25 -Action Block

Once the server is clean, ask each blocklist to remove your address through its own delisting page, and tell your email provider what happened. Listings removed before the cause is fixed tend to come back.

Are you legally responsible?

Possibly, and the answer depends less on the spam than on what was on the server and what care you had taken. Three pieces of Indian law matter.

CERT-In: report within six hours

The CERT-In Directions of 28 April 2022 list the incidents that must be reported within six hours of noticing. A hijacked server fits several entries on that list: unauthorised access to IT systems, malicious code attacks (the list names bots and cryptominers), attacks on servers including mail servers, and spoofing and phishing. CERT-In treats a firm as a body corporate, and the duty is the firm’s own. Email [email protected] or call 1800-11-4949. Not complying can cost up to ₹1 crore, up to a year’s imprisonment, or both (IT Act section 70B(7)).

Today: IT Act section 43A

Section 43A makes a body corporate, which includes a firm, liable to pay compensation if it handles sensitive personal data, is negligent in keeping reasonable security practices, and someone suffers wrongful loss as a result. Under the SPDI Rules 2011, sensitive personal data includes passwords and bank account or card details, both of which a CA firm’s server usually holds. Spam on its own is unlikely to bring section 43A into play. An intruder who could read that data, through a server you had left with a weak password and an open RDP port, is a different matter.

From mid-May 2027: the DPDP Act

When the main duties of the Digital Personal Data Protection Act 2023 begin, section 43A is omitted and section 8(5) takes its place: a data fiduciary must protect personal data “by taking reasonable security safeguards to prevent personal data breach”. The penalty for failing to do so can reach ₹250 crore. Section 8(6) and the DPDP Rules 2025 add a duty to tell the Data Protection Board and every affected person about a breach, with a detailed report to the Board within 72 hours; failing to notify can reach ₹200 crore. Those are maximums, but the standard is clear: reasonable safeguards, and the ability to show them.

If a client loses money to a phishing email sent from your server or your mailbox, expect them to ask what you did to prevent it. A written security policy, regular patching, kept logs and monitoring are the answer you want to be able to give. For the full cost picture, see the real cost of a data breach for a small business.

Prevent it next time

  • Take Remote Desktop off the internet. RDP security: how to lock it down covers the options in order.
  • Use passwords of at least 15 characters, never reused from portals or personal accounts.
  • Keep outbound port 25 blocked on servers that do not send mail.
  • Set up SPF, DKIM and DMARC on your domain. They do not stop a hijacked server sending as itself, but they help receiving services refuse mail that only pretends to come from you.
  • Get told when accounts, administrators, services or tasks change, instead of finding out from a client.

That last point is what Prixl Warden does. Rather than inspecting outbound mail, it watches the Windows event logs for what usually comes before it: brute-force campaigns, fast or slow, sign-ins outside working hours, new accounts and Administrators-group changes, new services and scheduled tasks, the audit log being cleared and the firewall being switched off. Serious events are emailed at once, and a daily digest arrives at 18:00 IST.

Start your 30-day free trial. No card is needed.

Related reading

Leave a Reply

Your email address will not be published. Required fields are marked *