pinging from within python

Jorgen Grahn jgrahn-nntq at
Sat Sep 17 23:37:52 CEST 2005

On Mon, 12 Sep 2005 01:36:35 +0200, billiejoex <billiejoex at> wrote:
> Impacket module can helps you to construct the ip/icmp packet structure, 
> then you can send the packet and wait for the ECHOREPLY by using a 
> Here's an example:

Yeah, but is he willing to be root, and ditch Windows, just to be able to
ping?  Exec()ing the ping utility is often better, but beware -- different
pings take different options.

[the original poster]
>> I need a simple script to run the ping command with some parameters and be 
>> able to read the return value of the ping function.

What is "the return value of the ping function"? You can use the ping
utility for many different things, and it reports many different kinds of
outcomes. It's not black and white.


  // Jorgen Grahn <jgrahn@       Ph'nglui mglw'nafh Cthulhu
\X/      >   R'lyeh wgah'nagl fhtagn!

More information about the Python-list mailing list