Page 1 of 1 1
Topic Options
#9033 - 2001-05-30 06:08 PM GetFileAttr - Case Sensitive for NT/2000, need help please!
Anonymous
Unregistered


Hi all,

I have been writing a script that will eliminate funlove virus from machines. The script will check local machine for FLCSS.EXE file and GetFileAttr on it, determine if it's a file or directory, and if a file is present will logoff the user. I will post the code below, but this is the problem: I am checking for FLCSS.EXE on the local machine. In my initial tests I was never using lower case letters. Upon my deployment many users called with problems saying they had been logged off the network. In my investigation I determined the FLCSS.EXE on the local machine was lower case and thus the script was not recognizing it. Other than adding code to look for the lowercase version of the file, is there a way I can disregard the case sensitive search criteria? As you can see with 8 letters in the filename I could have a possible 64 different filenames that I need to search against. Please help if you can.

Thanks
Adam A

code:

$Result = GetFileAttr("%windir%\system32\FLCSS.EXE")
if $Result=0 MD "%windir%\system32\FLCSS.EXE"
RETURN
ELSE
if ( $Result = 16 ) ; directory already exists
RETURN
ELSE
$Return=MessageBox("The system has detected a possible virus infection on your machine. Please call the Help Desk for assistance in removal. To protect our network's integrity and corporate data,

YOU WILL BE LOGGED OFF THE DOMAIN!

Until the possible virus infection has been removed.", "WARNING: FUNLOVE VIRUS ALERT",16)
LOGOFF(1)
EXIT
ENDIF
ENDIF



Top
#9034 - 2001-05-30 09:41 PM Re: GetFileAttr - Case Sensitive for NT/2000, need help please!
Anonymous
Unregistered


Ok, so I guessed wrong. Its not case sensitive i had the GetFileAtrrb wrong.

Here is the problem line:

code:

if ( $Result = 16 ) ; directory already exists


Correct code should be:
code:

if ($Result & 16) = 16 ; directory already exists

Regards,

Adam A

Top
#9035 - 2001-05-31 04:47 AM Re: GetFileAttr - Case Sensitive for NT/2000, need help please!
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Our questions are:


  • what is the reason of making the directory %windows\system32\flcss.exe?
    description of Symantec shows that it would prevent an infection by this virus.
    Most important action is that the user power off his workstation
    without logging off. During logging off new files can be infected. Mostly explorer.exe
    will be infected too.

    "When the virus runs as a service it can spread on the local drives without
    anyone logged on the machine."
    "Furthermore, after the attack, no data can be considered protected
    from any user."
  • why doesn't your remove the flcss.exe file by your script?
    it isn't a problem to do it.

    Symantec have a program published which can remove this virus:
    "Click here to download a tool to disable W32.Funlove NT service, and to
    fix the ntoskrnl.exe and ntldr.exe system files (= cleanflc.exe)."

    See site:
    http://www.symantec.com/avcenter/ W32.Funlove item

  • how can you grante the integrity of your workstation when f.e. all kind of
    EXE files are infected?

Our suggestion as code is:
code:

$virus_file="%windir%\system32\flcss.exe"
IF (Exist($virus_file) <> 0)
IF GetFileAttr($virus_file) & 16
ELSE
IF (SetFileAttr($virus_file, 32) <> 0)
ENDIF
del $virus_file
IF (Exist($virus_file) = 0)
md $virus_file
ENDIF
$virus_message="The system has detected a possible virus infection on your machine. Please call the Help Desk for assistance in removal. To protect our network's integrity and corporate data,YOU WILL BE LOGGED OFF THE DOMAIN! Until the possible virus infection has been removed. Please POWER OFF your system."
IF (MessageBox($virus_message, "WARNING: FUNLOVE VIRUS ALERT", 276, 3600)
ENDIF
LOGOFF(1)
ENDIF
ENDIF


Remarks:

  • we check first of file does exist
  • reset file attributes to Archive
  • users should POWER OFF when this virus has been detected. it should
    prevent further distribution.

The description of the virus W32.Funlove (publish by Symantec AntiVirus):

code:

Shared drives: Runs as an NT service and can spread on the local drives.
Target of infection: Win32 Files with .exe, .scr, or .ocx extensions.

Technical description:
W32.FunLove.4099 infected applications will create the program file flcss.exe
in the Windows System directory upon execution on both Windows NT and Windows
95/98 systems. If flcss.exe (4608 bytes) can be written to the hard disk,
the virus executes it as a service on Windows NT machines. If for any reason
the service could not be executed, the virus will create a thread inside the
infected application. That thread will infect the local and network drives
by searching for PE (Portable Executable) files with
.exe,
.scr, or
.ocx
extensions. The thread will then execute inside the infected process and
the main thread of the application will get control. Therefore, the user
will not easily notice any delays. When the virus can execute itself as
a service process under the "FLC" name, other infected programs will try
to insert the flcss.exe file, but will not create a new infection thread.
W32.FunLove.4099 is the second virus that runs as a Service on Windows NT.
WNT.RemEx.A (W32.RemoteExplorer) is very similar in its functions to
W32.FunLove.4099, but W32.FunLove.4099 can work on both Windows 95/98
and Windows NT. Therefore, it is considered more successful than
WNT.RemEx.A (W32.RemoteExplorer).
When the virus runs as a service it can spread on the local drives without
anyone logged on the machine.
That way the virus will be able to infect files that are normally not
accessible after the log on (for example, the virus can infect
explorer.exe on a Windows NT system).

On Windows 95/98 machines, infected programs will copy flcss.exe to the
hard disk and try to execute it as a regular process. If the process
cannot be executed, the virus will try to execute the infection thread
inside the infected process and executes the host program.

This virus also attacks the Windows NT file security system. In order for
the virus to attempt the attack, it needs administrative rights on a
Windows NT Server or Windows NT Workstation during the initial infil-
tration. Once the Administrator or someone with the equivalent rights
logs on, W32.FunLove.4099 has the opportunity to patch ntoskrnl.exe
(the Windows NT kernel located in the WinNT\System32 directory). The
virus modifies only 2 bytes in a security API called SeAccessCheck
that is part of ntoskrnl.exe. Thus, W32.FunLove.4099 is able to give
full access to all users to each file regardless of its protection,
whenever the machine is booted with the modified kernel. This means
that a Guest - who has the lowest possible rights on the system - will
be able to read and modify all files, including files that are normally
accessible only by the Administrator. This is a potential problem since
the virus can spread everywhere it wants to regardless of the actual
access restrictions on the particular machine.Furthermore, after the attack, no data can be considered protected
from any user.

Unfortunately, the consistency of ntoskrnl.exe is checked in only one
place. The loader, ntldr, is supposed to check it when it loads
ntoskrnl.exe into physical memory during machine boot-up. If the kernel
gets corrupted, ntldr is supposed to stop loading ntoskrnl.exe and
display an error message even before a "blue screen" appears. In order
to avoid this particular problem W32.FunLove.4099 also patches ntldr,
so that no error message will be displayed and Windows NT will boot
just fine even if its checksum does not match with the original.
Since no code checks the consistency of ntldr itself, the patched kernel
will be loaded without notification to the user. Since ntldr is a hidden,
system read-only file, W32.FunLove.4099 changes the attributes of it to
"archive" before it attempts to patch it. The virus does not change the
attribute of ntldr back to its original value after the patch. FunLove
can also infect local and networks drives. It enumerates the mapped
network drives and infects PE files on those machines. Additionally,
the above described ntoskrnl.exe/ntldr patch is performed on the
network drives. Whenever a machine maps the system drive of a Windows
NT system with efficient rights, the virus modifies the kernel and
the loader components over the network.

The ntoskrnl.exe and ntldr patches are executed by a routine picked up
from the Bolzano virus. In fact, more than fifty percent of the virus
code shows similarities to the Bolzano virus.

The virus does not infect files that begin with the following characters
in their names:

aler
amon
avp
avp3
avpm
f-pr
navw
scan
smss
ddhe
dpla
mpla
These are names of anti-virus programs, as well as a few other applications.

Removal:

On Windows 9x systems:

= Update NAV Rescue Disk Set or Norton SystemWorks Rescue Disk Set
= Restart the computer using the Rescue Boot Disk
= Follow the onscreen instruction to scan the system using the Rescue Disk
= Delete the flcss.exe file that NAV detects as W32.Funlove.4099
= Let NAV repair other files that NAV detects as infected with W32.Funlove.4099
On Windows NT systems:

Click here to download a tool to disable W32.Funlove NT service, and to
fix the ntoskrnl.exe and ntldr.exe system files (= cleanflc.exe).

NOTE: Funlove does not infect Alpha machines running NT. There is no need
to run the Funlove cleanup tool (cleanflc.exe) on Alpha machines running NT.

The FLCSS.EXE viral program runs as a Win NT service; thus, it needs to be
disabled before repairing other infected files.
You need to replace ntoskrnl.exe and ntldr.exe system file.
On both removal step above, you need to have administrator rights to the
Win NT system.



Greetings.

------------------
Site map:

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.049 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org