You are not logged in.

#1 2011-03-10 23:27:01

shadyabhi
Member
From: Bangalore
Registered: 2010-05-23
Posts: 262
Website

See hostname of users using Ad-Hoc connection

I use the following script to create ad-hoc connection.

#!/bin/bash

sudo iwconfig wlan0 mode ad-hoc
sudo iwconfig wlan0 essid shadyabhi
sudo iwconfig wlan0 key 0123456789
sudo ifconfig wlan0 192.168.1.1
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo su -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo iptables -t mangle -A PREROUTING -j TTL --ttl-inc 1
sudo /etc/rc.d/dnsmasq restart

Someone please guide my on how can I find out the hostname of the the machines using my ad-hoc?

Offline

#2 2011-03-11 05:15:29

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: See hostname of users using Ad-Hoc connection

http://www.cyberciti.biz/faq/how-to-tes … verse-dns/

If your hosts aren't registering with an internal DNS server, then you won't be able to resolve them.

Offline

#3 2011-03-11 07:51:42

shadyabhi
Member
From: Bangalore
Registered: 2010-05-23
Posts: 262
Website

Re: See hostname of users using Ad-Hoc connection

@fukawi2

See, I cant find out of what all have used my ad-hoc by checking the file /var/lib/misc/dnsmasq.leases

But, how do I know, who all are "currently" using it?

Offline

#4 2011-03-11 09:15:42

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: See hostname of users using Ad-Hoc connection

ping their addresses?
Run tcpdump and/or wireshark to see what traffic is passing through?

tcpdump -lnn -i wlan0

Last edited by fukawi2 (2011-03-11 09:16:00)

Offline

#5 2011-03-11 10:58:19

shadyabhi
Member
From: Bangalore
Registered: 2010-05-23
Posts: 262
Website

Re: See hostname of users using Ad-Hoc connection

Why didnt I think of packet sniffing!!
That does the job. Thanks.

Offline

Board footer

Powered by FluxBB