Results 1 to 7 of 7

Thread: hidden scripts

  1. #1
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    3

    Default hidden scripts

    When I run *.sh script on backtrack 4 it runs hidden how can I unhide the script?

    Example.sh
    Code:
    #!/bin/bash
    start-network

  2. #2

    Default Re: hidden scripts

    hi,

    it has nothing to do with backtrack, instead having some basic knowledge about
    shell scripting and how console redirects work in linux!

    Not the script is hided/unhided, the stuff you actual call within the script is the part
    you have to understand!

    As you can see, you spawn another process within your shell-script, in your
    case: /usr/bin/start-network

    /usr/bin/start-network will spawn another process (python) to finally
    execute another shell script: /etc/init.d/wicd start

    Do some homework, learn Linux basics.

    Killing a process is another thing you have to go familiar with, like
    stopping your shell-script, example: killall {your shell script name/process name}

    /brtw2003

  3. #3
    My life is this forum Snayler's Avatar
    Join Date
    Jan 2010
    Posts
    1,418

    Default Re: hidden scripts

    You can call xterm in the script.
    #!/bin/bash
    xterm [options] "/etc/init.d/wicd start"
    As for the options that you shall use, do man xterm.
    Last edited by Snayler; 02-07-2010 at 12:55 AM.

  4. #4
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    3

    Default Re: hidden scripts

    Many thanks for your replies.

    But if I type this "network.sh" in the terminal in backtrack 3 final I can see the script output, if I do this in BT4 it resuts in a error "bash: network.sh : command not found".

    network.sh convert with notepad++

    Code:
    #!/bin/bash
    # Backtrack Network Manager v 1.1 beta
    #Based upon M1r4g3 original work
    #Updated & modified by M1ck3y
    #... Enjoy ;)
    
    # intro
    intro="\n
    -------------------------------------------\n
    ~~~~~~~~~ BACKTRACK NETWORK MANAGER ~~~~~~~\n
    -------------------------------------------\n
    -------~ Semi automatic management ~-------\n
    -------~ Of the network card eth0 ~--------\n
    -----~ Developed for Backtrack 3 Final ~---\n
    -------------------------------------------\n
    ---- Brought to you by M1ck3y & M1r4g3 ----\n
    ------------- www.crack-wpa.fr ------------\n
    -------------------------------------------\n"
    
    
    # Choix d'Action
    clear
    echo -e $intro
    echo "--> Please enter your choice:"
    echo
    echo "--> 1 Eth0 informations"
    echo "--> 2 Set eth0 up"
    echo "--> 3 Set eth0 down"
    echo "--> 4 Set your ip address, netmask and getaway"
    echo "--> 5 Set the DNS server"
    echo "--> 6 Activate DHCP on eth0"
    echo "--> 7 Network test (ping)"
    echo
    echo "--> Your choice:"
    read choix
    case $choix in
    #On affiche ifconfig eth0
    1)
    clear
    echo -e $intro
    echo "--> Eth0 informations:"
    sleep 3
    clear
    echo -e $intro
    ifconfig eth0
    sleep 6
    $0;;
    #on active eth0
    2)
    clear
    echo -e $intro
    echo "--> Bringing eth0 up..."
    sleep 3
    clear
    echo -e $intro
    ifconfig eth0 up
    clear
    echo -e $intro
    echo "--> eth0 up"
    sleep 3
    $0;;
    #On d�sactive eth0
    3)
    clear
    echo -e $intro
    echo "--> Bringing eth0 down..."
    sleep 3
    clear
    echo -e $intro
    ifconfig eth0 down
    clear
    echo -e $intro
    echo "--> eth0 down"
    sleep 3
    $0;;
    #On configure l'ip, le masque de sous r�seau et la passerelle
    4)
    clear
    echo -e $intro
    echo "--> Please enter the following informations:"
    echo
    
    echo "--> (IP: static ip address of your network card eth0)"
    echo "--> (NETMASK: the netmask)"
    echo "--> (GETAWAY: the getaway)"
    echo
    echo "--> IP NETMASK GETAWAY:"
    read ip netmask getaway
    clear
    echo -e $intro
    echo "--> Setting new IP configuration..."
    echo "--> IP address: $ip"
    echo "--> Netmask: $netmask"
    echo "--> Getaway: $getaway"
    sleep 4
    clear
    ifconfig eth0 $ip netmask $netmask 
    route add default gw $getaway eth0
    echo -e $intro
    echo "--> Network settings saved."
    sleep 3
    $0;;
    #On configure le serveur DNS
    5)
    clear
    echo -e $intro
    echo "--> Please enter the following information:"
    echo
    
    echo "--> (DNS: ip address of the DNS server)"
    echo
    echo "--> DNS:"
    read dns
    clear
    echo -e $intro
    echo "--> Setting new DNS configuration..."
    echo "--> DNS server: $dns"
    sleep 3
    clear
    "echo" nameserver $dns > /etc/resolv.conf
    echo -e $intro
    echo "--> Network settings saved."
    sleep 3
    $0;;
    #On active le dhcp
    6)
    clear
    echo -e $intro
    echo "--> Activating dhcp on eth0..."
    sleep 2
    clear
    echo -e $intro
    dhcpcd eth0
    clear
    echo -e $intro
    echo "--> DHCP successfully activated"
    sleep 3
    $0;;
    #On teste le r�seau avec un ping
    7)
    clear
    echo -e $intro
    echo "--> Please enter the following information:"
    echo
    
    echo "--> (ADDRESS: address where you want to launch"
    echo "--> a ping to test the network. It can be an"
    echo "--> IP address or a domain name)"
    echo
    echo "--> ADDRESS:"
    read ipping
    clear
    echo -e $intro
    echo "--> Ping $ipping ..."
    ping $ipping -c 5
    sleep 3
    clear
    echo -e $intro
    echo "--> End of the network test."
    sleep 4
    $0;;
    esac

  5. #5
    Just burned his ISO crontab's Avatar
    Join Date
    Feb 2010
    Location
    local
    Posts
    4

    Default Re: hidden scripts

    Debug Mode:

    bash -x example.sh To see commands and arguments as they are executed.
    bash -x script.sh 2> log To see commands and arguments as they are executed and save the output to a file.

    or

    debugging can be turned on at the top of the bash script #!/bin/bash -x

  6. #6
    My life is this forum Snayler's Avatar
    Join Date
    Jan 2010
    Posts
    1,418

    Default Re: hidden scripts

    Quote Originally Posted by bbakker View Post
    Many thanks for your replies.

    But if I type this "network.sh" in the terminal in backtrack 3 final I can see the script output, if I do this in BT4 it resuts in a error "bash: network.sh : command not found".
    ...
    Code:
    ./network.sh  --> must cd to network.sh's directory.
    or
    Code:
    sh network.sh
    Linux Basics... You really should take a look at archangel.amael's "If you are new to Back Track or Linux read this thread" thread.
    Last edited by Snayler; 02-08-2010 at 07:56 AM. Reason: I have nothing else to do...

  7. #7
    Super Moderator Archangel-Amael's Avatar
    Join Date
    Jan 2010
    Location
    Somewhere
    Posts
    8,012

    Default Re: hidden scripts

    Pardon my bluntness, but whats the point? First this script is based on a totally different distro, and furthermore what is wrong with WICD?

Similar Threads

  1. Gerix-Wifi-Cracker + Hidden SSID
    By Snayler in forum BackTrack Bugs
    Replies: 7
    Last Post: 02-24-2010, 01:03 PM
  2. problems & intel wifi 1000 & hidden ssid
    By tehgame in forum Beginners Forum
    Replies: 1
    Last Post: 02-08-2010, 08:44 AM
  3. Connecting to a hidden access point
    By amfEichman in forum Beginners Forum
    Replies: 2
    Last Post: 02-01-2010, 04:08 PM
  4. Getting Elmurato's EEEasy-PC Scripts working on BT4 Final
    By trellis in forum BackTrack Howtos
    Replies: 3
    Last Post: 01-16-2010, 06:40 PM

Posting Permissions

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