Promiscuous mode

Hi guys. i have a question. i am new in a ruby world.
How can i set my wlan device in a promiscuous mode?
thank at all :slight_smile:

Marco B. wrote:

Hi guys. i have a question. i am new in a ruby world.

Welcome.

How can i set my wlan device in a promiscuous mode?

What does this have to do with Ruby?

thank at all :slight_smile:

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On 21.12.2009 21:02, Marco B. wrote:

Hi guys. i have a question. i am new in a ruby world.
How can i set my wlan device in a promiscuous mode?
thank at all :slight_smile:

I’d check the WLAN card’s documentation.

Hi,

Am Dienstag, 22. Dez 2009, 05:02:12 +0900 schrieb Marco B.:

Hi guys. i have a question. i am new in a ruby world.
How can i set my wlan device in a promiscuous mode?
thank at all :slight_smile:

When you ask in a forum that is about your WLAN device or your
OS/kernel, you should supply some information: what card you have,
error messages, and so on. Good luck.

Bertram

i have a wireless card of netgear and i want to make a code in ruby that
set it in a promiscuous mode to read all packet in a lan for catch and
block all wrong packet. (wrong packet according at rule of my boss).
this program run in ubuntu 9.04 :slight_smile:
thank to all :slight_smile:

Give it beer?

On Mon, Dec 21, 2009 at 2:34 PM, Marco B. [email protected]
wrote:

i have a wireless card of netgear and i want to make a code in ruby that
set it in a promiscuous mode to read all packet in a lan for catch and
block all wrong packet. (wrong packet according at rule of my boss).
this program run in ubuntu 9.04 :slight_smile:
thank to all :slight_smile:

just use:

system("")

That’s how you’d do it in ruby. The problem you have to answer is
what that shell command actually is.


Aaron T.
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix &
Windows
Those who would give up essential Liberty, to purchase a little
temporary
Safety, deserve neither Liberty nor Safety.
– Benjamin Franklin
“carpe diem quam minimum credula postero”

On Dec 21, 2009, at 5:47 PM, Aaron T. wrote:

On Mon, Dec 21, 2009 at 2:34 PM, Marco B.
[email protected] wrote:

i have a wireless card of netgear and i want to make a code in ruby
that
set it in a promiscuous mode to read all packet in a lan for catch
and
block all wrong packet. (wrong packet according at rule of my boss).
this program run in ubuntu 9.04 :slight_smile:
thank to all :slight_smile:

If you are already running under Ubuntu 9.04, why do you want to write
a program to do this at all? Does something like ‘iptables’ satisfy
the ‘wrong packet according at rule of my boss’?

Ruby is a very high-level language in which to be examining every
packet on a LAN.

-Rob

http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for
Unix & Windows
Those who would give up essential Liberty, to purchase a little
temporary
Safety, deserve neither Liberty nor Safety.
– Benjamin Franklin
“carpe diem quam minimum credula postero”

Rob B. http://agileconsultingllc.com
[email protected]

i have found the way to set my wlan device in promiscuos mode:

sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode monitor
sudo ifconfig wlan0 up

i have made a script that call by ruby code. thank all :slight_smile:

Marco B. wrote:

Hi guys. i have a question. i am new in a ruby world.
How can i set my wlan device in a promiscuous mode?

One answer is: use the Socket API. You have direct access there to all
the facilities there that you would have in a C program, e.g.
setsockopt.

So the problem boils down to: how do I create a raw socket, how do I set
promiscuous mode on it, how do I read packets from it? These are socket
questions, not Ruby ones. If you can find a C program which does what
you want, you can port it to ruby.

As has already been pointed out, Ruby is probably a poor choice of
language for packet inspection if you have any significant volume of
traffic.

But if you really want to do it in Ruby, I suggest you use someone
else’s code: google for “ruby pcap”.

On Tue, Dec 22, 2009 at 10:28 AM, Marco B. [email protected]
wrote:

i have found the way to set my wlan device in promiscuos mode:

sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode monitor
sudo ifconfig wlan0 up

Right. And which of those commands are ruby commands?


Paul S.
http://www.nomadicfun.co.uk

[email protected]

Marco B. wrote:

Hi guys. i have a question. i am new in a ruby world.
How can i set my wlan device in a promiscuous mode?
thank at all :slight_smile:

Maybe you could use Scruby module
(http://sylv1.tuxfamily.org/projects/scruby.html)… check for ‘sniff
function’.