Jump to content

Recommended Posts

Posted

scapy é uma biblioteca para criação e manipulação de Raw Packets

http://www.secdev.org/projects/scapy/

para mostrar o verdadeiro poder vou demonstrar a criação de um Port Scanner com python e Scpay

criem um ficheiro python - pscan.py

#!/usr/bin/env python

  import sys
  from scapy import *
  conf.verb=0

  if len(sys.argv) != 2:
      print "Usage: ./pscan.py <target>"
      sys.exit(1)

  target=sys.argv[1]

  p=IP(dst=target)/TCP(dport=80flags="S")
  ans,unans=sr(ptimeout=9)

  for a in ans:
      if a[1].flags == 2:
          print a[1].src

 

Nota: para tornar um ficheiro python em executável (interpretado pelo interpretador pyhton) coloquem esta linha sempre no início dos scripts

#!/usr/bin/env python

e vamos experimentar chamando o pscan na shell

shell#./pscan.py 192.168.9.0/24

  192.168.9.1

  192.168.9.2

  192.168.9.11

  192.168.9.14

artigo completo

http://hackaholic.org/papers/blackmagic.txt

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.