Results 1 to 6 of 6

Thread: How to use variables in other console-windows ??

  1. #1
    Just burned his ISO
    Join Date
    Oct 2007
    Posts
    17

    Default How to use variables in other console-windows ??

    First I have to say that I'm absolutely new to linux .

    Today I watched a movie-tutorial at milw0rm and the guy acting in this tut was using variables (like mac-address of AP, his own device, ESSID and so on) in other console-windows.

    I know the command ("export AP=11:12:12") and in the other windows "$AP" for example, but this works for me only in the console where the variables were defined, not in the next console.

    Is there anything I'm doing wrong with this ?

    Chris

  2. #2
    Jenkem Addict imported_wyze's Avatar
    Join Date
    Jul 2007
    Posts
    1,543

    Default

    are you talking about creating aliases?
    dd if=/dev/swc666 of=/dev/wyze

  3. #3
    Developer
    Join Date
    Mar 2007
    Posts
    6,124

    Default

    I'm assuming the video your talking about is muts clientless wep attack. If so you'll notice that he already had the variables defined in another file hence the cat command. So you must create a file and place it in the path. In the future when you refer to a outside source such as a video in this case it would probably be smart to link us or tell us the name so that we can see WTF you are talking about. If you give a piss poor question you will get a piss poor answer.

  4. #4
    Just burned his ISO
    Join Date
    Oct 2007
    Posts
    17

    Default

    Quote Originally Posted by purehate View Post
    I'm assuming the video your talking about is muts clientless wep attack.
    You're right, that's what I was talking about

    Quote Originally Posted by purehate View Post
    If so you'll notice that he already had the variables defined in another file hence the cat command. So you must create a file and place it in the path.
    Yepp, that happens at the beginning, in the first screen ("Shell-Konsole"), but after that, when he opens another window ("Shell-Konsole <3>") then he can use the $AP variable, too. And that's what I don't understand

    Quote Originally Posted by purehate View Post
    In the future when you refer to a outside source such as a video in this case it would probably be smart to link us or tell us the name so that we can see WTF you are talking about. If you give a piss poor question you will get a piss poor answer.
    I'd like to post the link, but I was told not being allowed to post links as long as I have less than 15 posts . Anyway, here it is w w w.milw0rm.com/video/watch.php?id=59

    Chris

  5. #5
    My life is this forum thorin's Avatar
    Join Date
    Jan 2010
    Posts
    2,629

    Default

    If you launch the shell/terminal from within a shell where you've already set environment variables then they should persist.

    I don't have BT with me right now but it works like this in Winblows:
    Code:
    C:\temp>set BLEH=BOB
    C:\temp>echo %BLEH%
    BOB
    C:\temp>cmd
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\temp>echo %BLEH%
    BOB
    C:\temp>exit
    C:\temp>
    Set a variable, echo it, launch another shell, echo the variable we set in the first, exit the additional shell. (In BT this would be export instead of set and $BLEH instead of %BLEH%)

    I don't know if it exists in BT but you could probably also use the screen command.
    I'm a compulsive post editor, you might wanna wait until my post has been online for 5-10 mins before quoting it as it will likely change.

    I know I seem harsh in some of my replies. SORRY! But if you're doing something illegal or posting something that seems to be obvious BS I'm going to call you on it.

  6. #6
    Member
    Join Date
    Aug 2007
    Posts
    231

    Default

    I do this BEFORE I run "startx". If done from the "root shell" before starting KDE, it will be included in the environment variables for all successive shells.

    Also, common variables can be added to the files "/etc/profile" and "/root/.bashrc" (they both must have the additions). I have a variable called "MY" that is my spoofed MAC address. To use it, I just enter $MY.

    If you don't do it BEFORE you enter KDE, any variables that you enter are only local variables and not the needed global type.

    To get the variables into the "global" pile, I start BT2, log in, then run "airodump-ng" to locate the MAC address of the AP that I am pentesting, then enter the command:

    Code:
    export AP=01:22:23:AB:CC:DD
    Now, AP is a global variable available to any program that wants it (via $AP). Do this with any other variable you want to be global.

Posting Permissions

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