e for simply sniff network traffic?
I made a simple 'data over ICMP' client that sends
packets containing strings:
http://billiejoex.altervista.org/a1.txt
...now I have to develop a simple server that
sniffs them.
Greetings
billiejoex
--
http://mail.python.org/mailman/listinfo/python-list
Hi!
I made a little, simple program that sends strings over an ICMP packet.
The source here:
http://billiejoex.altervista.org/a1.txt
Now all I need is create a simple network sniffer able to sniff the ICMP
packets and print the strings on the screen.
A useful library known in a lot of other prog
Thank you for your fast reply. You're right. I'll be more specific, sorry.
The example source is the one you can find on the 'Impacket' page on the
same site of pcapy:
http://oss.coresecurity.com/impacket/sniff.py
I use a Win XP prof sp2 system, python ver. 2.4.1.
Here's the output:
C:\Python24>1
Thanks for your help. Like you suggested I converted the integer value in a
string one by using the repr() funtion applied on the print:
print '%d \n %s' %(count, repr(iface))
The program now permit me to select the interface. The output is in a
strange hex-similar form:
C:\Python24>test.py
0
Sorry... the text has been wrong formatted. Read this, plz >>>
Thanks for your help. Like you suggested I converted the integer value in a
string one by using the repr() funtion applied on the print:
print '%d \n %s' %(count, repr(iface))
The program now permit me to select the interface. The outp
Moreover the getInterface() function seems to be unexistent:
>>> from pcapy import *
>>> getInterface()
Traceback (most recent call last):
File "", line 1, in ?
NameError: name 'getInterface' is not defined
Maybe it can be used only on *nix platforms?
--
http://mail.python.org/mailman/listi
Hi all.
I was wondering if it ispossible to integrate C source in a python project.
Best regards
--
http://mail.python.org/mailman/listinfo/python-list
Than you James. I'll take a look as soon as possible.
It is possible do the contrary (integrates python source in a C project)?
"James" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]
> billiejoex wrote:
>> Hi all.
>> I was wondering if it
usable in both platforms.
Maybe do can I process the unicode outputs and converting them into valid
strings?
Happy summer and happy coding! :-)
Regards
billiejoex
>>> pcapy.findalldevs()
[u'\u445c\u7665\u6369\u5c65\u504e\u5f46\u6547\u656e\u6972\u4e63\u6964\u5773\u6e6
1\u6441\u
The problem was my winpcap version. I was using the 3.1.
Now, with the 3.0 it works.
Really thanks. :-)
> For what it's worth, I can run that on my XP Professional SP2 machine and
> it works perfectly:
>
pcapy.findalldevs()
> [u'\\Device\\NPF_{15310604-FCFC-4016-9D36-14DAA948A600}',
> u'\\D
Hi all. I got a problem when using socket modules.
By using them I can't stop my program by pressing ctrl+c.
The only way to doit is by killing the python.exe process manually.
Is there a solution to avoid this?
Regards
--
http://mail.python.org/mailman/listinfo/python-list
Awesome. :-)
Thank you.
> You may find that CTRL/Break works even when CTRL/C doesn't.
>
> regards
> Steve
> --
> Steve Holden +44 150 684 7255 +1 800 494 3119
> Holden Web LLC http://www.holdenweb.com/
>
--
http://mail.python.org/mailman/listinfo/python-list
Hi all. I'm using pcapy module to sniff some ICMP packets. I would like to
modify this source:
http://www.google.it/search?hl=it&q=pcapy&btnG=Cerca+con+Google&meta=
and visualize only the DATA filed of the sniffed packets instead of all
fields that are generally visualized (for example: ip src, i
I'm really sorry. I was talking about this source:
http://oss.coresecurity.com/impacket/sniff.py
...but nevermind. I discovered the get_data_as_string() function that
resolved my problem
> Sorry, but *which* source are you talking about? The link you provided
> appears to be merely a page of G
Hi all. I'd need to aproximate a given float number into the next (int)
bigger one. Because of my bad english I try to explain it with some example:
5.7 --> 6
52.987 --> 53
3.34 --> 4
2.1 --> 3
Regards
--
http://mail.python.org/mailman/listinfo/python-list
Thank you. :-)
--
http://mail.python.org/mailman/listinfo/python-list
I wanted the round up the number (5.0 = 5.0, not 6.0.). The ceil funciotn is
the right one for me.
Thanks to all.
>> Grant Edwards wrote:
>>> On 2005-08-30, Devan L <[EMAIL PROTECTED]> wrote:
>>> >
>>> > RoundToInt(2.0) will give you 3.
>>>
>>> That's what the OP said he wanted. The next bigger
Hi all. I tried to compile this little source with py2exe:
http://pastebin.com/350143
...but once I execute the program I encount this error:
C:\src\dist>sniffer.exe
Traceback (most recent call last):
File "sniffer.py", line 24, in ?
File "sniffer.py", line 18, in get_int
LookupError: no codec
Really thank you. It works.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all. Hi would like to use two threads in a program but all the examples I
found on the net use oop programming that I doesn't love too much. :-)
Can you code me a short example in wich two different functions are executed
at the same time, plz?
Thank you all.
--
http://mail.python.org/mail
Thank you for your helping.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all. I'm sorry for a noob question like this but I'll try to ask it
anyway.
One of the greatest problem that may discourage a new user to choose Python
language is it's interpreted nature.
Another important problem is that no interpreter is installed on Windows
machine by default and this mak
I'm sorry. Maybe you misunderstanded.
I know the great advanteges deriving by using interpretation too, I
appreciate it very much (I'm newbie in Python and the interpeter really
helps me out in many situations), but a 'pure' interpretated language needs
obligatorily an interpreter and (sorry fo
> there are "noob" questions and there are uneducated questions, yours
> are of the latter ( actually yours are STATEMENTS not questions ), and
> just trolling for what it is worth, if you would take the time to read
> what Python is and why it is you would not be asking these "questions".
I'm rea
Clear. Thank you all.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all. I'm trying to make a simple icmp sniffer by using SOCK_RAW.
The code below works but ONLY if I first use the sendto() function.
Does anybody knows why?
Regards
from socket import *
import select
def recv():
while 1:
if s in select.select([s],[],[],99)[0]:
reply = s.
Hi all. The source below is a simple icmp sniffer made with pcapy.
To decode packets I'm using the EthDecoder() function that returns a
rapresentation of the packet including ICMP type, ICMP code, IP source and
IP destination.
All I need, now, is to get the ip src and ip dst only but I don't know
Hi all. I'm searching for a portable (working on *nix and win32) function
that executes a system command and encapsulate its output into a string.
Searching for the web I found this:
os.popen('command').read()
It is perfect but when che command return an error the funciotn returns an
empy strin
Thank you for your help but I'm searching a different way.
Moreover it doesn't work always (for exaple: try a 'dir' command).
Because of I'm implementing a remote shell the
[[os.popen('command').read()]] rapresents the best for me because it can
also accepts arguments direclty (for example:
os
Thanks for suggestions.
I'll try one of these solutions soon.
--
http://mail.python.org/mailman/listinfo/python-list
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
RAW_SOCKET.
Here's an example:
http://oss.coresecurity.com/impacket/ping.py
Cheers
> I need a simple script to run the ping command with some parameters an
Hi all. I noticed that with the original pcap sniffing library it is
possible to listen on multiple devices by using "select()" or "poll()"
function.
These function aren't present in pcapy module. Do you got any suggestion to
avoid this problem?
--
http://mail.python.org/mailman/listinfo/pyth
If you are intrested in speed my personal advice is to use UDP insted of
TCP.
The great majority of network games use it.
Here's a simple UDP implementation:
http://www.evolt.org/article/Socket_Programming_in_Python/17/60276/
> For an online game I'm developing I need some advice concerning
> tc
On 8 Giu, 16:54, "Dave Borne" <[EMAIL PROTECTED]> wrote:
> > I'm trying to figure out how to use FTP/SSL (FTPS) - just as a client. Can I
> > do this in Python? Is everything I need in ftplib? Where else do I look? And
> > - any good newbie references on using FTPS?
>
> Hi, Nancy,
> I'm not sure i
Hi there,
I've noticed that os.path.normpath does not collapse redundant
separators if they're located at the beginning of the string:
>>> print os.path.normpath('/a//b//c')
\a\b\c
>>> print os.path.normpath('//a//b//c')
\\a\b\c
Is it intentional or is it a bug?
--
http://mail.python.org/mailma
On 14 Giu, 22:35, Michael Hoffman <[EMAIL PROTECTED]> wrote:
> Intentional.
>
> http://en.wikipedia.org/wiki/Path_(computing)#Universal_Naming_Conven...
> --
> Michael Hoffman
Got it.
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
On 14 Giu, 19:25, samuraisam <[EMAIL PROTECTED]> wrote:
> FTP LST/LIST/NLST date field formatting function for all those seekers
> out there...
>
> import time
> import datetime
>
> def ftpdateformat(value):
> """Formats dates from most FTP servers"""
> if ":" in value: # within 6 months
>
Hi there,
unfortunately, I'm compelled to apply a sort of monkey patching at the
code of an existing libreary that I can't modify directly.
Here's my question
Having such code:
class test:
def caller(self):
self.b()
def called(self):
pass
...(if it is possible) how can I
On 19 Giu, 22:50, Stefan Sonnenberg-Carstens
<[EMAIL PROTECTED]> wrote:
> billiejoex schrieb:
>
>
>
> > Hi there,
> > unfortunately, I'm compelled to apply a sort of monkey patching at the
> > code of an existing libreary that I can't modify directl
On 20 Giu, 06:52, John Nagle <[EMAIL PROTECTED]> wrote:
> billiejoex wrote:
> > Hi there,
> > unfortunately, I'm compelled to apply a sort of monkey patching at the
> > code of an existing libreary that I can't modify directly.
> ...
>
> > ...(if i
os.listdir(path) return a list of file names independently if the path-
argument used is absolute or relative:
>>> os.getcwd()
'/home/user'
>>> os.listdir('Desktop')
['file.py']
>>> os.listdir('/home/user/Desktop')
['file.py']
glob.glob, instead, return file names only if given path is relative:
Hi there,
In an asyncore based FTP server I wrote I should be able to receive
OOB data from clients.
A client sending such kind of data should act like this:
>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.connect(('127.0.0.1', 21))
>>> s.sendall('hello there\r\n'
If it could be useful I attach the complete server application I used
for doing tests:
< code >
import asyncore, asynchat, socket, os
class Handler(asynchat.async_chat):
def __init__(self, sock_obj):
asynchat.async_chat.__init__(self, conn=sock_obj)
self.remote_ip, self.remo
Douglas Wells wrote:
> Second, when I look at the FTP specification, I don't find the
> concept of OOB anywhere. So, it's not clear what OOB data would
> mean in terms of the defined FTP commands in any case.
Steve Holde wrote:
> You are correct, however, in stating that the FTP
> protocol does
On 24 Apr, 19:51, "Viewer T." <[EMAIL PROTECTED]> wrote:
> I would like to know which modules I would need in order to create
> peer-to-peer chat program in python using Tkinter.
>
> If I would need modules that do not come packaged with python, I would
> appreciate information on where I can get t
On 26 Apr, 16:29, Florian Demmer <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I have a number of ftp uploads running in parallel using
> ftplib.storbinary and threading and in case one of them fails I need
> to interrupt all the others (but not exit the program completely)...
> do you guys have an idea ho
On 14 Mag, 06:51, "Paul Kozik" <[EMAIL PROTECTED]> wrote:
> I have trouble finding a solid example for what I need. Python.org and
> other sites provide simple examples, but they appear more intended for
> servers that simply send one peice of data to the client.
Not a big deal. asynchat / asyncor
On 14 Mag, 06:51, "Paul Kozik" <[EMAIL PROTECTED]> wrote:
> I have trouble finding a solid example for what I need. Python.org and
> other sites provide simple examples, but they appear more intended for
> servers that simply send one peice of data to the client.
Not a big deal. asynchat / asyncor
On 25 Lug, 09:48, [EMAIL PROTECTED] wrote:
> Hi,
> I write the following script to retrieve a part of a large file
> from a FTP site:
>
> import ftplib
>
> class ftp_getter(object):
>
> def __init__(self):
> self.handle = ftplib.FTP('ftp_server_address')
> self.handle.set_de
Hi there.
I'm setting up test suite for a project of mine.
>From test suite, acting as a client, I'd like to know, in certain
situations, if the socket is closed on the other end or not.
I noticed that I can "detect" such state if a call to socket.read()
returns 0 but it seems a little poor to me.
On 25 Lug, 16:37, Roy Smith <[EMAIL PROTECTED]> wrote:
> This isn't really a Python question, it's a Berkeley Socket API question.
> You don't say, but I assume you're talking about a TCP (i.e. SOCKSTREAM)
> connection?
Yes.
> The answer is you can use the select() system call to detect "excep
Hi all,
I would like to use tempfile module to generate files having unique
names excepting that I don't want them to be removed after closing.
Does it is possible?
--
http://mail.python.org/mailman/listinfo/python-list
On 9 Ago, 20:31, [EMAIL PROTECTED] wrote:
> On Aug 9, 11:21 am, billiejoex <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> > I would like to use tempfile module to generate files having unique
> > names excepting that I don't want them to be removed after closing.
On 21 Ago, 23:07, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hey all,
>
> I've been using libgmail to send out automated notification emails for
> my company's nightly regression testing. Last night these emails
> started failing, though the python code has not changed. I updated to
> the l
Hi there,
I'm facing a case where I need to get the traceback outptut when
occurring an exception.
I solved such problem by using traceback module in conjunction with
StringIO:
import StringIO, traceback
try:
raise Exception
except:
f = StringIO.StringIO()
traceback.print_exc(file=f)
On 21 Ago, 22:36, Brad Johnson <[EMAIL PROTECTED]> wrote:
> Joel Andres Granados gmail.com> writes:
>
>
>
> > Hello list:
>
> > I have tried various times to use an IDE for python put have always been
> > disapointed.
>
> Not sure which platform you're on, but I've really liked PyScripter for the
On 22 Ago, 03:11, "Evan Klitzke" <[EMAIL PROTECTED]> wrote:
> On 8/21/07, codesite-noreply <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On 22 Ago, 02:09, "Evan Klitzke" <[EMAIL PROTECTED]> wrote:
> > > On 8/21/07, billiejoex &
Hi there. I'm writing a modification for a FTP server library I'm
maintaining.
Depending on the system I'd want to temporarily impersonate the logged
user to perform actions on filesystem.
Something like:
try:
change_user('user', 'password')
os.rmdir('dir')
except:
print "some error"
f
On 23 Ago, 10:38, Tim Golden <[EMAIL PROTECTED]> wrote:
> billiejoex wrote:
> > Hi there. I'm writing a modification for a FTP server library I'm
> > maintaining.
> > Depending on the system I'd want to temporarily impersonate the logged
> > user
On 23 Ago, 13:13, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> On 8/23/07, billiejoex <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On 23 Ago, 10:38, Tim Golden <[EMAIL PROTECTED]> wrote:
> > > billiejoex wrote:
> > &g
On 23 Ago, 23:20, Steve Holden <[EMAIL PROTECTED]> wrote:
> billiejoex wrote:
> > On 23 Ago, 13:13, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> [...]
> >> Note that running your process as a user with enough priviledges to
> >> impersonate ano
On 24 Ago, 09:57, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> I have to write a little program that has to run on a number of hosts.
> Versions of python range from 2.2.3. to 2.4.2.
>
> The easiest way to implement the necessary behaviour seems to me to
> use the tarfile module. However that was onl
Hi there.
I'm trying to generate a brand new file with a unique name by using
tempfile.mkstemp().
In conjunction I used os.fdopen() to get a wrapper around file
properties (write & read methods, and so on...) but 'name' attribute
does not contain the correct file name. Why?
>>> import os
>>> impor
Thanks all.
Another question: I have to open file for writing ('wb') but I noticed
that both tempfile.mkstemp() and os.fdopen() accept a "mode" argument.
It's not clear *when* do I have to specify such mode. When using
tempfile.mkstemp?
>>> fileno, name = tempfile.mkstemp(text=False)
>>> fd = os.f
Gabriel Genellina wrote:
> As someone already suggested, why don't you use TemporaryFile or
> NamedTemporaryFile and avoid such problems?
Because I don't want file to be removed after closing.
--
http://mail.python.org/mailman/listinfo/python-list
>>> import os
>>> hasattr(os, 'sep')
True
>>> hasattr(os.path, 'sep')
True
By chance I noticed it.
Are there differences (I think not...)?
IMHO, if there are no differences os.path.sep should be removed since
it may be confusing.
--
http://mail.python.org/mailman/listinfo/python-list
Hi there,
into a module of mine I 'warn' a message if a certain situation
occurs:
def add_anonymous_user(permissions=('r'):
if 'w' in p:
import warnings
warnings.warn("it's not rencommended assigning 'w'
permission to anonymous user.", RuntimeWarning, stacklevel=2)
I'd
On 10 Set, 17:15, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On Sep 10, 7:08 am, billiejoex <[EMAIL PROTECTED]> wrote:
>
> > Hi there,
> > into a module of mine I 'warn' a message if a certain situation
> > occurs:
>
> >
Hi there,
I'm having problems with creating an installer for a module of mine by
using distutils. I'll try to explain my problem as clear as I can
(sorry but English is not my first language).
This is the structure of my module:
setup.py
mypackage/
__init__.py
ychat frameworks.
pyftpdlib is actually the most complete RFC959 FTP server
implementation available for Python language.
Requirements
==
Python 2.2 or higher
Bug reports / Contacts
====
billiejoex [EMAIL PROTECTED] gmail (dot) com
--
http://mail.python.org/mailman/listinfo/python-list
ychat frameworks.
pyftpdlib is actually the most complete RFC959 FTP server
implementation available for Python language.
Requirements
==
Python 2.2 or higher
Bug reports / Contacts
====
billiejoex -_[AT]_- gmail (dot) com
--
http://mail.python.org/mailman/listinfo/python-list
ychat frameworks.
pyftpdlib is actually the most complete RFC959 FTP server
implementation available for Python programming language.
Requirements
==
Python 2.2 or higher
Bug reports / Contacts
====
billiejoex -_[AT]_- gmail (dot) com
--
http://mail.python.org/mailman/listinfo/p
On 5 Mar, 15:13, Duncan Booth <[EMAIL PROTECTED]> wrote:
> "billiejoex" <[EMAIL PROTECTED]> wrote:
> > Hi all,
> > I'm proud to announce the first beta release of pyftpdlib available at
> > the following urls:
>
> Announcing it once will do.
Hi,
I'm writing a small asyncore-based server application serving a lot of
clients. When I have to handle more than 1021 client simoultaneously
the 'binded' socket object raises an error:
[...]
connections: 1018
connections: 1019
connections: 1020
connections: 1021
Traceback (most recent call last
On 20 Mar, 17:44, John Nagle <[EMAIL PROTECTED]> wrote:
> When you ask questions like this, please specify what
> operating system you're using. Thanks.
That was a Linux Ubuntu 6.10. I submitted a bug report on sourceforge:
http://sourceforge.net/tracker/index.php?func=detail&aid=1685000&group_i
> I wish to do some low level network stuff using python.
> I've googled somewhat and came up with pylibpcap[1], trouble is I
> can't compile it on my Ubuntu 6.10 workstation.
I would suggest pcapy:
http://oss.coresecurity.com/projects/pcapy.html
Higher level, easier Object-Oriented API and suppor
Hi,
I developed an ftp-server library and now I would like to add support
for SSL/TLS as described in RFC 2228: http://tools.ietf.org/html/rfc2228
Currenlty I'm searching for documentation about this subject and I
would like to start to ask some questions:
- I noticed that socket module provides a
77 matches
Mail list logo