Slashdot Mirror


Frankenstein Code Stitches Code Bodies Together To Hide Malware

mikejuk writes "A recent research technique manages to hide malware by stitching together bits of program that are already installed in the system to create the functionality required. Although the Frankenstein system is only a proof of concept, and the code created just did some simple tasks, sorting and XORing, without having the ability to replicate, computer scientists from University of Texas, Dallas, have proved that the method is viable. What it does is to scan the machine's disk for fragments of code, gadgets, that do simple standard tasks. Each task can have multiple gadgets that can be used to implement it and each gadget does a lot of irrelevant things as well as the main task. The code that you get when you stitch a collection of gadgets together is never the same and this makes it difficult to detect the malware using a signature. Compared to the existing techniques of hiding malware the Frankenstein approach has lots of advantages — the question is, is it already in use?" Except for the malware part, this has a certain familiar ring.

21 of 111 comments (clear)

  1. Re:Is this actually hard to detect? by Namarrgon · · Score: 3, Insightful

    The first thing it would find was its own scanning code, and before you know it your AV system has decided that it is itself an unacceptable risk, and has self-quarantined.

    --
    Why would anyone engrave "Elbereth"?
  2. Fun but not interesting by Anonymous Coward · · Score: 5, Informative

    The concept of malware using existing code, libraries even...let's see what's on every system in existance:
    1. zlib
    2. libpng
    3. c runtime (albeit different forms)
    4. BSD-compatible TCP/IP stack

    Yup all the right elements needed to create malware, better go remove all those stat!

    All joking aside, The Unix programming model is more or less the "right" way to program things except in two cases:
    - Threading, which the unix model does horrible horribly. Many applications still are designed like there is only one CPU in the system, and the worst offenders (eg google chrome) try to solve it by wasting more memory on a broken sandbox model. It doesn't help when the parent process is the one locking up.
    - Library dependency hell. Linux specifically has a "NOT INVENTED HERE" problem, where everyone violates the Rule of Diversity. Perl is the worst victim of this in action. Various C libraries also fall into this problem. What happens is that over time, shared libraries change their API, or start requiring yet-more dependancies. The end result is that binary programs on Linux are poorly cobbled-together, and highly dependant on upstream developers to get their ass in gear to fix bugs. As opposed to the FreeBSD/gentoo model where compiling everything solves the library hell and replaces it instead with versioning hell. What I mean is that if you don't constantly update everything every time a new point release is made, eventually the ports library will remove the port (eg php5,52,53,54) and break everything.

    In some cases some really stupid crap is a dependency and takes forever (why must all graphics-related ports want to compile the complete X11 system for example)

    The Windows model is somewhat better, albeit has it's own problems. Most windows applications, even when they have shared libraries, distribute the shared libraries they use and keep them in their own directories. If you remove these, the system library is then used. It's also possible to just replace a library. However some applications are really bad... and I mean broken-by-design if you use any shared libraries at all...

    The current way many MMO games prevent hacking, is by monitoring for injected processes or regular processes on a blacklist. However the more creative hacks actually patch the C runtime itself and patch-over the anti-hacking code. It was kinda fun watching this progress with one specific game, as months would go by and the hackers would have their way with the MMO, and then suddenly the anti-hacking software would come back to life and they'd all panic and stop playing for a few hours as they try to figure out what changed. But the way they do it is by using a benign shared library (zlib or jpeg for example) that is loaded before the anti-hacking library, having all imports passed-thru it to the real library renamed to something else. The payload of the dll file however is when it's loaded.

    So it's entirely possible for antivirus software to be neutered by the same process. Antivirus software should be staticly compiled and not relying on any shared files, not even the c-runtime.

    1. Re:Fun but not interesting by 0123456 · · Score: 4, Insightful

      The Windows model is somewhat better, albeit has it's own problems. Most windows applications, even when they have shared libraries, distribute the shared libraries they use and keep them in their own directories.

      How is having seventy-five copies of zlib, all with different security holes, scattered around your system better than having one copy provided by the OS?

    2. Re:Fun but not interesting by Bert64 · · Score: 2

      In some cases some really stupid crap is a dependency and takes forever (why must all graphics-related ports want to compile the complete X11 system for example)

      This is why Gentoo has USE flags, so you can turn off optional dependencies if you don't require their functionality.

      The Windows model is somewhat better, albeit has it's own problems. Most windows applications, even when they have shared libraries, distribute the shared libraries they use and keep them in their own directories. If you remove these, the system library is then used. It's also possible to just replace a library. However some applications are really bad... and I mean broken-by-design if you use any shared libraries at all...

      The windows model is more convenient for end users, at the expense of performance and efficiency... And incidentally, OSX works in a similar way with application bundles.

      The system provided shared libraries maintain binary level backwards compatibility by including multiple versions of the library, making it much easier to run old binaries but also causing significant code bloat and resulting in the presence of lots of old and potentially insecure code.

      By including libraries with each application instead of installing them centrally, you end up wasting memory if you ever run several programs at once, since each one will load its own copy - thus defeating one of the key benefits of shared libraries.

      Also by including libs with each app, you end up with an absolute nightmare should a security vulnerability be discovered in one of them... Instead of updating the library centrally, you now have to update each individual application that uses it, either by installing an updated version of the app (usually by hand since windows lacks any proper package management), or by manually replacing the library version (which may or may not work). You also have various vendors which ship old versions of libraries which already have known security holes!

      The biggest problem with the windows model however, is the fact that its mandatory... You cannot go and strip out all the old libraries and configure the system centrally.... Linux can actually operate in the windows way quite easily, but the fact it doesn't is largely because package management and source code availability eliminates most of the hassle of keeping centralised libraries while retaining the benefits. The windows model is largely a kludge designed to mitigate the lack of package management and sourcecode.

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
  3. Not possible in my system by mykepredko · · Score: 5, Funny

    Seriously, I would expect the pieces of the Frankenstein code to be fairly readily identifiable and

    Erectile Dysfunction? Need to please more than one woman. Have we got the pills for you - legal and over the counter just click here: getitup.com

    highly unlikely that a well protected system like mine would EVER have to worry about it.

    myke

  4. Hasn't something like this been done? by Immerman · · Score: 2

    Perhaps someone was pulling my leg at the time, but I remember back in the mid-nineties hearing about a project where dozens (soon to be hundreds) of self-modifying/evolving viruses were turned loose on a host machine to compete, with one of the most successful being a tiny bit of "parasite" code that had offloaded virtually all of it's functionality to other viruses in the ecosystem.

    --
    --- Most topics have many sides worth arguing, allow me to take one opposite you.
    1. Re:Hasn't something like this been done? by m6tt · · Score: 2

      You're possibly thinking about the classic corewars game?

      http://www.corewars.org/

  5. Re:In the wild ... by jd2112 · · Score: 5, Funny

    From TFA:

    Although the Frankenstein system is only a proof of concept, and the code created just did some simple tasks, sorting and XORing, without having the ability to replicate, computer scientists from University of Texas, Dallas, have certainly proved that the method is viable. And who knows, it might even be out there in the wild. After all, one of the main advantages of the method is that it hides malware more effectively.

    While I have to profess that I do not know of any existing Frankenstein-code in operation, I can't discount the possibility that, buried in thousands and thousands closed-source software fragments there are things that we have absolutely no idea what they are Even in a totally open source environment, hiding code fragments isn't that hard to accomplish either And who knows? Maybe TPTB already got the Frankenstein codes installed in all our machines

    Let me check...

    Directory of C:\
    ...
    08/28/2012 11:37 PM 904,704 abbynormal.exe
    ...
    I think you might have a point.

    --
    Any insufficiently advanced magic is indistinguishable from technology.
  6. DirecTV, "Been there, done that". by Trax3001BBS · · Score: 4, Interesting

    Quoting a portion of http://news.slashdot.org/story/01/01/25/1343218/directvs-secret-war-on-hackers
    Posted by michael on Thursday January 25 2001

    "...It was apparent that DirecTV had lost this battle, relegating DirecTV to hunting down Web sites that discussed
    their product and using their legal team to sue and intimidate them into submission.

    "Four months ago, however, DirecTV began sending several updates at a time, breaking their pattern. While the
    hacking community was able to bypass these batches, they did not understand the reasoning behind them. Never before
    had DirecTV sent 4 and 5 updates at a time, yet alone send these batches every week. Many postulated they were
    simply trying to annoy the community into submission. The updates contained useless pieces of computer code that
    were then required to be present on the card in order to receive the transmission. The hacking community
    accommodated this in their software, applying these updates in their hacking software. Not until the final batch of
    updates were sent through the stream did the hacking community understand DirecTV. Like a final piece of a puzzle
    allowing the entire picture, the final updates made all the useless bits of computer code join into a dynamic
    program, existing on the card itself. This dynamic program changed the entire way the older technology worked. In a
    masterful, planned, and orchestrated manner, DirecTV had updated the old and ailing technology. The hacking
    community responded, but cautiously, understanding that this new ability for DirecTV to apply more advanced logic
    in the receiver was a dangerous new weapon. It was still possible to bypass the protections and receive the
    programming, but DirecTV had not pulled the trigger of this new weapon.

    "Last Sunday night, at 8:30 pm est, DirecTV fired their new gun. One week before the Super Bowl, DirecTV launched a
    series of attacks against the hackers of their product. DirecTV sent programmatic code in the stream, using their
    new dynamic code ally, that hunted down hacked smart cards and destroyed them. The IRC DirecTV channels overflowed
    with thousands of people who had lost the ability to watch their stolen TV. The hacking community by and large lost
    not only their ability to watch TV, but the cards themselves were likely permanently destroyed. Some estimate that
    in one evening, 100,000 smart cards were destroyed, removing 98% of the hacking communities' ability to steal their
    signal. To add a little pizzazz to the operation, DirecTV personally "signed" the anti-hacker attack. The first 8
    computer bytes of all hacked cards were rewritten to read "GAME OVER"..."

    end quote

    1. Re:DirecTV, "Been there, done that". by girlintraining · · Score: 2

      Not exactly. In that case, most of the code was uploaded, then resequenced and executed. The completed program looked the same on each card. In this case, what they're saying is with all the DLLs on a system, if you can heuristically analyze them for relevant code segments to fulfill your objective, then you can use code that's already trusted and integrated into the system as a foundation for your attack.

      The problem with this method, is that it still requires a 'seed'. It needs a program with the logic necessary to stitch together its payload. In other words, the delivery system is still vulnerable to conventional countermeasures.

      --
      #fuckbeta #iamslashdot #dicemustdie
  7. Re:Interesting by 1u3hr · · Score: 3, Interesting

    aliens, could construct a data stream to take over a receiving computer on any listening planet.

    Basically the plot for "A for Andromeda", the 1961 TV series written by Fred Hoyle. A message is decoded to a computer program for a powerful AI that can answer just about any question. It seems the inventions it creates are designed to make us destroy ourselves; in the sequel it turns out that it was actually an exercise of "tough love" to force us to work together to defeat it rather than nuke each other to oblivion as most intelligent species do.

  8. ROP & The Halting Problem by Tracy+Reed · · Score: 2

    This sounds like Return Oriented Programming, used in some exploits to thwart countermeasures. But it is a long way from stitching together code to do trivial things all the way to making code which replicates, has a payload, AND can stitch together code to do all Of this. The Halting Problem makes me wonder if it is even theoretically possible.

  9. Bash... by flyingfsck · · Score: 2

    "...gadgets, that do simple standard tasks..." Well, I don't want to bash the authors, but what they describe is exactly what a script would do on a Linux system. I suppose they come from a pure Windows environment, where a script is an unheard of, super guru thing...

    --
    Excuse me, but please get off my Pennisetum Clandestinum, eh!
  10. Re:Interesting by ldobehardcore · · Score: 2

    I haven't seen "A for Andromeda", so I'll take you at your word, and comment on the series, since I think the premise is utterly absurd.

    The idea that an extraterrestrial civilization would send out a "tough love" kind of virus, in order to teach us a lesson in cooperation, is incredibly naive. Firstly: if contact with an alien civilization is made, it's likely to be accidentally picking up a private signal on our part, and we'll probably NEVER understand the signal in itself. It's overwhelmingly probable that it would have totally indecipherable content, no matter that we could figure out that the signal is not from natural emission.

    Secondly: Why the hell would another civilization, with superior technology to us want to help us at all? We're essentially shaved apes with thermonuclear weapons! We aren't much smarter than the animals we dominate. Our only real advantage over other animals is our ability to communicate through complex language, and even then we really suck at it. We can't agree on most things, and those of us who do seem to only be like minded due to meme viruses that pretty much break the useful parts of our minds regarding making advances to the human race (religion anyone?)

    Thirdly: What do we have to contribute to a galactic society that they can't just take from observing our broadcasts? We pretty much have nothing to offer. We're insanely optimistic. In fact, we have to be irrationally optimistic in order to not be labeled severely depressed. Depressed people see the out of control nature of the universe and what happens to them, and realize that any event they do have control over are insignificant to the universe and 99.9999% of the people on earth, so they despair at the knowledge of their own impotence. This is logical, but bad for mental health. How fucked up are we that we need to think that we matter in order to keep from killing ourselves.

    In all it's a crazy idea that any extraterrestrial civilization would ever want to contact us, much less carry us along, other than for pure altruism. And from all the study I've done of humans, the correlation between size of a society and altruism has a negative correlation as a society grows.

    Just a few thoughts about the above description of "A for Andromeda". I'm going to look for it now and see if I'm just a bloviating dick.

    --
    Hectice, baby, Mercator says hello to you
  11. I think it's the most dangerous piece of tech ever by Panaflex · · Score: 2

    Seriously... the ability to stitch together a thousand different versions of "the same" virus using pieces of code commonly available on every system would be overwhelming and devastating to a target.

    No, you don't send the generator in the payload (unless you have it generate itself first), as it would be easily detected and reverse engineered. You send a thousand viruses at a set of targets and there will be no virus scanner able to handle 100% of them without dynamic analysis. With a zero day exploit and root kit implementation this is potentially devastating. With some careful engineering you could sometimes defeat dynamic analysis as well.

    What makes current viruses largely ineffective is that you can only make a few effective ones in a limited time period. You need a large team of experienced developers to be able to build such a critter. Iterating new payloads takes lots of testing and QA. With this sort of tech you build one good virus blueprint and out comes thousands of different little beasties with a good probability of success. Each one is different!

    This stuff is dangerous - atomic bomb dangerous if it gets a proper engineering.

    --
    I said no... but I missed and it came out yes.
  12. Re:Is this actually hard to detect? by Opportunist · · Score: 4, Funny

    If Symantec did it, you were infected with Symantec.

    --
    We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
  13. Re:Detecting malware is doing it wrong...fix holes by SuricouRaven · · Score: 2

    A lot of the time the users are the holes. You can use the most secure software in the world, but it's not going to do you a lot of good if Mr Smith in accounting decides that he simply must run that program from a dubious website that sends a cartoon cat to crawl around the screen to make his job less depressing.

  14. Re:Biological weapon by SuricouRaven · · Score: 2

    That basically is a virus. Their own genome doesn't supply all of the information needed to make a new virus, but rather adapts the existing processes coded for by the host's own genome. That's why viruses tend to be much more species-specific than bacteria.

  15. Re:Return oriented computing by gweihir · · Score: 2

    It is not. Return oriented programming has it right: It is a small part of the malware doing the privilege escalation. All other virus code gets propagated. This "revolutionary new thing" is not revolutionary and it is not new. Other have not pursued it because it does rather obviously not work for any kind of propagating code. The simple question of "how do you get the scanner/stitcher" on the target system and running as root?" seems to escape people.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  16. Re:Is this actually hard to detect? by gl4ss · · Score: 2

    the code that searches for the xoring code would be mutated as well.
    technically this leads to 50% size increase in each new generation of the malware, due to the added cruft. the article was making rounds maybe two weeks ago or something already...

    I'm pretty sure the av guys can find some common denominator to look for though, like the api calls that go looking for the files.. - But I would presume the main use point for this would be on malware installing servers.

    --
    world was created 5 seconds before this post as it is.
  17. So basically... by AttyBobDobalina · · Score: 2

    Computer "viruses" as we know them are really more like computer "bacteria", whereas this concept is a bit more like a real virus.