Will add lots of other Commands to set up server, bash shell command ...... when I'm free.
Hope it will help you and will make it easier for you to work with Backtrack.
1)
DHCP
Type in:
dhclient <interface>
root@bt:~# dhclient eth0
...
Listening on LPF/eth0/00:0c:29:f6:08:7a
Sending on LPF/eth0/00:0c:29:f6:08:7a
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPOFFER of 192.168.1.155 from 192.168.1.254
DHCPREQUEST of 192.168.1.155 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.155 from 192.168.1.254
bound to 192.168.1.155 -- renewal in 99903 seconds.
root@bt:~#
To check the current opened interface, type:
ifconfig
to check the available interfaces. ( like eth0, wlan0 ....
2)
Static IP assignment
The following example shows you how to set a static IP address assuming:
Host IP: 192.168.0.4
Subnet mask: 255.255.255.0
Default gateway: 192.168.0.1
DNS Server: 192.168.0.200
Type in the following according to the example above:
root@bt:~# ifconfig eth0 192.168.0.4/24
root@bt:~# route add default gw 192.168.0.1
root@bt:~# echo nameserver 192.168.0.200 > /etc/resolv.conf
3)
SSHD
The SSH server can be very useful in various situations, such as SSH Tunneling, SCP file transfers, remote access etc.
Before the SSH server is started for the first time, SSH keys need to be generated. If you attempt to start the SSHD server before you've created your keys, you'll get an error.
To start the SSHD server for the first time, issue the following commands:
root@bt:~# sshd-generate
then type:
root@bt:~# /etc/init.d/ssh start
4)
Apache
You can control the Apache server by using either the apache2ctl stop / start commands, or by using the relevant init.d script:
root@bt:~# apachectl2 start
Using the init.d scripts:
root@bt:~# /etc/init.d/apache2 start
or you can use stop to stop the Apache server.
5)
FTP
The following bash script (setup-ftp) will set up the FTP user “Lebgeek”:
#!/bin/bash
groupadd ftpgroup
useradd -g ftpgroup -d /dev/null -s /etc ftpuser
echo "[*] Setting up FTP user Lebgeek\n"
pure-pw useradd Lebgeek -u ftpuser -d /ftphome
pure-pw mkdb
cd /etc/pure-ftpd/auth/
ln -s ../conf/PureDB 60pdb
echo "[*] Setting home directory in /ftphome/\n"
mkdir /ftphome
chown -R ftpuser:ftpgroup /ftphome/
/etc/init.d/pure-ftpd restart
echo "[*] Starting FTP server\n"
6)
TFTPD
The default TFTP server on BackTrack is ATFTPD. To start the ATFTPD, issue the following commands:
root@bt:~# atftpd --daemon --port 69 /tmp
To stop the TFTPD, use the pkill or kill command FROM THE NETSTAT command ( in 7). Remember that TFTP uses the UDP protocol.
7)
Netstat
You can verify that the server is up and listening using the netstat command:
For example on SSH:
root@bt:~# netstat -antp |grep sshd
For UDP, like TFTPD, type :
root@bt:~# netstat -anup | grep atftp
8)
VNC Server
A VNC server is useful for remote desktop sharing or for sending remote reverse VNC connections from an attacked machine. To start the VNC server on BackTrack, simply type vncserver in a console window. You will be prompted for a password and the VNC server will open on port 5901.
When you type this:
root@bt:~# vncserver
you get :
You will require a password to access your desktops.
Password: XXXXXXXX
Verify: XXXXXXXX
Would you like to enter a view-only password (y/n)? n
New 'X' desktop is bt:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/bt4:1.log
9) To set up an internet connection from a VMware, you can use the Networking script:
root@bt:~#/etc/init.d/networking start
Got to go now, i'll add other commands later.