c++ - program that will send a magic packet to a certian ip -
i need code c, c++, .bat, or python program. should detect if there person trying connect ip address(192.168.1.149) through port(25570) outside router/ fire wall. program send magic packet ip address (192.168.1.149). magic packet wake computer. because computer in sleep mode code have on computer in network(i don't want this). maybe in router or dns. have windows 7 computer. computer supposed in sleep mode. need people answer question give me guide i not coder why asking question
here router info:
https://www.asus.com/networking/rtn65u/
sorry have old dns cant give specs.
how this?
thx.
here's python code use on 1 of network machines wake another. not sure got originally, works great. can adapt purposes.
#!/usr/bin/env python import socket s=socket.socket(socket.af_inet, socket.sock_dgram) s.setsockopt(socket.sol_socket, socket.so_broadcast, 1) s.sendto('\xff'*6+'\x00\x11\x22\x33\x44\x55'*16, ('192.168.0.255', 9)) print "attempted wake host"
note \x00\x11
etc. stuff mac address of machine awakened , should replaced machine's mac address (converted hex bytes). 192.168.0.255
broadcast address of network and, again, should replaced yours.
Comments
Post a Comment