Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Mdk3

  1. #1
    Junior Member
    Join Date
    Sep 2006
    Posts
    45

    Default Mdk3

    I would personally like to see MDK3 in the final release. Or a similar application which can increment through a word-list to show an AP's SSID.

    Thanks on the stellar job folks!

    Aliosity

  2. #2
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default

    In the meantime you can get MDK3 as follows:

    Code:
    wget http://virjacode.com/projects/beefup/dloads/mdk3.tar.bz2
    tar xjf mdk3.tar.bz2
    cd mdk3-v5
    sed -i 's|-Wall|-w|g' ./Makefile
    sed -i 's|-Wextra||g' ./Makefile
    sed -i 's|-Wall||g' ./osdep/common.mak
    sed -i 's|-Wextra||g' ./osdep/common.mak
    sed -i 's|-Werror|-w|g' ./osdep/common.mak
    sed -i 's|-W||g' ./osdep/common.mak
    make
    make install
    cd ..
    rm mdk3.tar.bz2
    rm -r mdk3-v5
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  3. #3
    Member
    Join Date
    Aug 2006
    Posts
    100

    Default

    Worked like a charm, thanks!

  4. #4
    Junior Member
    Join Date
    Sep 2006
    Posts
    45

    Default

    Thanks Virchanza, that soution was beyond my comprehension.
    I'll try it tonight.

  5. #5
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default

    You're best off just copying the whole lot into a script and executing the script at the commandline. Saves you having to copy and paste a dozen times.
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  6. #6
    Member
    Join Date
    Jan 2010
    Posts
    140

    Default

    Its bad programming practice to get rid of compiler flags like that. mdk3 may not compile (w/out patching) for gcc-4.3 but the compiler flags are there for a reason. Its best just to use gcc-4.2.
    Code:
    # apt-get install gcc-4.2
    # make CC=gcc-4.2
    # make install

  7. #7
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default

    Why on Earth is it "bad practise" to get rid of compiler flags which shouldn't be there in the first place?

    You say that the compiler flags are there for a reason... but that is not true. The makefile for mdk3 is broken, it contains compiler flags which it shouldn't contain (as do most Linux opensource programs). Warnings should never be treated as errors, especially in the makefile for a program which has already been tested and released to the public.

    Anyone who's written a C program more than 10 lines long knows that compiler warnings are a part of everyday life, and knows that they shouldn't be treated as errors. With every future release of a compiler, there's gonna be more and more warnings added. Warnings are a great help to the programmer, they give them a gentle knudge to say "Hey did you really mean to do that?". But they weren't intended to make you have to install older versions of a compiler just to get something to compile.

    Your solution of using an older compiler is terrible. If a program is written properly, along with having a properly written makefile, you shouldn't have to use older compilers to get it to work. Here's the thread where we originally discussed the problem:

    http://forums.remote-exploit.org/bt4...tml#post135846
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  8. #8
    Member imported_vvpalin's Avatar
    Join Date
    Apr 2009
    Posts
    442

    Default

    I have personally used Virchanza's method and it works perfectly.

    I also want to say that if your going to use mdk3 with the alfa card it will work, but its less than functional. The whole thing BADLY needs a rewrite, and until someone steps up to the plate i think it should be left out of BT.

    Dont get me wrong its a wonderful program and i still use it from time to time with the alfa, but it could be so much better than what it is its not even funny.

    btw i never got to say thank you Virchanza .. so here it is

    Thanks
    Using backtrack for the first time is like being 10 years old again with the keys to a Ferrari.

  9. #9
    Member
    Join Date
    Jan 2010
    Posts
    140

    Default

    Quote Originally Posted by Virchanza View Post
    Your solution of using an older compiler is terrible. If a program is written properly, along with having a properly written makefile, you shouldn't have to use older compilers to get it to work.
    Agreed. My solution wasn't any better and on top of that added an extra package to download. Using a previous version of gcc shouldn't be necessary.

    The extra compiler flags are in the Makefile(s)/common.mak to keep the code clean. And with the stricter standards that come with newer versions of gcc it shows that (at least for osdep/linux.c) it does not abide by the newer gcc restrictions. It looks like to get it to compile with gcc-4.3 then only linux.c needs to be patched.

    If the sed statements help people get mdk3 compiled then that's good. The end user shouldn't have to be concerned about compiler flags or errors that lead to uncompiled source code.

    It looks like one of the sed statements is irrelevant. I don't see a -Wextra in osdep/common.mak.

  10. #10
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default

    Quote Originally Posted by larryhaja View Post
    The extra compiler flags are in the Makefile(s)/common.mak to keep the code clean. And with the stricter standards that come with newer versions of gcc it shows that (at least for osdep/linux.c) it does not abide by the newer gcc restrictions. It looks like to get it to compile with gcc-4.3 then only linux.c needs to be patched.
    The newer warnings shouldn't be thought of as restrictions. Take the following piece of code:

    Code:
    void Func(int i)
    {
        if (i = 3)
            DoSomething();
        else
            DoSomethingElse();
    }
    According to the C language standard, there's nothing at all wrong with this code, it should compile without error. But most compilers will issue a warning, they'll say something like:

    Code:
    Warning: Assignment in conditional : a.c  Line 3 :  i = 3  (Did you mean i == 3)?
    This is actually a very handy warning because it catches typoes that would otherwise take a while to track down.

    But let's say we have different code, something like:

    Code:
    while (  n = getchar()  )
    {
        DoSomething(n + 5);
    }
    In this example immediately above, we deliberately want "=" instead of "==", however the compiler doesn't know what we want to do and so it will still issue the same warning. Does this mean there's something wrong with our code? No! It's just a warning, nothing more. Warnings were never meant to be treated as errors. If you have a program that's a few thousand lines long, you might get 20 harmless warnings when you compile it.

    Every time you edit your program and re-compile it, you have a read over the warnings to make sure you haven't made a typo of some sort somewhere in the source code. Warnings are to be used by the programmer when he's actually compiling the code to test it out. Warnings are not for use my people who have downloaded source code from the net. In fact, if you are distributing your own source code for other people to compile, you should set a compiler flag to silence all warnings, because the end user doesn't need to know about it.

    As for most opensource Linux programs using the "-Werror" flag which treats all warnings as errors, well it's frankly a load of bullshit. Warnings can be produced by perfectly acceptable code, and as we've seen with MDK3, new errors are added to compilers all the time to help programmers catch their mistakes faster. As more and more warnings are added to a compiler, then code is eventually gonna break if it specifies "-Werror".

    The people who are distributing opensource Linux programs must all be using the same makefile producing program, because all the makefiles are the same, they're all broken in the same way. I myself don't use makefiles at all, I just give GCC everything it needs at the command line, for example here's how I compile my Internet Prober program:

    Code:
    gcc *.c -g -D inline="static inline" -D _REENTRANT -D VJC_PLATFORM=1 -D NO_ERRPRINT -lpthread -lncurses -o inp
    If you want to change your source code so that it doesn't produce any warnings, then there are ways of doing so. For instance, for the "Assignment within a conditional" warning, you can suppress it in GCC by using two pairs of parentheses:

    Code:
    while ((  n = getchar() ))
    {
        Whatever();
    }
    One of the warnings produced by the MDK3 code is that a particular function should never have its return value discarded. So instead of having:

    Code:
    SomeFunction();
    You need something like:

    Code:
    int i = SomeFunction();
    There was one other warning I believe, something to do with string literals, but I never bothered to investigate it.

    I wouldn't go patching files like linux.c just to make them past a warning test. If you really want warnings to disappear, you can specify all sorts of flags to GCC:

    Warning Options - Using the GNU Compiler Collection (GCC)

    I can't stress enough though: Warning should never be treated as errors, not even when the programmer is testing out his code. To have warnings treated as errors in the makefile of source code which is distributed to the public, is nonsense. If every program was distributed like this, they'd all be broken within 5 years.

    When I'm testing my own programs, I tend to use "-Wall", it tells the compiler to give me every warning possible, no matter how ridiculous the warning is. However you'd never see me include this a compiler flag when I'm telling other people to compiler my code.
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •