Discovered: October 24, 2000
Updated: February 13, 2007 11:34:40 AM
Also Known As: W95.Troc, W95.Bistro.dr, PE_TROC
Type: Virus
W95.Bistro is a 32-bit metamorphic virus. It was created by two virus writers: GhostDog (UK) and Mesut (Turkey).
The virus does not use a permutated polymorphic decryptor to create new generations of itself. However, the virus looks different in every infection.
The virus is based on the ideas from the W95.Zperm virus, which has four different minor variants. The virus spreads via an infected dropper. The dropper copies the virus with a random name under the Windows directory and automatically runs when the computer starts.
When an infected application is executed, the virus gains control via the modified entry point that points to the last section of the application. The last section sometimes has a random name of three to five lowercase characters. The virus turns off the relocation in the PE header, because it requires the section header relocation field for its own use.
The real virus code starts with an SEH (Structured Exception Handling) trick. The virus generates a division by zero, but sets up an exception handler to catch the actual exception. This lets the virus give control to its next part indirectly. This confuses heuristic analyzers and 32-bit code emulators.
The virus then gets the address of various APIs from Kernel32.dll. The API names are not stored in the virus. The virus uses only checksums of the APIs it needs to call. The virus then searches for files to infect on the path and all hard disk and network drives from A to Z. The virus infects only .exe and .scr files that are not DLLs.
The infected files have an enlarged stack. The virus mutates itself on the stack. Each instruction can be followed by a JMP to the next instruction of the virus code. The actual stream of the virus is around 64KB, but infected files occasionally have a much larger size change. This is because the virus sometimes places garbage instruction blocks at the entry point of the infected files. These garbage blocks will generate millions of iterations before the first active virus instruction (that is part of the mutated virus body) gains control.
Unlike the Zperm virus that uses only zero islands between instruction blocks, W95.Bistro writes random garbage blocks between code islands. Sometimes these islands are filled with the string "still trying to disarm me?" When the infected .exe file is examined this string can be found hundreds of times in the image.
The virus recalculates the proper checksum of the PE files. During infections the virus loads Imagehlp.dll and uses a checksum API to recalculate the proper value. Consequently, even images that did not have a checksum will have a properly calculated checksum after the infections.
In case of infection the virus pays special attention to Cdplayer.exe, Notepad.exe, Mplayer.exe, Rundll32.exe, and Scanregw.exe files to ensure that the virus code is executed enough times when the virus spreads from one computer to the other.
The virus can also infect Explorer.exe by making a copy called Explorer.ab, infecting that file, then creating a Wininit.ini which will rename Explorer.ab to Explorer.exe when the computer is restarted.
The virus can also add an infected executable into .zip or .rar archive files. When one of these files is executed, it will not be visible in the Windows task list, and will continue to infect files even if no user is logged on. In some cases the virus fails to work properly. However, it does replicate and is very difficult to detect. W95.Bistro is also a retro virus. It is hostile to resident antivirus programs and debuggers such as SoftIce, and disables them in memory. It also trashes some antivirus program files, and their signature database files (and in some cases, all files in all subdirectories whose names begin with the first three letters of those antivirus products). It also occasionally trashes .doc, .xls, .mp3, and .jpg files. The damage consists of writing the text "[RSA encrypted. (c) V.Bogdanov//KasperskyLab]" 13 times to the middle of those files. This text is encrypted within the virus, and is not visible to the casual observer. W95.Bistro uses a call gate mechanism for alteration of the thread context to execute these disabling routines in Ring0 (Kernel mode).
W95.Bistro got its name from a string "Cafe-Bistro troc" placed into one of its known droppers.
W95.Bistro uses code replacement logic from the W32.Evol or W95.Zperm viruses. For instance, the virus replaces instructions of SUB EAX, EAX with XOR EAX,EAX. The instructions mean the same thing but have a different encoding. This permutates the virus code beyond the jump structure.
W95.Bistro is currently one of the most complex and difficult to detect 32-bit metamorphic viruses. Norton AntiVirus detects the known droppers as well as other files infected by this virus.
Recommendations
Symantec Security Response encourages all users and administrators to adhere to the following basic security "best practices":
- Use a firewall to block all incoming connections from the Internet to services that should not be publicly available. By default, you should deny all incoming connections and only allow services you explicitly want to offer to the outside world.
- Enforce a password policy. Complex passwords make it difficult to crack password files on compromised computers. This helps to prevent or limit damage when a computer is compromised.
- Ensure that programs and users of the computer use the lowest level of privileges necessary to complete a task. When prompted for a root or UAC password, ensure that the program asking for administration-level access is a legitimate application.
- Disable AutoPlay to prevent the automatic launching of executable files on network and removable drives, and disconnect the drives when not required. If write access is not required, enable read-only mode if the option is available.
- Turn off file sharing if not needed. If file sharing is required, use ACLs and password protection to limit access. Disable anonymous access to shared folders. Grant access only to user accounts with strong passwords to folders that must be shared.
- Turn off and remove unnecessary services. By default, many operating systems install auxiliary services that are not critical. These services are avenues of attack. If they are removed, threats have less avenues of attack.
- If a threat exploits one or more network services, disable, or block access to, those services until a patch is applied.
- Always keep your patch levels up-to-date, especially on computers that host public services and are accessible through the firewall, such as HTTP, FTP, mail, and DNS services.
- Configure your email server to block or remove email that contains file attachments that are commonly used to spread threats, such as .vbs, .bat, .exe, .pif and .scr files.
- Isolate compromised computers quickly to prevent threats from spreading further. Perform a forensic analysis and restore the computers using trusted media.
- Train employees not to open attachments unless they are expecting them. Also, do not execute software that is downloaded from the Internet unless it has been scanned for viruses. Simply visiting a compromised Web site can cause infection if certain browser vulnerabilities are not patched.
- If Bluetooth is not required for mobile devices, it should be turned off. If you require its use, ensure that the device's visibility is set to "Hidden" so that it cannot be scanned by other Bluetooth devices. If device pairing must be used, ensure that all devices are set to "Unauthorized", requiring authorization for each connection request. Do not accept applications that are unsigned or sent from unknown sources.
- For further information on the terms used in this document, please refer to the Security Response glossary.
Writeup By: Peter Szor