What Can Malicious Code Do?

What can malicious code do

With there are thought to be over a billion strains of malicious code in existence – and over 500,000 new forms detected every day, companies must make protection against malicious code a top priority. However, strategies for mitigating the effects of malicious code have to constantly evolve to combat their growing variety and the ever-increasing damage they can cause.     

So, the question is, what can malicious code do? This post looks to answer this, as well as detailing ways that you can protect your company from the possible effects of malicious code.                        

Malicious Code Explained 

Malicious code is code designed by a hacker or cybercriminal for a malevolent purpose, i.e., to harm an organisation – typically through infrastructural and reputational damage and/or financial loss. Also, while the terms malware (“malicious software”) and malicious code are used interchangeably, malicious code includes the simple web scripts used by hackers, as well as more sophisticated applications.  

Can malicious code steal personal information?   

Malicious code can be used to steal sensitive data via a variety of methods. Hackers can use it to steal data directly, through rootkits or an injection attack that allows them to gain admin access. They could also hijack a session, giving them free rein as they impersonate the user or capture personal information through keyloggers.  

Alternatively, they can steal personal information by using malicious code to redirect users to websites where they trick them into divulging their information.  

Examples of Malicious Code  

To better answer the question what can malicious code do, let’s look at the most common types of malicious code first. 

Computer Virus

Among the best-known examples of malicious code, malware viruses infect files and applications, replicating themselves due to specific user actions. Subsequently, computer viruses can rapidly spread to other devices and throughout and across networks as users unwittingly open infected applications and share contaminated files.  

Computer Worm

This is malicious code similar to a virus, with the main difference being that a worm can replicate itself without human interaction. Put another way, if a computer worm finds its way onto a device, it can propagate and make its way through your network without a user opening an infected file or application.  

Trojan Virus

Also known as a Trojan horse, named after that in Greek mythology, this is an example of malicious code disguised as a harmless application. However, once a user makes the mistake of installing a Trojan virus, the malicious code concealed work goes to work.  

Logic bombs

These examples of malicious code refer to a code programmed to execute when specific conditions are met, namely after a certain amount of time or if a user carries out a particular action. Subsequently, this malicious code can prove harder to detect, especially as the hacker has the time to cover their tracks. 


An increasingly common type of malicious code that installs itself onto a victim’s device, encrypts or steals their files, and demands a ransom (typically in cryptocurrency) to decrypt or return it.  


Malicious code that creates a secret entry method, a “backdoor”, granting cybercriminals remote access to a device. Much like logic bombs, as backdoors are often intended for future use, they can lie dormant for years without detection.  


These refer to a collection of tools that allows hackers to carry out malicious activity. This could include backdoors, remote access software, bots, and malicious code from disabling cyber security controls.  


A category of malicious code designed to capture and exfiltrate a victim’s sensitive data. This notably includes keyloggers that allow hackers to record what the user types – such as their access credentials. 


Malicious code that displays unwanted ads at users, especially when browsing online. The featured ads may be designed to generate ad revenue – or they may result in the installation of a more malicious code.


Also known as rogueware, this worries users into thinking that their devices have become infected with a virus, e.g., “Warning: Your Computer is infected!”. Ironically, it’s a social engineering scam to convince victims to purchase a malicious or fake application. 

Fileless malware

While malicious code typically needs an executable program to infect a device, fileless malware is distinct because it loads itself directly into memory as system commands. This allows it to, instead, use trusted applications to cause damage – with a prime example being Microsoft’s PowerShell

How malicious code can compromise your cyber security 

Now that we have a better idea of what it is, what can malicious code do to your security? Let’s examine how malicious software and scripts compromise your cyber security.  

Disabling security controls 

Hackers can use malicious code to disable a device or network’s cyber security settings. They can design malicious code to target anti malware software, firewalls, monitoring tools, and other security controls, making it easier for the malicious code to remain undetected and increase its efficacy. Worse, disabling security controls makes it easier to deploy additional malicious code – and lowering your company’s cyber security defences could be the first step in a plan. Not to mention, you’re now more susceptible to cyber threats from other malicious actors too.   

Stealing user access credentials 

Cybercriminals can use malicious code to fraudulently acquire a user’s access credentials in many ways. It could be done using spyware that can track each character the user types in and records it for the hacker. Worse, if the spyware goes undetected, the hacker will know every time the user changes their password.  

Plus, there are phishing campaigns, one of the most common cyber attacks on businesses, that trick users into divulging sensitive data by playing on their fear or greed. Worse still, however, some malicious code can get into your contacts, like those in your email inbox, and send out emails with infected attachments – in your name. This could then start infecting members of your network, such as customers and suppliers, letting them all know you’ve suffered a cyber attack – while compromising your relationships and reputation in the process.  

Hijacking devices and user sessions  

Malicious code can compromise your IT security by enabling hackers to take over devices within your network. Through rootkits, backdoors and botnets, for instance, malicious actors can gain access to your network and make their way through them. 

Alternatively, cybercriminals can use malicious code to hijack a user’s session, impersonating them as they carry out their intended objective, whether stealing sensitive data or installing additional malicious code.  

Redirecting users to malicious sites  

As well as assuming control of devices and sessions, hackers can use malicious code to take over browsers and DNS records. They can then send users to fraudulent sites, instead of the address they requested, where they’re shown ads and are susceptible to phishing, pharming, and “malvertising”, i.e., ads that install malicious code.  

Protecting Against Malicious Code    

Here are the most effective ways to protect your company against malicious code.    

A robust anti malware solution 

Your company’s first line of defence against malicious code is installing comprehensive anti malware software. This can detect malicious code based on its known characteristics, i.e., its digital signature, or by heuristic analysis, i.e., if it exhibits harmful behaviour.  

Another huge advantage of anti malware is that it’s automatic and allows you to continuously monitor your IT ecosystem for malicious code. However, it’s essential to constantly update your anti malware software to make sure it can prevent newly discovered malicious code.                


A firewall helps protect your company from malicious code by inspecting all incoming network traffic. It can then block traffic if it comes from a suspicious IP address or the contents of its data packets appear malicious.  

Strong passwords and MFA 

Using strong passwords and changing them frequently, per your organisation’s access control policy, is an effective measure against malicious code as it helps to mitigate unauthorised access. Better still, implement multi-factor authorisation (MFA) so malicious actors can’t access your network, even if they successfully steal an employee’s credentials.  

Regular software updates 

Updating your software and firmware as often as possible mitigates the threat of malicious code infecting devices through known vulnerabilities. Activating automatic updates where available and instituting a patch management schedule for those that must be updated manually helps protect against compromised applications and hardware.  

Cyber security awareness training 

Investing in cyber security threat awareness for your staff is a potent form of protection against malicious code. It allows you to:  

  • Educate employees on cyber security best practices and keep them up to date on emerging cyber threats.
  • Teach users how to suspicious-looking websites, texts, social media posts, etc.  
  • Encourage staff to report unusual files, applications, and behaviour exhibited by their devices. 
  • Advise users to connect to VPNs when working outside the office.

Regular backup 

This isn’t so much a protection strategy as one that aids business continuity if your IT infrastructure is infected with malicious code. Conducting frequent backups allows you to roll back to a time before the malicious code – and restore data to its previous, uncompromised state.  

How RiskXchange can help your company mitigate the risks of malicious code  

So, what can malicious code do to your company’s networks, data, and digital assets? 

Well, in short – a great deal of damage. With malicious code able to help cybercriminals achieve everything from stealing and deleting your data to using your infrastructure to carry out cyber attacks on your supply network and customers – the possible effects could be nothing short of catastrophic.   

Fortunately, RiskXchange can help protect your organisation against the many dangers of malicious code. We can pinpoint where you’re most vulnerable to malicious code, before we devise a strategy to improve your cyber security posture to better prevent infection.  

Contact us to schedule your free cyber risk assessment.  

Malicious Code FAQ

How do hackers use malicious code to attack organisations?  

Hackers can use malicious code to attack companies in several ways, including:  

• Using malicious code to lower its cyber security controls 
• Using viruses and worms to delete or damage data 
• Using ransomware to encrypt or steal data  
• Using rootkits and backdoors to assume remote control 
• Turning devices into “zombies”, i.e., part of a botnet, launching DDoS attacks 
• Clogging up system resources with adware 

How do hackers use malicious code to gain access to systems? 

Hackers can use malicious code to gain access to systems in a number of ways: 

• Installing backdoors and rootkits to create secret methods of entry to a system 
• Acquiring admin level privileges – allowing to alter, and create, access credentials 
• Taking advantage of known exploits in vulnerable software 
• Hijacking sessions, assuming control as an authorised user