bash - Sending packets in Netcat from an address without binding -


i've set promiscuous mode ifconfig eth0 promisc , in python can send packets without binding doing raw sockets. i've done command nc -vs 192.168.11.1 -p 22 192.168.11.2 22 see if can send packets computer without having bound address of machine. feature possible in netcat or have bind? machine has no address settings, in promiscuous mode can see traffic.

update:

in python created hex string use struct , send out. utilize ifconfig set promiscuous mode (because couldn't figure out how in python) inside bash script runs python script, once it's set seems select eth0 automagically without me setting thing.

i wasn't if netcat or not , nothing in utility seems indicate this. might make python script make work raw sockets, if possible.

i don't think possible netcat unless allows use of raw sockets (bound interface).

given have no address settings, instructive @ routing table:

$ route  kernel ip routing table destination     gateway         genmask         flags metric ref    use iface $ 

e.g. empty.

netcat uses tcp default. tcp sockets, don't have bind source interface, if don't, kernel stack destination address in kernel routing table figure out interface send out of. since there no addressing, routing table empty , route lookup fail. tcp won't able send out first syn packet.

one possible workaround considered adding appropriate static route, should send initial syn. tcp still won't work, because when syn-ack comes hext-hop router, next-hop router won't have arp entry machine, , won't able resolve 1 if machine has ip address.

if care sending traffic, might away udp sockets , static route, kernel stack may not allow it.

for raw sockets in python, assume are binding local interface, allows operate @ lower level , bypass checks above.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -