( Disclaimer: I am not supportive of virus/malware programming. )
Note: I have not blogged for 3 week, because I am quite busy recently. Originally, I am posting 3 post in one go, instead of 2 post, but the last post, which is a paper on the structure of KeServiceDescriptorTable(Shadow), and its related structure/method/functions, is not yet finished. I will be away for a week, so you can expect this paper around 1 to 2 weeks from now.
Regarding MzBot, as I mentioned, I am quite busy. So if you really want to add in feature, I can perhaps send you the source ( for the usermode part. ), or you can mod the EXE like how you mod Maple.
Although I have left the world of writing everything that’s evil and nasty, but just recently, I came across many poorly written virus. Just to name a few, some how this spyware called spylocked got stuck on my brother’s box. ( It’s a hijackware actually. ). What it does is pretty simple, it will constantly alert the user that there’s “spyware” in the computer, but the fact is, the only spyware around is itself, all it want you to do is to pay $$$ to the author, for a fake anti-spyware. It also make itself hard to uninstall.
There’s also the case of Mark Russinovich came across a botnet client that rename mIRC.exe as explorer.exe, and run whatever command that’s issued in the channel that it joined.
Anyway, enough ranting about noob virus that doesn’t work properly, here’s the tips:
- Don’t be evil
Remember, white hat dudes are always around. Unless you are hacking retard, or else someone will definitly catch you.
- Don’t use Visual Basic
This is common sense, Visual Basic is the big no-no when it comes to programming anything but fancy GUI that does practically nothing. All “virus” written in Visual Basic is source inclusive, I know you don’t mind people peeking at your virus’ source right? You released your virus under GPLv2? Cool! Do worry if your victim’s in a lack of MSVBVM60.DLL.
- Don’t use mIRC
We heard of the case of Zango sueing PC Tools, maybe mIRC will sue McAfee or something, who knows? Anyway, there are too many dudes out there abusing mIRC to write “botnet”, so the security dudes’ got fed up, they don’t allow mIRC to pass normally.
- Don’t target POSIX boxes
POSIX boxes are too portable, you have to ensure that your virus works on a toaster, before you can ensure that it works on NetBSD… =Z
- Don’t use commercial packers
Watch out! If you do, your virus will be stuck in someone’s unpacking tutorial!
- Don’t think they can’t find you if you do DLL injection
Spylocked’s main executable’s a DLL that runs in explorer’s process space. The author must be a mentally disabled to be satisfied with that level of protection.
- Don’t name it as picture.jpg.exe
We live in the twenty-first centuary, people’s not as dumb as to fall for some old social engineering tricks. Be more creative, there are other ways of getting people to run your code. Or even better, get your victim’s Windows to run the code for you, if you are lucky, you might just come across a bug that would allow code injection in any Windows computer.
- Don’t use other’s virus
AV Vendors are faster than you, always.
- Do make it clear that Ctrl-Alt-Del isn’t working
Things that you can do:
+ Delete taskmgr.exe
+ Screw OpenProcess()
+ Screw QuerySystemInformation()
+ Access I/O port 0×64 whenever they open Task Manager
+ Hammer _EPROCESS
+ Set PspCidTable a bomb
+ Mess the mm to give you an Address Space
+ Anything else that works
- Do delete your main executable
Renting a “house” on a foreign computer is too expensive, why not borrow other process’ executable? ntoskrnl.exe seemed to be a good choice. Don’t forget to delete your main executable after you injected into some other program.
- Do delay a bit before you do whatever that you are going to do
Please don’t
mov al, 0FEh
out 64h, al
the moment you get your code in your victim’s box. The rootkit philosophy is to be hidden, not to destroy. It would be more valuable to hide your code, than to give them coupons to free reboots, or free system reformat. It’s better that they don’t know.
- Do give dudes’ at Symantec/McAfee/F-Secure/ fun!
Imagine, those dudes sit in front of their computer the whole day disassembling lousy virus written by some noob with an absense of a main body of neurons. ( aka: Brain ) Very sadly, this is their job… Just in case your virus gets into these guys’ hands, please do ensure that they are well entertained! A completely metamorphic packaging, inclusive of built-in Virtualization method, with a dosage of high memory VM call… preferably some stack call method. That should do the job of enlightening their job.
- Do inject/intercept packet in NDIS if you need network
Local firewall in your victim’s box just doesn’t give a damm about the packets, if you send them by direct packet injection into the miniport driver’s queue.
May 30, 2007 at 12:33 am |
Hey John
Generally good guidelines but I try to avoid meddling with the front-end and I’m specifically referring to disabling the Task Manager, there are many more feasible ways to stop your virii from being detected. (DKOM, injecting into parent process [as you said], etc)
Take care
June 1, 2007 at 1:33 pm |
so, i guess the question is then, when can we expect your master-super-virus?
June 1, 2007 at 1:34 pm |
btw Irwin, you can also drop into ring0 and hide like the rootkits do
June 1, 2007 at 1:39 pm |
…and im sorry about the third reply, but i like this entry a lot. great job zuan about talking about the commercial packers – any av company has many ways of unpacking any comercial packer. this also relates to your later post which asks to give the av guys a lot of fun. if the program is packed well (with an unknown packer), it’s going to make it a lot more fun for mr. symantic to unpack the program, then disassemble it.
so, once again i say it, when can we expect yours?
June 1, 2007 at 4:38 pm |
I don’t write virus anymore, I only write crackmes.
June 4, 2007 at 6:44 pm |
Before you can mess around kernel, you need access to ring0 which can be quite costly nowadays. Most AV and even Firewall (namely ZoneAlarm) intercepts the driver loading function so going into kernel can be quite a problem. To mess up the problem even more comes Windows Vista, which promises only a paid and digitally-signed virus are allowed into kernel.
Okay set that aside. I suggest that a future virus should take advantage of “hypervisor” of the new processors. It is extremely hard to detect such a virus, as it host the OS inside “nothing is wrong” fake environment and sit in between the hardware.
As for disabling Task Manager, you dont need to do that at all since your virus is well hidden from sight. DLL injection alone is not enough, but DLL injection + PEB hiding should keep your virus from prying eyes for a very very long time. (unless your virus happens to infect leet users who knows how to use IceSword
, but that is none of our concern)
Virtualization is a very nice trick to keep your virus from being reverse engineered. It renders a lot of tricks virtually useless. You can see the virus, but youll never know what it does. An extra dose of creativity can guarentee AV vendors some headache.
————————————————————————————
Possible off-topic warning
————————————————————————————
I like to point out a sad fact is that a lot of people still fall for simple social engineering tricks like i_loev_you.jpg.vbs. People may have learned not to open attachments from email, but it seems they didnt realize not to trust any downloads they get off the net. You can easily snip a keylogger into a DoTA Blue Server installer and release it into the wild. You may be amazed by how easily people can fall for such tricks.
It wasnt the first time people came to me yelling “zomg my pc is full of spyware” and be amazed, they are infected with the same spyware for the 10000000000th … again. It was a simple virus that hid inside a pendrive, activated by autorun.ini. Guess what, AVs like AVG Free and NOD32 doesnt raise any alarm at ALL ! Theres another guy that is infected with that spyware told me “AV is not needed, cause I have ZoneAlarm”. ……………… speechless?
So we came to a conclusion, user awareness about malwares is the problem. It takes only a noob virus to infect noob users.
————————————————————————————
PS. You write crackmes eh? So when can I get my hand on one of those ?
June 4, 2007 at 6:46 pm |
Before you can mess around kernel, you need access to ring0 which can be quite costly nowadays. Most AV and even Firewall (namely ZoneAlarm) intercepts the driver loading function so going into kernel can be quite a problem. To mess up the problem even more comes Windows Vista, which promises only a paid and digitally-signed virus are allowed into kernel.
Okay set that aside. I suggest that a future virus should take advantage of “hypervisor” of the new processors. It is extremely hard to detect such a virus, as it host the OS inside fake “nothing is wrong” environment and sit in between the hardware.
As for disabling Task Manager, you dont need to do that at all since your virus is well hidden from sight. DLL injection alone is not enough, but DLL injection + PEB hiding should keep your virus from prying eyes for a very very long time. (unless your virus happens to infect leet users who knows how to use IceSword
, but that is none of our concern)
Virtualization is a very nice trick to keep your virus from being reverse engineered. It renders a lot of tricks virtually useless. You can see the virus, but youll never know what it does. An extra dose of creativity can guarentee AV vendors some headache.
————————————————————————————
Possible off-topic warning
————————————————————————————
I like to point out a sad fact is that a lot of people still fall for simple social engineering tricks like i_loev_you.jpg.vbs. People may have learned not to open attachments from email, but it seems they didnt realize not to trust any downloads they get off the net. You can easily snip a keylogger into a DoTA Blue Server installer and release it into the wild. You may be amazed by how easily people can fall for such tricks.
It wasnt the first time people came to me yelling “zomg my pc is full of spyware” and be amazed, they are infected with the same spyware for the 10000000000th … again. It was a simple virus that hid inside a pendrive, activated by autorun.ini. Guess what, AVs like AVG Free and NOD32 doesnt raise any alarm at ALL ! Theres another guy that is infected with that spyware told me “AV is not needed, cause I have ZoneAlarm”. ……………… speechless?
So we came to a conclusion, user lack of awareness about malwares is the problem. It takes only a noob virus to infect noob users.
————————————————————————————
PS. You write crackmes eh? So when can I get my hand on one of those ?
June 4, 2007 at 6:47 pm |
Sorry for double posting. I accidently pressed back and submit again.
June 5, 2007 at 8:27 pm |
Nice point on ring0 access. Fully agree, especially on the point on Vista. Vista stinks…
A point on hypervisor: I don’t think all CPUs have VMX extension, in fact, only high end computers get them. My laptop’s a recent one ( see my previous blogpost on a review on it. ), but it doesn’t have the VMX extension… ( Intel Core Duo CPU ). Furthermore, reading through the section on VMX in the Intel Developer’s Manual for Software Designer, is a pure headache, trapping intterrupt and stuff…
IceSword’s good stuff… sometime I feel that I am a bit over-reliant on it… In fact, it is involved in the process of removal of Spylocked.
Oh, and on social engineering. It’s quite sad that there’s so many IT illiteracy around the place. No wonder Microsoft can secure their market.
Oh, crackmes, I have done two at the moment. the first one’s more difficult then the second. The second can be found in this blog, written in TASM. I bet it won’t be anywhere near challenging to you. I will dig up my first one and send it to you. Sunny cracked it already.
June 27, 2007 at 5:13 pm |
John just a question how do you stop something
If it shutsdown your cpu in 30 seconds
trough cmd\shutdown
It disables ctrl+alt+del
something called AVshell?
June 27, 2007 at 6:26 pm |
IceSword it or procxp it.
August 26, 2007 at 1:30 am |
that stupid spylocked is on my pc I think. whatd you do to pull it out?
November 22, 2007 at 3:42 am |
Tisker, Download like John says Icesword
Avshell is run by 2 seperate processes, 1 is the process itself the other is a process 2 prevent the virus from getting deleted or modified. if you delete the second process you,ll be able 2 stop your cpu from shutting down. if you manage 2 do this go in your register editor, there is this reg_sz file that loads when your cpu boots
and deleting it is no use since it regenerates after 1 second. putting the section in quarantine should do fix it
John, ty for you the advice. it really made a difference
July 8, 2009 at 4:14 pm |
I have just come across this blog and have found it interesting and informative.
I will be coming back soon.:)