Results 1 to 8 of 8

Thread: Wanting to create my own script but.....

  1. #1
    Just burned his ISO
    Join Date
    Oct 2008
    Posts
    3

    Question Wanting to create my own script but.....

    I am using bt3f on usb, with alfa usb adapter I have searched high and low for anything on scripts for bt3,
    I have no idea on scripting but willing to learn commands etc.....
    what language are they written it or is it just with kwrite??

    Not too sure if it is possible to do the things i want to do which are
    in order

    start airmon-ng wlan1
    iwpriv wlan1 highpower 1
    iwconfig wlan1 txpower 14
    macchanger --mac=XX:XX:XX:XX:XX:XX wlan1
    start airodump-ng

    I wanted to do this for a challenge but keep hitting a wall. Any help on this would be greatly appreciated, or if someone could point me in the right direction other than search box lol
    I have even tried google for creating scripts in bt3

    I have also been looking through other peoples scripts to see if i can edit them to suit my own but ..... well you get the picture

    Many Thanks

    active

  2. #2

    Default

    Hi Active:

    Put commands into a text file, just like you would into the command line, - line by line. like how you have this:

    Code:
    start airmon-ng wlan1
    iwpriv wlan1 highpower 1
    iwconfig wlan1 txpower 14
    macchanger --mac=XX:XX:XX:XX:XX:XX wlan1
    start airodump-ng
    replace the X's with the real 8 bytes of a MAC address though, ("X"'s aren't hexidecimal). to do this you could either echo each line into the file with the ">>" bash 'dump and append' option like so:

    Code:
    echo "airmon-ng wlan0 start" >> program.sh
    echo "iwpriv wlan1 highpower 1" >> program.sh
    echo "iwconfig wlan1 txpower 14" >> program.sh
    echo "macchanger -m 00:11:22:33:44:55 wlan1" >> program.sh
    echo "airodump-ng wlan1" >> program.sh
    Then make it executable by typing
    Code:
    chmod +x program.sh
    then running it with
    Code:
     ./program.sh
    that's called "shell scripting" and you can use it with any operating system that has a UNIX-like shell. Even the oldest of Sun systems I have worked on have all of the commands above, some of them I needed to use built-in shell commands to create programs for people though, like "echo", "while", "read", ">|>>" etc.

    You can make a shell script take your user input too, and make some of commands you have in the script contain variables. Here I will show you how to do it with another language, Perl:
    Code:
    echo '#!/usr/bin/perl' >> program0.sh
    echo 'print "give me an address to ping ";' >> program0.sh
    echo '$addr = <STDIN>; chomp $addr;' >> program0.sh
    echo 'system ("nmap -T Aggressive $addr"); >> program0.sh
    echo 'exit;' >> program0.sh
    That one asks you for the variable $addr, so you dont have to keep editing the file to change the IP you would like the "system" to "nmap." There is a Perl Module i have been playing with that is completely amazing called IO::Socket that allows you to create your own "nmap"
    Then make it executable so you can simply run it with dot slash like so:

    Code:
    chmod +x program0.sh
    ./program0.sh
    Oh, yeah, or you could use a command line text editor such as:

    Code:
    nano program.sh
    Then using the commands listed below, (the "^" means the CTRL key) so CTRL+X to exit "y" or "n" to save changes.

    You could now, take what tiny samples i gave above and start coding your own "scripts" by altering what programs to use, and what variables to choose.

    I'd suggest using books like "Perl for dummies, Perl by O'reilly, Classic Shell Scripting by O'rielly, and maybe even Mastering Regular Expressions, Awk programming, and Sed and Awk (which covers grep too) all by O'reilly. They helped me out a lot! And don't feel over whelmed, take it slow and have fun! coding, scripting, and hacking in a lab is fun!

  3. #3
    Just burned his ISO
    Join Date
    Oct 2008
    Posts
    3

    Default

    Thanks very much for the speedy reply and time you have taken, This is much more than i expected, going to try it now

    Thanks again


    My god it works, now to try modding it as i know how to make it exe etc...

    Cheers

  4. #4

  5. #5
    Member imported_Deathray's Avatar
    Join Date
    Oct 2007
    Posts
    381

    Default

    Thanks Trevelyn for the great perl example. The simplicity just inspired me to get my hands dirty :b.
    - Poul Wittig

  6. #6
    Junior Member
    Join Date
    Apr 2007
    Posts
    57

    Default

    Linux Shell Scripting Tutorial
    How to write shell script
    http://www.freeos.com/guides/lsst/ch02sec01.html

    and / or

    Advanced Bash-Scripting Guide
    An in-depth exploration of the art of shell scripting
    http://www.tldp.org/LDP/abs/html/

    regards

  7. #7

    Default

    Quote Originally Posted by Deathray View Post
    Thanks Trevelyn for the great perl example. The simplicity just inspired me to get my hands dirty :b.
    sure! hey if you get deeply interested in Perl you can take the ping csript i listed above to a higher (well, lower) level and not include a dependency. Just use the "Net::Ping" perl module.

    Code:
    use Net::Ping;
    print "give me an IP "; $ip = <STDIN>; chomp $ip;
    $pinger = new Net::Ping; if ($pinger->ping($ip)) { print "$ip is alive :)\n";
    I'm currently recoding netgh0st to not have any dependencies (meaning its like 500 lines but, heh) and I have been playing with Net based Perl modules a lot:

    Net::Ping, LWP::Simple, Net:NS, IO::Socket, and a few others.

    hope that helps anymore more interested!

  8. #8
    sLiPpErY
    Guest

    Default

    Subscribed!! This is excellent, just what i'm looking for as a noob to linux in general. If I find any good sources of info on scripting I'll post them. Anyone have those books online? I use to have a good website that had all those ebooks for free.... I'll google around...

Posting Permissions

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