51
Testes não Funcionais Nauber Gois Pen Test

Seguranca informacao 1

Embed Size (px)

Citation preview

Page 1: Seguranca informacao 1

Testes não FuncionaisNauber Gois

Pen Test

Page 2: Seguranca informacao 1

Testes de segurança podem, também, ser chamados de Pentest, que significa uma invasão onde se descobre as falhas do sistema. O teste de penetração pode ser associado com o objetivo de achar falhas, aberturas, rastreando por completo todo o sistema, realizando uma auditoria completa.

Page 3: Seguranca informacao 1
Page 4: Seguranca informacao 1
Page 5: Seguranca informacao 1

Utilizar técnicas de enumeração de SNMP e enumeração DNS. Enumeração de DNS é o processo de localizar todos os servidores DNS e entradas DNS para uma organização.

Este processo permitirá reunir informações críticas sobre a organização, como nomes de usuário, nomes de computadores, endereços IP, e assim por diante.

Enumeração de SNMP

Page 6: Seguranca informacao 1

SnmpEnum. Ferramenta de enumeração de SNMP

Page 7: Seguranca informacao 1

dmitry -wnspb targethost.com -o /root/dmitry-resultado

Page 8: Seguranca informacao 1

Usando scapy, podemos emitir um traceroute paralelo. Para iniciá-lo, digite o seguinte comando:

# scapy

>>> ans,unans=sr(IP(dst="www.targethost.com/30", ttl=(1,6))/TCP())

Page 9: Seguranca informacao 1

>>> ans.make_table( lambda (s,r): (s.dst, s.ttl, r.src) )

Page 10: Seguranca informacao 1

res,unans=traceroute(["www.google.com","www.Kali- linux.org","www.targethost.com"],dport=[80,443],maxttl=20, retry=-2)

Page 11: Seguranca informacao 1

res.graph()

Page 12: Seguranca informacao 1

Para salvar o gráfico, basta digitar a seguinte função:

>>> res.graph(target="> /tmp/graph.svg")

Para sair scapy, digite a seguinte função: >>> exit()

Page 13: Seguranca informacao 1
Page 14: Seguranca informacao 1

A typical Nmap scan :

-A, to enable OS and version detection, script scanning, and traceroute; -T4 for faster execution; and then the hostname.

# nmap -A -T4 scanme.nmap.org

Nmap scan report for scanme.nmap.org (74.207.244.221) Host is up (0.029s latency). rDNS record for 74.207.244.221: li86-221.members.linode.com Not shown: 995 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 5.3p1 Debian 3ubuntu7 (protocol 2.0) | ssh-hostkey: 1024 8d:60:f1:7c:ca:b7:3d:0a:d6:67:54:9d:69:d9:b9:dd (DSA) |_2048 79:f8:09:ac:d4:e2:32:42:10:49:d3:bd:20:82:85:ec (RSA) 80/tcp open http Apache httpd 2.2.14 ((Ubuntu)) |_http-title: Go ahead and ScanMe! 646/tcp filtered ldp 1720/tcp filtered H.323/Q.931 9929/tcp open nping-echo Nping echo Device type: general purpose Running: Linux 2.6.X

Page 15: Seguranca informacao 1

-sS (TCP SYN scan)

-sT (TCP connect scan)

-sU (UDP scans) While most popular services on the Internet run over the TCP protocol, UDP services are widely deployed. DNS, SNMP, and DHCP (registered ports 53, 161/162, and 67/68) are three of the most common. Because UDP scanning is generally slower and more difficult than TCP, some security auditors ignore these ports. This is a mistake, as exploitable UDP services

nmap -Ss host

Page 16: Seguranca informacao 1
Page 17: Seguranca informacao 1

nmap -p 1-1000 192.168.1.101

Identificando portas ativas

Usando o amap, também podemos identificar o aplicativo em execução em uma porta específica ou um intervalo de portas, como mostrado no exemplo a seguir: # amap -bq 192.168.10.200 200-300

Page 18: Seguranca informacao 1

Intitle Faz a busca no conteúdo do título [tag title] da página. Exemplo: “intitle: senhas”.

Ele quebra a regra do exemplo acima, dizendo ao Google que todas as palavras que seguem devem ser encontradas no title da página (mais restrito). Exemplo de Dork: “allintitle:admin”

Page 19: Seguranca informacao 1
Page 20: Seguranca informacao 1

gov.br inurl:"/web-console/" intitle:"Administration Console"

brasil inurl:"/debug/default" intitle:"Yii Debugger"

gov.br inurl:"jmx-console/HtmlAdaptor"

Page 21: Seguranca informacao 1

• # intitle:”index of /” password.txt• # filetype:txt + senha + com.br• # filetype:txt intext:senha• # intext: charset_test = email = default_persistent ●• # inurl: / wwwboard / passwd.txt • # filetype: log inurl: “password.log”

Page 22: Seguranca informacao 1

uscando câmeras/webcams disponíveis na internet: ● inurl:”inurl:/view.shtml” ● inurl:”inurl:ViewerFrame?Mode=” ● inurl:”intitle:”Live View / – AXIS” | inurl:view/view.shtml^” ●

inurl:”inurl:ViewerFrame?Mode=Refresh” ● inurl:”inurl:axis-cgi/jpg” ● inurl:”inurl:axis-cgi/mjpg (motion-JPEG)” ● inurl:”inurl:view/indexFrame.shtml”

Page 23: Seguranca informacao 1

http://sechow.com/bricks/index.html

Page 24: Seguranca informacao 1
Page 25: Seguranca informacao 1

Executed SQL query when username is tom and password is ' or '1'='1:

SELECT * FROM users WHERE name='tom' and password='' or '1'='1'

Page 26: Seguranca informacao 1
Page 27: Seguranca informacao 1
Page 28: Seguranca informacao 1
Page 29: Seguranca informacao 1
Page 30: Seguranca informacao 1
Page 31: Seguranca informacao 1

<script>alert("This is a XSS Exploit Test")</script>

Page 32: Seguranca informacao 1

Um exploit (em português explorar, significando "usar algo para sua própria vantagem") é um pedaço de software, um pedaço de dados ou uma sequência de comandos que tomam vantagem de um defeito, falha ou vulnerabilidade a fim de causar um comportamento acidental

Page 33: Seguranca informacao 1

Na computação, payload (às vezes referenciado como o corpo de dados) refere-se à carga de uma transmissão de dados.

É a parte dos dados transmitidos, que é o objetivo fundamental da transmissão, excluindo as informações enviadas com ela (como cabeçalhos ou metadados, também conhecido como dados complementares, que podem conter, dentre outras informações, a identificação da fonte e do destino dos dados) apenas para facilitar a entrega.

Uma vez que estes são utilizados apenas no processo da transmissão, eles são removidos do pacote ao chegar ao destino. Assim, payload refere-se aos dados recebidos pelo sistema destino.

Page 34: Seguranca informacao 1

Metaexploit

Page 35: Seguranca informacao 1
Page 36: Seguranca informacao 1
Page 37: Seguranca informacao 1
Page 38: Seguranca informacao 1

msf > load wmap

.-.-.-..-.-.-..---..---.| | | || | | || | || |-'`-----'`-'-'-'`-^-'`-'[WMAP 1.5.1] === et [ ] metasploit.com 2012[*] Successfully loaded plugin: wmap

msf > help

wmap Commands=============

Command Description ------- ----------- wmap_modules Manage wmap modules wmap_nodes Manage nodes wmap_run Test targets wmap_sites Manage sites wmap_targets Manage targets wmap_vulns Display web vulns

...snip...

Page 39: Seguranca informacao 1

sf > wmap_sites -h[*] Usage: wmap_targets [options]

-h Display this help text-a [url] Add site (vhost,url)-l List all available sites-s [id] Display site structure (vhost,url|ids) (level)

msf > wmap_sites -a http://172.16.194.172[*] Site created.msf > wmap_sites -l[*] Available sites===============

Id Host Vhost Port Proto # Pages # Forms -- ---- ----- ---- ----- ------- ------- 0 172.16.194.172 172.16.194.172 80 http 0 0

Page 40: Seguranca informacao 1

sf > wmap_sites -h[*] Usage: wmap_targets [options]

-h Display this help text-a [url] Add site (vhost,url)-l List all available sites-s [id] Display site structure (vhost,url|ids) (level)

msf > wmap_sites -a http://172.16.194.172[*] Site created.msf > wmap_sites -l[*] Available sites===============

Id Host Vhost Port Proto # Pages # Forms -- ---- ----- ---- ----- ------- ------- 0 172.16.194.172 172.16.194.172 80 http 0 0

Page 41: Seguranca informacao 1

msf > wmap_targets -l[*] Defined targets===============

Id Vhost Host Port SSL Path -- ----- ---- ---- --- ---- 0 172.16.194.172 172.16.194.172 80 false /mutillidae/index.php

Page 42: Seguranca informacao 1
Page 43: Seguranca informacao 1
Page 44: Seguranca informacao 1
Page 45: Seguranca informacao 1
Page 46: Seguranca informacao 1
Page 47: Seguranca informacao 1
Page 48: Seguranca informacao 1
Page 49: Seguranca informacao 1
Page 50: Seguranca informacao 1
Page 51: Seguranca informacao 1