Reverse Engineering Win32 Trojans on Linux
slackrootcyc writes "A post (and previous article) give a detailed examination of the reversing process, using a trojan found in the wild. Later on in the story it discusses some techniques for reversing Windows-native code entirely under Linux."
Add it to the list, 80 to go!
Strange is our situation here on earth. Each of us comes for a short visit, not knowing why, yet sometimes seeming to divine a purpose. From the standpoint of daily life, however, there is one thing we do know: that man is here for the sake of other men -- above all for those upon whose smiles and well-being our own happiness depends.
-- Albert Einstein
I don't have use Win32 platforms or do virus work, but I use GNU/Linux and can't get a girlfriend, no
.... a fucking GNU/Linux hippy". He sounded so defeated. She
matter what I do. From what I can tell, not too many of you have girlfriends
either; I must make it clear right now that I do not want advice from you. I am
seeking the advice of those who have consentual, regular, heterosexual
intercourse with a well adjusted woman.
You may be wondering why I placed so many restrictions on the type of sexual
intercourse. Being a GNU/Linux user, I can get all the men I want, but my ass
hurts from years of anal sex. I am tired of pillow-biting. I have met women at
Linux User Groups (LUGs) but they didnt want sex the way I wanted it - they
brought their strap on and rode my chute like the men did. The date would end
with her taking me to a gay bar and selling my ass to a drunk and bearded
kernel hacker.
I am convinced, therefore, that I need to meet women that do not use GNU/Linux.
I have tried dating regular women, but find it hard to make conversation. I was
surprised that regular women do not give a shit about Free Software or the
Microsoft monopoly which leaves me with nothing to discuss. Some women tried to
talk about the weather, but I don't keep up with the weather from my mums'
basement.
I have had some success, I dated one girl several times. She picked me up from
home, mum liked her. I am sure dad would have too, but he left us soon after I
installed Slackware on the family computer. I can still hear him crying and see
him moping around the house, saying "I knew he was different; I could handle a
gay son, but this
wanted to go to the beach, but my skin is not adjusted to the sun and my skin
peels while at the beach. This was not a turn on for her and when she came back
to my mum's basement that night we were going to have sex but the raw skin was
too much for her.
Going out at night for a meal can be difficult too; all restaurants refuse to
serve smelly GNU/Linux hippies. The only place we can go for food is the
McDonald's drive through, but she doesnt like waiting in her car in the heat of
the day when I tend to smell the most. She doesn't like the stares she gets
from the drive through staff.
I could go on, but I won't. I now seek your advice.
Department of Physics and Atmospheric Science, Dalhousie University, Halifax, N.S., Canada, B3H 3J5
fp suck it clay
i love you
Hi
...the condoms that bluescreen.
Where do you want to Put It Today?(TM)
Honey, I shrunk the Cygwin
on a related note:
http://news.com.com/2100-1001-965916.html CNET reports hackers infest tcpdump distribution with trojan.
This just goes to show that Windows is just as vulnerable as Linux.
They're completely unbiased. New IIS hole? Here's the story. New Apache hole? Here's the story. All objective, no "M$ suX0rs!!!1".
wait a minute anti-virus software makers don't make virii, what was I thinking
Ignore the "p2p is theft" trolls, they're just uninformed
*GASP* Does this mean that the cat is out of the bag with that top secret trojan known as 'Sub7'?
I know a Windows underground group which is converting M$ Windows trojans to Mac OS-X. They just think it's cool - that's their motivation. I don't see what's so cool in it..
This is why we should be coding everything in Open Source. The fact being is, in this highly dynamic internet society today Trojans can hide their code to prevent security professionals from doing their job. When we finally open source these trojans, our software will become more secure because programmers from around the world can work on making the trojans and the programs the effect faster, better, and more secure.
Currently, trojans are badly written because of their inherent proprietary nature. Using something like sourceforge a multitude of coders can be simultaneously working on different parts of a trojan while the open source community can review, debug and test the code for infectioness effectiveness.
Only when we make Trojans open source will we realize that our computer controlled Oil tankers accross the world will be safe from Da Vinci.
This is some pretty neat stuff: the author details how to find a needle in a haystack for a virus establishing a TCP connection from nothing more than raw dissassembly, and then how to use breakpoints in the WINE program to get gdb to work with it.
Though you can do that with a simple netstat, it opens up ways to find everything else about the trojan, too, without the risk of raping your native environment Windows system.
Too bad most nu-geek slashdotters would rather hear about someone putting a neon rope light inside their computer case.
I made this little patch a few days ago to /etc/magic, it can detect when an executable has been packed with upx (works against latest 1.90 release)
./counter
--- magic.orig 2002-11-16 20:43:02.000000000 +0000
+++ magic 2002-11-13 12:54:09.000000000 +0000
@@ -1793,6 +1793,7 @@
>>16 leshort 1 relocatable,
>>16 leshort 2 executable,
>>16 leshort 3 shared object,
+>>0x79 string UPX UPX compressed,
# Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
# corrections by Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de>
>>16 leshort 4 core file
example output:
$ file
./counter: ELF 32-bit LSB executable, UPX compressed, Intel 80386, version 1 (Linux), statically linked, stripped
ex$$
And in further news, trojan writers worldwide file a DMCA suit against linux users for circumventing there security and reverse compiling there intelectual property ;)
We are 1337 h4x0rs.
Reverse engineering
trojans like crazy.
Don't give me none of this "nature theme" business.
I've used WINE quite extensively and I would say if you want to reverse engineer a piece of Win32 code WINE might be the best way to do it on Linux. On the other hand, so much is either not implemented or only implemented halfway, I wouldn't really consider my WINE-based findings to be an objective assessment of what a piece of code would do once actually run on a system based on an original version of Windows.
I don't really see why you'd go through all the trouble of using Linux to reverse a Win32-trojan. The only argument the author of the two linked articles gives is that all related development tools on Linux/Unix are free. However, if you just want to poke around some code without producing optimized binaries, you can get cheap versions of MS Developer Studio (so-called "Learning Editions") as well.
I mean, this kind of stuff is complicated enough without the possible hassle of having your environment messed up because of some incomplete emulator.
With any luck, the anti-virus companies will soon start to figure out how to write linux viri...
.Exe attachments .Com attachments
They've done a darn good job on win32! Just imagine the amount of work they've put in... Especially when all you need is the following options:
o Remove
o Remove
o Remove embedded (inline) e-mail files.
But wait, that'd be too easy!
Doing assembly dumps on object code isn't terribly exciting. Doing this on trojans is perhaps even less so, even on Linux.
But, referring to doing this on native Windows code is not a good idea at all. Remember the EULA, simply having the Windows code on your disk constitutes acceptance of the EULA and reverse engineering by assembly dumps is explicitly defined as a violation of the EULA. In other words you are setting yourself in a position for major legal problems.
The only legitimate way to reverse engineer software is the method used by the Samba team. You must look at the input and look at the output and then determine your OWN method of achieving the same result.
This is the only legal way to do it. If you even glance at an assembly dump of the actual software, you are no longer virgin. Thus ANYTHING that you produce afterwards the even vaguely resembles the operation of the original software will place you in a losing position, legally.
Avoid assembly dumps of MS code!
Plea for forgiveness... (Score:0)
by Anonymous Coward on Saturday November 16, @02:46PM (#4686623)
I have a problem.
I used to be a regular at geekizoid. I make no excuses -- at the time it was a fun place. People posted random thoughts... nonsense articles... flamed each other with wanton abandon. It wasn't full of stuck up dickless wonders like certain other sites. Amazing as it may sound now, this haven of juvenile fun was hosted by Vladinator, aka Scott Lockwood, aka Fat Fucking Loser.
Things changed, of course, because nothing involving a brain-dead obesity like Lockwood can remain fun for long. Sure enough, the drooling fat fool tried to make geekizoid into a more "serious" site, and offer commercial hosting to other piss-poor attempts at slash/scoop sites -- amusing to anyone familiar with the long history of hilarious incompetence shown by the band of half-wits administering his systems. It is at this point that anyone bar a few determined Lockwood mockers and his pet cock-suckers left *.geekizoid for good.
This is my problem. I was once a geekizoidian. I now hate and despise Lardinator and all those associating with him. How do I remove this taint from my soul and rejoin the troll brotherhood? Am I doomed to wander, anonymously, the wastelands of 20721, forever excluded from decent troll society?
Please help. [ezboard.com]
[ Reply to This | Parent ]
!!Troll Gespräch Auswahlsterndatum JETZT (Score:0)
by Anonymous Coward on Saturday November 16, @02:19PM (#4686455)
Collection Stardate di Trolltalk TODAY (Score:-1, Troll) from Anonymous Coward the 16 saturday November, @12:02PM (# 4685796) That is pathetic (Score:0) from gnillort (myslashdotemailaccount@yahoo.com) the 16 saturday November, @10:5ÂM (# 4685513) (customer #617577 Info | last newspaper: Wednesdays October 23, @07:53PM) rather than it eliminates the infuence of Vlad that crapflooding and the cabal/AVT/CUNT/CLIT/Klerck that crapflooding, yo [ the fatasses of slashdot.org]u are based here. I have an alternative perfectly good [ ezboard.com ] all the putting to point. Why not diagli a test? [ answer to this | parent ] YOOOOU Is TEH GAY! (Score:0) from Anonymous Coward the 16 saturday November, @10:4ÀM (# 4685454) in A.D. Faggotry 2002 was beginning. AV3: Which thing happens? Boy 1 Of The Telephone: Someone them pump on boy 2 of the extremity telephone: We do not obtain lubricating AV3: That what! Boy 2 Of The Telephone: Hard main turn AV3 of the tap: He is You!! Vlad: As you are fagmasters!! Vlad: All your females are belong to we Vlad: You are on the sense to the dead women from AIDS AV3: That what you say!! Vlad: You do not have probability to survive smoke your Vlad pole: IT HAS HAS HAS HAS.... AV3: It removes every AV3 ' cockring ': You know that what you that fairies AV3: It moves ' jizcatcher ' the AV3: For justice great [ answer this | parent ] to 1 January 2003: daily count down. (Score:0) from Anonymous Coward the 16 saturday November, @07:01AM (# 4684935) the count down: 45 days [ answer to the srings of this trolltalk | of the parent ] to life! (Score:0) from Anonymous Coward the 16 saturday November, @06:49AM (# 4684907) who on earth could carry therefore unexpected of tide-fluctuates of the vitalità of new to this justification cruddy for a sid secret? why, momochrome naturally! only its brightness could possibly king-corroborate therefore condition sad of the degeneration and to newly breathe the new life within this justification weak person for a troll collective. All hail the momochrome! [ answer to srings of this | the parent ] Re:trolltalk to life! (Score:0) from Anonymous Coward the 16 saturday November, @06:59AM (# 4684931) moreover, "of tide-fluctuates of the vitalità" had been continuous for a enough sure time before that the sig. Momochrome has been sormontato with the jealousy that popolano was speaking about someone except he and decided therefore to throw its hat in the ring. It is nothing. Washed - in on-state. To the day today, who even remembers itself of who Momochrome was? The sure one not sweeping in order to remember itself of and has been in the hardcore of troll-scene of Slashdor from when before the scene has existed. Momochrome was a famous one to piè of page of the a-line to page 4,275 of the history of trolling and the greater part of people has not been taken care to read that page, and many less notes to piè of page. Momochrome who? Not squilla one flange [ answer to srings of this | the parent ] Re:trolltalk to life! (Score:0) from Anonymous Coward the 16 saturday the November, @07:0ÃM excuses (# 4684944) Excuses \A*pol"o*gy \, n.; pl. Excuses. [ apology of the L., gr.; from +: cfr. apologies of the F.. See Apologetic. ] 1. Something said or written in the defense or the justification of that what appears badly to others, or of that what can be responsible to the disapprobation; justification; axis, excuses of the Tertullian for christianity. It is not my intention to excuse for mine poem; some will think it do not have need of justification and others will not receive any. -- Dryden. 2. An acknowledgment planned like atonement for one sure observation or improper or injurious action; an admission to an other of a wrong one or a discourtesy made he, accompanied from an expression of the sorrow. 3. Qualche.cosa supplied like substitute; a espediente. It goes to work inventing the excuses for stretches them of the window. -- Dickens. Syn [slashdot.org]
Read the rest of this comment... by
[ Reply to This | Parent ]
Warning to Crapflooders (Score:1)
by gbwd on Saturday November 16, @02:33PM (#4686546)
(User #626693 Info)
Hi everybody (Dubya here),
i am logging the IP addresses of everybody who posts to this here trolltalk forum. if you are a crapflooder i WILL turn you in to the authorities.
[ Reply to This | Parent ]
You only popped up yesterday (Score:0)
by Anonymous Coward on Saturday November 16, @02:39PM (#4686594)
You fuck the dick mister.
If you really want to avoid crapflooding, go join chainrust.
[ Reply to This | Parent ]
A note to the Vladequacy/AVT CRAPFLOODERS (Score:0)
by Anonymous Coward on Saturday November 16, @01:49PM (#4686311)
Fucking stop it already.
plz die k thx
[ Reply to This | Parent ]
This is pathetic (Score:0)
by gnillort (myslashdotemailaccount@yahoo.com) on Saturday November 16, @10:54AM (#4685513)
(User #617577 Info | Last Journal: Wednesday October 23, @07:53PM)
Rather than get rid of the influence of Vlad crapflooding and the cabal/AVT/CUNT/CLIT/Klerck crapflooding, you fatasses sit here. I have a perfectly good alternative [ezboard.com] all set up. Why not give it a try?
[ Reply to This | Parent ]
GOD DAMMIT CHAINRUST (Score:1)
by gbwd on Saturday November 16, @02:25PM (#4686490)
(User #626693 Info)
Hi everybody (Dubya here),
dear Mr. Chainrust, please stop trying to attract attention to yourself. it is painfully obvious you are not welcome under any name you choose for yourself. instead of wasting your time here trying to be "cool" with us trolls, someone your age should be spending his time with real other people at his age and developmental level. why don't you go partake in some time-honored American extracurricular activities? you could go and join the Boy Scouts, sign up for ROTC (the War on Terror needs you), or if you're one of them new-age sensitive guys [www.dobi.nu], you can learn some Home Ec or something. just stop gallavanting around here like a damn fool.
[ Reply to This | Parent ]
Re:This is pathetic (Score:0)
by Anonymous Coward on Saturday November 16, @12:39PM (#4685992)
I just LOVE Klerck's site [klerck.org]! Especially the "fash" section [klerck.org], where I learned to cut the bottom off of an old pair of testicles to use as a hair enhancement! Oh, and the "fetish party" photos [klerck.org]!
Of course, don't forget to read Klerck's emails [rotten.com]! Here you will discover how truly difficult it is to decide what to do on the weekends... have an orgy? A mass rape party? Go to the mall and sodomize yourself with splintery broomsticks? Autofellate or autoeroticasphixyate yourself?
In short, if you haven't checked out Klerck's site [goatse.cx], you don't know what you're missing!
[ Reply to This | Parent ]
YOOOOU ARE TEH GAY! (Score:0)
by Anonymous Coward on Saturday November 16, @10:42AM (#4685454)
In A.D. 2002
Faggotry was beginning.
AV3: What happen?
Phone Boy 1: Somebody pump us up the butt
Phone Boy 2: We get no lubricant
AV3: What!
Phone Boy 2: Main cock turn hard
AV3: It's You!!
Vlad: How are you fagmasters!!
Vlad: All your females are belong to us
Vlad: You are on the way to death by aids
AV3: What you say!!
Vlad: You have no chance to survive smoke your pole
Vlad: HA HA HA HA....
AV3: Take off every 'cockring'
AV3: You know what you doing
AV3: Move 'jizcatcher'
AV3: For great justice
[ Reply to This | Parent ]
January 1st, 2003: daily countdown. (Score:0)
by Anonymous Coward on Saturday November 16, @07:01AM (#4684935)
The countdown: 45 days
Those wishing to learn more about Reverse Engineering software may find the following pages useful:
Fravia's pages - A huge, sprawling resource of RE information. Chances are, any info you need is in here somewhere. It's just a matter of finding it...
The Art of Assembly and other essential ASM programming links. If you want to learn RE, sooner or later you're going to have to learn assembly. Get to it.
Mammon's Tales to his Grandson and other useful RE classics by a G.O.M. of the genre. Oh, and an older mirror, possibly with extra/different stuff on it.
Google's directory listing for Disassemblers, which you'll be wanting at least one of...
...and the listing for Testing tools, which may come in handy.
Finally, Compuware's SoftIce page - SoftIce being the single most popular RE tool for Win32 software... Not that you're likely to be paying for it, you warez monkey, you.
Have fun, kids, and release Open Source.
(Posting Anon because I don't need the Karma or the implication of knowledge =)...
http://goatse.cx
http://pub56.ezboard.com/btrolltalk
Not everyone can hack the kernel, and not everyone can disassemble win32 code and make sense out of it.
One thing that Windows has over Linux is that no one ever implies that you shouldn't be running Windows just because you don't know C++.
I've seen this phrase a couple of times on /., but I'm not sure entirely what it means. Can someone provide a link or a concise explanation if no link?
--tomkiit
But, referring to doing this on native Windows code is not a good idea at all. Remember the EULA, simply having the Windows code on your disk constitutes acceptance of the EULA and reverse engineering by assembly dumps is explicitly defined as a violation of the EULA. In other words you are setting yourself in a position for major legal problems.
Don't believe everything you read. Just because Bill Gates writes into the EULA that you'll work as his towel boy if you open the box doesn't mean you are actually legally obligated to.
The only legitimate way to reverse engineer software is the method used by the Samba team. You must look at the input and look at the output and then determine your OWN method of achieving the same result.
Sorry, but you don't know what you are talking about. That is not "the only legitimate way".
Thus ANYTHING that you produce afterwards the even vaguely resembles the operation of the original software will place you in a losing position, legally
Oh, please, stop the hysteria. These things need to judged on a case-by-case basis. I frankly doubt that reverse engineering a trojan/virus will get you into hot water with Microsoft's EULA.
dont forget to mod this shit down, too
I believe what the submitter meant by "Windows native code" was code compiled to run on a Windows platform, not specifically code written by (or owned by) Microsoft. Most Linux tools I know of primarily operate on ELFs/cores/etc. compiled for Linux. Being able to debug/examine binaries compiled to run on Windows without having a Windows box handy (or without wanting to risk it, or without wanting to use it for whatever reason) is useful.
A coworker was able to succesfully debug in vmware by looping a serial cable out one port and back in the other, giving one port to vmware and using softice's remote serial debugging to debug from the vmware host computer.
B.G.A.T.(Billy Goats Against Trolls) is proud to announce that SexyKellyOsbourne has made our most wanted list. Normally it is pretty hard for us to prove our case against such people. But Ms. Osbourne has taken special care to ensure that the world knows she is a troll. Example #1 Right from her own journal. As much as B.G.A.T. would like to take credit for this, it does all come right from the trolls mouth!That one wasn't enough to convince you. How about This one? And then there is this one. She has also taken a moment to tell her something about herself. A quick glance at her posting History tells it all. Here is one of my favorites. Just have a look at the people on her FOE LIST. She has to go! So please take this time to spend just one mod point to keep this genital wart on society out of sight. MOD HER DOWN AS A TROLL!!!! Not because I said so, but remeber she is a self confesed troll.
Moderators PLEASE come to your senses !!! This is such an *obvious* troll.
Is Linux a tool of the unlawful?
To be, or not to be: that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles,
And by opposing end them? To die: to sleep;
No more; and by a sleep to say we end
The heart-ache and the thousand natural shocks
That flesh is heir to, 'tis a consummation
Devoutly to be wish'd. To die, to sleep;
To sleep: perchance to dream: ay, there's the rub;
For in that sleep of death what dreams may come
When we have shuffled off this mortal coil,
Must give us pause: there's the respect
That makes calamity of so long life;
For who would bear the whips and scorns of time,
The oppressor's wrong, the proud man's contumely,
The pangs of despised love, the law's delay,
The insolence of office and the spurns
That patient merit of the unworthy takes,
When he himself might his quietus make
With a bare bodkin? who would fardels bear,
To grunt and sweat under a weary life,
But that the dread of something after death,
The undiscover'd country from whose bourn
No traveller returns, puzzles the will
And makes us rather bear those ills we have
Than fly to others that we know not of?
Thus conscience does make cowards of us all;
And thus the native hue of resolution
Is sicklied o'er with the pale cast of thought,
And enterprises of great pith and moment
With this regard their currents turn awry,
And lose the name of action.
William Shakespeare
Well since I still don't know ASM, I guess I learned "Always pack your trojans"... That would probably be useful information, if I start writing trojans, or get laid
This is about vir... forget it, not even wasting my time, the subject says it all... karma whore
I've met them in real life. Usually they're boys in their mid teens, totally psychopathic, obsessed with being 'cool', and take joy in the whole badness of the cr4ck0r groupy thing. These boys do alot of damage, so as much as you may demean them for being the idiots they are, they're still going to doing their vandalism.
I have no idea why this was modded as a troll, cause it definitely does give you some insight into:
(a) writing your own trojans =P
(b) doing analysis and stuff inhouse without any consultants being needed.
I can sum up the whole article with:
c:\> type Trojan.exe | find "WSAStatup"
c:\> Netstat -a -n | find "LISTENING" >before.txt
c:\> Trojan.exe
c:\> Netstat -a -n | find "LISTENING" >after.txt
c:\> diff before.txt after.txt