Thursday, 29 December 2016

Receiving Brodcast Packets in Python

- Receive Brodcast Packets in Python Without Configuring Network (Network cable connection needed )

Sending Packets 

import os
import sys
import commands
from socket import *
macid = commands.getoutput('ifconfig | grep -i hwaddr | head -1')
os.system("echo '%s' | awk '{print$5}' >/tmp/.mac"%macid)
mac = commands.getoutput('cat /tmp/.mac')
hostname = commands.getoutput('hostname')
username = commands.getoutput('whoami')

info = "connect:"+'%s?%s?%s'%(username,mac,hostname)

s=socket(AF_INET, SOCK_DGRAM)
s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
s.sendto(info,('255.255.255.255',12345))

Receiving Packets

from socket import *
count = 0
while (count < 100):

s=socket(AF_INET, SOCK_DGRAM)
s.bind(('',12345))
m=s.recvfrom(1024)
print m[0]
    count = count + 1


X11Forwarding with SSH not working when connect user through Ncomputing device ?

X11Forwarding with SSH not working when connect user through N-computing device ? Issue Description: Install N-computing Server in one l...