{"id":2813,"date":"2012-05-14T01:35:35","date_gmt":"2012-05-14T01:35:35","guid":{"rendered":"http:\/\/www.ethicalhacker.com.br\/site\/?p=2813"},"modified":"2019-05-23T21:06:07","modified_gmt":"2019-05-24T00:06:07","slug":"comandos-basicos-linux-backtrack","status":"publish","type":"post","link":"https:\/\/www.ethicalhacker.com.br\/site\/2012\/05\/diversos\/comandos-basicos-linux-backtrack\/","title":{"rendered":"Comandos B\u00e1sicos LINUX Back|Track"},"content":{"rendered":"<p>A seguir alguns comandos b\u00e1sicos UNIX utilizados no Back|Track 5.<\/p>\n<p>Listando diret\u00f3rios:<\/p>\n<pre id=\"terminal\">ls -la\r\n\r\nteste.sh  teste2.sh  \/tmp<\/pre>\n<p>Navegando em diret\u00f3rios :<\/p>\n<pre id=\"terminal\"> cd \/pentest\/enumeration\/snmp<\/pre>\n<p>Criando diret\u00f3rio chamado teste :<\/p>\n<pre id=\"terminal\"> mkdir teste<\/pre>\n<p>Checando IP:<\/p>\n<pre lang=\"shell\"> ifconfig eth0\r\n\r\neth0      Link encap:EthernetHWaddr 08:00:29:fd:8d:79\r\ninet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0\r\ninet6addr: fe80::a00:29ff:fefd:8d79\/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:8 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0\r\ncollisions:0 txqueuelen:1000\r\n          RX bytes:1444 (1.4 KB)  TX bytes:1712 (1.7 KB)\r\n          Interrupt:10 Base address:0xd020<\/pre>\n<p>Atribui\u00e7\u00e3o de IP\/DHCP<\/p>\n<pre lang=\"shell\"> dhclient eth0\r\n\r\nInternet Systems Consortium DHCP Client V3.1.1\r\nCopyright 2004-2008 Internet Systems Consortium.\r\nAll rights reserved.\r\nFor info, please visit http:\/\/www.isc.org\/sw\/dhcp\/\r\n\r\nListening on LPF\/eth0\/08:00:27:8d:76:21\r\nSending on   LPF\/eth0\/08:00:27:8d:76:21\r\nSending on   Socket\/fallback\r\nDHCPREQUEST of 10.0.2.15 on eth0 to 255.255.255.255 port 67\r\nDHCPACK of 10.0.2.15 from 10.0.2.2\r\nbound to 10.0.2.15 -- renewal in 37988 seconds.<\/pre>\n<p>Configurando IP manualmente e atribuindo rota default:<\/p>\n<pre lang=\"shell\"> ifconfig eth0 192.168.0.10\/24<\/pre>\n<pre lang=\"shell\"> route add default gw 192.168.0.1<\/pre>\n<pre lang=\"shell\"> echo nameserver 192.168.0.254 &gt;&gt; \/etc\/resolv.conf<\/pre>\n<p>Reiniciando placa de rede:<\/p>\n<pre lang=\"shell\"> \/etc\/init.d\/networking restart<\/pre>\n<p>Parando placa de rede:<\/p>\n<pre lang=\"shell\"> \/etc\/init.d\/networking stop<\/pre>\n<p>Iniciando placa de rede:<\/p>\n<pre lang=\"shell\"> \/etc\/init.d\/networking start<\/pre>\n<p>Atualizando o Back|track 5:<\/p>\n<pre lang=\"shell\"> cat \/etc\/apt\/sources.list\r\n# conteudo source.list\r\ndebhttp:\/\/all.repository.backtrack-linux.org revolution main microverse non-free testing\r\ndebhttp:\/\/32.repository.backtrack-linux.org revolution main microverse non-free testing\r\ndebhttp:\/\/source.repository.backtrack-linux.org revolution main microverse non-free<\/pre>\n<pre lang=\"shell\"> apt-get update<\/pre>\n<pre lang=\"shell\"> apt-get upgrade<\/pre>\n<p>Iniciando o Apache :<\/p>\n<pre lang=\"shell\"> \/etc\/init.d\/apache2 start<\/pre>\n<p>Verificando portas ativas:<\/p>\n<pre lang=\"shell\">netstat \u2013an | grep 80\r\n\r\ntcp instal0  0 0.0.0.0:80      0.0.0.0:*               LISTEN<\/pre>\n<p>Parando o Apache:<\/p>\n<pre lang=\"shell\"> \/etc\/init.d\/apache2 stop<\/pre>\n<p>Gerando chaves SSH:<\/p>\n<pre lang=\"shell\"> sshd-generate<\/pre>\n<p>Iniciando o SSH:<\/p>\n<pre lang=\"shell\"> \/etc\/init.d\/ssh start<\/pre>\n<p>Parando o SSH:<\/p>\n<pre lang=\"shell\"> \/etc\/init.d\/ssh stop<\/pre>\n<p>Atribuindo permiss\u00e3o de escrita, leitura e execu\u00e7\u00e3o em um arquivo:<\/p>\n<pre lang=\"shell\"> chmod 777 teste.sh<\/pre>\n<p>Excluindo um arquivo:<\/p>\n<pre lang=\"shell\"> rm teste.sh<\/pre>\n<p>Copiando arquivo teste.sh para diret\u00f3rio temp:<\/p>\n<pre lang=\"shell\"> cp teste.sh \/temp<\/pre>\n<p>Renomeando arquivo teste.sh para teste2.sh:<\/p>\n<pre lang=\"shell\"> mv teste.sh teste2.sh<\/pre>\n<p>Mostrando espa\u00e7o em disco:<\/p>\n<pre lang=\"shell\"> df -h\r\n\r\nSist. Arq.              Tam     Usad    Disp    Uso%            Montado em\r\n\/dev\/hda1               8,0G    4,00    4,00    50%             \/<\/pre>\n<p>Reiniciando o sistema:<\/p>\n<pre lang=\"shell\">reboot<\/pre>\n<p>Desligando o sistema:<\/p>\n<pre lang=\"shell\">shutdown<\/pre>\n<p>Visualizando hist\u00f3rico:<\/p>\n<pre lang=\"shell\">history\r\n  400  su\r\n  401  cd tmp\r\n  402  clear<\/pre>\n<p>Localizando execut\u00e1veis:<\/p>\n<pre lang=\"shell\">whereis teste.sh\r\n teste.sh: \/root<\/pre>\n<p>Exibindo nome e vers\u00e3o do Kernel:<\/p>\n<pre lang=\"shell\">uname -a\r\nLinux blackhat-phenom 2.6.8-2-x6 #1 Sun Mai 13 04:26:00 EST 2012 i686 GNU\/Linux<\/pre>\n<p>Montando dispositivos USB Pendrive FAT:<\/p>\n<pre lang=\"shell\">mkdir \/mnt\/pendrive<\/pre>\n<pre lang=\"shell\">mount -t vfat \/dev\/sdaX \/mnt\/pendrive<\/pre>\n<p>Desmontando dispositivo:<\/p>\n<pre lang=\"shell\">umount \/dev\/sdaX<\/pre>\n\r\n\t\t<div class='author-shortcodes'>\r\n\t\t\t<div class='author-inner'>\r\n\t\t\t\t<div class='author-image'>\r\n\t\t\t<img src='https:\/\/www.ethicalhacker.com.br\/site\/wp-content\/uploads\/186048_100001838322519_1550894_n-11668_57x57.jpg' alt='' \/>\r\n\t\t\t<div class='author-overlay'><\/div>\r\n\t\t<\/div> <!-- .author-image --> \r\n\t\t<div class='author-info'>\r\n\t\t\t<p>Autor:\u00a0<strong>S\u00edlvio C\u00e9sar Roxo Giavaroto<\/strong><\/p>\n<p>\u00c9 MBA Especialista em Gest\u00e3o de Seguran\u00e7a da Informa\u00e7\u00e3o,\nTecn\u00f3logo em Redes de Computadores, C|EH Certified Ethical Hacker,\natua como Pentest e Analista de Seguran\u00e7a em Servidores Linux no\nGoverno do Estado de S\u00e3o Paulo, Professor Universit\u00e1rio , \u00a0Instrutor\nC|EH e C|HFI.<\/p>\n<p><em>\u00a0<\/em>\r\n\t\t<\/div> <!-- .author-info --><\/p>\r\n\t\t\t<\/div> <!-- .author-inner -->\r\n\t\t<\/div> <!-- .author-shortcodes -->\n","protected":false},"excerpt":{"rendered":"<p>A seguir alguns comandos b\u00e1sicos UNIX utilizados no Back|Track 5. Listando diret\u00f3rios: ls -la teste.sh teste2.sh \/tmp Navegando em diret\u00f3rios : cd \/pentest\/enumeration\/snmp Criando diret\u00f3rio 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3320,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[100],"tags":[],"class_list":["post-2813","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-diversos"],"_links":{"self":[{"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/posts\/2813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/comments?post=2813"}],"version-history":[{"count":55,"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/posts\/2813\/revisions"}],"predecessor-version":[{"id":10219,"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/posts\/2813\/revisions\/10219"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/media\/3320"}],"wp:attachment":[{"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/media?parent=2813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/categories?post=2813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ethicalhacker.com.br\/site\/wp-json\/wp\/v2\/tags?post=2813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}