Get a Pentest and security assessment of your IT network.

Cyber Security

Remove Backdoor File

TL;DR

A backdoor file has been found on your system. This guide will help you identify and remove it, along with steps to secure your system against future attacks.

1. Identify the Backdoor File

The first step is finding the malicious file. You’ll need some clues about its location or name. Common places backdoors hide include:

  • Temporary folders: /tmp, %TEMP%
  • System directories: /etc/init.d/, /usr/bin/, C:WindowsSystem32
  • Web server root directory: If you run a web server (e.g., Apache, Nginx) check its document root.

Look for files with unusual names or extensions (e.g., .php, .exe, .sh) that don’t belong to legitimate applications.

Using command line tools:

# Linux/macOS - Find recently modified files
find / -type f -mtime -1

# Windows (PowerShell) - Find recently modified files
Get-ChildItem -Path C: -Recurse | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-1)}

Scanning with antivirus software: Run a full system scan with your installed antivirus program. Make sure it’s up to date.

2. Confirm the File is Malicious

Before deleting anything, be *sure* it’s a backdoor. False positives can happen.

  • VirusTotal: Upload the file to VirusTotal. This scans the file with many different antivirus engines.
  • Check File Hashes: If you know what a legitimate version of the file should look like, compare its hash (MD5, SHA256) to the suspicious file’s hash.

If VirusTotal flags it as malicious or the hashes don’t match, proceed with removal.

3. Remove the Backdoor File

Once you’ve confirmed the file is a backdoor, remove it immediately.

  • Delete the file: Use your operating system’s file manager or command line tools.
  • # Linux/macOS
    rm /path/to/backdoor_file
    
    # Windows (Command Prompt)
    del C:pathtobackdoor_file
  • If the file is in use: You may need to restart your computer in Safe Mode to delete it.

4. Investigate for Persistence

Backdoors often try to run automatically when you start your computer (persistence). Check these locations:

  • Startup programs: msconfig (Windows), System Preferences > Users & Groups > Login Items (macOS)
  • Scheduled tasks: Task Scheduler (Windows), crontab -l (Linux/macOS)
  • Services: Services app (Windows), systemctl list-units --type=service (Linux)

Remove any entries related to the backdoor file.

5. Check for Other Malicious Files

A single backdoor may be part of a larger infection. Scan your system again with updated antivirus software and consider using a second opinion scanner (e.g., Malwarebytes).

6. Secure Your System

Prevent future infections by following these steps:

  • Keep software up to date: Regularly update your operating system, web browser, and other applications.
  • Use strong passwords: Use unique, complex passwords for all accounts.
  • Enable a firewall: A firewall helps block unauthorized access to your system.
  • Be careful with downloads: Only download software from trusted sources.
  • Regular Backups: Regularly back up your important data so you can restore it if needed.
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation