2

I configured my Windows 8 machine that it listens to magic packages send from other PCs to start it. It works very good. BUT I don't want to explicitly send a magic package, I would rather prefer it if I could send a magic package automatically when I try to access the PC over network.

I tryed using an smbclient event (30803). I configured this event to trigger a command line WOL. But This command will be triggered each time I get this event, no matter which PC I try to reach. I don't want to wake up PC-X when I actually try to access PC-Y.

Is there another way?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Matthias
  • 1,200
  • 2
  • 13
  • 33
  • Do you mean you want to start PC-X when try to access for example its shared resources? So calling \\PC-X if PC-X is stoped it should start... is that what you mean? – ZeroWorks Jun 01 '14 at 11:17
  • exactly :) PC-X can also be in Stnad-by mode if that makes things easyier. – Matthias Jun 02 '14 at 07:16

1 Answers1

1

This sounds interesting... a possible solution would be, create a windows service and install it on the server or a computer that uses to be up. This service basically would be a network sniffer that captures all tcp traffic in network. It would have a table with ips and MAC addresses (to get MAC from an IP) that should be filled previously with manually or better... from ARP table (I did a program that gets IP / MAC from ARP table but has its issues... so each machine plugged on the LAN will get its MAC / IP), also this service would have last date ping done to each IP.

Then... how it would work... the service would capture all TCP packets and make a list of distinct IP, then each second or two get all distinct IPs (this will guarantee that the service is not consuming a lot of system resources), and on each distinct ip check last ping: if last ping was done successfully in last 5 or 10 minutes nothing is done (machine is guessed up), if no ping done or success in 5-10 minutes a ping is made. Based on ping response... if the machine is not responging magic packet is sent to MAC (provided from ARP when machine is up or manually as commented before). If ping responds nothing is done. Ping result and date is stored to avoid pings to all machines every time. Instead of ping also its possible to do it reading ARP table.

I this approach, system resources are preserved, and pings are made with sense, also magic packets are not sent if machine is up or guessed up.

Note that firewall should allow ICMP.

ZeroWorks
  • 1,618
  • 1
  • 18
  • 22
  • Hm A Windows Service. That is pretty close to what I already tried. But still I did not came up with the idea myself. Thanks for That. Now I need to figure how to program Windows Services. Is there an easy point to start at? Any hints ? :) – Matthias Jun 02 '14 at 12:59
  • 1
    I use to program in .net, I did a program that reads from ARP and send magic packets when needed, here the basic sniffer http://www.codeproject.com/Articles/17031/A-Network-Sniffer-in-C, here a basic service: http://www.codeproject.com/Articles/3990/Simple-Windows-Service-Sample, sending magic packet is simple and guess you're done with that. If I had more time will help you, all in all don't hesitate to ask if you need help. – ZeroWorks Jun 02 '14 at 13:10
  • .net is just perfect. Can't wait for weekend now to try out. Programming a service just sounds very interesting right now. And be sure I'll ask if I have issues :P ... also thanks for your sample. – Matthias Jun 02 '14 at 14:52