Malware
Malware authors target bugs, or loopholes, to exploit. A common method is exploitation of a buffer overrun vulnerability, where software designed to store data in a specified region of memory does not prevent more data than the buffer can accommodate being supplied. Malware may provide data that overflows the buffer, with malicious executable code or data after the end; when this payload is accessed it does what the attacker, not the legitimate software, determines.
Fileless malware
This synonymy is however incorrect. Although the aforementioned behavioral execution environment is the same, in both cases i.e. both malware variants are executed in system memory, the crucial differentiation is the method of inception and prolongation. Most malware’s infection vector involves some writing to the hard disk, in order for it to be executed, whose origin could take the form of an infected file attachment, external media device e.g. USB, peripheral, mobile phone etc., browser drive-by, side-channel etc.