WOW (wake On WAN) Project

New: You can now watch the tutorial if you want to learn how to install the app and how to use it!

WOW Project

The WOW project is meant to wake computers on your LAN from anywhere in the world.

First of all: Why would you implement this project in the first place?

Let's say you have a computer in your house the you want to access from the Internet, but you don't want it to be on all the time because you care about your monthly electricity bill.

In this case, you would set up WOL - Configuring your computer to normally be in a sleep or hibernate state, where it doesn't use a lot of electricity. The computer waits for a magic packet to be received from a host on the LAN, and then it turns on.

The problem is that WOL works only on the LAN, but what if you want to wake your computer when you're outside your house, from the Internet?

This is where my WOW project comes in handy.

This is how it works:

The project is made of two applications: The server side and the client side.

The server side is meant to run on a low power consumption device, for example – A Raspberry PI, which is connected to the LAN where the computers you want to wake up are also connected.

The client side runs on your laptop, your mobile phone or on any device that is connected to the Internet.

Using the client application, you can connect to the WOW server and wake up the computers on your LAN from anywhere in the world.


Table Of Contents:



How to set up

1. Getting a low power consumption device and installation of OS and Java

At first you need to get your hands on a low power device that can run Java, for example a Raspberry PI, or you can get an Android device that is running Android 7.0 and up.

You can order a raspberry PI from the internet from websites like eBay, Amazon.

If you're using a Raspberry PI, I recommend installing the official Linux distribution for the Raspberry PI, Raspbian OS.

Link to the official download page of Raspbian OS

Link to installation guide of Raspbian OS

If you not using an Android Device, the next step is installing java on your low power device. If you are using the Raspbian OS, java is pre-installed, so you can skip this step.

Link to Oracle Java download page

2. Installation of the Server application

Installation on Android

If you want to run the server application on Android, download the WOW server android application from the following link:

https://play.google.com/store/apps/details?id=com.matan.wowandroidserver


And when the installation is finished open the app.

The app should start automatically after android boots.


Installation on Windows\ Linux \ Mac OS Servers:

At first, download the server application from the following link:

https://drive.google.com/open?id=1Eh5YLtdSpWWFckCmdpyUfOcxzpeLiVvV

SHA-1 Hash: 7A628327F49DA9C58F2762421FDBC0CC10515332

Next, extract the zip archive that you have downloaded.

In order to start the server application you need to run the following command in the server_dist directory on the Linux terminal or the Windows CMD: java -jar WOW.jar

The next thing we want to do is to start the server automatically at boot. We're gonna show you how to do it on Raspberry Pi.

1. copy the "server_dist" folder to the /home/pi folder.

2. Go to files explorer, navigate to the /home/pi folder. Look for a file called ".bashrc".

3. Open the file with text editor and add these two lines at the end of the file:

cd /home/pi/server_dist/

java -jar WOW.jar

4. Save the file. Now reboot the raspberry pi and make sure the serve application is running!

If your server application runs on Windows, create a shortcut to the WOW.jar file, and copy the shortcut to the following folder: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Be aware that this method starts the Server application on Windows only after a user has logged in.

If you want to start the server application at boot regardless if a user has logged in, you would have to create a scheduled task that starts the server application.

if you want to change the port which the server runs on, edit the "data.inf" file and change the port numbers.


3. Configuring the Network Settings

The next stage is to configure a static IP for your device.

If your LAN router uses NAT, you would have to configure port forwarding (also called port mapping) on your router. The process is different for each manufacture, but is usually simple.

The server application uses ports 7700 and 7701 by default (you can also configure different ports) and your will need to port forward them to the IP you have gave to your server device.

If your router doesn’t use NAT, make sure its firewall doesn’t block the server ports.

The next step is required if you don't have a Static IP for your router – Setting up dynamic DNS (or DDNS) for your LAN router. By doing this you will be able to connect to your LAN router by a domain name, and not by a IP address that might change every couple of days.

I recommend using the Duckdns or no-ip services.

https://www.duckdns.org/

https://www.noip.com/

you can also run the duck dns client application on the raspberry pi or on android alongside the wow server application!

4. Configuring the Server

When the network setting are fully configured, we need to configure the server by connecting to it through the client application.

Download link for the desktop client application:

https://drive.google.com/open?id=1RoblP9k6z_4XyKRhPn8Av1T2izEV5ZTE

SHA-1 Hash: 2C84FA9617B6741495E87E609B7C1CE981DBA000FFEF01A36900E0A64EB16FBD

After downloading the client application zip file and extracting it, run the WOW.jar file to start the application. Make sure you have Java installed on your computer before running this app!!

You can also configure the server using the Android app.

Here is a link to the Android app on the Play Store:

https://play.google.com/store/apps/details?id=com.matan.wowandroidclient

Connecting to the server

When running the client application, a logon screen will appear. In the address bar you need enter the domain name you have set up or the IP address of your router/server.

The default username for the managing the user is admin and its password is also admin.

Changing the admin password

The first step of configuring the server is changing the default password of the admin user since its highly risky to leave it as default.

After logging in to the server with the admin user,


Click on User Options>Change Password


In the following window, enter the new password. Make sure you remember the admin password because otherwise you would have to reinstall the WOW server!

Adding Computers to the server

After you've logged into the server, you need to add the computers details on your LAN that you want to wake.

Click on Admin Option>Add a new PC


Enter your computer details, and then click on OK

Now you would be able to wake and ping your computer.

Adding Users to the server

In order to add new user to the server, click on Admin Options>Manager User.


The following screen will be shown.

In order to add a new user to the server, click on User Options> add a new User.

Enter the details of the new user, and then click OK.

The new user will appear in the list.


5. Security

Transport Layer Security

The WOW platform has TLS (Transport Layer Security) by default, meaning that the connection between the server and the client is secured from end to end.

This feature is really important since the communication between the client and the server is being transferred through the internet. Before sending data, it's being encrypted by the sender and only the recipient can decrypt this data. This feature allows sending sensitive data, like passwords, etc.

The platform uses private-public keys cryptology. When launching the WOW server or client apps, uniqe keys pair are being generated, one of them is the public key that is going to be exchanged, and a private key that isn't being exchanged. When a client connects to the server, the public keys are being exchanged through the certificate port, which is by default port 7700 on the server. Then, the server and the client start a secured session using the keys they've exchanged on the secured port, which is by default port 7701 on the server.

Passwords Protection

The users' passwords that are stored on the server aren't saved as plain text.

Before saving a password, it's being hashed by a one direction encryption algorithm. The hashed password can't be reverted back into its original password.

This way, Only the real user who knows his password can sign in, and even if hacker have manged to get the server database, he wouldn't be able to find the real passwords since they were hashed.


Group ID

From the 1.4 version, each user and PC have a property called "group_id". Each user which isn't admin can see, wake and ping only the computers with the same group_id as him.

The group_id must be an integer.



6. Troubleshooting


1. Q: I can't access my WOW server even on the LAN.

A: It's most likely because your WOW server application is not running properly.

Please make sure the application is running properly and that it starts automatically after boot.


2. Q: I can access my server on the LAN, but not on the WAN.

A: It's probably because you haven't set up the network settings probably.

Make sure the device that the WOW application is running on has a static IP, and if your router uses the NAT protocol(most likely), make sure it's configured properly. The NAT setting are called sometimes as port forwarding.

Also, check your routers firewall settings, and confirm that it doesn't block the WOW application.

Then, if you can access the server by entering the router's public IP address but not by your domain name, check that the DDNS service that is linked to your LAN is set up correctly.


3.Q: I can access the WOW server, but when I try to wake a computer, the computer doesn't wake up.

A: It's most likely because WOL isn't configured properly on your computer. Check the WOL settings on your computer, and test if your computer wakes up using WOL app.

Also, check that the device the WOW server and your computer are on the same network.


4. Q: When I try to wake a computer through the WOW server the computer wakes up, but It appears off in the app.

A: If you're using an IP address to ping the computer to see if it's on, make sure it has a static IP address. Otherwise, it's IP address might be changed and the ping won't work.

If you're using the hostname to ping the computer, check that the DNS server is configured properly on the device that runs the WOW server and on your router.

7. Advanced Users Stuff


CLI Interface

If you prefer a CLI (Command Line Interface) rather than a GUI (Graphical User Interface), you can do it by sending the -cli argument when starting the client application.

This is the full command you need to order to start the CLI:

java -jar WOW.jar -cli

Another way of opening the CLI is by modifying the "settings.inf" file, by changing the show_gui value.

1 stands for showing GUI, and 0 stand for showing a CLI.

CLI commands

Here is a list of the commands you can use in the CLI and its usage

Regular Users commands:

1.

getpcs - getpcs - sends a list of the pcs in the database that are relevant for the current user. Usage:

getpcs


2.

getusers - sends a list of the users in the database. Usage:

getusers


3.

wol - sends a wol packet to a pc. Usage:

wol <pc id>

F.E: wol 2


4.

ping - checks link state of a pc on the LAN. Usage:

ping <pc id>

F.E: ping 7


5.

isadmin - reutns rather the current user is admin or not. Usage:

isadmin


6.

ispwm - returns rather the password for user is matching.Usage:

ispwm <user id> <password>

F.E: ipwn 7 87654321


7.

getid - returns the id of the current user.Usage:

getid


8.

pingur -send ping packets to a computer and waits until it's reachable. Usage:

pingur <pc id>

F.E: pingur 8

*note - this command works only on the pc client

9.

Exit - Closes the connection to the server.

Usage:

exit




Admin Special commands:


1.

pcadd -mac_address <mac_address> -name <name> -broadcast_ip <broadcast_ip> -ports <ports>

Optinal: -ping_address <ping address>

F.E: pcadd -mac_address 018d746a54e2 -name my_computer -broadcast_ip 192.168.2.30 -ports 7,9 -group_id 1


2.

pccg - changes properties of a pc. usage:

pccg <id> -<property> <new value>

F.E: pccg 3 -mac_address 018d746a54e2 -name my_computer


3.

pcdel - deletes a PC from the database. Usage:

pcdel <id>

F.E: pcdel 7


4.

useradd - adds a new user to the database. usage:

useradd -un <username> -pw <password (clear text)> -is_admin <1 - admin 0 - not admin>

F.E: useradd -un daniel -pw 12345678 -is_admin 0 -group_id 1


5.

usercg - changes properties of a user. usage:

usercg <id> -<property> <new value>

F.E: usercg 3 -pw 87654321 -is_admin 1


6.

userdel - deletes a user from the database. Usage:

userdel <id>

F.E: userdel 7


7.

getusers - sends a list of the users in the database. Usage:

getusers


8.

ipban - bans a given ip from connecting to the server. Usage:

ipban <ip address>

F.E: ipban 75.13.56.235


9.

ipallow - allows a banned ip to connect to the server. Usage:

ipallow <ip address>

F.E: ipallow 75.13.56.235


10.

getdb - saves a copy of the database at the admin's pc. Usage:

getdb


11.

getactivesessions - - returns a list of the active user sessions to the server.Usage:

getactivesessions


Good Luck using these commands!

In order to browse the database, your can use DB Browser for sqlite.

Here is a link to DB Browser for sqlite official page: https://sqlitebrowser.org/

Automation

Automation at the PC client

If you want to automate things, you can create a file called "autorun_script.txt" in the folder where you've extracted the client desktop application and write commands that will be executed automatically after logging into the server.

Each line means a different command.

Here is an example of an "autorun_script.txt" file:

wol 3
ping 3
wol 8
pingur 8
exit

The commands will be executed right after logging into the server, regardless if you're using GUI or not.

You can see the output of these commands if you're using the CLI interface.

Automation at the Android Client

You can create a home screen shortcut that automatically loges in into the WOW server and wakes a specific computer. You can do it by long pressing on the PC you want to create a shortcut to, and then selecting the "Create a home-screen shortcut" option.

8. Contact Me

If you need to contact me, report bugs or send any ideas for improvement, you can do this by sending an email to: matanissler2@gmail.com

9. License

The "WOW" platform is free for personal use, with an option to purchase the premium version of the app.

However, Only the premium version of the "WOW" platform is allowed to be used in a business or enterprise environment.

The premium version can be purchased through the Android client application, at the 3 dots menu> "Purchase Premium".

A business/organization that uses the free version might face legal measures.

The creator of this project is responsible for creating a private and secured platform, but he's not responsible for any damage that might be caused due to using the "WOW" platform.

The source code of the "WOW" project and all types of media that appear in it are copyright protected, and are not allowed to be reused or copied in any type of way and form.

10. Links

Archive of all distribution versions of the WOW project :

https://drive.google.com/drive/folders/1kJ8rwUN4_icLR25N7J6nT3woStjZUssj?usp=sharing