W95.Bistro is a virus that infects files under Windows 9x. It is currently one of the most complex and difficult to detect 32-bit metamorphic viruses.
The virus infects Portable Executable (PE) files, and adds an infected executable into .zip or .rar archive files.
Norton AntiVirus, with the latest virus definitions file, detects all known dropper files from the virus as well as other infected files by using the Symantec Striker32 scanning engine.
Also known as: W95.Troc, W95.Bistro.dr, PE_TROC
Category: Virus
Virus definitions: October 25, 2000
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.
Infected files should be deleted and replaced with clean backup copies.
Write-up by: Peter Szor and Peter Ferrie