Slashdot Mirror


Analyzing Binaries For Security Problems

Matt writes "At the last talk at BlackHat in Las Vegas, Greg Hoglund demonstrated a product for sale by his new company that analyzes binaries for security vulnerabilities. He showed the analysis of several commercial products, the results of which were shockingly insecure. This product should help end the debate of closed source or open source applications being more or less secure."

304 comments

  1. Like the concept, but... by Meat+Blaster · · Score: 5, Interesting
    Isn't it blatently illegal to analyze the majority of the binaries out there? You can't even give benchmarks on many of them without violating the EULA, let alone actually dig through the internals, because it's damaging to the rights of the software designer under the license.

    Then again, it's not like virus scanners don't do the same thing.

    1. Re:Like the concept, but... by msgmonkey · · Score: 4, Informative

      Nope, the contract may say that you may not do this nor that you and you could only be sued for breaking a contract.

      If it was illegal ie there was a law against reverse engineering, benchmarking, etc it would not be in the EULA.

      Also just because something is in a contract does n't make it legally binding if the clause breaks laws.

    2. Re:Like the concept, but... by in7ane · · Score: 1

      First of all, EULA's are hardly enforceable. And yes, virus scanners do something reasonably similar - so depends who the program is by and how much it pisses of the creators of the binaries.

      Now, somebody run a copy of Windows through this thing.

    3. Re:Like the concept, but... by quigonn · · Score: 5, Informative

      Not in most parts of Europe. The copyright there explicitly permits disassembling and reverse engineering.

      --
      A monkey is doing the real work for me.
    4. Re:Like the concept, but... by Gregg+M · · Score: 1

      EULA's are only binding if you license your software. If you bought it over the counter, the exchange of money is all the agreement needed. Once you own the product they can't start adding "conditions".

      --
      Linux is only free if your time has no value. Windows is only free if you threaten to use Linux.
    5. Re:Like the concept, but... by t123 · · Score: 5, Informative

      Because this is /. and nobody RTFA

      Q: Does BugScan decompile programs?
      A: No. BugScan does analysis of assembly code and does not need to decompile the program.

      Q: Does BugScan "reverse engineer" programs?
      A: No. Reverse engineering is a process where a program or device is taken apart to understand how it works, generally for the purpose of reimplementing, complementing, or modifying a behavior of the system. BugScan doesn't try to understand how the program works, what algorithms it employs, or anything else. BugScan analyzes usage of known APIs and the dataflow to and from those APIs.

    6. Re:Like the concept, but... by BlueWonder · · Score: 5, Informative
      Not in most parts of Europe. The copyright there explicitly permits disassembling and reverse engineering.

      I don't know what you mean by most parts of Europe, but an EU directive makes disassembling and reverse engineering explicitly illegal. This directive must be made the law by all EU member countries, and already has by many.

    7. Re:Like the concept, but... by Anonymous Coward · · Score: 0, Funny

      i) Take an open source project
      ii) build it
      iii) run the tool against the binary

      profit?

    8. Re:Like the concept, but... by Quila · · Score: 3, Informative

      Unless you live in a UCITA state, then you're screwed.

    9. Re:Like the concept, but... by IamTheRealMike · · Score: 1

      Not for interop purposes though, as far as I'm aware. Obviously, you cannot use code gained from disassembly in your own products.

    10. Re:Like the concept, but... by Anonymous Coward · · Score: 0

      Which EU directive would that be exactly?

    11. Re:Like the concept, but... by LarsG · · Score: 5, Informative

      an EU directive makes disassembling and reverse engineering explicitly illegal.

      Which directive? According to directive 91/250/EEC, reverse engineering is expliclitly legal in EU/EEC.

      --
      If J.K.R wrote Windows: Puteulanus fenestra mortalis!
    12. Re:Like the concept, but... by kasperd · · Score: 4, Interesting

      Not for interop purposes though, as far as I'm aware.

      In Denmark the law still says reverse engineering is legal for interoperability purposes. It also says you are allowed to fix bugs in the code and make backups. And finally the EULA is not allowed to state otherwise.

      --

      Do you care about the security of your wireless mouse?
    13. Re:Like the concept, but... by quigonn · · Score: 2, Informative

      Decompilation is explicitly allowed in Austria, to (re-)establish interoperability, even in the revised version: http://www.parlinkom.gv.at/pd/pm/XXII/I/images/000 /I00051__3097.pdf

      And this revised copyright law is an implementation of the EU directive!

      --
      A monkey is doing the real work for me.
    14. Re:Like the concept, but... by Slick_Snake · · Score: 0, Interesting
      No. Reverse engineering is a process where a program or device is taken apart to understand how it works, generally for the purpose of reimplementing, complementing, or modifying a behavior of the system.
      Do you read binary files on a daily basis. There's nothing like a good binary before bed. Compiled code has been used intentionally by programmers as a sort of encryption/stenography. You can't see what my program is doing so you can't do anything but use it. This program reads the binary and translates parts of it into meaningful messages. Giving you information about the product that you didn't have before this is reverse engineering.
      Not only does BugScan automatically detect security errors, it recommends how to fix each error with detailed code examples.
    15. Re:Like the concept, but... by BobTheLawyer · · Score: 3, Informative

      it's a little more complicated than that: it depends what, exactly, you mean by reverse engineering.

      There's a general right in Article 5(3) of the Directive to "observe, study or test the functioning" of a program to "determine the ideas and principles which underlie any element of the program".

      But decompilation is restricted to circumstanecs where it's essential to do so to achieve interoperability (e.g. interchange of file formats) with other, independently created, software. You can't use decompiled code for any other purpose.

      As this is an EC Directive, it should have been implemented by an EU member States. If you live in a State which hasn't implemented it in full, and you suffer loss as a result, you are entitled to sue your government!

    16. Re:Like the concept, but... by The+Fanta+Menace · · Score: 1
      Isn't it blatently illegal to analyze the majority of the binaries out there? You can't even give benchmarks on many of them without violating the EULA, let alone actually dig through the internals, because it's damaging to the rights of the software designer under the license.

      It's blatently illegal to break into other people's machines using the same holes found in such software. So if this is the case, and black hats are still going to do it, do you really think that crappy laws forbidding analysing binaries are really going to stop such people?

      --
      -- Even if a god did exist, why the fsck should I worship it?
    17. Re:Like the concept, but... by anshil · · Score: 1

      "
      But decompilation is restricted to circumstanecs where it's essential to do so to achieve interoperability (e.g. interchange of file formats) with other, independently created, software. You can't use decompiled code for any other purpose.
      "

      Well I don't like this regulation, why is decompilation not allowed for anything?

      IMHO I say this law puts the desires of few over the total network advantage of many. (better economy)

      --

      --
      Karma 50, and all I got was this lousy T-Shirt.
    18. Re:Like the concept, but... by BlackHawk-666 · · Score: 4, Insightful
      Compiled code has been used intentionally by programmers as a sort of encryption/stenography

      Speaking as a programmer I can say this is a load of horse pucky. Firstly, if we wanted to use encryption, we would simply use encryption. Secondly, stenograhpy is deliberating hiding information within outher information, but that's not what compiled code is doing. Sheesh, I can't believe anyone modded this crap up.

      Code is actually compiled from human readable form (text, source code, ASM) into a binary form that may be loaded and executed by the computer. This process is not designed to obscure it from humans, but make it readable by computers. Since any decent decompiler can take that binary and get a working (or mostly working) set of source from it (just not the same as the original, and usually only in assembler) it makes both a lousy form of encryption and steganography.

      --
      All those moments will be lost in time, like tears in rain.
    19. Re:Like the concept, but... by IM6100 · · Score: 1

      What does a tool that looks for 'security problems' in a program have to do with interoperability?

      --
      A Good Intro to NetBS
    20. Re:Like the concept, but... by palmucci · · Score: 1

      Is the product disassembling the code (where the end result is the disassembly), or is it just flagging the errors?

      Seems to me that if no human is viewing the disassembly, you shouldn't be in violation of the laws.

    21. Re:Like the concept, but... by Anonymous Coward · · Score: 0

      What does a tool that looks for 'security problems' in a program have to do with interoperability?

      Well, if your system is insecure, and your network becomes insecure, and then eventually everything gets crashed and deleted, I would think that's a problem with interoperability if there ever was one.

    22. Re:Like the concept, but... by Anonymous Coward · · Score: 0

      I feel sorry for the people in the EU, they don't even seem to realize what's coming. They are going to be turned into another US where accountability is obfuscated by so many layers of government that they eventually won't even know WHO to complain to.. as if they would listen anyway. Ahh, it's great to be citizen #546140091.

    23. Re:Like the concept, but... by Henry+V+.009 · · Score: 1

      You don't have to sign the EULA if you don't run the program. Until you run the program, a binary is just like a book. For some reason, our beloved leaders have neglected to extend and expand their laws into the concept of implied contract.

      It is probable that this will be remedied soon.

    24. Re:Like the concept, but... by dustman · · Score: 1

      I can't decide whether this is a troll or not.

      Regarding the encryption thing, I agree with you 100%, I have no idea why the grandparent put that word in there.

      But, regarding steganography, if there is no reason to "hide" the source by distributing only binaries, then why doesn't everybody release their code? Why, when a company releases a software version, do people whine about its faults and ask the company to fix them, rather than fixing them themselves (or getting a programming friend to).

      The purpose of compiling is to make a "more useful" form of the program for the computer to load. But, a side effect of compiling is definitely the "obfuscation" that occurs.

      Since any decent decompiler can take that binary and get a working (or mostly working) set of source from it (just not the same as the original, and usually only in assembler)

      So, how is a big blob of assembly code, possibly not working 100%, stripped of identifiers and comments, nearly as useful as "properly written" C/C++?

    25. Re:Like the concept, but... by Anonymous Coward · · Score: 5, Funny

      Speaking as a programmer I can say this is a load of horse pucky. Firstly, if we wanted to use encryption, we would simply use encryption. Secondly, stenograhpy is deliberating hiding information within outher information, but that's not what compiled code is doing.

      Speaking as a stenographer, I can say this is a load of horse pucky. Stenography is using shorthand to write/type things. You must be thinking of steganography, which is hiding information.

    26. Re:Like the concept, but... by Anonymous Coward · · Score: 0
      Compiled code has been used intentionally by programmers as a sort of encryption/stenography

      Note that he said : "[compilation is] used by programmers as a sort of encryption". He didn't say that compilation is an encryption, he said some programmers used to pretend it to be (past tense). Hell, this is the very argument of security through obscurity. Is that method efficient or not is another question (you answered it correctly imho).
      I think that it's more PR bullshit that programmers crap btw, but who knows what some lazy programmer can do to avoid work :P
    27. Re:Like the concept, but... by Anonymous Coward · · Score: 0

      Windows open source has been released in a limited capacity:
      http://www.wired.com/news/business/0,13 67,59847,00 .html

    28. Re:Like the concept, but... by MasTRE · · Score: 1

      Interesting how this is the first post under this topic. The legality of it is the first thing that came to your mind when you read about this technology? To me, this is sad. It signals the end of free thinking - all good little robots are running around worrying about compliance.

      --
      Must-not-watch TV!
    29. Re:Like the concept, but... by poot_rootbeer · · Score: 1

      If it was illegal ie there was a law against reverse engineering, benchmarking, etc it would not be in the EULA.

      Why not? If there were a law against benchmarking, AND it was fobidden by the EULA, even if the law were overturned the software publisher could still go after a benchmarker for contract violation.

      Not that I think benchmarking should be illegal (abrogation of free speech), but I'm just giving the corporate perspective on EULA authoring.

    30. Re:Like the concept, but... by BlackHawk-666 · · Score: 1
      I can't decide whether this is a troll or not.Not trolling, just not playing nice with the other children today ;->

      But, regarding steganography, if there is no reason to "hide" the source by distributing only binaries, then why doesn't everybody release their code? Why, when a company releases a software version, do people whine about its faults and ask the company to fix them, rather than fixing them themselves (or getting a programming friend to).

      In terms of hiding the source, companies already benefit from the obfuscation that occurs when code is compiled in, and I suspect if they didn't get that basic level of protection more would look to encryption to protect their code. I imagine, instead of self extracting .exes, we would have self extracting and decypting .exes. The problem with this of course is that the key also needs to be distributed, and that's almost certainly why they aren't doing it at present.

      People whine to the company to fix the code because hacking a binary is hard work and usually reserved for cracking efforts. If companies also released the source then people *might* consider looking at it and fixing something itself, but the great majority would still just go whining to the companies.

      So, how is a big blob of assembly code, possibly not working 100%, stripped of identifiers and comments, nearly as useful as "properly written" C/C++?Because you can modify it and reasseble it to get a customised version of the code. Now, this is by no means a substitute for the c/c++/whatever code if it's available, but it is a valid technique for replacing and updating small sections of code. I've personally done it to viruses and some older software (back in my DOS days) to get an idea of what they're doing, or to remove some unwanted code snippets. It looks like I'll have to do it again shortly too, because the NVidia driver for the XBox is only available in binary form. A quick disassemble, a long period of code inspection, and an equally long translation to equivalent c and we will have an open source version of the driver. It'd be nice if NVidia simply released the source code, but that isn't going to happen :-

      --
      All those moments will be lost in time, like tears in rain.
    31. Re:Like the concept, but... by pbox · · Score: 1

      Especially if you never agreed to the EULA, since you have never installed it on your comp, rather you have analyzed it before-hand to see if it fits your security criteria.

      --
      Code poet, espresso fiend, starter upper.
    32. Re:Like the concept, but... by Anonymous Coward · · Score: 0

      in order to install/run most commercial apps you must accept the EULA, but if you don't run the installer and pull the binary off your self and analyze it... then you haven't broken the EULA b/c you aren't actually using the program which is your end of the contract in most cases... if you use this software you cannot do this, this, this, shouldn't apply if your not running it.

    33. Re:Like the concept, but... by BobTheLawyer · · Score: 1

      Sorry - I'm a lawyer: I can answer the "what" but I can't answer the "why".

      If you're really interested you could explore europa.eu.int and see if you can find background information from the time the Directive was introduced. The site's hopeless, but good luck.

    34. Re:Like the concept, but... by Anonymous Coward · · Score: 0

      No.

      stenography: the art or process of writing in shorthand

      steganography: information hiding

    35. Re:Like the concept, but... by Slick_Snake · · Score: 1

      A quick disassemble, a long period of code inspection, and an equally long translation to equivalent c and we will have an open source version of the driver. So you are admitting that you require a program to understand the binary and convert it back into something that you can read. That sounds exactly like decryption to me. My point wasn't that it was impossible to read the binary files only that is was very difficult to the point were few would attempt to and less actually could. Just because a form of encryption can be broken doesn't mean that it is not encryption. Granted I do agree that compiling was not created as a form of encryption, but as programmers have become increasingly dependent on higher level languages they have become less and less familiar with byte code. BTW here are some definitions from googling. Encrypt - to convert from one system of communication into another; especially : to convert a message into code Decrypt - to discover the underlying meaning of

    36. Re:Like the concept, but... by Anonymous Coward · · Score: 0

      I'm not really sure what Europe hopes to accomplish by forming the EU. Is it trying to compete with America?

    37. Re:Like the concept, but... by scottj · · Score: 1

      I have never actually signed a EULA.

      --
      .-.--
    38. Re:Like the concept, but... by Henry+V+.009 · · Score: 1

      I'm ahead of you. My younger (minor) brother installs all software on the computer I use.

    39. Re:Like the concept, but... by mtahrens · · Score: 1

      I believe the DMCA allows for EULA to include clauses like you mentioned(reverse engineering, benchmarking, etc). While it may not be applicable in your state/country, it is in my state.

    40. Re:Like the concept, but... by zoloto · · Score: 1

      this is pathetic. what more of a definition do you need that "dissasemble" and "reverse engineer" ? If it's legal, it's legal.. what's with the red tape?

      IS it only allowed if you do X or Y and illegal if you do Z? Seems as if someone is playing favorites...

    41. Re:Like the concept, but... by BobTheLawyer · · Score: 1

      well, whether you like it or not, EC law distinguishes between reverse engineering (which is generally allowed) and disassembling (which is generally prohibited).

      And it's quite normal for laws to be subject to exceptions: otherwise the law would be completely inflexible and (more importantly) nobody would pay lawyers lots of money for advice.

    42. Re:Like the concept, but... by tez23 · · Score: 1

      EULA s are not entirely enforcable anyway. For instance, if a manufacturer wrote in small print "by opening this package the user agrees to give microsoft his house" do you think a court would uphold it?

  2. heh by ergonal · · Score: 1, Funny

    Slashdot really needs an [Advertisements] section so I can disable it.

    1. Re:heh by Duncan3 · · Score: 1

      No doubt. Seem to be lots of these lately. They are obviously desperate for cash.

      --
      - Adam L. Beberg - The Cosm Project - http://www.mithral.com/
    2. Re:heh by ergonal · · Score: 1, Funny

      Stop modding this up Funny, it's meant to be Flamebait! Bastard moderators.

    3. Re:heh by EvilTwinSkippy · · Score: 1
      Good point. I'd like to RTFA, but there isn't any.

      I was expecting a view viegraphs of products tested, and the sorts of bugs found. No... It was just an Ad.

      Though I should have known when I saw an inflamitory headline and only 107 comments.

      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
    4. Re:heh by Anonymous Coward · · Score: 0

      I don't think you'll attract many flames by pointing out how much Slashdot sucks. Downmods, yes, but not flames.

  3. Hmm. by Anonymous Coward · · Score: 5, Insightful

    Isn't it kind of strange how they make such big claims but present no actual evidence?

    1. Re:Hmm. by Gleng · · Score: 3, Funny

      You must be new here.

      --
      "Proudly Posting Without Reading The Article"
    2. Re:Hmm. by tankdilla · · Score: 3, Interesting
      Is there any evidence? OpenBSD maybe.

      If they did present an app as being secure, it'd definitely put that app under the microscope, as someone would find a vulnerability just to try to show that BugScan doesn't work.

      But I guess at that if a vuln was found, BugScan would say they just suggest purchasing BugScan v1.1.

      --

      -Look lively. LOOK LIVELY!!! --Mr. Shmallow

    3. Re:Hmm. by archeopterix · · Score: 5, Informative

      Indeed, even finding what code gets actually executed is by no way a simple task. Easy to follow from the main entry point of the executable? Not always. Some compilers/interpreters create tables of entry points for some functions then call the functions via entries in the table. Moreover, the table doesn't have to be present in the executable, but created at runtime instead (calculated from offsets or something). That's only one of many problems with static analysis of machine code. I don't think their program does much more than scanning for a set of known patterns produced by a set of known compilers.

    4. Re:Hmm. by ldrolez · · Score: 3, Interesting

      Moreover, Reasoning's ( http://www.reasoning.com/news/pr/07_01_03.html ) source code analysis of apache was not very convincing (31 defects => 7 real bugs, see http://www.apacheweek.com/issues/03-07-11 ). So how could they make a better analysis tool without software's source code ??

    5. Re:Hmm. by Anonymous Coward · · Score: 0

      You're assuming that the software run on apache is of the highest quality, meaning that no other method could have done a better job. By better job, I mean being more precise in ever aspect of what is determined to be quantified. It is possible that this application sucks so bad that I could do a better job by guessing. So basically, your argment is flawed.

    6. Re:Hmm. by croddy · · Score: 1

      well, I'd certainly hope they ran BugScan on the binary before shipping v1.0!

    7. Re:Hmm. by BlackHawk-666 · · Score: 1

      I assume you are talking about vtables here? These would be created by both the compiler and the runtime. Under Windows the runtime is responsble for loading the code, performing fixups, then executing it. This is known behaviour and could be emulated by the software.

      --
      All those moments will be lost in time, like tears in rain.
    8. Re:Hmm. by tuber · · Score: 1

      Q:"isn't it strange how every time someone says you must be new here, they get modded up +5 funny?" A:"you must be new here."

    9. Re:Hmm. by foolip · · Score: 1

      I know little about decompilation or these tables you talk about. But more generally, wouldn't it be simple to modify a debugger (say, gdb) to follow execution and actually analyse the calls that are actually made. If there's a security hole size 10 in a function which is hardly ever called, that wouldn't be as serious as a size 4 security hole in the main program loop.

      Or actually, come to think of it... a security hole is not just a bug -- the bigger the hole the bigger the problem as the attacker would find a way to have that code executed no matter where in the code it is.

    10. Re:Hmm. by Reziac · · Score: 1

      IANAProgrammer, but couldn't this util's capabilities be tested against an app with a known set of vulnerabilities?? if it finds them all, great; if not, then we'd know their claims are overblown.

      --
      ~REZ~ #43301. Who'd fake being me anyway?
    11. Re:Hmm. by IanBevan · · Score: 1
      It's easier than you think. They don't need to follow the logical flow of the application at all, which I agree might be difficult. Windows programs 'announce' which common runtime routines they need using the IMPORTS section of the executable (or DLL). One needs only to look at the IMPORTS section to see if commonly vulnerable functions are called - like strcpy etc. By examination of the CODE section of executables (looking for the appropriate entry in the IMPORTS jump table), one can determine where such calls are made from. One can then possibly determine what parameters are being passed to the call.

      This is, however, extremely difficult indeed if the application is not running. For a running application, one can simply hook the calls to strcpy etc. and examine the passed parameters, dynamically checking buffers lengths etc. Call interception like this is not terribly straightforward, but is certainly possible. Indeed, it's what WinHeap does (see my sig). In WinHeap's case, all the calls to the heap management functions are intercepted (malloc, free etc).

  4. At least the advantage with open source.... by jamieswith · · Score: 5, Insightful

    Is that, provided you have the ability, then you don't have to sit around and wait for someone else to fix the problems in the programs you use...

    Still, politics aside, perhaps with more applications like this freely available, perhaps more bugs will actually be fixed - rather than relying on security through obscurity - sitting tight and hoping no-one notices...

    Leave me alone! - I can dream can't I ??

  5. Bite them in the bottom by fbjon · · Score: 1

    Huh?! So Windows users can finally revolt against Microsoft's security policies? I'd like to see some OS comparisons with this!

    --
    True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
  6. Presentation slides by bartc · · Score: 5, Informative

    You can get the slides of his presentation here:

    http://www.blackhat.com/presentations/bh-usa-03/bh -us-03-hoglund.pdf

  7. obfuscation by doofusclam · · Score: 5, Informative

    I'd like to know exactly how it does this, considering how much of a mess compiled/optimised c++ code can look at an assembler level. It's also unlikely to be any use on a semi-compiled runtime, such as those used by Visual Basic, .NET etc as the only 'code' is the runtime, the actual program is held in a data section.

    1. Re:obfuscation by darkov · · Score: 4, Funny

      I'd like to know exactly how it does this.

      It searches for '(c) Copyright Microsoft Corporation'.

    2. Re:obfuscation by Nindalf · · Score: 1

      From their FAQ:
      "BugScan doesn't try to understand how the program works, what algorithms it employs, or anything else. BugScan analyzes usage of known APIs and the dataflow to and from those APIs."

      IOW, they search for "strcat", dust off their hands, and call it a good day's work.

      Okay, it's more than that, but it's basically just that idea repeated for similarly-untrustworthy functions.

      They say they're not "decompiling" or "reverse engineering", which is weak legal doublespeak, but the way they support it basically claims that they're not doing anything complicated. They don't even check static buffer size, so they won't catch the common strncat bug of putting the total buffer size in place of the maximum catenation length.

      The whitepaper backs it up pretty solidly. They don't even attempt to find weaknesses in your code, they look for the use of API routines with known weaknesses.

      Not a bad idea, though from the depth of marketing bullshit to wade through, I'd bet it's hideously expensive and not terribly well implemented.

      The funny thing here is that they're exploiting the fear of low-quality closed-source software, but you don't even get to look at their binary. They sell you a sealed-box network computer that does the crunching, and I bet the licensing will be very restrictive. Restrictive to the point where software houses will have to buy a copy to see the false positives that their customers are complaining about.

      At any rate, it's good that this is out there. At the least, it should scare some sloppy software houses into doing some grepping on the source.

  8. How does this thing really work? by wazlaf · · Score: 5, Insightful

    I can't imagine this program to work very well - finding buffer overflows and other possible security vulnerabilities can be an immensely hard task when you actually _do_ have access to the source code. Also, the available compilers produce quite different assembly for the same code. This just all sounds a little bit too good to be true...

    1. Re:How does this thing really work? by leuk_he · · Score: 5, Informative

      Howabout checking thewhitepaper?

      It tells how it works, and it also tells it does not have the abilty to smell at the data users provide.

      It just smells at the code, looks if it uses vulnerable calls like strcpy, an reports this. But it completely puzzels me how you can use the report to report "this is good" or "this is good enough" or "this is a piece of shit".

      finding buffer overflows and other possible security vulnerabilities can be an immensely hard task when you actually _do_ have access to the source code. Also, the available compilers produce quite different assembly for the same code.

      This is the part they did right. They can analyze all kind of assembly, also non-x86. (It does not produce C, no they ananlyze function calls and backtrack them. The problem is that it analyzes "compiled source code", but not the user input.

    2. Re:How does this thing really work? by Arker · · Score: 1

      It just smells at the code, looks if it uses vulnerable calls like strcpy, an reports this. But it completely puzzels me how you can use the report to report "this is good" or "this is good enough" or "this is a piece of shit".

      Well it looks to me like you wouldn't want to trust a 'this is good' result from this tool, but if it says it's bad it's probably right.

      --
      =-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Friends don't let friends enable ecmascript.
    3. Re:How does this thing really work? by leuk_he · · Score: 1

      Well it looks to me like you wouldn't want to trust a 'this is good' result from this tool, but if it says it's bad it's probably right.

      That is ok if you are security paranoia, but if you want it fixed you cannot send a report to the producer, bugscan says it is bad. You cannot send a report to upper management, because they canoot read the result. And it doent report a "quality" number, it reports individual "bugs".

      If you are paranoia you want the sourcecode reviewed. And that is most of the times possible if you want to pay for it. (You can let it review by a 3th party). If they even refuse to have it reviewed under a NDA something is wrong anyway.

    4. Re:How does this thing really work? by Anonymous Coward · · Score: 0

      Well it looks to me like you wouldn't want to trust a 'this is good' result from this tool, but if it says it's bad it's probably right.

      I think in this case, you have that backwards. This will be reporting many more false problems than real ones. Any buffer overflow - no matter the usability of it - will be reported. So, even though there will be no exploitable overflows, they will be reported. If your program handles every string correctly, it will report nothing.. and the world would be very impressed.

  9. Slackware Linux ships with just such a product by Anonymous Coward · · Score: 4, Funny
    It's called "file", and you can use it to recognize problematic/insecure binaries.

    $ file /usr/lib/jed/bin/w32/w32shell.exe
    /usr/lib/jed/bin/w32/w32shell.exe: MS Windows PE 32-bit Intel 80386 console executable not relocatable

    And voila!

  10. Re:Binary vs open source by ftvcs · · Score: 3, Insightful

    Judging from the url, they don't have a lot of faith in open source software.

  11. Uh oh by beacher · · Score: 5, Funny

    I just put my boss's Windows 2003 Server CD under a microscope to examine the binaries.. Started zooming in.. and then SNAP. The bitch cracked into 2. I'll put gentoo on the server now and just tell him that a security cracker broke his shit.
    -B

  12. Nice double edged tool by msgmonkey · · Score: 4, Interesting

    If this can be used to detect for example buffer overflows than does n't it also help speed up a crackers turn around rate?

    I mean instead of trying to find flaws instruction by instruction with some debugger, simply specify all exe and dll's in your %winroot% directory press start and wait for the report and then manually inspect hilighted areas.

    1. Re:Nice double edged tool by kinnell · · Score: 4, Insightful
      If this can be used to detect for example buffer overflows than does n't it also help speed up a crackers turn around rate?

      All the more reason for companies to buy this product - if crackers can find the bugs easily using this program, it's much more important that the developers do to.

      --
      If I seem short sighted, it is because I stand on the shoulders of midgets
    2. Re:Nice double edged tool by Phreakiture · · Score: 1

      I think this is a valid observation. [sarcasm]Let's ban it, and while we're at it, let's ban port scanners and encryption cracking software. Oh, that's right, we already did that![/sarcasm]

      Seriously, though, just about any useful security tool is also a useful cracker tool. This fact is not confined to the field of computers.

      --
      www.wavefront-av.com
  13. Rubbish... by MosesJones · · Score: 4, Informative


    So this analyses binaries and will find all issues where the code will halt and will exceed its resource requests, thus eliminating the need for testing...

    I call Snake Oil.

    For those who don't know about the Halting Problem or Busy Beaver Problem then you should really know about what computers can or cannot do.

    I dare say these people have some basic pattern matching, but this is NOT a reason to stop testing.

    --
    An Eye for an Eye will make the whole world blind - Gandhi
    1. Re:Rubbish... by doofusclam · · Score: 2, Insightful

      Damn right, I agree 100%

      This program might find potential buffer overruns, but it has no idea of context - most overruns come in the common interfaces between components rather than internally to an exe, bear in mind too that a (windows) exe usually spends most of its time in COM or operating system components anyway., I'd rather spend time manually checking the code which is executed 100000 times a second rather than getting told of buffer overruns in something probably never gets executed.

    2. Re:Rubbish... by Anonymous Coward · · Score: 0

      I call SMA. No-one is claiming it removes the need for testing.

    3. Re:Rubbish... by kasperd · · Score: 2, Insightful

      I'd rather spend time manually checking the code which is executed 100000 times a second rather than getting told of buffer overruns in something probably never gets executed.

      The number of times it gets executed is not an issue. If it is vulnurabe executing it once is enough for the cracker to take control. Even if it is never executed under normal circumstances, the cracker might be able to do something to get it executed.

      --

      Do you care about the security of your wireless mouse?
    4. Re:Rubbish... by doofusclam · · Score: 1

      Fair enough, but given x number of overruns i'd prefer to get the obvious and/or easy ones of the way first. The theoretical ones get left till later. Problem with this sort of tool is that, without source profiling, it can't point you to the ones you need first.

    5. Re:Rubbish... by sporty · · Score: 3, Funny

      "Snake oil?" "Shenanagins", is more fun.

      --

      -
      ping -f 255.255.255.255 # if only

    6. Re:Rubbish... by Phillip2 · · Score: 2, Insightful

      "For those who don't know about the Halting Problem or Busy Beaver Problem then you should really know about what computers can or cannot do."

      I'm not sure what the relevance is here though. They are claiming that they can find security problems, not that they can guarentee to find all security problems.

      The halting problem does not mean that you can not write a program to identify other programs that will not halt. It just says you can not always do this.

      Phil

    7. Re:Rubbish... by MosesJones · · Score: 1


      The relevance is that what they are doing is nothing more than doing a "you called an API that MIGHT potentially cause an issue" they do _nothing_ to determine the way the code works or how the code flows.

      Their claim that this is in anyway a substitute for testing is laughable in the extreme. The point about the halting problem is that yes you might identify definate causes of error but you cannot identify even the majority of errors in a complex system. And that is when taking a proper approach.

      This is classic script kiddy numpty rubbish that they think is actually a product, but is really the work of a first year CS student, who is then told why it was pointless.

      --
      An Eye for an Eye will make the whole world blind - Gandhi
    8. Re:Rubbish... by S.Lemmon · · Score: 1

      The problem with this sort of thing is it can't always know the full context in how the program is using some code - it just sees a section of code that has the potential for problems (like a strcpy), but may not see that everything being fed to it has already been length checked beforehand. Unless the software can also confirm there's actually some way to feed the code something that could overflow it, I don't see how it proclaim it a bug.

    9. Re:Rubbish... by BlackHawk-666 · · Score: 1
      It looks like what it does is similar, but not quite as useful, as what Bounds Checker (now called Dev Partner) does. This is debug code and a runtime instrumentation that is added to your code. It then checks the parameters of every single library call you make and ensures you pass good values. It can detect things like passing in a bad handle to a function and memory leaks...all good stuff at development time.

      This product looks less useful because it will not process it in regard to user input, and user input is the thing *most* likely to bring your system down.

      I would say it's worth running the check, but think of it not as a way to say your code is clean, but a way to say your code is not dirty.

      --
      All those moments will be lost in time, like tears in rain.
    10. Re:Rubbish... by Placido · · Score: 1

      >> thus eliminating the need for testing...

      Very good. You've just proved conclusively that you did not read the article. You'll fit in well here.

      --

      Pinky: "What are we going to do tomorrow night Brain?"
      Brain: "I would tell you Pinky but this 120 char limi
    11. Re:Rubbish... by telstar · · Score: 1

      Who needs shenanigins when you've got a busy beaver?

  14. Program crash == insecure ? by e_AltF4 · · Score: 0

    any program you can crash by feeding invalid data has a (possibly exploitable) security problem, so there hardly is any program not vulnerable.

    try to feed word or excel corrupted .doc or .xls files and see what happens, try to load corrupted images in photoshop or gimp.

    probably that's no problem if you don'r read files not produced by your own programs, are not connected to any network and are the only one to access your compuert :-)

    1. Re:Program crash == insecure ? by FrozenDownload · · Score: 1

      probably that's no problem if you don'r read files not produced by your own programs, are not connected to any network and are the only one to access your compuert :-)

      no problems? microsoft windows can take care of that, it can be your one stop shop for corrupted files.

    2. Re:Program crash == insecure ? by TheDredd · · Score: 1

      try to feed word or excel corrupted .doc or .xls files and see what happens, try to load corrupted images in photoshop or gimp.

      I guess that's just laziness on the programmers behalf, you should never assume the data you get fed is correct.

      BTW I checked with photoshop with some corrupted file, and photoshop warns me it is corrupt, and asks me if i want to proceed with opening it, no crashes though

  15. There are fundamental limits to this stuff by WolfWithoutAClause · · Score: 2, Interesting
    Ultimately whether a program has a security or other kind of bug in it; that's an equivalent level problem to Turing's halting problem, and we know that that is an NP complete problem.

    Which isn't to say that this product is useless, it's entirely possible to have useful approximations or rules of thumb for checking programs out. Heck, that's how people mostly do it, and automating what people do is fair enough.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
    1. Re:There are fundamental limits to this stuff by Anonymous Coward · · Score: 0

      Ultimately whether a program has a security or other kind of bug in it; that's an equivalent level problem to Turing's halting problem, and we know that that is an NP complete problem.

      No, it's an impossible problem. NP Complete problems just take a really long time to finish.

    2. Re:There are fundamental limits to this stuff by Anonymous Coward · · Score: 5, Insightful

      The halting problem isn't NP-complete (that would be bad but not that bad) but actually intractable -- it can be proved that you can't solve it at all, in general.

      Which indeed does not mean that you can't make interesting inroads using a suitable tool that calls your attention to problematic areas in code.

    3. Re:There are fundamental limits to this stuff by Anonymous Coward · · Score: 1, Informative

      The halting problem is not an NP complete problem.
      Imagine you have a haltingChecker program
      run it on
      CheckThis(){
      if(haltingChecker==True)
      LoopEndlessly
      else
      stop
      }

      NP complete is a completely differant ball game its basically problems that have so many choices that you cant search the entire space.

      Your right that the security problem above is in Turing territory, replace haltingChecker with securityChecker and loopEndlessly with ExecuteHole and you get the idea.

    4. Re:There are fundamental limits to this stuff by Anonymous Coward · · Score: 0

      Just so you know, solving the halting problem isn't in NP-C, it's entirely impossible.

      NP-C problems are ones isomorphous to the travelling salesman problem.

    5. Re:There are fundamental limits to this stuff by WolfWithoutAClause · · Score: 1
      You're right, it's undecidable, mea culpa.

      Still, I think it may well be possible to frame it as an NP-complete problem. If n is the length of the program the expected run time certainly goes up faster than polynomial.

      --

      -WolfWithoutAClause

      "Gravity is only a theory, not a fact!"
    6. Re:There are fundamental limits to this stuff by Lost+Race · · Score: 1
      Still, I think it may well be possible to frame it as an NP-complete problem.
      You should stop thinking that, because it's not true, and there are much better impossible things to daydream about.
  16. when it sound too good to be true, it is. by nietsch · · Score: 5, Insightful
    from the faq:

    Q: Does BugScan make it easy for hackers to develop new attacks?

    A: No. The information BugScan gives optimizes a small part of the exploit development process, but it still requires a very skilled person to do the additional work to produce a working exploit. That being said, BugScan is used in HBGary's exploit development process, and some customers are using BugScan for similar purposes.

    Q: Does BugScan determine if a security coding error creates an exploitable vulnerability?

    A: No. While we are working to enable this kind of functionality in the product in response to customer demand, it is a difficult to determine with any amount of certainty if a problem detected is truly exploitable.


    So actually you will end up with a report that cannot mention if you are safe or not, and no way to change the application if you think you are.

    Snake oil. Very good against any kind of bugs, esp security bug whatever those may be.
    --
    This space is intentionally staring blankly at you
    1. Re:when it sound too good to be true, it is. by wirelessbuzzers · · Score: 1

      Give it a rest. We are quite aware that perfect security checking is impossible, just like the halting problem. IT IS NOT POSSIBLE, EVEN IN THEORY, TO WRITE AN ALGORITHM WHICH TELLS WHETHER ANY GIVEN HOLE IS EXPLOITABLE. Even doing this effectively in a substantial minority of cases would be an amazing feat.

      However, perhaps the tool is still useful for bug checking. People still use IDSs and other similar security tools, even though they aren't perfect, and give both false positives and false negatives.

      --
      I hereby place the above post in the public domain.
  17. How exactly does this help open versus closed? by blowdart · · Score: 5, Interesting

    Lets look at the quote on the web page, shall we?

    "The alternatives are to laboriously test software or meticulously review source code line by line. But these options are so time consuming and expensive that few companies will do it." (emphasis added)

    So how exactly, as the article submitter says will this "help end the debate of closed source or open source applications being more or less secure"? The product page already says that few companies have the time or money to check source code, and how many others do? Sure, it's great to have the source, but when you install apache do you check every single line for buffer offerflows? Of course not. You rely on others doing it, and you rely on others doing it correctly. That may well be a mistake, are you sure someone else will check every revision line by line?

    So, frankly, this product contributes nothing to open or closed source arguements, it's simply a nice tool to automate some reviews.

    (as an aside, it appears that bugscaninc have made their choice over open and closed source,

    Server: Microsoft-IIS/5.0
    X-Powered-By: ASP.NET

    1. Re:How exactly does this help open versus closed? by Anonymous Coward · · Score: 0

      open source has millions (well maybe thousands) of eyes looking through code every day. with closed source it is up to a handful of developers (at most) to go back and review their source.

      it's power in numbers.

    2. Re:How exactly does this help open versus closed? by EvilTwinSkippy · · Score: 1
      Yellow journalism at its best.

      This is the sort of crap I'd expect from Fark. Right next to the article about the Dwark launched from a catapult.

      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
    3. Re:How exactly does this help open versus closed? by blowdart · · Score: 1
      But that's only true for the big projects, like apache or maybe mozilla. Even for middle sized projects I'd dispute the thousands. Maybe a couple of hundred, but even that is probably stretching it. Even then most of those coders are concentrating on their own area, be it error codes, how to open a socket, etc, and in all probability, 1-5 people are looking at that area of code (the Linux kernel is probably a prime example of this). There are very few people looking at how the complete product integrates.

      Simply because people can look and work at the code doesn't mean they will.

      This is, of course, a gut feeling rather than based on imperical evidence

    4. Re:How exactly does this help open versus closed? by krital · · Score: 1

      Amen to that. Neither closed nor open source software are inherently more secure -- you can have a terribly programmed open source program which is fifty times more buggy than any commercial program; the only difference here is that a buggy open source program can, possibly, be peer-reviewed and fixed. (Note that having a lazy/apathetic maintainer of the project can, and does, happen.) Although I'm a huge advocate of open-source software in terms of security, it's for the same reason that cryptographers publish their algorithms: peer review helps one not only find and fix flaws in one's program, thereby improving one's own skills, but also helps the peer reviewers by giving them experience with secure programming practice in the field.

      --
      -- K
  18. Does it really work by Dexter77 · · Score: 5, Insightful

    The webpage says "report is created for each program identifying the specific locations of potential security vulnerabilities"

    All programmers know that high level languages create very large binary files. A small program that prints few lines written in Visual Basic, might take hundreds of kilobytes space. Hundreds of kilobytes might mean even millions of lines of assembly code.

    Let's take an example. The bugscan reports that there are bugs on lines 24.234, 93.234, 134.834, 342.234, 534.444, 767.835 and 822.511 out of 1.023.890 lines. The BugScan might even report that those lines are from abcd.dll, efgh.dll, ijkl.dll and aaaa.dll. Do you now feel reliefed? No, I didn't think so either. I mean that BugScan might be very useful on low level languages, but when there are ten layers of different libraries between your code and the machine code, I bet the usefulness is not that high.

    1. Re:Does it really work by BenjyD · · Score: 3, Insightful

      Exactly what I thought. I imagine things like inlining and other compiler optimisations might confuse things further.

      From looking at the report generated on Trillian (in the whitepaper on the site), most of what it seems to do is check for bad function calls (sprintf etc). I'm not sure who their target market is - not developers, as they can use automatic auditing tools on the source which would tell them more useful information.

    2. Re:Does it really work by lokedhs · · Score: 2, Informative
      All programmers know that high level languages create very large binary files. A small program that prints few lines written in Visual Basic, might take hundreds of kilobytes space. Hundreds of kilobytes might mean even millions of lines of assembly code.
      Really?

      Most assembly language representations use one instruction per line.

      So, in order to get a million lines of code out of a 100 KB program, you'd need a CPU which has instructions less than one bit in size(!).

      There are other flaws in your reasoning, but the above example should be sufficient in proving that what you say should be taken with a little grain of salt.

    3. Re:Does it really work by Anonymous Coward · · Score: 0

      It seems that you haven't coded in assembly. I've seen a thousand line program that took only 50 bytes of space in a .COM file.

    4. Re:Does it really work by lokedhs · · Score: 1
      I've written a lot of assembly. Trust me.

      First of all, comments are no part of the "LOC".

      Explain to me again, how a 50 byte program becomes one thousand lines after disassembly. You're talking out of your arse.

    5. Re:Does it really work by FrozenDownload · · Score: 0

      Thats ok, because "42.7% of all statistics are made up on the spot, including mine."

    6. Re:Does it really work by lokedhs · · Score: 1
      All right. So one again show me a single example of a case where you have a piece of binary code, N bytes in size, which, after dissembly, becomes N+X where X>=1 lines of assembly code.

      I'll tell you what: It's impossible. And if it is, then I'm sure you will have no problem giving a single example.

      And remember: the ORIGINAL size of the source is irrelevant: We're talking about diassembled code here, since that is what the analyser is working on.

    7. Re:Does it really work by lokedhs · · Score: 1
      Of course it's possible to write a one million line of code routine which is never executed, which is then completely optimised away.

      But... It's competely irrelevant, since the code analyser works on the generated code and in this case the diassembly will end up being zero lines of code, or somehting very close to that.

      Before you try to look all cool and slashdotty, please reply to this post and give me a simple example. Should be easy, huh?

    8. Re:Does it really work by Anonymous Coward · · Score: 0

      That one guy already pointed out that linked libraries make the difference. If you use BugScan, it also has to browse through every library that is dynamically linked. So even though original exe was only 100,000kbytes, there might be few megabytes of dynamically linked dlls behind it.
      Wasn't that the whole point in the original message? High level languages use hundred of dynamically linked libraries and another hundred of statically linked ones.

    9. Re:Does it really work by lokedhs · · Score: 1
      Dynamically linked libraries do not add to the size of the binary, and they will not be part of the disassmbly.

      Unless of course you want to include the libraries in the check. But in this case the libraries themselves are a part of the code base that needs to be analysed.

      Remember that the only thing I objected to was:

      A small program that prints few lines written in Visual Basic, might take hundreds of kilobytes space. Hundreds of kilobytes might mean even millions of lines of assembly code.
      As for the libraries, their whitepaper (you did read it, didn't you?) says that it does have knowledge of the libraries so one would assume that it doesn't perform a full scan of the libraries. Unless, of course, you want that, but then again, it would have to be included in the byte count of the code base to be analysed.

      DISCLAIMER:

      My original post in this thread was written when I was in a personal state in which no one should post on public forums. This caused me to blow things out of propotion. I still claim I'm correct, but I really should have been more polite. I'm sorry about that.

      Secondly: Do not take me for a proponent of Bugscan. I think it might be a good idea, but only for the developers of a product as part of their test routines. Considering how easy it is to write a secure routine that will trigger their check, placing it in the hands of the end users might not have the desired effect.

    10. Re:Does it really work by BlackHawk-666 · · Score: 1
      The best I could manage was 50 lines:

      nop
      nop
      nop
      repeats 47 more times.

      --
      All those moments will be lost in time, like tears in rain.
    11. Re:Does it really work by Anonymous Coward · · Score: 0

      Then you must be right. Although it doesn't matter if its 100,000 locs or 1,000,000 locs, both are too much, if the original code was five lines.

    12. Re:Does it really work by BlackHawk-666 · · Score: 1
      *** EXAMPLE *** .CODE NOP *** /EXAMPLE ***

      Hehe, just fucking with you, but are we allowed to count all that crap at the top of the page. This is my crappy, and likely to run to ruination (no return statement), assembly program. 1 byte of code, two lines of assembler.

      You're right though, many assembler instructions take 2-3 bytes to represent IIRC and will distill to a single line of code using another 1-8 bytes (or more) for the data.

      --
      All those moments will be lost in time, like tears in rain.
    13. Re:Does it really work by lokedhs · · Score: 1

      Well that I agree with.

    14. Re:Does it really work by lokedhs · · Score: 1
      On the CPU's I've programmed on, a NOP takes from 1 byte (6802), to 4 bytes (SPARC).

      Your program would take 50 bytes on 6502, 100 bytes on M68K or 200 bytes on SPARC. All of these number are greater than or equal to the number of lines in the program.

      But I'm babbling... Most likely becuase I really have nothing else to do right now... I am perfectly aware of the fact that you probably argue that the series of NOP's will be optimised away. Assuming it is, your program will then end up zero bytes in size, and disassemble to zero lines of code. 0 is not greater than 0. :-)

      And now, I believe I have said everything that is to be said on this subject, so I'll try to stay away. Thanks for giving me something to do when I was bored. :-)

    15. Re:Does it really work by HidingMyName · · Score: 1
      Exactly what I thought. I imagine things like inlining and other compiler optimisations might confuse things further.
      I looked through the talk slides in pdf, and they discuss some of the approaches. I think the tool works, but it has some limits. From what I can tell, the tool disassembles a binary and identifies the basic blocks (the longest pieces of code that must run from start to finish, so they start on a labeled statement or after a branch/jump/call instruction and end before a labeled statement or branch/jump/call instruction), and establishes a control graph, indicating which basic blocks invoke which other basic blocks. Some types of known unsafe instructions can be identified, and the tool back tracks through the basic blocks looking to see how inputs are manipulated to these instructions, and what the triggers might be. Some graph analysis tricks are done, and they can back track up to 64 levels (I don't know if they mean instructions or basic blocks). This kind of tool sounds very useful to me. Consider the following scenarios:
      • Suppose you worked for a software customer has large exposure in the event of a security compromise (e.g. stock market/bank/medical data/social security numbers/military data). They want to limit their risk exposure. They can now check binaries for some known vulnerabilities before they are deployed and make detailed reports to their vendors. They may be able to cancel contracts with vendors who deliver code that is shown to be unsafe, or they may make passing these tests a precondition to acceptance, or they could work with the vendor and release detailed reports to them so they can fix the problems.
      • Imagine you are a software vendor, and you have the source code to your project. You can usually compile extra symbol table information in for debugging, so that you can map data and instruction locations back to source code.

        I do agree that source code analysis tools may be informative, but if you have cross language development or have to link to libraries that you don't have the source for, this sort of tool could be really helpful.

      On a side note, when I develop software, I find many bugs are actually in error handlers, since they are seldom executed and not heavily tested. Being able to analyze code that is not ordinarily executed is very useful.
  19. no... by Anonymous Coward · · Score: 4, Insightful

    "This product should help end the debate of closed source or open source applications being more or less secure"

    how so? who's to say *this* tool is an official measure of security? its *a* measure. and how would you actually do the comparison? that statement just doesn't make sense.

    1. Re:no... by realnowhereman · · Score: 1

      It doesn't matter, as long as it's consistent. The assumptions are 1) open and closed source are comprable 2) the ratio of bugs findable by bugscan : total bugs is the same for all programs. Given that these are true (not an entirely unreasonable assumption). Then even if bugscan only finds 1% of bugs in a program then when you run it on open source and find that there are 100 bugs per megabyte and on closed source and find that there are 200 bugs per megabyte then you have some evidence that open source is more secure.

      There does not need to be an official measure, a measure is sufficient.

      --
      Carpe Daemon
    2. Re:no... by William+Tanksley · · Score: 1

      The point is that closed-source security holes are harder to find by analysis. With this program, a certain class of them becomes equally easy.

      Thus, for this class of problem, closed source is at best no more secure than open source -- and open source is far easier to fix.

      (The submitter was envisioning black-hat crackers using this tool.)

      -Billy

  20. It doesn't by i_really_dont_care · · Score: 4, Insightful

    Looks like a lot of hot air.

    The PDF presentation tells us things that we know already (buffer overflow, race conditions, whatever).

    Two screenshots show debuggers and disassemblers. Another screenshot shows the "analysis results" of the "tool": "wsprintf: This function is insecure, use another function." Even this info is useless, because wsprintf is insecure only if it is used the wrong way, and I bet the "tool" doesn't check that. Besides, everyone uses std::string these days (or at least should do so).

    It's also worth to note that about every University in the world has one or more groups working on topics like "automatic code verification", "code path analysis" and other things. This stuff is nowhere rocket science, but there's a lot to happen until it will go usable by the mainstream of developers.

    1. Re:It doesn't by Zathrus · · Score: 2, Insightful

      Even this info is useless, because wsprintf is insecure only if it is used the wrong way

      Yes, but the point being that it's pretty damned easy to use it in the wrong way. More importantly, it's very likely that someone else will come behind you to patch the program and end up using it the wrong way. End result? Don't use wsprintf()... at the very least use wsnprintf() (or whatever the hell the equivalent of snprintf() is for wide character sets). I know, snprintf() isn't standard, but it's implemented on virtually every platform nowadays. And there's other ways to avoid using the insecure function anyway.

      Besides, everyone uses std::string these days

      Well, I do, but I write C++. Anyone writing C is going to have a helluva time using any of the STL! If you do write C, I highly recommend picking up and using a good string library. Look at vsftpd's for example -- they've been very careful to ensure no string buffer issues.

      There's still deadlocks, race conditions, and other security holes to worry about, but buffer overruns are by far the most common (and most easily exploitable).

    2. Re:It doesn't by i_really_dont_care · · Score: 1

      Even this info is useless, because wsprintf is insecure only if it is used the wrong way.

      Yes, but the point being that it's pretty damned easy to use it in the wrong way.


      Full ACK. But if the tool doesn't make a difference between legal and illegal use of wsprintf it is exactly as useful as grepping the linker symbols. In either case, no need to buy a product from "Bug Scan Inc.".

    3. Re:It doesn't by Anonymous Coward · · Score: 0
      everyone uses std::string these days

      Everyone who's lucky/lazy enough to be working in an environment where C++ and STL are supported, and dumb enough to actually use them instead of a real language or library. 90% of programmers have better things to do with their time.

    4. Re:It doesn't by Placido · · Score: 1

      Come on! You guys are still looking at this from a developer's viewpoint. What you're forgetting is that this could be an extremely valuable tool for businesses looking to implement a third party software.

      Put it this way: you have a choice between two firewalls. You put the binaries for each through this software and one report shows repeated use of classes with known vulnerabilities.

      Which vendor are you going to buy from?

      --

      Pinky: "What are we going to do tomorrow night Brain?"
      Brain: "I would tell you Pinky but this 120 char limi
    5. Re:It doesn't by timeOday · · Score: 1
      Put it this way: you have a choice between two firewalls. You put the binaries for each through this software and one report shows repeated use of classes with known vulnerabilities.

      Which vendor are you going to buy from?

      That's the problem; this tool isn't a good basis for making a decision like that. It can only detect a few of all the different possible problems there might be.

      The closest thing I've used to this new program is Purify. Let me pose this question: What does it mean for code to run "Purify clean?"

      Answer: It means whoever developed the code has access to Purify and worked on getting rid of the warnings one by one until there were none left. Does it mean the code is higher quality? Yes, it's probably at least a bit higher quality than it was beforehand. But does that mean it's higher quality than some other code which isn't Purify-clean? Not necessarily. Just as code that compiles without warnings is not necessarily better than code that compiles with some warnings. It's like a used car that has been through one of those "40-point inspections>" It doesn't guarantee years of trouble-free driving by any means.

    6. Re:It doesn't by Anonymous Coward · · Score: 0

      Before or after you already bought it?

  21. Humor impaired by SgtChaireBourne · · Score: 0
    I just put my boss's Windows 2003 Server CD under a microscope to examine the binaries.. Started zooming in.. and then SNAP. The bitch cracked into 2. I'll put gentoo on the server now and just tell him that a security cracker broke his shit.
    For the humor impaired, if you put anything thin and crunchable on an optical microscope's stage, say a CD like in the example above, the viewing objective mount will crush it if you keep zooming. There is usually a buffer spring to allow for a margin of error, but if you keep turning the coarse focus, something will crush...
    --
    Beta is broken and the link to classic doesn't work. Stop wasting our time or there won't be anybody left here.
  22. First things first by hummassa · · Score: 1

    The moderators, under influence, had this as interesting just before I went to post this.
    Seriously, put Debian on your server. You'll thank me many many times.

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
  23. This should find trivial bugs... by nacturation · · Score: 2, Interesting

    but complex ones? I imagine what this software does is it scans the binary for things like instances of strcpy calls instead of explicit strncpy calls. Given that the software is likely not executed, how would it be able to catch more complex bugs? How can it find all instances of user interaction which could modify a variable where that variable is used as a parameter in strncpy for example?

    Dollars to do[ugh]nuts says that even with a program that gets a clean bill of health, there are still countless bugs undiscovered.

    --
    Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    1. Re:This should find trivial bugs... by Anonymous Coward · · Score: 2, Interesting

      Check out valgrind sometime. Now expand on that context.

      For every byte in the application (code segment, data segment, stack segment, heap) keep a record with minimum, maximum, likely values etc. Do this for every assembler instruction. (heap will need special treatment). Now trace every possible execution flow, and check if any of the values lead to "strange" behavior.

      You can get to the point where you can do full dataflow analysis. You start with a variable that is initialized at some point, then another value is computed from that variable, so you can check all possible states in a (finite !) program, and you can check all those states for consistency. (you can easily check wether the stack has gotten smashed for example, you could define a set of things the application is "allowed" to do and check if anything violates that (eg writing outside of the home directory)). If you do this right, the scanner can give you the input for the program that will crash it (maybe it could even generate exploits directly).

      Of course, this probably requires a supercomputer for anything but a "hello world" program.

      Due to the halting problem it will have to say "I don't know" for some programs, but those are mostly academic (the program that doesn't stop in the proof of the halting problem is basically a program that checks wether there is a halting problem in the first place, and because it will never find an answer you have the halting problem)

      There will however be, a large number of programs it can give a "dirty bill of health" also, if the program does give a program a clean bill of health, the program is uncrasheable, keeps a clean stack in all situations, and it is utterly incapable of violating your security parameters.

    2. Re:This should find trivial bugs... by RdsArts · · Score: 1

      But this also glosses over the fact that it's finding simple bugs that have been known to be bad coding technique for years.

      It's amazing how many times, for example, the OpenBSD team will report they've found another buffer overrun in some program or another. It's 2003, why are we still allowing ourselves to code software that allows this to happen?

      The big news here isn't that it can probably only find simple bugs, but that it still does.

  24. Another doubt by archeopterix · · Score: 1

    Compressed executables, a la UPX.

  25. The Other Night by Anonymous Coward · · Score: 3, Funny

    A friend asked me to help her install an operating system on her brand spanking new PC. I have installed many operating systems - Debian, Slackware, Mandrake and Red Hat among them - and thought I knew a bit about the process. Boy was I in for a surprise!

    The OS she wanted me to install was Windows XP Home Edition. I have never bothered with Microsoft software in the past, not since Bill Gates got all pissy-arsey about people making copies of "his" BASIC interpreter at the Homebrew Computer Club. Grow up guys! You liken your ideas to your babies, but babies eventually grow up, leave home and learn to survive without you! Well, Gates was basically saying that if people didn't pay for their software, programmers would go out of business because nobody would want to create software unless they got paid for it. Right ..... 'cause that's exactly what Richard Stallman and Linus Torvalds got famous for doing!

    So I have never bothered with MS stuff, never having felt the need. But I figured, it could not be too difficult to install it, could it?

    Windows XP comes on just one CD. First installation attempt sort of worked, but it was a bit flakey and it was a bit slow. And the desktop is just downright annoying - both in terms of colour sceme and general UI. It's a bit like KDE, but not quite. Only one desktop, for crying out loud! And it's slow and crash-prone. Just like Mandrake where you get a really bloaty stock kernel {drivers for god knows what compiled into it just in case anybody ever needs them}. So I figured, first thing we should do was maybe recompile the kernel. Never recompiled a kernel in Windows, never even run the damn thing. Never even likely to now.

    Could we find the Kernel Configurator? Could we hell! And the command prompt was useless. It seems to be based on the old DOS command line. And it doesn't understand make menuconfig.

    The kernel configurator was not the only thing we could not find. There didn't seem to be any Packages either. You know, stuff like KWord, KSpread and Kate. MySQL, Apache and a scripting language like PHP, Perl or Python. And some simple games. Just the basics. There is something called Internet Explorer, which is a bit like a cut-down Konqueror, but it's nasty to use.

    So I'm guessing that the missing configurator probably is part of a Kernel Source Devel package which is not installed by default. In fact, almost no packages seem to be installed by default. And there are no .rpm, .deb or .tar.gz files on the CD. I've analysed it thoroughly and I found no sign.


    In the end, I installed Slackware 9 and configured it to look as much like the Live CD as I could manage, but obviously not running everything as root. I can only suppose those missing packages are on another CD which we weren't sent for some reason or another. I mean, she has paid good money for the software, so she is entitled to get it! And the source code. Especially the source code! After all, if we can't check out that source, we have no way to be sure what we're running. It could be sending every keystroke to Microsoft, for all we know!

    Anyway, my friend is well chuffed with Slack so I suggested to take the XP CD back to the shop and get a refund. But of course, that might be difficult seeing as she doesn't seem to have the full set. We'll keep you posted as this story develops.

  26. Open Source rules by gonvaled · · Score: 3, Insightful

    Security problems are often inteoperation issues. You can make sure a program is bug free, but this will not guarantee that your program is not going to fail if the rest of the pieces are not functionning properly. To analyze the interconnections, Open Source is required.

    1. Re:Open Source rules by JDBrechtel · · Score: 1

      To analyze the interconnections good documentation of the protocols is required. Granted Closed Source can be lacking in this department, but so can Open Source...for different reasons however.

    2. Re:Open Source rules by gonvaled · · Score: 1

      There is a difference between what a program does and what the documentation says the program does. This mismatch can be intentional or a mistake. The only way to know it is to have access to the source code. The "black box" approach can be enough to test functionality, but is not enough for stress test.

  27. As long as there is C... by Temporal · · Score: 4, Interesting

    What does this have to do with open source vs. closed? Sure, in theory, every single person who downloads an open source program will review the code themselves to make sure there are no buffer overruns. If they find any, they will of course report them back to the maintainer, who will then fix the bug.

    In practice, this doesn't really happen.

    As an open source developer, I can assure you that very few people are interested in reviewing other people's code for free. I'm sure the bigger projects, like Apache and Linux, manage to get a good amount of code review -- but then, big closed source projects usually do ample code review, too. As for little open source projects, like the ones I run, you're lucky if people even take a peek at the source. Really, no one is interested. I do not believe that open source projects are any more (or any less) likely to have security issues than typical closed source ones (Microsoft aside).

    As long as people are using C, there will always be buffer overruns. C is just that kind of language -- it makes it so amazingly difficult to do simple things (like allocate space for a character string) that programmers naturally take shortcuts (giving the string a static length) without taking the proper precautions (bounds checking). We can't make programmers not be lazy, so the only real solution is to move on to a better language.

    1. Re:As long as there is C... by mcrbids · · Score: 1

      What does this have to do with open source vs. closed? Sure, in theory, every single person who downloads an open source program will review the code themselves to make sure there are no buffer overruns. If they find any, they will of course report them back to the maintainer, who will then fix the bug.

      In practice, this doesn't really happen.


      But it's not required to happen for OSS to work. Somebody who "downloads and installs and that's it" factors in as a zero into the matrix of development efforts.

      The point of OSS is that *more* people actually *do* look at the source than with a closed environment, not that *everybody* does.

      Additionally, with OSS, developers are more likely to be careful because they know that at any time somebody could check out "their stuff".

      But people who, (like anybody, most of the time) simply d/l, compile, install, and use said application really don't matter for the developers.

      As long as people are using C, there will always be buffer overruns.

      C is the "old" high-level language. Remember Assembler? Now we're talking HIGH level languages like c#, PHP, perl, and Java. These really don't compare directly with C, other than the fact that they "get the job done".

      A tight, clean assembler program will kill the performance of any C or Java program. But it will take forever to build and will be tied to the hardware.

      C is an abstraction of assembler, PHP/Perl/Java is a further abstraction based on C.

      It won't be long (10 years?) before we move to a another level of "high level languages".

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
    2. Re:As long as there is C... by Anonymous Coward · · Score: 0

      "it makes it so amazingly difficult to do simple things (like allocate space for a character string)"

      You're not a programmer, are you?

      char* foo = (char*) malloc(15);
      if (foo == NULL)
      {
      fprintf(stderr, "Out of memory\n");
      exit(EXIT_FAILURE);
      }

      That's hardly hard

    3. Re:As long as there is C... by Temporal · · Score: 1
      *sigh* I'm trying to talk about the real world here.

      A string concatination in C:
      char* a = "Hello ";
      char* b = "World!";

      char* c = malloc(strlen(a) + strlen(b) + 1);
      memcpy(c, a, strlen(a));
      memcpy(c + strlen(a), b, strlen(b));
      c[strlen(a) + strlen(b)] = '\0';
      A string concatination in most other languages:
      String a = "Hello ";
      String b = "World!";

      String c = a + b;
      Anyway, if you're trying to tell me that C programmers never use static-sized strings when it's not safe to do so... then I assert that you aren't really a programmer.
    4. Re:As long as there is C... by Temporal · · Score: 1

      The point of OSS is that *more* people actually *do* look at the source than with a closed environment, not that *everybody* does.

      That is NOT TRUE. That's exactly my point. Most software companies do code reviews, regression testing, etc. Most open source projects are something whipped up by one or two guys in their spare time. The only testing usually done is actual usage testing, and it's not normally very extensive. Most open source programs are NOT reviewed by anyone other than author. Again, some of the big-name projects might be exceptions, but big-name commercial products also undergo more testing.

      There's just no reason to say that one method or the other results in fewer bugs.

    5. Re:As long as there is C... by Temporal · · Score: 1
      And some other points... (why do I bother?)

      Let's say you have a function which takes a string as a parameter and copies it into a global variable. Here's the "correct" C:
      char* global = NULL;

      void function(char* str)
      {
      if(global == NULL)
      {
      global = malloc(strlen(str) + 1);
      if(global == NULL)
      {
      fprintf(stderr, "Out of memory\n");
      exit(EXIT_FAILURE);
      }
      }

      strcpy(global, str);
      }
      That's a pain to type all the time. Thus, C programmers will usually be lazy and do this instead:
      char global[50]; /* should be big enough */

      void function(char* str)
      {
      strcpy(global, str);
      }
      Ahh, much easier, right? But, woops, that code has a security flaw!

      In other languages (C++ or Java or whatever) the correct code would look like this:
      String global;

      void function(String str)
      {
      global = str;
      }
      No security flaws here. Also, note that the memory check is unnecessary since C++ and Java throw exceptions when they run out of memory.

      I think I've proven my point now.
    6. Re:As long as there is C... by Anonymous Coward · · Score: 0

      You're making it complicated just to prove your point

      char* a = "Hello ";
      char* b = "World!";

      char* c = malloc(strlen(a) + strlen(b) + 1);
      strcpy(a, c);
      strcat(b, c);

    7. Re:As long as there is C... by binaryDigit · · Score: 1

      No security flaws here. Also, note that the memory check is unnecessary since C++ and Java throw exceptions when they run out of memory

      Wrong, at least for C++. If you look at most implementations of String, you'll see that they either internally use strcpy or use memcpy with the length being stored in the String structure. I've seen MANY bugs where the String itself is corrupt (usually because it was freed/never allocated) so when the assignment occurs, bam, it blows up (if you're lucky, if you're not, then it doesn't blow up, not alerting you to the problem until it shows up on bugtraq). So don't be fooled into thinking that just because YOU didn't have to write the code, that deep down inside, SOMEONE did, and that their code is perfect.

    8. Re:As long as there is C... by ajs318 · · Score: 1
      Actually, the caconical operator for joining strings is the full stop / decimal point / dot (.) + is used for addition, which is not the same thing.

      If you have, say,
      $mins = "30";
      $step = "5";
      $mins = $mins + $step;
      You probably want the new value of $mins to be "35", not "305".

      If a language was smart enough to be able to tell a string from a number without prompting, yet stupid enough to use the same operator for concatenating strings and adding numbers, you might find that "2" + "2" == "22" ! That probably isn't what you want. {Javascript is so afflicted, and I often find myself having to subtract negative numbers instead of adding. If I remember rightly, VAX/VMS could actually subtract strings, and it did use the + and - operators for strings. Gick.}

      And, while your C string concatenation looks complicated, there's nothing to stop you putting it into a function - arguably, that's the whole point of C - and #including it whether or not you actually need it ..... compilers these days are smart enough not to put in the code for a function if there isn't actually a call to it in the source. But back in the days, when it was safe to assume stupid machines and smart humans, every byte you could save was important.
      --
      Je fume. Tu fumes. Nous fûmes!
    9. Re:As long as there is C... by Temporal · · Score: 1

      Sorry, I'm not used to the old C commands. It's still a lot more code, though, when you have to do lots of those operations. And, of course, we're ignoring the problems of checking if malloc returns NULL or who frees the string when it's no longer needed (things which are handled automatically in many other languages).

    10. Re:As long as there is C... by Temporal · · Score: 1

      Of course the library could have bugs. We're assuming here that it doesn't. The C stardard library could have bugs, too. What's your point?

      Besides, I wrote my own String class, reviewed it, and exensively tested it. I do not believe it has any such vulnerabilities.

    11. Re:As long as there is C... by binaryDigit · · Score: 1

      Of course the library could have bugs. We're assuming here that it doesn't. The C stardard library could have bugs, too. What's your point?

      My point is that it DOES exhibit these problems, you can't assume that it doesn't because the nature of the beast is that it CAN'T. Example:

      class foo {
      public:
      void bar();
      char *pch;
      };

      void fn() {
      foo *f;
      f->bar();
      }

      So you created a pointer to foo, but never allocated it. You then call a method of foo, if bar tried to access pch, that would be an error. It can't check to see if pch is null, since it might not be (since *f could be pointing anywhere, but the method call WILL work). Your only recourse is to track that your object was truely initialized in the constructor, but NOBODY does that. How does YOUR string class handle that situation? Maybe you're lucky and all your methods are virtual, making the above scenerio more likely to crash, unless of course *f happens to be left pointing at a previous foo (which can be the case if the method is being called say in a loop). Btw, I know that in this trivial example that the compiler will warn you about using f before it's initialized, but in a more complex case where you can have pointers being freed, esp in multithreaded code, things like this crop up all the time and are not easy to catch.

      Anyway, my point was never that C was perfect (I don't know how you assumed that since I never made any statement about the superiority of C). It's that while many of these types of exploits are created by "lazy" programmers, that many still are created simply because A) the realities are that the amount of effort required to make our code TRUELY free of these types of vulnerabilities is not practical or B) we make assumptions about the correctness of others code, which are the wrong assumptions to make.

    12. Re:As long as there is C... by Temporal · · Score: 1
      I don't use pointers to Strings. I pass them by value. The copy constructor takes care of memory management (including reference counting), and I know that the copy constructor is implemented correctly.
      String global;

      void function(String str)
      {
      global = str;
      }
      You say that there is a security problem in this code. I do not see one. If someone passes in an invalid String somehow, that's not a problem in THIS code, it's a problem in THEIR code.

      I am certainly not saying that C++ is immune to memory problems. I was specifically talking about common string buffering issues in C. This is a common problem in C because C doesn't have very good string management methods. All I was saying is that it is a lot easier to avoid these problems in C++ since you can use something like a String class to manage memory for you. Or, in other languages, there's usually a built-in string type which has the same effect. As a result, buffer overruns when dealing with strings are much less common in these languages, if they are even possible at all.

      Some other languages also prevent other forms of memory bugs (like dangling pointers and whatnot), but I am well aware that C++ does not. (Although, I use reference-counted smart pointers a lot in C++, which eliminates most problems.)
    13. Re:As long as there is C... by IM6100 · · Score: 1

      Uncle Raymond has some Kool-aide that you've simply got to try. Here, have a big swig of it!

      --
      A Good Intro to NetBS
    14. Re:As long as there is C... by Anonymous Coward · · Score: 0
      char global[50]; /* should be big enough */

      void function(char* str)
      {
      strcpy(global, str);
      }


      No, either that will be something huge, like 1024, instead of 50 (not good enough anyway), or they'll use strncpy and forget that it doesn't guarantee that the string is nul terminated.

      The C standard library functions for strings are pretty much all brain dead.

      One thing tho, the static buffer is going to be a lot faster than the dynamic version. Not noticibly faster these days (esp. if there's only one), but still.
    15. Re:As long as there is C... by hike2 · · Score: 1
      Am I the only one here that thinks C does not have a problem and the only reason you have all these leaks and problems is because the so called C programmers can't really program in C?

      If I remember correctly one of the strenghts of the C language is precisely that lack of enforcement in that area. It means you can effectively program drivers and such. I am not even mentioning the fact that it probably is the closest you can get to the machine except assembly language ...

      So yeah, as long as there will be lousy C programmers ...

      --
      Fourty-two!
  28. Reverse Engineering Laws by aking137 · · Score: 3, Interesting

    I realise that this particular software may not actually decompile or disassemble anything, but this presents a very good reason for making reverse engineering of any software legal in any country: if I'm not allowed to make my own private analysis of a piece of proprietary software out there, how am I to know what it's going to do to my computer? How can I know that it isn't going to take liberties and do damage (such as installing backdoors) on my systems?

    To be fair, many software packages I see for Windows machines these days do take advantage of this fact, such as by giving users adverts, invading their privacy, and withholding information to them about what their computer is doing. (One example is Freeserve, a UK ISP: some of their dialling software refuses to tell you what numbers your computer is dialling out to. This can be got round, but it's the principle of the thing...). For the past few years, I've refused to run any software on my desktop machine where source code is not made available, for that reason. If they are prepared to reveal to me what they're going to do to my computer, then I'm not prepared to run their software.

    Here's another question: if I have a copy of this software on a machine in a country where reverse engineering is allowed, but then I shell in to that machine (via ssh, vnc, or some other means which will allow me to control that machine remotely) from a country where reverse engineering is not allowed, and then carry out the reverse engineering over that link, is that illegal?

    1. Re:Reverse Engineering Laws by aking137 · · Score: 1

      Should have said: if they aren't prepared to reveal to me what they're going to do to my computer, then I'm not prepared to run their software, of course.

  29. Run it on itself by arcanumas · · Score: 2, Funny
    Can you image running it on itself?

    # bugscan bugscan
    Segmentation Fault

    Hehe

    --
    Slashdot Sig. version 0.1alpha. Use at your own risk.
  30. Article? by Karamchand · · Score: 1

    Uhm well. Nice yea. But where's the article?

  31. Encrypted/protected binaries by RenHoek · · Score: 2, Insightful

    Does anybody have any idea how many binaries are protected nowadays, wich encryption, obfuscation and/or compression?

    If a program uses any kind of serial entry, CD check or other kind of 'protection' scheme, you can be sure the makes have run an obfuscation program like 'PEcrypt' on it.

    Even then, I don't see this program unpacking unprotected executables that have been packed with UPX or one of the other dozens of PE compressors.

    Simply put, this program will have VERY limited uses for normal consumers. The only one who could use it would be the firm who made the program in the first place, before obfuscation/protection/compression, but why would they? They have the source code. A source-code checking program would be MUCH more effective.

  32. strings -a [binary file] | egrep 'gets|scanf' by Anonymous Coward · · Score: 0

    That's a good start.

  33. Too many false positives by jcochran · · Score: 3, Interesting

    I suspect that this product will flag a lot of false positives. After reading the white paper, I believe that the following code would be considered "insecure."

    #include <stdlib.h>
    #include <string.h>

    char *duplicate(const char *input)
    {
    size_t len;
    char *out;

    out = NULL;
    if (input != NULL) {
    len = strlen(input);
    out = malloc(len + 1);
    if (out != NULL) {
    strcpy(out, input);
    }
    }
    return out;
    }

    Note the use of the "evil" function strcpy().

    1. Re:Too many false positives by anshil · · Score: 1

      On GNUish systems just call strdup() ;o)

      --

      --
      Karma 50, and all I got was this lousy T-Shirt.
    2. Re:Too many false positives by Anonymous Coward · · Score: 0

      What if you were using threads and between

      len = strlen(input);

      and

      strcpy(out, input);

      input was realloc()'d ?

    3. Re:Too many false positives by Anonymous Coward · · Score: 0

      It is insecure. By passing an input that doesn't have a NULL in it, strlen will go until it finds one somewhere. len will be huge, and malloc will allocate a huge space. A malicious attacker could execute a DOS attack that eats up all the computer's memory.

    4. Re:Too many false positives by Anonymous Coward · · Score: 0

      You don't know from what point the function will get called so your accusations is baseless. The length of the input may be limited in the calling function.

      Besides, if a program let's a local user eat up all the memory (i.e. execute a DOS attack) I wouldn't consider it buggy. Its not a programs job to set limits on the amount of memory it will take up when used locally. Admins can set ulimit if they want.

      OTOH servers with untrusted clients must guard against unlimited length input.

    5. Re:Too many false positives by anshil · · Score: 1

      that argument is absolutly stupid. Sorry.

      --

      --
      Karma 50, and all I got was this lousy T-Shirt.
    6. Re:Too many false positives by Anonymous Coward · · Score: 0

      Better a DOS than a buffer overflow.

    7. Re:Too many false positives by jspraul · · Score: 1

      isn't this a problem should the size overflow? (len == -1)

  34. Found a huge hole in an executable once myself by LordDartan · · Score: 5, Interesting

    Once before, while working at a client site, I was installing a 3rd party application. Well, in setting it up and looking for any security holes, I found a pretty large one. Apparently, the client application talks to a MSSQL server using a single account (which happens to have dbo access). Not only did it use a single account for everyone, but the username and password were stored as cleartext in the executable itself! Now granted, not likely that an end user would look there to find this information, but if someone did, and the client did happen to know someone breached the security, the only way to block the intrusion was to shut down the entire system. With the username and password hard coded into the executable, there was no way to change it witout having the vendor make the change and send out a new executable.

    Just goes to prove that MS programmers are a dime a dozen, but most of them are worth that too!

    1. Re:Found a huge hole in an executable once myself by Spiked_Three · · Score: 1

      And the difference between this and every executable running against an open source database is ... ?? WHat you meant to say was;
      Just goes to prove that programmers are a dime a dozen, but most of them are worth that too!
      In fact I can use Kerberos security with MSSQL by coding "security=integrated" on the connection - care to explain how to accomplish the same thing with an (pick your favorite) open source DB?

      --
      slashdot troll = you make a compelling argument I do not like the implications of.
    2. Re:Found a huge hole in an executable once myself by LordDartan · · Score: 1

      What I'm saying is, it's bad design to put the one and only username and password into the executable as plaintext.

      And you're right about the integrated security, it works quite nicely with MSSQL. Granted, there are ways to get usernames and passwords from NT/2000, but that's much more secure than putting the dbo username and password out there for everyone to see.

    3. Re:Found a huge hole in an executable once myself by Spiked_Three · · Score: 1

      OK, I'll agree that its a bad idea to put a userid/password in plain text for any exe or script, database or other, windows or other. But I was refering to your comment about why you believe this is unique to Microsoft programmers and lessens their value.
      I'm still interested in how you can accomplish db connections without clear text userids and passwords on any open source database. I'm working on a project and have yet to see any way to be secure if I use an open source database. It seems a bit unfair to trash MS programmers when their solution is so simple to implement.

      --
      slashdot troll = you make a compelling argument I do not like the implications of.
    4. Re:Found a huge hole in an executable once myself by JDBrechtel · · Score: 1

      No, you also were taking a potshot at MS programmers because of a mistake made by one person which can easily be made by a programmer who works on open source products.

      Anyhow, calling someone an "open source" or "MS" programmer is stupid anyways. Unless you're doing contract work exclusively (and not always then even) you don't get to decide what you're going to program against. Not when you have bills to pay anyhow.

    5. Re:Found a huge hole in an executable once myself by Spiked_Three · · Score: 0

      Do the moderators and meta-moderators simply check to see if an article bashes Microsoft? Is that all you need to do to get moderated up? Can't you automate it then? Why have people read?

      --
      slashdot troll = you make a compelling argument I do not like the implications of.
    6. Re:Found a huge hole in an executable once myself by LordDartan · · Score: 1

      Oh, I'm not saying it's unique to MS programmers at all. It's just been my professional experience (my job is almost totally MS programming, only do linux programming on my own on the side) that there are a lot of programmers that have no idea what they're doing. And since most of my professional experience in programming is with MS software, hence the comment.

      There are good and bad programmers wherever you go, I just happen to run into most of the bad ones.

      As for your question about programming with open source databases, that's probably best left for someone to answer who has experience with that. As much as I'd like to program more with open source, I don't have much time to do so, or much experience with.

    7. Re:Found a huge hole in an executable once myself by LordDartan · · Score: 1

      You're right, after reading my comment again that does sound like a pot shot at MS programmers. For that I appologize.

      Sometimes my fingers just type faster than my brain can keep up with!

    8. Re:Found a huge hole in an executable once myself by Spiked_Three · · Score: 1

      Exactly! In fact, I normally do Windows programming. But times are hard and I've had to do some BSD and Linux stuff. I think I'll go add a few security holes just to keep things evened up a bit.

      --
      slashdot troll = you make a compelling argument I do not like the implications of.
    9. Re:Found a huge hole in an executable once myself by JDBrechtel · · Score: 1

      Apology accepted. It's easy to get caught up in the anti-ms tornado here at /..

      =)

  35. Scam by roady · · Score: 5, Interesting
    Reverse Engineer Halvar Flake called BugScan a scam at his BlackHat Amsterdam course.

    It is just a bunch of simple IDA pro plugins and it will give you a false sense of security.

    Halvar has published is own open source version called BugScam on sourceforge

    1. Re:Scam by Anonymous Coward · · Score: 0

      Among the posters, Roady is the only one who knows the subject and provided very insightful information.

    2. Re:Scam by Anonymous Coward · · Score: 0

      This post was very useful and added to the
      subject ! Thanks Roady !

  36. Decrypt or decompress them by Anonymous Coward · · Score: 0

    If you can't decrypt or decompress them, you can't run them anyway.

    1. Re:Decrypt or decompress them by RenHoek · · Score: 1
      If you can't decrypt or decompress them, you can't run them anyway.

      That's not how it works. Encrypted/compressed data is unpacked in-memory, usually in a way so that it's really hard to get to the data unpacked/decrypted data. Meaning that the .EXE file on your harddisk is almost impossible to decrypt by hand.
  37. Oh boy... by compacflt · · Score: 1

    " He showed the analysis of several commercial products, the results of which were shockingly insecure"

    Where will this end, if even their results are insecure? Can they be trusted?

  38. Re:Uh oh - offtopic I know but by panurge · · Score: 1

    Reminds me of my first microscopy class at U. The Zeiss phase-contrast oil-immersion scopes cost the equivalent of over $20000 at today's prices and they gave them to 18 and 19 year olds (almost all male) to use. The only things that ever got broken were the 2c cover glasses. It made me appreciate German engineering.

    --
    Panurge has posted for the last time. Thanks for the positive moderations.
  39. "Amazingly hard"? by Anonymous Coward · · Score: 0
    How "hard" is malloc()/calloc()? Or even strdup()? And if you don't want to bother with freeing the pointer and the string is only local to the function creating it, you can use alloca().

    Why do I get the feeling that when you watch TV you pass out because your brain becomes overworked and forgets to breathe?

    1. Re:"Amazingly hard"? by Temporal · · Score: 1

      It's a whole lot harder then using a simple String class in C++ or Java -- especially when you have to do hundreds of these operations.

      By "amazingly hard", I didn't mean that it's that difficult, but that it's much more difficult than it should be.

  40. won't work well on optimised code by Anonymous Coward · · Score: 0

    1: Any halfway decent optimising compiler will inline things like strcpy() so it won't see them.
    2: If its not an external call to the OS and the binary shipped stripped of debug symbols how can it even tell what function gets called?

    So its going to raise flags on badly optimised code and its going to spot some problems if developers bother to use it on debug builds. On random binaries it will fail and give a false sense of security.

  41. operation by *weasel · · Score: 2, Insightful

    they can't even likely tell what code is going to execute, so that severely restricts their options.

    odds are they are just scanning for loops that copy until they find a null at the end of a string. (searching for resulting patterns from compiled strcpy as opposed to strncpy).

    as most exploits are buffer overflows, this would theoretically catch all of them. it would also catch all sorts of potential buffer overflows that would never be possible given the level of user input (since it's not running the code, or disassembling, it can't know).

    but this is why i made my own string object wrapper that stores the bound of a string (and a regexp to define allowed chars) - and then overload the cpy functions to prevent a string from ever copying a single byte more to itself than it should, and always makes sure it's nicely null terminated. but that's just responsible coding.

    and it's easy enough to get a compiled binary from .Net

    there's an option to 'finalize' .Net code on installation if you like. then the binary on the client machine is native code, compiled down to machine language on install (instead of execution), and optimized for their particular system (processor optimizations, api optimizations, etc).

    --
    // "Can't clowns and pirates just -try- to get along?"
    1. Re:operation by hankaholic · · Score: 1
      I'd imagine there's a lot of "didn't check return value of such-and-such function call" as well.

      Checking return values is something that a lot of people tend to leave out, and something that C doesn't have a way of doing that "feels" natural.

      Perl's simplistic:
      dostuff($param) or die("Couldn't do stuff!");
      ...is nice, because it leaves the most important part at the beginning of the line, and it's immediately obvious what's important. I'm reminded of how Spanish (and many other languages, I'd wager) tends to put adjectives after nouns ("salsa verde" instead of "green salsa").

      Exceptions would be nice, but even in C++ use of exceptions is quite expensive. I'm not a Java fan in general, but Java's you-MUST-handle-any-possible-exception is nice. It provides a way of handling important errors without cluttering up the code too much. It would be nice if the language explicitly complained if you didn't handle OutOfMemYouClod after calling malloc(), or YouCannotOpenThatFile after calling open().

      Programmers are lazy, and as much as I'm for languages which stay out of your face, something which works to limit the extent to which coders can be lazy when it matters would be a big help.

      Perhaps a compiler flag, such as -Wunhandled-exceptions would be an ideal solution (again, assuming an efficient exception mechanism were designed into the language) -- warn the condition, and let those who truly know better do their own thing.

      Walter Bright's D language is looking more and more intriguing. It's designed from the perspective of an experienced compiler writer, and cuts out much of the vagueness of C++ while providing many of the features.

      The front-end is released under the GPL. It should be possible to tie the front-end together with GCC's back-end, but nobody with the necessary time and skill to do so has yet done it.
      --
      Somebody get that guy an ambulance!
    2. Re:operation by wirelessbuzzers · · Score: 2, Informative

      Not checking the results of malloc() isn't the worst thing you can do. If malloc returns EBUYMOREMEMORY, usually the worst you can do is segfault. That sort of thing is in the "bugs" category, and is not usually exploitable except for DoS attacks.

      The nastier bugs are generally buffer overflows, not authenticating data, and interpolating passed strings into commands without escaping them. Occasionally you see other exploitable bugs (bad user authentication, man in the middle or eavesdropping, etc), but these must be at least 95% of the easily exploitable ones.

      --
      I hereby place the above post in the public domain.
    3. Re:operation by jandrese · · Score: 1

      Interestingly enough, checking the return value of malloc is useless on most platforms anyway. Most platforms overcommit the memory, and you won't know if you're out of memory until you try to access that block you just created (at which point something on the system is going to die to make room for the memory you just requested, possibly even you.).

      --

      I read the internet for the articles.
  42. Limits to any technological solution by heironymouscoward · · Score: 1

    1. Many false positives, as apparently insecure constructs are totally secure given knowledge the programmer has about the source of inputs. E.g. a static buffer may appear prone to overflows, but maybe it's copying data with a known fixed size.

    2. Many missing positives that depend on external factors: security settings, file visibility, encoding algorithms, etc.

    My guess is that the false positive issue will make the approach unusable for any real software. If the developers can fine-tune that, the tool may be a good way of eliminating the most common kinds of security flaws in software today. But IMO crackers will simply find more subtle ways through the maze.

    The key to software security may be good programming practice on the one hand, but that has to go hand in hand with simplicity and the elimination of unnecessary features, and transparency, so that security problems can be found by inspection and usage.

    --
    Ceci n'est pas une signature
    1. Re:Limits to any technological solution by vidarh · · Score: 1
      1. Many false positives, as apparently insecure constructs are totally secure given knowledge the programmer has about the source of inputs. E.g. a static buffer may appear prone to overflows, but maybe it's copying data with a known fixed size.

      If the data is part of the executable, it will be available to a good static analyser, and there's no reason there should be a false positive. If the data is not part of the executable, the programmer may think he "knows" that it is secure as much as he wants, he'd still be WRONG, unless the properties he relies on are being verified in some other part of the code, in which case it a good statical analyzer would still have plenty of opportunity to prevent false positives.

      Making assumptions about data, even data that is actually part of the executable, makes the code less secure. An adversary could possibly have found a way to modify even part of the executable itself, so using "apparently insecure" constructs might still be a security risk even in the face of formal proof that the program is "safe" (for some definition of safe) if the executable remains unmodified.

      It's all a matter of how secure you need your application to be. Do you simply need to prevent buffer overflow and filesystem race conditions, or does your system need the kind of security that require you to overwrite certain variables immediately after you're done with them to reduce the chance of accidental or intentional data leaks, check inputs to ALL functions even when you "know" the inputs, etc?

      Most often you don't need to care that much. Sometimes you do.

      I agree with you that you need a way of tuning what will trigger an error report, but not because there will be that many false positives, but because there may be a lot of reports that is irellevant for your application - it would be ridiculous to assume that a developer would spend as much time and effort on securing a recipe database and a credit card clearing system, for instance.

  43. Wow Thanks! by attaboy · · Score: 2, Informative

    From the PDF:

    Use this logon to scan any binary free for blackhat attendees for the next 60 days...

    http://www.hbgary.com/freeblackhat/

    Now the people who sound like they know what they're talking about can actually try it out and prove it ;-)

    --
    The facts have a liberal bias. --The Daily Show
  44. strncpy, a green alert? by vincentlab · · Score: 2, Insightful

    that sounds misleading. the white paper states that "for example, using strncpy " is a good security practice"

    even though strncpy and strncat are actually used incorrectly MUCH MORE OFTEN than strcpy.

    Let me explain. People that use strcpy tend to use malloc()ed memory because they
    know how it works, and that they have to supply a certain size before they copy in it.

    However, almost nobody knows how strncpy works. (as for strncat, i don't recall seeing it correctly used)

    i wouldn't call that "safe", i see most strncpy uses as "oh well there's probably an off-by-one there". (i'm not pushing for strcpy() use, it's horrible, i'm pushing for strlcpy() use, with which you know you understand the API, and you can detect truncation easily. google for the paper, and the stupid gnulibc objections)

    1. Re:strncpy, a green alert? by Mryll · · Score: 2, Interesting

      I prefer to initialize the first character of the destination buffer to '\0' and use strncat. Less paranoia about the ultimate null termination...

    2. Re:strncpy, a green alert? by vincentlab · · Score: 1

      and you think you understand strncat?

      i hope you reread the manpage and its implementation before going to bed, or you're probably just sticking your finger in your eye. real deep.

    3. Re:strncpy, a green alert? by Mryll · · Score: 1

      We discussed this in-depth on comp.lang.c about a year ago. Please don't insult randomly.

  45. And... I'm an idiot... by attaboy · · Score: 1

    The PDF is from a 2002 conference and the link is thus months out of date and no longer allowing a free trial. ;-(

    --
    The facts have a liberal bias. --The Daily Show
  46. Oh really? by smittyoneeach · · Score: 1
    This product should help end the debate of closed source or open source applications being more or less secure.

    The feet of man who uses hypotheticals may no longer be aground.

    Never argue with a drunkard, a woman, or a fool.

    Proof by analogy is fraud.

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  47. And what's inside 'class String'? by Anonymous Coward · · Score: 0

    Somewhere inside there is a pointer to a nul-terminated string buffer obtained with malloc(). Someone's got to write and maintain that.

    By using most C++ STL/MFC classes you just single-threaded your app through the heap. At least - because you're assuming that C++ class is MT-safe. On a lot of platforms the "normal" C++ class library isn't really MT-safe. For example, on Solaris the IO streams libraries (used by cout and cerr) are decidedly MT-unsafe. Another is that in a multithreaded app even if cout/cerr is actually MT-safe, statements such as 'cout << "n: " << n << endl;' are not atomic.

    So you wind up forced to use lower-level C-style operations that are "hard" so you can meet performance and/or data integrity requirements.

    1. Re:And what's inside 'class String'? by Temporal · · Score: 1

      None of this has anything to do with what I was saying. You're talking about problems with specific implementations of C++, whereas I was talking about fundamental problems in the C language.

  48. This slays me.. by Anonymous Coward · · Score: 0

    Users submit program binaries to the BugScan appliance via a web interface and a report is generated automatically. It's that simple.

    Ahh, so because "not disclosing the source" isn't security-through-obscurity enough, they don't even allow you to see the binary of their own software?

    Yeah, like I'd trust that.

  49. Undecidable by Jagasian · · Score: 1

    So the plan is to automatically find possible security problems in assembler code, even though such a process is not computable. Hence the program either doesn't find every security problem or finds ones that aren't actually problems. Is this really a good way to judge software?

    I mean, I can write a program that scans executables and tells ya which ones are good and which ones suck. It won't actually mean anything though.

    1. Re:Undecidable by C.+E.+Sum · · Score: 1

      Bogus. While the question is theoreticlly undecidable, that means that you can't be 100% sure. Certainly you could scan the code for (let's say) calls to gets. It's easy to imagine much more complicated schemes involving calculating a control flowgraph for the code in an executable and looking for paths that contain uninitialized variables.

      After all, isn't most code going to be generated by a C compiler anyway? We're probably not talking about people writing encrypted, self-modifying software here.

      --
      -- Have you ever imagined a world with no hypothetical situations?
    2. Re:Undecidable by vidarh · · Score: 1
      If you could write a program that gave you the right lotto numbers 1% of the time, would you consider it useless because it hardly ever worked? Or would you use it because 1% is would be good enough to make you filthy rich in a couple of years?

      The question is: Does this program find enough security problems to pay for itself? The answer obviously depends on what kind of analysis it does, and what the potential cost of a breakin would be for you.

      That it is impossible to find a perfect solution is irellevant. If the rewards are high enough, a partial solution is often still good enough to be worth significant effort.

      Scanning for commonly abused functions, such as gets() would be one method. Scanning for buffer overflows is another check that would be highly useful and that is fairly easy to do. If you do complex flow analysis and couple that with a database of information about legal ranges of inputs and outputs from various system calls etc., you could catch a lot of problems.

      Even if you do have access to source, consider that it's not uncommon for a developer to cost their employer well above 300 USD a day. It doesn't take bugs found automatically to justify a fairly hefty price tag if it means less time spent debugging.

  50. Bug detector by edp · · Score: 2, Funny
    There's no need to pay for expensive software to detect bugs. I used to have a freeware bug detector. You would drop an executable on it, and it would display a message indicating whether or not there was a bug in the executable.

    A near as I could tell, for almost any executable you gave it, it reported there was a bug. The exception is that if you dropped its own executable on itself (even a renamed copy), it reported no bug. That seems pretty accurate to me.

    1. Re:Bug detector by Sri+Lumpa · · Score: 1

      "A near as I could tell, for almost any executable you gave it, it reported there was a bug. The exception is that if you dropped its own executable on itself (even a renamed copy), it reported no bug. That seems pretty accurate to me."

      Actually there was one bug in that software so it should have reported itself as having a bug but since it didn't do it that was a bug in the bug detection system so it should have reported itself as having a bug... ;)

      --
      "The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers." Bill Gates,
  51. This is nothing new.... by eric_stats · · Score: 1

    Lots of people have been doing this for years.

    Check the University of Wisconsin's WiSA project. And, of course, the commercial solution

    Standing on the shoulders of giants... ;)

  52. no way to change it ? by DrSkwid · · Score: 2, Insightful

    With the username and password hard coded into the executable, there was no way to change it witout having the vendor make the change and send out a new executable.

    if it was in cleartext couldn't you just edit the executable, so long as the new username/password was the same length you'd be set.

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    1. Re:no way to change it ? by LordDartan · · Score: 1

      True, you could have changed it in the executable if it was the same length, but that would have gone against company policy of not changing vendor code.

    2. Re:no way to change it ? by bajo77 · · Score: 1

      if it was in cleartext couldn't you just edit the executable, so long as the new username/password was the same length you'd be set.

      Changing the username/pass wouldn't fix anything, they would still be cleartext in the exe.

  53. Yes... by Phreakiture · · Score: 1

    Sure it makes sense. If you analyse the open-source code and it comes up secure, and the closed-source comes up insecure, then you may have not quite proven, but you have at least bolstered, the assuertion often made by the open-source lobby that open-source code is more secure.

    Of course, it also could come up the other way, thus giving closed-source advocates more fuel.

    --
    www.wavefront-av.com
  54. Closed Source tool? by IM6100 · · Score: 1

    Greg Hoglund demonstrated a product for sale by his new company

    Yes. But is it safe to run this 'product for sale' on your system? Has anybody scanned it to look for security problems?

    And where do we download the source code for it?

    --
    A Good Intro to NetBS
  55. Or apostrophes by DrSkwid · · Score: 1

    BugScan requires users to log into the system in order to user its' services. Enter your username and password into the appropriate fields, and click the "Login" button. If you do not have an account, ask your Administrator to add one.

    I asked my administrator but I couldn't answer myself.

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  56. strlcpy by Anonymous Coward · · Score: 1, Informative
    strlcpy helps a lot.

    I get shot down every time I bring this up, but...the OpenBSD folks have a database of coding flaws that can cause vulnerabilities. Every time they find a new one, they go over all their code and fix all the other places that have it, whether they find an exploit at those spots or not. This is the process that makes them so secure. So...why not publish all this?

    Whenever I bring this up, people say "just read the man pages for strncpy, you moron." Which is ironic, because if you read the paper I linked, you'll find that the OpenBSD team has found problems with strncpy, too...that's why they made strlcpy.

    Even the excellent book Building Secure Software doesn't mention strlcpy.

    1. Re:strlcpy by Temporal · · Score: 1

      Well... that's great that they do that. And, yes, good programmers can usually write pretty secure code in C. But, most programmers are lazy and won't remember to use strlcpy(). Anyway, it's still more difficult than other languages, and it's still only useful if you used statically-sized strings, which are usually a bad idea anyway.

  57. Re:Uh oh - offtopic I know but by Anonymous Coward · · Score: 0

    German engineering is what won the war in Europe.

    The German planes were beautiful, like works of art. Highly engineered, with beautiful consoles. Every model of plane had it's own unique design.

    The American planes were cheap, simply made, easily repaired and there were more of them.

  58. Why don't we just release all the murderers and by fz00 · · Score: 0, Offtopic

    rapists to make sure that there's enough room for these "criminals". Obviously, this is a more pressing situation! These people must be incarcerated at all costs! Even if a few people have to die and get raped.

  59. Re:Uh oh - offtopic I know but by Anonymous Coward · · Score: 0
    Actually, not entirely. It was the ability of the Allies to control the supply of oil, then encircle Germany, and finally the emerging huge production capacity of the US. What was the war in Africa and the Middle East all about? Oil. Why are we in the Middle East now? Oil.

    However, you do have a point. Why is Airbus Industrie eating Boeing's lunch? Because their planes are cheap, and they have more common parts.

  60. Eating Their BlackHat by gooru · · Score: 1

    What I would really like to see is for them to run that program on that program. Now, that would be interesting! It would also help determine how much confidence I have in their software.

  61. s/intractable/undecidable by Goonie · · Score: 1
    You've got it right conceptually (unlike the parent poster), but your terminology isn't quite right. Intractable==can't solve it in a reasonable amount of time (where reasonable==before the heat death of the universe for non-trivial instances of the problem). NP-complete problems are intractable, but they're not the only ones. The halting problem is not intractable, it's undecidable, which means that there is no algorithm that will give you an answer for all cases, no matter how long you're prepared to wait...

    Sorry to nitpick...

    --

    Any sufficiently advanced technology is indistinguishable from a rigged demo
    --Andy Finkel (J. Klass?)
  62. clear text? generate it on the fly by MemeRot · · Score: 1

    Why not store them in encrypted format? Decrypt them on the fly so that the clear text is nowhere in the code. I like to use an RC4 encryption routine, where the key is stored as another string which is base64 encoded, so you decode64 the key, feed it and the connection string to your RC4 module, and get back a clear text connection string which is stored only in memory in a local variable that I reset to "" as soon as I establish the connection. There's a nice free COM object to handle both base64 and RC4 at http://www.paipai.net/texts/asp-cast128-1.1.htm. The overhead for this is about nil as far as I can tell. Even the code is pretty secure - reading it without knowing what objCast was wouldn't tell you what the password was, only how it was formed, I would have had to tell you what the com object was, and where the strings were loaded from. I don't use open source databases myself so I can't speak to that, but I think you can do this same routine for any database connection. The key and the encoded connection string I store in a tiny XML doc on the web server, the text of the xml doc is read at application start up and stored as text as an application variable thereafter. Allows easy mods to the passwords without touching the code, and without any overhead for constant file access. By the way, the old MS theory of "write a COM object to return your connection string and you're safe" is incorrect. If you do so, you can open the DLL with Notepad and see the password and userid in cleartext. The rest of the file is a jumble of meaninglessness, but the one thing you wanted to secure isn't. It's when I discovered this on another forum that I switched to the above paranoid method.

  63. The Golden Rule... by kris · · Score: 2, Interesting

    The Golden Rule Of Programming:

    Never check for an error condition you don't know how to handle.

    I mean, what use is this? If you do not have the source, you may use this tool to check for potential security vulnerabilities. The result will leave you with a binary which you cannot change because you don't have the source, and with a list of potential vulnerabilities, which you can't validate without a great deal more of work which you would need to create working exploits. Failure to produce an exploit does not prove that there is no vulnerability, though.

    And if you happen to have the source, what use is this tool? There are better tools to find this class of errors on source level.

    Kristian

    1. Re:The Golden Rule... by vidarh · · Score: 1
      I mean, what use is this? If you do not have the source, you may use this tool to check for potential security vulnerabilities. The result will leave you with a binary which you cannot change because you don't have the source, and with a list of potential vulnerabilities, which you can't validate without a great deal more of work which you would need to create working exploits. Failure to produce an exploit does not prove that there is no vulnerability, though.

      It's useful because you can a) call your vendor and ask them to explain why your tool tells you their product is junk, b) look for another vendor with fewer reported problems, c) a basis on which to do the type of vulnerability testing any security conscious company would be doing on software they use for mission critical, high security systems anyway, but with the bonus that you have additional information on particularly interesting targets for your testing.

      a and b are important because they provide customers with information they classically haven't been able to obtain for closed source programs.

      And if you happen to have the source, what use is this tool? There are better tools to find this class of errors on source level.

      And which tools would that be? First of all, there are a few statical analysers available that works on source, but have you evaluated what classes of security problems they catch compared to this product?

      Secondly, this product has the potential to catch problems that source level statical analysers CAN'T: Problems introduced by buggy compilers. Granted, it's not a high risk, but modern compilers are huge, and DO frequently have bugs in code generation, and on when compiling a huge program it certainly isn't impossible that code generation bugs might trigger security problems in code that would otherwise be "safe".

    2. Re:The Golden Rule... by William+Tanksley · · Score: 1

      what use is this?

      Depends who's asking. To end-users, it might provide a way to evaluate a vendor's software. To vendors it's useless.

      To crackers, black-hat or otherwise, it's a gold mine -- and therefore every vendor who makes any security claims will HAVE to buy this in order to head off the crackers.

      -Billy

  64. *Black* Hat Conference by sleepingsquirrel · · Score: 1
    Isn't it blatently illegal to analyze the majority of the binaries out there?
    Hmmm... Maybe that's why the presentation was a the Black Hat Conference.
  65. Then my OS is illegal? by leeet · · Score: 1

    Isn't what all OSes do? Take a binary and read it bit by bit and then analyse each bit and convert it in understandable format by the CPU?

    --
    -- Leeeter than leet
    1. Re:Then my OS is illegal? by DetrimentalFiend · · Score: 1

      Actually, the OS doesn't convert anything. It basically just provides hardware abstraction and security (in the form of protecting programs from other programs). The OS doesn't really do anything except during system calls. Otherwise the compiled form is what's executed by the cpu--byte for byte.

  66. End the debate? Nope. by anthonyrcalgary · · Score: 1

    This product should help end the debate of closed source or open source applications being more or less secure.

    Open source is not inherently more secure, and people need to STFU about it. Many eyes only find more problems if many eyes are looking, and even then it doesn't always help enough.

    Proprietary code includes Windows, but it also includes OpenVMS and Multics.

    --
    When someone might yell at me, it has to be OpenBSD.
  67. No by kikta · · Score: 1

    So compiling a program is now a form of steganography??? That's a misguided and just plain wrong statement. Reading your comment makes me wonder if you've ever taken an assembly class, let alone a regular programming one.

    Programs are compiled so that the machine can run it. Period. That's the only reason. Comments are stripped because they are pointless to the machine. The original code is further jumbled by optimization.

    However, the fact that disassembly is difficult is a side effect, not a goal. Companies who produce closed source products may be happy about it, but it is nothing more than happy coincidence.

    And if compilation is anything, it's encryption. Steganography has fuck-all to do with encryption. It deals with hiding. Encryption deals with making your data difficult to read. If you know the assembly code is there - guess which one it's closer to...

    1. Re:No by dustman · · Score: 1

      Reading your comment makes me wonder if you've ever taken an assembly class, let alone a regular programming one.

      In fact I have never taken any programming courses. Nice argument technique though, I believe there's a name for it. I don't know the name, of course, since I'm so uneducated.

      Companies who produce closed source products may be happy about it, but it is nothing more than happy coincidence.

      Compilation increases performance (you don't have to recompile every time a program loads), and as a side effect, "obfuscates" source code. This is exactly what I said in my previous post, and you repeated it... what point were you trying to make?

      I really doubt the "happy coincidence". Most companies don't care all that much about performance. If they have the choice of optimizing their app to increase performance 50%, or releasing it 2 quarters ahead of time, which will they choose?

      Observe the python and java newsgroups/irc, and see how many people are asking how to make it so that their code can't be decompiled.

    2. Re:No by kikta · · Score: 1

      Entities that write programs & don't want them reverse engineered may be the current status quo, but you're wrong about the causality. If Python and Perl had been around well before C and the compiling/non-compiling advantages were flip-flopped, I believe we'd have a different environment today.

      Either way, it is a moot point. Compilation was a more efficient way of doing things, especially large programs, long before Perl or Python existed (and still is, for the most part). I don't think Microsoft chose to write Windows in C because it would be "like encryption". They chose it because assembly would be practical and BASIC didn't have the power.

      And my comment about your education wasn't an attempt to belittle you (though it could be interpreted that way), it was to point out that you're demonstrating a lack of theoretical knowledge of the subjects that you are claiming to know about. Just as you did on steganography versus encryption.

      In other words, you're talking out your ass, and you shouldn't. Have a nice day.

    3. Re:No by Steveftoth · · Score: 1

      You don't compile code to increase performance. Like the parent post said, you compile code so that the machine can understand it. Period.

      Also, the reason that Java can be easily decompiled is because the output of the Java compiler doesn't obfuscate the code at all. Basically the output of the compiler is VERY deterministic and the transformation can be reversed. Since the java compiler has almost no optimization options, it bascially does a one-to-one translation to your source code to Java ByteCode, and not much is lost in the process. (If you compile with debugging information, the only thing lost is comments. Line numbers, local variables,etc are all preserved).

      C Compilers (which most people use) on the other hand, there are many different brands from different vendors, all of which output different code and all have multiple different levels of optimization. Also, don't forget that a binary may not actually be from a C source. It could be Fortran, C++, Java (yes there is a Java->x86 compiler), etc. Thus decompiling a random binary may be very hard if you don't know what it was written in.

      So you're saying that reading a executabe for any other reason then plain execution is illegal? That's crazy.

    4. Re:No by RetroGeek · · Score: 1

      You don't compile code to increase performance. Like the parent post said, you compile code so that the machine can understand it. Period.

      Well, not actually.

      PHP is an interpreted langauge, as is Perl. Both languages are complied "on the fly" by an interpreter. The compiled code only exists in memory. Once it has been compiled, then the computer runs it.

      Compiled languages (such as C, C++, Pascal, etc) use a complier. The compiler produces compiled code, which the linker uses (along with libraries) to produce executables.

      And there are C, etc, interpreters, and Perl, PHP compilers.

      Thus decompiling a random binary may be very hard if you don't know what it was written in.

      Nope.

      Decompiling executables produces assembly code. Does not matter what the original language was.

      Now, decompiling Java byte code does produce Java (albet with funning looking variable names), but that is only because Java byte code IS NOT an executable. It still needs a runtime environment (Java Virtual Machine, or JVM) to run the byte code on the native computer. Which is why Java can be compiled once, and can run in differring environments.

      --

      - - - - - - - - - - -
      I am a programmer. I am paid to produce syntax not grammar. Deal with it.
    5. Re:No by Pooua · · Score: 1
      So compiling a program is now a form of steganography???

      What would that look like? If literal, it would mean that some of the bits of the compiled code were changed to hide the extraneous message. I think the most likely result of doing that would be the program would not run, or would run unpredictably. However, that is not to say that some companies don't hide secret message or secret code inside compiled software. This secret information sometimes is called, "Easter eggs." I understand that Microsoft Word has a flight simulator hidden within it. I wonder how much these hidden codes increase program size?

      Programs are compiled so that the machine can run it. Period. That's the only reason.

      There are methods used when writing the code and assembling the code that will make it more difficult to decompile the code, and that is the primary purpose of using these methods. The code would work just as well without using these methods.

      Several years ago, I used my new copy of MASM 5.0 and hexedit to decompile several programs. I was a student, and it was interesting to see how the code was written. I even looked at some Microsoft code, but I ran into the problem of some special programming technique that called for a code jump that I could not follow. The code trail simply disappeared at that point. I had been told that Microsoft used that technique to make it harder to reverse engineering its software.

      --
      Taking stuff apart since 1969 (TM)
  68. Ripped off free stuff & now selling it ... :-( by Anonymous Coward · · Score: 0

    The stuff presented is hardly new. Halvar Flake
    presented IDC scripts to analyze binaries in a
    similar (if not better) fashion in 2000 ... does
    it really take three years to rip an idea ?

    Presentation Amsterdam 2000
    Presentation Vegas Spring 2001
    Presentation Vegas Summer 2001

    Furthermore, there's a free sourceforge project
    which has all of BugScan's features plus some
    more:


    http://sourceforge.net/projects/bugscam

    So what's up with re-announcing old work in a
    pretty new dress ? And if there's a free
    alternative, why announce a commercial variant
    on slashdot without mentioning the free one ?

  69. Well, it appears that by gotr00t · · Score: 1
    the tactics of SCO are catching onto other software developers.

    If you give the people what they want to hear, regardless of it being true or false, not many would bother to even question whether it is true or not.

  70. Device? by BlakeStone · · Score: 2, Insightful

    I don't see why this has to be a separate physical device, aside from being able to analyze programs without taking up your CPU time. Why not just sell it as a program?

  71. No sense legalese by 12357bd · · Score: 1

    Any binary content (read 'file') is just and only a number.

    It's ridiculous to declare illegal to analize a given number because it can be viewed as a program (.dll), or pretend that a number cannot be copied because it can be processed as a song (.mp3).

    No sense rules are void by definition.

    --
    What's in a sig?
    1. Re:No sense legalese by Anonymous Coward · · Score: 0

      Nonsense rules may be void in your world (and if so, I'd like to move to wherever you live), but in the rest of the world, politicians enact and enforce meaningless legislation all the time. It's like breathing to them.

    2. Re:No sense legalese by Peaker · · Score: 1

      Is it rediculous to label numbers that are difficult to come up with as exclusively-distributable by a single entity?

      Especially given that the entity can simply sell this number to other entities under NDA's, which is much worse than copyrighted distribution (that later becomes public domain, that is)?

    3. Re:No sense legalese by 12357bd · · Score: 1

      Yes it is rediculous to pretend to restrict what can or can not be done with a number, but it's not ridiculous to protect the process/investment (non digital content) that leads to find a new usage for that number.

      If someone says that under a NDA you can't distribute number '32', you can simply distribute the number '16' twice.

      See? Non sense, pure non sense.

      --
      What's in a sig?
    4. Re:No sense legalese by 12357bd · · Score: 1

      So sad, so true. But is good to remember that being real doesn't meant being good.

      --
      What's in a sig?
  72. More verbosity if you want cleanness by r6144 · · Score: 1
    Actually the cleanest way means more verbosity: you should use "const char *" if you want to assign string literals to pointers, and the return values of strlen() should be cached in variables, otherwise there will probably be duplicated work making the code slower than Java (In this case the compiler can, although most don't, figure out that the string C does not overlap with A or B because C is malloc'ed, so strlen(a) and strlen(b) won't change, but most of the time it can't, for example when you call some strange function in the middle). Thus C programs dealing with strings ARE very verbose if you don't want to use libraries.

    However, using g_strdup_printf() in Glib (or asprintf() in GNU libc, but it isn't portable enough) will be a far easier option.

    1. Re:More verbosity if you want cleanness by Temporal · · Score: 1

      Right... yes, I realize the code I wrote wasn't the best, but it was correct. Besides, as you said, making it cleaner is just going to require more typing, and the whole point is that coders hate more typing.

      Using some sort of better string library would certainly help. I'd probably write my own if I ever had to work in C.

  73. .net has memory management and garbage collection by Anonymous Coward · · Score: 0

    unless they're manually forcing pointers into their programs, it's unlikely that a buffer overflow is even possible

  74. Re:clear text? generate it on the fly by Spiked_Three · · Score: 1

    The problem with this is any monkey and a LAN sniffer can see the userid and password as easily as if it was in the clear in the exe. Next.

    --
    slashdot troll = you make a compelling argument I do not like the implications of.
  75. How unreliable is this? by El · · Score: 1

    It doesn't sound any more useful than grepping through the source for calls to strcpy and sprintf... any cluefull developers would have fixed those problems already.

    --

    "Freedom means freedom for everybody" -- Dick Cheney

  76. Wierdly, it's a hardware product by Animats · · Score: 1
    Notice that this program isn't sold as a program. You have to buy it with its own 1U server. That looks like a way to pump up the price.

    Something I've been lobbying for a while - it's time to deprecate "sprintf", etc. Tney should be removed from the standard include files. If you need them, you should have to explicitly include something like <unsafe/string.h>. This would break lots of programs on recompile, but after some work, things would be better.

    1. Re:Wierdly, it's a hardware product by Courageous · · Score: 1

      I use a variant of sprintf that takes as its frist argument char**; if the value is null it allocates the appropriate space for you. While it does add the overhead of dynamic memory allocation to your program, it's a fire and forget sort of thing. One needs to remember to free the memory of course.

      C//

    2. Re:Wierdly, it's a hardware product by Peaker · · Score: 1

      If you care more about safety than performance, why do you use C at all?

    3. Re:Wierdly, it's a hardware product by Courageous · · Score: 1

      Most programmers, being in the field for a long time, use many different programming languages. You seem to believe that someone would pick *one* programming language. That's a wrong assumption.

      C//

  77. BugScan's core algorithm revealed! by swillden · · Score: 1
    nm $PROGRAM_TO_TEST| grep -f dangerousfuncs.txt
    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  78. Re:This is nothing new.... (well, it might be!) by defMan · · Score: 1

    The programs you link to seem to work on source code , not on binaries. That's a major difference. With this new tool you can (theoretically anyway) check for security problems in programs that you don't have the source for.

    Hmmm. Let's see how "unbreakable" this oracle thing really is.

  79. Use source code analyzer if have source-flawfinder by dwheeler · · Score: 2, Interesting

    If you HAVE the source code, use a source code analyzer like my flawfinder tool (or Viega's RATS tool). Source code analyzers can immediately identify where the problem is, and several are freely available. And has been noted elsewhere, the problem with binary analyzers is that they may show where some possible problems are, but it's very difficult to actually FIX the binary without the source code. That doesn't mean this is a useless product; if nothing else, if you're planning to use a proprietary program, a tool like this one might help you begin to understand your risks.

    --
    - David A. Wheeler (see my Secure Programming HOWTO)
  80. Re:strncpy sucks big-time by multipartmixed · · Score: 2, Informative

    I have seen strncpy() abused so many times it makes me sick. Like you, I prefer strlcpy(), although I have no idea about the politics behind its adoption in GNU -- I just link in -lgen (the xpg4 lib) under Solaris and code away. I usually have -lgen linked anyhow for strecpy() and such. The Apache Runtime (apr.apache.org) has apr_cpystrn() which is fine, too.

    I have actually seen code like this during a code review:

    strncpy(a, b, strlen(b));

    What the hell is the point of that?

    {
    char *a = malloc(10);
    strncpy(a, b, sizeof(a));
    }

    At least that won't overrun, but lord help the guy who tries to put five characters into b.

    From the same programmer, I have even seen this:

    {
    static char a[10];
    if (a)
    strncpy(a, b, sizeof(a));
    }

    Okay, the strncpy won't overflow, but what's the point of checking if a is NULL or not?

    I like to to this:

    {
    strncpy(a, b, sizeof(a));
    a[sizeof(a) - 1] = (char)0;
    } ..where a is an array of chars and b is a "known good" ASCIZ char *.

    I suppose we should point out for the neophytes that strncpy() doesn't write the trailing NUL if it fills the buffer. So the next time you read the string, you're screwed; you have no idea how long it is.

    --

    Do daemons dream of electric sleep()?
  81. aspack and other protection wrappers... by sweet+'n+sour · · Score: 1

    If this program only searches for certain byte code sequences, or looks for link-time libraries, wouldn't it fail to find anything when the binary is compressed or otherwise protected?

  82. An "Appliance" by nsxdavid · · Score: 1

    Did anyone notice that this thing is sold as an "Appliance" and not as an application? That seems very... odd. There is no indication that this takes any special hardware. Anyone have any idea what the deal is with that?

    --
    David Whatley
  83. Re:Use source code analyzer if have source-flawfin by pe1chl · · Score: 1

    I think it is not very useful.
    It just outputs standard warning texts when it sees the use of some function, up to ridiculous things such as:

    [1] (buffer) strlen:
    Does not handle strings that are not \0-terminated (it could cause a
    crash if unprotected).

    or:

    [1] (buffer) getc:
    Check buffer boundaries if used in a loop.

    Yeah, sure. When you need that kind of warnings you better not program in C.

    Useful warnings are about gets or sprintf, but the gcc linker even has some of those.

    To be of any value, an analyzer like this needs to actually analyze something. Like string functions that are outputting to a buffer in the stack.

  84. So why let them? by MemeRot · · Score: 1

    Uh....firewall off your database from anything but the web server(s). There should be no connections between your sql server and the internet.

    1. Re:So why let them? by Spiked_Three · · Score: 1

      What are you talking about? We are discussing applications that connect to a database. What the hell do web servers and the internet have to do with anything?

      --
      slashdot troll = you make a compelling argument I do not like the implications of.
  85. Static and dynamic analysis by Mryll · · Score: 2, Interesting

    I think you'd really want to do at least static analysis per this tool as well as dynamic analysis of the executable to get much confidence from results on a binary with no source. (Rational Purify seems to do a good job of locating dynamic buffer overwrites, etc.).

    The static analysis may catch some code paths that aren't typically executed, while the dynamic analysis can catch problems not evident from the source code. You still can't prove an executable is safe, but you can show where it is clearly unsafe. Putting both of these functions into a single product might make more sense.

  86. More Rubbish... by Anonymous Coward · · Score: 0

    Computers are not Turing Machines. They're finite atomata which approximate turing machines. It's entirely possible to determine whether or not a computer program will halt. Doing so can be very resrouce intensive, but it's still 100% possible.

  87. Translation vs. Encryption by solprovider · · Score: 1

    This is a response to Slick_Snake. Anybody who understands the difference between "translation" and "encryption" should skip it.

    ---
    There are people who can start with a stream of ones and zeroes, change them to hexadecimal, look up the first instruction, find the number of additional data to be included, interpret that data, and repeat for the rest of the stream.

    Even for HelloWorld, this would take a very long time and much knowledge about how binaries are written for a particular architecture.

    There are people (programmers) who can take a set of tasks and write a program to do it. There are some people who can take the program and turn it into binary code the machines can understand. That process would take a very long time.

    The first paragraph is about "decompiling"; the third is about "compiling". Both tasks would take a very long time if done "by hand", so some of the first programs were tools to remove much of the work to make more tools. Operating systems and compilers reduce the grunt work of talking to hardware and translating from human-understandable to processor-understandable. Unix, gcc, and VisualStudio reduce the amount of time spent teaching the machines to do something. They also reduce the knowledge required. (Would you like a VB programmer poking bits into memory to create graphics?)

    But both tasks are only translating from one language (C, Pascal, ...) into another (assembly).

    So you are admitting that you require a program to understand the binary and convert it back into something that you can read
    Even if the other poster had the skill, he would probably write a program to do it. Computers were invented to do very repetitive tasks.

    That sounds exactly like decryption to me.
    Please look up translation
    - If I translate this post to German, and you do not understand German, it is still not encrypted, just translated.

    My point wasn't that it was impossible to read the binary files only that is was very difficult to the point were few would attempt to and less actually could.
    That is why we build tools. Difficult != impossible. In this case, it is not "difficult", just incredibly repetitve.
    - Is assembly language still taught in computer school? It is not difficult. Processors do not understand very many verbs (mostly various ways of saying "get" this and "put" it there), and most of the nouns are memory locations. (They also know how to add one to a number!)

    Just because a form of encryption can be broken doesn't mean that it is not encryption.
    This post is encrypted in English. Please do not break the encryption.

    Granted I do agree that compiling was not created as a form of encryption, but as programmers have become increasingly dependent on higher level languages they have become less and less familiar with byte code.
    Just because you do not understand German does not mean everything written in German is "encrypted", it just means you cannot read it.
    - Most 2-year-olds in America would have difficulty reading this English. That means that they do not know the language yet, not that this is encrypted.

    Encrypt - to convert from one system of communication into another; especially : to convert a message into code Decrypt - to discover the underlying meaning of
    You are confusing definitions for code.
    2: a coding system used for transmitting messages requiring brevity or secrecy
    3: (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions

    The act of translating programs into computer code is not the same as encrypting for secrecy.

    ---
    Personal Information:
    - I am a programmer.
    - I do not understand German. I could attempt to translate by hand with a German-English dictionary. Or I could use a computer program to translate. Guess which I prefer.
    - I am not good at reading or writing computer assembly language.
    - I am a very good programmer.

    --
    I spend my life entertaining my brain.
    1. Re:Translation vs. Encryption by Slick_Snake · · Score: 1
      A bit of a history lesson... The US used the Navajo Language to send secure messages back and forth. This was their encryption. In fact is was never broken by the Germans Encryption is the translation of one set of symbols into another set of symbols in such a way as the information is still present, but much harder to understand. Like I said before just because it can be broken and understood doesn't make it not encrypted. People don't read the binary and understand it they have to translate it back into a set of instructions that they understand.

      "NAVAJO CODE TALKING

      Most experts agree: one of the most cryptanalytically sound form of code-making is simply to speak in Navajo.

      There are a few tricks here, the first being that Navajo is an intensely nuanced and dialectic form of language, and is thus royally difficult to pick up if you don't either grow up as a Navajo Indian, or spend 30 years hanging out, 24 hours a day, with Navajo Indians.

      That's why the U.S. military hit upon Navajo as the singularly most successful code in World War II--because it wasn't a code at all. At the time of the war, it was estimated that only about 30 people outside of the Navajo nation could speak the language, making it extremely cryptanalytically sound. In fact, Navajo code was so successful that it is perhaps the only traditional code technique to be profiled on an episode of the X-Files--pop culture's official stamp of paranoia-culture approval."

      From Navajo

  88. Re: Flawfinder by dwheeler · · Score: 1
    Actually, it DOES do some analysis - see the accompanying documentation. Basically, it looks at the parameters passed to the dangerous function, and adjusts the risk level based on its contents. For example, appending a constant is much less dangerous than appending a variable (because an attacker might be able to make that variable contain naughty data). RATS does the same sort of things (as does ITS4, for that matter).

    However, both flawfinder and RATS (and ITS4) have the same basic problem - they only do basic lexical analysis, and none do an in-depth data and control flow analysis of the data sources. That's definitely a weakness, to which I say: I agree - so where's YOUR code? Please develop a more impressive source code analysis tool, and I'll be glad to reference it. Tools like smatch might help you implement one.

    Sure, you shouldn't be coding in C if you don't know about how to protect against buffer overflows. But having a simple tool to help you find the spots you may have forgotten can help.

    --
    - David A. Wheeler (see my Secure Programming HOWTO)
  89. strcpy has such a bad name by Myria · · Score: 1

    Sometimes, I get people emailing me saying that my program has a security bug due to its use of strcpy, and that strcpy is unsafe. They don't bother to notice that my code is safe (in a setuid program) and yet faster than strncpy: int main(int argc, char **argv) { char buffer[256]; if (!argv[1]) return 1; argv[1][sizeof(buffer) - 1] = 0; strcpy(buffer, argv[1]); } I hate having to deal with this in my program. I can't imagine what code reviews would be like from my bosses... >_ Myria 3

    --
    "Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
  90. Re:yes (nm) by Anonymous Coward · · Score: 0

    asdf

  91. How I analyze my binaries for security problems by MainframeKiller · · Score: 1


    strings /usr/bin/something | grep "d00d, 1 0wN3d dJ00!"

    --
    http://www.club977.com/ - The 80's Channel!
    Your source for commercial free 80's music!
  92. i know, thanks for the help by DrSkwid · · Score: 1

    With the username and password hard coded into the executable, there was no way to change it witout having the vendor make the change and send out a new executable.

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  93. You know.. by Anonymous Coward · · Score: 0

    Someone should run this bugscan against itself..

  94. Translation vs. Encryption Part 2 by solprovider · · Score: 1

    I am familiar with the US using Navajos to translate messages for World War 2.And it served as a form of encryption because the Germans did not understand Navajo. As I pointed out earlier, this message is not understandable to someone who cannot read English. But it is not "encrypted" the way we use the word when talking about computers.

    There are 2 forms of "encoding" for secrecy:
    Codes: Replace each word (or concept) with another word (or concept.)
    Ciphers: Replace each letter with another letter.

    Codes are translated.
    - If I replace each word (or concept) from one language using a dictionary, then I am translating. If the dictionary is German-English or Navajo-English, then the result will be understood by people who understand the new language. If I use a "secure communication" codebook, then the new message may seem like English, but to the (desired) receiver, it will have a different meaning. "The dogs got out again" can mean "Meet me at the corner", but someone without the language (dictionary, codebook) will think we are talking about canines.

    Ciphers are encryption.
    - Every letter gets replaced with a specific letter, such as ROT1 or ROT13, or using a chart such as cryptograms in the newspapers. These can be easily broken due to patterns in our language structure.
    - Use a revolving key. The first letter can be offset by some amount. The second letter adds the first letter. The third letter adds the second letter. To be more secure, add offsets to every letter.
    - XOR every set of a certain number of bits with a big number. Without knowing the big number, it is very difficult to break encryption.

    Off-topic:
    I do not know why the revolving key is not used with the XOR method. The big flaw in most of today's methods is that the length of the key is known. Wouldn't security be improved if the key length changes for every pass, and the data is garbage for the first pass?
    - I recently wrote an encryption routine that encrypts data based on a password. The data is XML, and the encryption routine will be open source (visible, but in a commercial product). The key generated from the password is variable length, and the key revolves based on the data. And since the key length is variable, I shuffle the data based on the key length. I believe (and I am certain that I will be notified if anybody cracks it) that the only method of to crack it is brute force: try every password and see if the result is usable. Only the administrators will have access to the encrypted data, and only the owners will have access to the passwords, and the account is locked if the password is incorrect 3 times. I hope this will suffice; I may hide the encrypted data from the administrators to prevent them attempting brute force attacks.

    Back to the topic:
    The Navajo language trick was successful for maintaining secrecy because the Germans could not guess the dictionary used, but it was still a "code" which was translated. Machine code is called code because it is a different language, but messages (programs) can be understood if you understand the language. Both can be translated with the proper dictionary (and grammar instructions.) Neither is "encryption" as we use the term today.

    --
    I spend my life entertaining my brain.
    1. Re:Translation vs. Encryption Part 2 by BlackHawk-666 · · Score: 1
      I recently wrote an encryption routine that encrypts data based on a password

      I've written very basic encryption routines in the past and can highly reccommend you use a modern, well studied, and well tested form of encryption rather than something homebrew. Unless you are deeply skilled in the maths and number theory for crypto then it is likely there are major flaws in your encryption routines. If you're using Windows then try out the cypto routines provided, and under Linux there's always some library you can link to. It's bound to be safer (especially when your dataset has known cribs - like starting with byte markers and the XML.. shebang). Use RSA/triple DES/AES or some stream oriented cyher with a 128bit or greater key and you should be safe from all except government and big business (think really rich) level snooping. Those XML tags will fall to statistical analysis in no time flat.

      --
      All those moments will be lost in time, like tears in rain.
  95. byte code is executable by Steveftoth · · Score: 1

    Java bytecode is an executable. It's executable by a Java Machine. There's only a few java machines out the, Sun created a chip that could run bytecode native and ARM has extensions that run most bytecode directly on the chip.

    1. Re:byte code is executable by RetroGeek · · Score: 1

      Hmmm, by that logic, Perl source code is an executable. It's executable by a Perl interpreter.

      The term "executable"'s conventional meaning is that the binary code can be executed by the CPU, not that an extra layer is required, such as a VM.

      Sun's chip had that layer in firmware (ROM?, PROM?, EEPROM?) rather than software.

      --

      - - - - - - - - - - -
      I am a programmer. I am paid to produce syntax not grammar. Deal with it.
    2. Re:byte code is executable by Steveftoth · · Score: 1

      Ok, this thread is very far from my original responces intent, but I would like to say that yes you're right about the perl source being executable, because yes, it is. You could build into the kernal a Perl interpreter and then there would be no difference between a perl .pl and a normal executable. Though you'd probably want a special header on the .pl file (magic number and whatnot) to identify it correctly. Rather then rely on the file extension.

      Also, it really doesn't matter how Sun's chip executed the Java bytecode internally. It ran java bytecode, you put in bytecode, you get out the proper result. All modern x86 CPUs do dynamic recompiliation of the code to a simple RISC style instruction set. And before that they used microcode, which translated the x86 operations (using software) into the actual internal instructions that the cpu used.

  96. Writing my own encryption by solprovider · · Score: 1

    Here are the specs and my design. Please tell me if I missed anything. Any suggestions welcome.

    Specs:
    - Language = Java
    - The encyption has 2 inputs:
    1: data = long String of XML.
    2: password = short String acceptable for input through a web form.
    - Data is all of a user's logins for all websites for a single sign-on system.
    - Data is currently stored after encryption where only administrators (and the valid user) can see it.
    - (In development) Change so that administrators cannot see the data. Requires code to cleanup obsolete users.
    - Requires password that is never stored in the system. There is no recovery method if the user forgets the password.

    Encryption:
    - Get password. All implementations should require SSL. (Why worry about the encryption method otherwise?)
    - Key is generated by multiplying the password by the password with all the bits in reverse order, repeat using the result, and removing consecutive zeroes and the first one. One more bit is removed if the result has an even number of bits.
    - Additional key lengthening could be added by using the MD5 or SHA hashes. My concern is that these return fixed length Strings. Probably use them before the previous step.
    - Data is shuffled in portions where the length is based on the number of bits in the key. This is so first char != < and the last char is not >.
    - Data is then encrypted using the key repeatedly. Since the key has an odd number of bits, it does not repeat on a byte boundary until 8 passes.
    - (In development) I want the key to evolve on each pass, possibly adding bits to the length. Change the bits in the key based on the data. Probably need to remembers the last bit from the data, since the current key bit and data bit are already used to get the current encrypted bit.

    The major strength is the unknown key length. Since the data is in ASCII, you can guarantee the first bit of the data should be a zero. Even if you knew the first char of the data, you could not know when those 8 bits of the key are reused, especially if the key grows erratically.

    If I prove that the first bit is always zero, then I will remove it, leaving 7 bits per char of data. Do any web servers allow passwords or domain names using chars above 127? I deal with many international clients, so I worry about losing data.

    Our Encryption class allows for new algorithms to be added easily while maintaining backwards compatability: data from older algorithms is migrated to the latest algorithm the next time the user logs in. There is no mass update, since the application does not know the passwords.

    ---
    My concerns are:
    1. Brute force attack - logging the number of missed attempts, and locking an account after a number of bad login attempts, should remove much of that threat.
    2. Java is open source by definition. Someone with file access could change the code in the program to log all passwords or unencrypted data. The data must be stored in memory at some point to be usable. This is why hiding the encrypted data from the administrators is not a high priority, since they can circumvent the whole security system if they know how to work with Java.
    - Changing to another language for the security system might help some, but even C executables can be hacked. And we would lose the single codebase for multiple OSes.

    --
    I spend my life entertaining my brain.