Comandos Básicos LINUX Back|Track

A seguir alguns comandos básicos UNIX utilizados no Back|Track 5.

Listando diretórios:

ls -la

teste.sh  teste2.sh  /tmp

Navegando em diretórios :

 cd /pentest/enumeration/snmp

Criando diretório chamado teste :

 mkdir teste

Checando IP:

 ifconfig eth0

eth0      Link encap:EthernetHWaddr 08:00:29:fd:8d:79
inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
inet6addr: fe80::a00:29ff:fefd:8d79/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
          RX bytes:1444 (1.4 KB)  TX bytes:1712 (1.7 KB)
          Interrupt:10 Base address:0xd020

Atribuição de IP/DHCP

 dhclient eth0

Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/08:00:27:8d:76:21
Sending on   LPF/eth0/08:00:27:8d:76:21
Sending on   Socket/fallback
DHCPREQUEST of 10.0.2.15 on eth0 to 255.255.255.255 port 67
DHCPACK of 10.0.2.15 from 10.0.2.2
bound to 10.0.2.15 -- renewal in 37988 seconds.

Configurando IP manualmente e atribuindo rota default:

 ifconfig eth0 192.168.0.10/24
 route add default gw 192.168.0.1
 echo nameserver 192.168.0.254 >> /etc/resolv.conf

Reiniciando placa de rede:

 /etc/init.d/networking restart

Parando placa de rede:

 /etc/init.d/networking stop

Iniciando placa de rede:

 /etc/init.d/networking start

Atualizando o Back|track 5:

 cat /etc/apt/sources.list
# conteudo source.list
debhttp://all.repository.backtrack-linux.org revolution main microverse non-free testing
debhttp://32.repository.backtrack-linux.org revolution main microverse non-free testing
debhttp://source.repository.backtrack-linux.org revolution main microverse non-free
 apt-get update
 apt-get upgrade

Iniciando o Apache :

 /etc/init.d/apache2 start

Verificando portas ativas:

netstat –an | grep 80

tcp instal0  0 0.0.0.0:80      0.0.0.0:*               LISTEN

Parando o Apache:

 /etc/init.d/apache2 stop

Gerando chaves SSH:

 sshd-generate

Iniciando o SSH:

 /etc/init.d/ssh start

Parando o SSH:

 /etc/init.d/ssh stop

Atribuindo permissão de escrita, leitura e execução em um arquivo:

 chmod 777 teste.sh

Excluindo um arquivo:

 rm teste.sh

Copiando arquivo teste.sh para diretório temp:

 cp teste.sh /temp

Renomeando arquivo teste.sh para teste2.sh:

 mv teste.sh teste2.sh

Mostrando espaço em disco:

 df -h

Sist. Arq.              Tam     Usad    Disp    Uso%            Montado em
/dev/hda1               8,0G    4,00    4,00    50%             /

Reiniciando o sistema:

reboot

Desligando o sistema:

shutdown

Visualizando histórico:

history
  400  su
  401  cd tmp
  402  clear

Localizando executáveis:

whereis teste.sh
 teste.sh: /root

Exibindo nome e versão do Kernel:

uname -a
Linux blackhat-phenom 2.6.8-2-x6 #1 Sun Mai 13 04:26:00 EST 2012 i686 GNU/Linux

Montando dispositivos USB Pendrive FAT:

mkdir /mnt/pendrive
mount -t vfat /dev/sdaX /mnt/pendrive

Desmontando dispositivo:

umount /dev/sdaX

Autor: Sílvio César Roxo Giavaroto

É MBA Especialista em Gestão de Segurança da Informação, Tecnólogo em Redes de Computadores, C|EH Certified Ethical Hacker, atua como Pentest e Analista de Segurança em Servidores Linux no Governo do Estado de São Paulo, Professor Universitário ,  Instrutor C|EH e C|HFI.

 

468 ad

Deixe seu Comentário