Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I call the send function without getting output?

Tags:

python

scapy

Does anyone know how to send a packet using scapy and not receive any output?

This is the command:

send(packet, iface="eth0") 

This is the output

Sent 1 packets.

I'm trying to get it not to print the packet count line at all.

like image 265
CBaker Avatar asked Mar 13 '13 04:03

CBaker


1 Answers

Try the verbose parameter. Scapy documentation says that verbose should "make the function totally silent when 0". Both False and 0 appear to work. For example:

>>> send(IP(dst="1.2.3.4")/ICMP())
.
Sent 1 packets.
>>> send(IP(dst="1.2.3.4")/ICMP(), verbose=0)
>>> send(IP(dst="1.2.3.4")/ICMP(), verbose=False)
>>> 

You can get little more information using help():

>>> help(send)
Help on function send in module scapy.sendrecv:

send(x, inter=0, loop=0, count=None, verbose=None, realtime=None, *args, **kargs)
    Send packets at layer 3
    send(packets, [inter=0], [loop=0], [verbose=conf.verb]) -> None
(END)
like image 130
crayzeewulf Avatar answered Oct 30 '22 16:10

crayzeewulf