| |||||
| |||||
Search Irongeek.com:
Help Irongeek.com pay for bandwidth and research equipment: |
Back To MAN Pages From BackTrack 5 R1 Master List
scapy is a powerful interactive packet manipulation tool,
packet generator, network scanner, network discovery, packet sniffer,
etc. It can for the moment replace hping, parts of nmap, arpspoof, arp-sk,
arping, tcpdump, tshark, p0f, ...
scapy uses the python interpreter as a command board. That means that
you can use directly python language (assign variables, use loops,
define functions, etc.) If you give a file as parameter when you run
scapy, your session (variables, functions, intances, ...) will be saved
when you leave the interpretor, and restored the next time you launch
scapy.
The idea is simple. Those kind of tools do two things : sending packets
and receiving answers. That's what scapy does : you define a set of
packets, it sends them, receives answers, matches requests with answers
and returns a list of packet couples (request, answer) and a list of
unmatched packets. This has the big advantage over tools like nmap or
hping that an answer is not reduced to (open/closed/filtered), but is
the whole packet.
On top of this can be build more high level functions, for example one
that does traceroutes and give as a result only the start TTL of the
request and the source IP of the answer. One that pings a whole network
and gives the list of machines answering. One that does a portscan and
returns a LaTeX report.
$HOME/.scapy_startup.py
This file is run after scapy is loaded. It can be used to configure
some of the scapy behaviors:
More verbose examples are available at
http://www.secdev.org/projects/scapy/demo.html
Just run scapy and try the following commands in the interpreter.
Test the robustness of a network stack with invalid packets:
Pcap file packet reemission:
Manual TCP traceroute:
Protocol scan:
ARP ping:
ACK scan:
Passive OS fingerprinting:
Active OS fingerprinting:
ARP cache poisonning:
Reporting:
May miss packets under heavy load.
Session saving is limited by Python ability to marshal objects. As a
consequence, lambda functions and generators can't be saved, which seriously
reduce usefulness of this feature.
BPF filters don't work on Point-to-point interfaces.
This manual page was written by Alberto Gonzalez Iniesta <agi@agi.as>
and Philippe Biondi.
15 most recent posts on Irongeek.com:
|
If you would like to republish one of the articles from this site on your
webpage or print journal please contact IronGeek.
Copyright 2020, IronGeek
Louisville / Kentuckiana Information Security Enthusiast