Projects


Easy way to monitor websites visited

posted Oct 1, 2017, 2:48 AM by open wrt   [ updated Feb 2, 2018, 5:44 AM ]

Project Name: Monitor URLs

Configure OpenWrt router to monitor and save websites opened by your connected devices. Below steps need to be followed:

Step 1 : Modify the /etc/dnsmasq.conf file with below entries

                        log-dhcp
                        log-queries
                        log-facility=/tmp/dnsmasq.log

Step 2 : Restart the dnsmasq service

                        /etc/init.d/dnsmasq restart

Steps 3: Create a script called chkurl.sh to view the urls visited

cat /tmp/dnsmasq.log | grep query | awk '{print $1" "$2" "$3","$8","$6}'


Step 4: Run the script by ./chkurl.sh

Output:

root@OpenWrt:/tmp# ./chkurl.sh
Oct 1 16:23:37,192.168.1.2,clients5.google.com
Oct 1 16:23:37,192.168.1.2,9htcorthlk68j1dkmltt8qp5u01ohlj9-a-sites-opensocial.googleusercontent.com
Oct 1 16:23:37,192.168.1.2,apis.google.com
Oct 1 16:23:38,192.168.1.2,lh3.googleusercontent.com
Oct 1 16:23:38,192.168.1.2,sites.google.com
Oct 1 16:23:38,192.168.1.2,ogs.google.com
Oct 1 16:23:38,192.168.1.2,ssl.gstatic.com
Oct 1 16:23:38,192.168.1.2,www.google.co.in
Oct 1 16:23:38,192.168.1.2,www.google.com
Oct 1 16:23:38,192.168.1.2,www.gstatic.com
Oct 1 16:23:38,192.168.1.2,adservice.google.co.in
Oct 1 16:23:38,192.168.1.2,notifications.google.com
Oct 1 16:23:39,192.168.1.2,translate.googleapis.com
Oct 1 16:23:39,192.168.1.2,clientservices.googleapis.com
Oct 1 16:23:40,192.168.1.2,accounts.google.com
Oct 1 16:23:44,192.168.1.2,fuhlkmamwprea.lan
Oct 1 16:23:44,192.168.1.2,ccdvrurn.lan
Oct 1 16:23:44,192.168.1.2,glrzjjjozxr.lan
Oct 1 16:23:44,192.168.1.2,safebrowsing.googleapis.com
Oct 1 16:23:50,192.168.1.2,fonts.gstatic.com
Oct 1 16:23:50,192.168.1.2,play.google.com
Oct 1 16:24:01,127.0.0.1,www.google.com
Oct 1 16:24:01,127.0.0.1,www.google.com
Oct 1 16:26:01,127.0.0.1,www.google.com
Oct 1 16:26:01,127.0.0.1,www.google.com

Got any questions or queries, kindly leave comments below.


Google Drive API for Linux Machines

posted Sep 30, 2017, 3:32 AM by open wrt   [ updated Oct 9, 2017, 8:33 PM ]

Project Name: Google Drive API

I have created this Google Drive API using shell scripting on my TP-Link 3220 router. This router is a mini version of linux machine and this API is not available anywhere on internet for this router model but can be used on any Linux machine.

With this utility, we can manage our Google Drive files directly from command line without need to login.

Few screenshots are below for your reference

File List


Create folder 


Upload file in test folder


Updated File list


Google Drive account Online


Got any questions or queries, kindly leave comments below.


OpenWrt HTML Dashboard

posted Sep 29, 2017, 10:28 PM by open wrt   [ updated Nov 14, 2017, 12:52 AM ]

Project Name : OpenWrt Dashboard








For users who are not aware what is OpenWrt,
it is an open source project for embedded operating system based on Linux, primarily used on embedded devices to route network traffic. The main components are Linux, util-linux, uClibc or musl, and BusyBox. You can refer www.openwrt.org for more details.

I am a big fan of OpenWrt and have been using for quite sometime now on my little and cheap router TP-Link 3220 V2. 


This router has been my guide in learning Linux and inspiration to create something new myself which you will figure out yourself after analyzing hardware specs of my router.

Standards SupportedIEEE 802.11n, IEEE 802.11g, IEEE 802.11b, IEEE 802.3, 802.3u
Maximum Speed150 Mbps
Ethernet Speed10/100 Mbps Fast Ethernet
LAN Ports4 Nos. ( RJ-45)
Memory                        
WAN Ports
4 MB Flash/ 32 MB RAM
1 No. ( RJ-45)
USB Ports1 No. USB 2.0
Ethernet Port4 Nos. ( RJ-45)
3G Dongle SupportYes
3G SIMNo
WEP SecurityYes
WPA2 SecurityYes
SPI SecurityYes
NAT SecurityYes
LED IndicatorsPOWER, SYSTEM, WIRELESS, QSS, WAN, LAN, USB

While using OpenWrt I was amazed by the power of Linux and wanted to explore and thus my quest began if i remember in summer of 2014.

I wanted a quota management interface to be installed on this router and 
if you have notice this router doesn't have enough flash memory to install third party binaries. Yes, we do have option to extend the rootfs partition by putting up a USB Flash drive but this i did not wanted to.

Someday while browsing, I came across DD-WRT operating system for the routers. It has in built bandwidth usage management for the devices attached but my router was not on their supported devices list and thus I began my journey to create my own software for the TP-LINK 3220 router.

Below are the key highlights which my scripts are able to perform:

1. Monitor WAN link.
2. Quota Management
3. Wireless devices monitoring and send email alerts whenever any devices connects/disconnects
4. Block unwanted devices to connect to the router
5. Maintains Usage history
6. Maintains Dashboard Archives
7. Maintains websites accessed historical data
8. Send email alerts with the screenshot of the dashboard at your specified time
9. Has the capability to do data backup directly to your personal Google Drive account and on your desktop at mentioned specific time
10. In case of reboots, downloads databases directly from Google Drive account and data is synchronized with current time.

I am sure that these features are not readily available in most home routers available in the market.

I can help in installing this package on any router. If interested in converting your old home router into a high end networking machine, you can contact me through comments or Feedback section.

Few screenshots are below for your reference:

Keep WAN link drop log


Historical websites accessed data



Summarized Website category email



Dashboard email alert


Dashboard Archives


WiFi Log tracking


WiFi device connect/Disconnect alert



Bandwidth Usage history


Google Drive backup alert



Router reboot and databases restoration alert


Got any questions or queries, kindly leave comments below.


1-3 of 3