Home / malware Win32.Worm.Downadup.Gen
First posted on 21 November 2011.
Source: BitDefenderAliases :
Win32.Worm.Downadup.Gen is also known as W32.Downadup, W32/Worm.AHGV, Net-Worm.Win32.Kido.bg.
Explanation :
Win32.Worm.Downadup is a worm that relies on the Microsoft Windows Server Service RPC Handling Remote Code Execution Vulnerability (MS08-67) in order to spread on other computers in the local network. The authors took various approaches to make this malware especially fast spreading and hard to remove.
This malware always comes wrapped in an obfuscated layer which aims at deterring analysis. The layer can be in two flavors, either packed with UPX or not packed, but it is always obfuscated and uses various rarely used apis to break emulators. The real malware is contained inside in an encrypted form. It is packed with a standard upx version, but to deter unpacking it is never written on disk and it doesn't have the PE header which makes it appear as an invalid executable. This has the side effect of being undetectable when injected into another process, it just looks as standard memory allocated page.
A computer can be infected by possible three means:
* if not patched with the latest security updates (in this case if MS08-67 vulnerability is not patched), by an already infected computer in the local network
* if the administrator account of the computer has a weak password (brute force dictionary attack against administrator password is used)
* if the computer has the Autoplay feature enabled and an infected mapped/removable drive stick is attached.
Once gained execution this worm does the following actions:
* hooks NtQueryInformationProcess from ntdll.dll inside the running process
* creates a named Mutex based on the computer name
* injects intself into one of the following processes:
* explorer.exe
* svchost.exe
* uses the following registry key to hide the files with hidden attributes:
* HKLMSOFTWAREMicrosoftWindowsCurrentVersionexplorerAdvancedFolderHiddenSHOWALL"CheckedValue" = "0"
* executes the following command, which disables auto-tuning (details) option under Windows Vista :
* netsh interface tcp set global autotuninglevel=disabled
* copies itself into one or more of the following locations:
* %Program Files%Internet Explorer[Random Name].dll
* %Program Files%Movie Maker[Random Name].dll
* %Documents and Settings%All UsersApplication Data[Random Name].dll
* %Temp%[Random Name].dll
* %System32%[Random Name].dll
* if residing into services.exe application (Win2K) it hooks on the following apis:
* NetpwPathCanonicalize from netapi32.dll - this api is used to avoid reinfection of the local machine from other infected computers
* sendto from ws2_dll.dll
* if residing into svchost.exe it hooks the following apis
* NetpwPathCanonicalize from netapi32.dll - this api is used to avoid reinfection of the local machine from other infected computers
* DnsQuery_A, DnsQuery_W, DnsQuery_UTF8, Query_Main from dnsapi.dll - this apis are hooked to restrict access to various sites related to antivirus companies.
* it sets maximum number of simultaneous connections allowed by doing one of the following
* patching tcpip.sys driver, using a driver it drops itself (contained in an unencrypted form)
* setting HKLMSYSTEMCurrentControlSetServicesTcpipParameters"TcpNumConnections" to "00FFFFFE"
* injects itself into services.exe (Win2K)
* it sets the following registry keys (if they are not set already), probably as an infection marker:
* HKCUSoftwareMicrosoftWindowsCurrentVersionApplets"dl" = "0"
* HKLMSOFTWAREMicrosoftWindowsCurrentVersionApplets"dl" = "0"
* HKCUSoftwareMicrosoftWindowsCurrentVersionApplets"ds" = "0"
* HKLMSOFTWAREMicrosoftWindowsCurrentVersionApplets"ds" = "0"
* Disabled the following Windows services:
* Background Intelligent Transfer Service (BITS)
* Windows Automatic Update Service (wuauserv)
* sets the following registry key to hide files with hidden attribute:
* HKLMSOFTWAREMicrosoftWindowsCurrentVersionexplorerAdvancedFolderHiddenSHOWALL"CheckedValue" = "0"
* enumerates all the available ADMIN$ network shares and tries to connect as an existing user using a list of weak passwords (essentially doing a dictionary attack on the user passwords). Examples of passwords from the available ones:
* academia
* access
* account
* Admin
* admin
* admin1
* admin12
* admin123
* adminadmin
* administrator
* anything
* asddsa
* asdfgh
* asdsa
* asdzxc
* backup
* boss123
If this attack is successful it copies itself into the share directory:
* ShareNameADMIN$System32[Random Name].dll
To be sure the file is launched it creates a scheduled job on the attacked server, which is to run every day. The job looks like this:
* rundll32.exe [Random Name].dll, [Random String]
* it connects to the following URL's to get the address of the infected machine
* http://www.getmyip.org
* http://www.whatsmyipaddress.com
* http://getmyip.co.uk
* http://checkip.dyndns.org
This ip address, along with a random port number, is used to create a HTTP server which is used by the worm to infect using the MS08-67 vulnerability. The infected computers which connect to that ip and port will be exploited and forced to download a copy of the malware hidden with a random name and with one of the following extensions:
* png
* bmp
* jpg
* gif
* it monitors remote and removable drives for infection using the Autoplay feature:
* a copy of the file is placed inside a random folder (created by the malware) : :RECYCLERS-%d-%d-%d-%d%d%d-%d%d%d-%d%d%d-%d[Random Name].dll
* an obfuscated autorun.inf file is generated used to launch the malware from the above location. The file is obfuscated by adding random commentaries, with random length.
* Using the apis hooked from dnsapi.dll it denies (error timed out) access to sites containing one of the following strings:
* virus
* spyware
* malware
* rootkit
* defender
* microsoft
* symantec
* norton
* mcafee
* trendmicro
* sophos
* panda
* etrust
* networkassociates
* computerassociates
* f-secure
* kaspersky
* jotti
* f-prot
* nod32
* eset
* grisoft
* drweb
* centralcommand
* ahnlab
* esafe
* avast
* avira
* quickheal
* comodo
* clamav
* ewido
* fortinet
* gdata
* hacksoft
* hauri
* ikarus
* k7computing
* norman
* pctools
* prevx
* rising
* securecomputing
* sunbelt
* emsisoft
* arcabit
* cpsecure
* spamhaus
* castlecops
* threatexpert
* wilderssecurity
* windowsupdate
* nai.
* ca.
* avp.
* avg.
* vet.
* bit9.
* sans.
* cert.
* connects to one of the following sites to get the current date (day and month) (HTTP_QUERY_DATE)
* w3.org
* ask.com
* yahoo.com
* google.com
* baidu.com
* using the information gathered in the previous step it generates a list of possible update sites with this format:
* http://[Date Base Name].[Random Domain]/search?q=%d
* domain name can be:
* .biz
* .info
* .org
* .net
* .com
* .ws
* .cn
* .cc
* examples of domains generated for 9 January 2009
* opphlfoak.info
* mphtfrxs.net
* hcweu.org
* tpiesl.info
* bmqyp.com
* aqnjou.info
* kxxprzab.net
* gjbueqbdb.com
* qkccgprsp.net
* yjxraefn.org
* civmakjl.net
* ygmjyyzbj.info
* ulptholvr.org
* dqyusn.info
* gsvfy.org
* sjdvt.net
* tizkywcd.com
* bkqxwccwseo.org
* bmrmgxv.com
* xlkfp.org
* pvfesejm.com
These domains most probably contain updates of the worm or other malware related to it.
* In recent variants there has been an added functionality which permits the worm to be update or another payload downloaded by means of remote connection to other computers. The mechanism is based on a bi-directional named pipe (on each computer a named pipe is created with the name "\.pipeSystem_[COMPUTER_NAME]7") which is used for communication between two infected computers. Upon receiving a null terminated string, it interprets it as an URL and tries to download it. Upon completion of download, the file is checked using an RC4 and an asymmetric cryptographic algorithm and if it's considered valid is executed. This can be seen as a technique employed by the authors to ensure that no foreign payload is injected in the download process.
* deletes all the System Restore points prior to infection.
* The worm protects itself from deletion by removing all NTFS file permissions,except execute and directory traversal, from all users.
On 7 March 2009 a new variant was seen in the wild.While minor modifications were seen before, this variant is very different and had clear indications of the path taken by the writers towards keeping already infected computers and disabling removal tools done by the AV companies.
This version has the following behavior once executed:
* Checks for presence of itself using a mutex created based on process id. If mutex is created already it exits.
* Hooks NtQueryInformationProcess from ntdll.dll* Creates two random length mutexes based on computer name. These are used to later on.* If run using rundll32.exe and above mutexes have been created succesfully then it tries to inject in either : svchost.exe or explorer.exe. It then deletes the scheduled task used to execute itself.
*Uses the following registry key to hide the files with hidden attributes:
* HKLMSOFTWAREMicrosoftWindowsCurrentVersionexplorerAdvancedFolderHiddenSHOWALL"CheckedValue" = "0"* if residing into services.exe application (Win2K) it hooks on the following apis:
* NetpwPathCanonicalize from netapi32.dll - this api is used to avoid reinfection of the local machine from other infected computers
* sendto from ws2_dll.dll* if residing into svchost.exe it hooks the following apis
* NetpwPathCanonicalize from netapi32.dll - this api is used to avoid reinfection of the local machine from other infected computers
* DnsQuery_A, DnsQuery_W, DnsQuery_UTF8, Query_Main from dnsapi.dll - this apis are hooked to restrict access to various sites related to antivirus companies.* error mode is set so that in case of an unhandled exception no information is shown to the user. This can be seen as a safety method to keep the malware stealthy even in case of unknown bugs.* hooks InternetGetConnectedState function from wininet.dll.* copies itself into system32 and temp directory* disables the following services
* wscsvc (Windows Security Center)
* WinDefender (Windows Defender Service)
* wuauserv (Windows Automatic Update Service)
* BITS (Background Intelligent Transfer Service)
* ERSvc (Error Reporting Service)
* WerSvc (Windows Error Reporting Service)* deletes Window Defender startup key* delete HKLMSYSTEMCurrentControlSetControlSafeBoot thus not allowing infected machine to perfom a safe boot* creates a thread that every second kills processes having names containing one of the following string
* autoruns
* avenger
* confick
* downad
* filemon
* gmer
* hotfix
* kb890
* kb958
* kido
* klwk
* mbsa
* mrt.
* mrtstub
* ms08-06
* procexp
* procmon
* regmon
* scct_
* sysclean
* tcpview
* unlocker
* wireshark
Someone with experience in analyzing malware will immediately see that the worm tries to close any tool which could be used in analyzing its behaviour and also any tool which could be used to disinfect an infected machine* if an internet connection is available it tries to update itself. This process has changed, it generates 50000 number of random domains and tries to connect to 500 of them randomly. Another change is the fact that there are now 116 possible domain extensions that can be used.Sites containing one of the following strings are blocked:
* agnitum
* ahnlab
* anti-
* antivir
* arcabit
* avast
* avgate
* avira
* bothunter
* castlecops
* ccollomb
* centralcommand
* clamav
* comodo
* computerassociates
* conficker
* cpsecure
* cyber-ta
* defender
* downad
* drweb
* dslreports
* emsisoft
* esafe
* eset
* etrust
* ewido
* f-prot
* f-secure
* fortinet
* free-av
* freeav
* gdata
* grisoft
* hackerwatch
* hacksoft
* haur
* ikarus
* jotti
* k7computing
* kaspersky
* kido
* malware
* mcafee
* microsoft
* mirage
* msftncsi
* msmvps
* mtc.sri
* networkassociates
* nod32
* norman
* norton
* onecare
* panda
* pctools
* prevx
* ptsecurity
* quickheal
* removal
* rising
* rootkit
* safety.live
* securecomputing
* secureworks
* sophos
* spamhaus
* spyware
* sunbelt
* symantec
* technet
* threat
* threatexpert
* trendmicro
* trojan
* virscan
* virus
* wilderssecurity
* windowsupdate
* avg
* avp
* bit9
* ca
* cert
* gmer
* kav
* llnw
* llnwd
* msdn
* msft
* nai
* sans
* if a site was found running, the worm downloads the file and checks if it's a valid payload: this is done using asymetric cryptography to test the origin and integrity. If everything is ok, the executable payload is decrypted and executed.
A new variant of the worm has been recently detected in the wild. One of the first issues the update worm addressed was restricting access to the http://bdtools.net resource repository used by BitDefender to supply removal tools for the worm. Also, the removal tools used for the previous variants of the worm have been rendered useless, as the malware would block any file named bd_rem_tool.exe.
The following keywords are used to deny access to website domains and applications that may remove the malware:* precisesecurity
* ms-mvp
* mitre
* enigma
* bdtools
* av-sc
* adware
* activescan
* stinger
* kill
* cfremo
* bd_remLast update 21 November 2011