While all of this amazing UI work has been rolling out, I was trying to hack together a way to email a Skynet report to myself - a la the Diversion weekly report.The command was never designed to be visually pleasing when output to a file, but to make it somewhat more readable you can do the following;
Code:sh /jffs/scripts/firewall stats | sed -r 's/'$(echo -e "\033")'\[[0-9]{1,2}(;([0-9]{1,2})?)?[mK]//g' | strings > skynet.txt
#!/bin/sh
sh /jffs/scripts/firewall stats 50 | sed -r 's/'$(echo -e "\033")'\[[0-9]{1,2}(;([0-9]{1,2})?)?[mK]//g' | strings > skynet.txt
#!/bin/sh
FROM="Skynet Weekly Stats"
AUTH="xxxx@gmail.com"
PASS="secret"
TO="yyyy@gmail.com"
FRIENDLY_ROUTER_NAME="Your Router Name"
makemime skynet.txt
makemime -a"Subject: $FRIENDLY_ROUTER_NAME Router Stats $(date +"%F_%H.%M")" -a"From: $FROM" -o output.msg skynet.txt
cat /home/root/output.msg | sendmail -H"exec openssl s_client -quiet \
-CAfile /jffs/configs/Equifax_Secure_Certificate_Authority.pem \
-connect smtp.gmail.com:587 -tls1 -starttls smtp" \
-f"$FROM" \
-au"$AUTH" -ap"$PASS" $TO
cp -a skynet.txt "/tmp/mnt/path/to/backup/skynet-$(date +"%y-%d-%m").txt"
Put them all on one line with a space between at the prompt, just don't try to add one at a time, do them all at once.Only 1 country can be banned at a time?
Uh, whoopsie!
I have had this ntp server battle intermittently for months. Thought I had whitelised the entire pool.ntp.org domain and solved it - guess not. @XIII this might be something of your issue, seeing your posts on this DNS niggle. @Adamm any comment?
Result of clicking View Details
https://otx.alienvault.com/indicator/ip/23.129.64.159
Is there a way we can collapse(default) source ports inbound or even remove from the page as it's really not significant to show as they are random anyway, that's my understanding.
I created/formatted to NTFS to clear out previous ext2 then deleted partition and did a clean ext2.
I have removed the devices section in paste below...
Should I try to format JFFS partition at next boot?Code:Router Model; RT-AC1900P Skynet Version; (04/01/2020) (261a3ffac493975e67c86db6970e2133) iptables v1.4.15 - (eth0 @ 192.168.x.x) ipset v6.32, protocol version: 6 FW Version; 384.14_2 (Dec 31 2019) (2.6.36.4brcmarm) Install Dir; /tmp/mnt/sdc5/skynet (3.0G / 3.7G Space Available) SWAP File; /tmp/mnt/sdc5/myswap.swp (512.5M) Uptime; 0 days, 20 hours, 13 minutes. Ram Available; (181M / 249M) -------------------- | ---------- | Test Description | | | Result | -------------------- | ---------- Internet-Connectivity | [Passed] Write Permission | [Passed] Firewall-Start Entry | [Passed] Services-Stop Entry | [Passed] SWAP | [Passed] Cron Jobs | [Failed] IPSet Comment Support | [Passed] Log Level 5 Settings | [Failed] Duplicate Rules In RAW | [Passed] Inbound Filter Rules | [Failed] Inbound Logging Rules | [Failed] Outbound Filter Rules | [Failed] Outbound Logging Rules | [Failed] Whitelist IPSet | [Failed] BlockedRanges IPSet | [Failed] Blacklist IPSet | [Failed] Skynet IPSet | [Failed] Diversion Plus Content | [Failed] ----------- | ---------- | Setting | | | Status | ---------- | ---------- Skynet Auto-Updates | [Disabled] Malware List Auto-Updates | [Enabled] Logging | [Enabled] Filter Traffic | [Enabled] Unban PrivateIP | [Enabled] Log Invalid Packets | [Disabled] Ban AiProtect | [Enabled] Secure Mode | [Enabled] Fast Switch List | [Disabled] Syslog Location | [Default] IOT Blocking | [Disabled] Country Lookup For Stats | [Disabled] CDN Whitelisting | [Enabled] Display WebUI | [Disabled] 7/18 Tests Sucessful
My Skynet did not survive the reboot once again even after updating and applying the web GUI restart/refresh command. Will retry again or reformat my USb drive and reinstall everything to see if that makes a difference.
Sent from my iPhone using Tapatalk
It survived the reboot! We are back in business! Thank you @Adamm!
@Adamm When I hover over the View Details URL link for "Last 10 Unique Connections Blocked (Outbound) (click to expand/collapse)" I see the tooltip as "http://192.168.1.1/user1.asp" and "http://192.168.1.1/US" for second link in same group. Other Alienvault URLs look to be correct. Seems to be the first and second items in the list.
Router Model; RT-AX88U
Skynet Version; (04/01/2020) (261a3ffac493975e67c86db6970e21)
iptables v1.4.15 - (eth0 @ 192.168.50.1)
ipset v6.32, protocol version: 6
IP Address; (XXX.XXX.XXX.XXX)
FW Version; 384.14_0 (Dec 13 2019) (4.1.51)
Install Dir; /tmp/mnt/yangdrive/skynet (12.0G / 14.2G Space A)
IPTables Rules | [Failed]
-------------------- | ----------
| Test Description | | | Result |
-------------------- | ----------
Internet-Connectivity | [Passed]
Write Permission | [Passed]
Firewall-Start Entry | [Passed]
Services-Stop Entry | [Passed]
SWAP | [Passed]
Cron Jobs | [Passed]
IPSet Comment Support | [Passed]
Log Level 6 Settings | [Passed]
Duplicate Rules In RAW | [Passed]
Inbound Filter Rules | [Failed]
Inbound Logging Rules | [Failed]
Outbound Filter Rules | [Failed]
Outbound Logging Rules | [Failed]
Whitelist IPSet | [Passed]
BlockedRanges IPSet | [Passed]
Blacklist IPSet | [Passed]
Skynet IPSet | [Passed]
Diversion Plus Content | [Passed]
----------- | ----------
| Setting | | | Status |
---------- | ----------
Skynet Auto-Updates | [Enabled]
Malware List Auto-Updates | [Enabled]
Logging | [Enabled]
Filter Traffic | [Enabled]
Unban PrivateIP | [Enabled]
Log Invalid Packets | [Disabled]
Ban AiProtect | [Enabled]
Secure Mode | [Enabled]
Fast Switch List | [Disabled]
Syslog Location | [Default]
IOT Blocking | [Disabled]
Country Lookup For Stats | [Disabled]
CDN Whitelisting | [Enabled]
Display WebUI | [Enabled]
14/18 Tests Sucessful
==============================================================
[#] 0 IPs (+0) -- 0 Ranges Banned (+0) || Inbound -- Outbou]
[i] Press Enter To Continue...
I've been having some issues with Skynet not being able to start up properly.
Code:Router Model; RT-AX88U Skynet Version; (04/01/2020) (261a3ffac493975e67c86db6970e21) iptables v1.4.15 - (eth0 @ 192.168.50.1) ipset v6.32, protocol version: 6 IP Address; (XXX.XXX.XXX.XXX) FW Version; 384.14_0 (Dec 13 2019) (4.1.51) Install Dir; /tmp/mnt/yangdrive/skynet (12.0G / 14.2G Space A) IPTables Rules | [Failed]
Here is my debug output
Code:-------------------- | ---------- | Test Description | | | Result | -------------------- | ---------- Internet-Connectivity | [Passed] Write Permission | [Passed] Firewall-Start Entry | [Passed] Services-Stop Entry | [Passed] SWAP | [Passed] Cron Jobs | [Passed] IPSet Comment Support | [Passed] Log Level 6 Settings | [Passed] Duplicate Rules In RAW | [Passed] Inbound Filter Rules | [Failed] Inbound Logging Rules | [Failed] Outbound Filter Rules | [Failed] Outbound Logging Rules | [Failed] Whitelist IPSet | [Passed] BlockedRanges IPSet | [Passed] Blacklist IPSet | [Passed] Skynet IPSet | [Passed] Diversion Plus Content | [Passed] ----------- | ---------- | Setting | | | Status | ---------- | ---------- Skynet Auto-Updates | [Enabled] Malware List Auto-Updates | [Enabled] Logging | [Enabled] Filter Traffic | [Enabled] Unban PrivateIP | [Enabled] Log Invalid Packets | [Disabled] Ban AiProtect | [Enabled] Secure Mode | [Enabled] Fast Switch List | [Disabled] Syslog Location | [Default] IOT Blocking | [Disabled] Country Lookup For Stats | [Disabled] CDN Whitelisting | [Enabled] Display WebUI | [Enabled] 14/18 Tests Sucessful ============================================================== [#] 0 IPs (+0) -- 0 Ranges Banned (+0) || Inbound -- Outbou] [i] Press Enter To Continue...
Sent from my SM-G975U1 using Tapatalk
iptables --line -t raw -vnL
cat /jffs/scripts/firewall-start
sh /jffs/scripts/firewall restart
In your script, include two lines: a dot command to pull most of the info from the diversion email.conf command, and then something that extracts the password from the encrypted file.I tried to figure out how to use the email information already set up with Diversion, but could not, so took the separate email approach.
# Email settings (mail envelope) #
. /opt/share/diversion/.conf/email.conf
PASSWORD=$(openssl aes-256-cbc -d -in /opt/share/diversion/.conf/emailpw.enc -pass pass:ditbabot,isoi)
#!/opt/bin/sh
#Parameters passed#
mailsubject=$1
mailbody=$2
# Email settings (mail envelope) #
. /opt/share/diversion/.conf/email.conf
PASSWORD=$(openssl aes-256-cbc -d -in /opt/share/diversion/.conf/emailpw.enc -pass pass:ditbabot,isoi)
#Build email
echo "From: \"$FRIENDLY_ROUTER_NAME\" <$FROM_ADDRESS>" >/tmp/mail.txt
echo "To: \"$TO_NAME\" <$TO_ADDRESS>" >>/tmp/mail.txt
echo "Subject: $mailsubject " >>/tmp/mail.txt
echo "Date: $(date -R)" >>/tmp/mail.txt
echo >>/tmp/mail.txt
echo " $(cat $mailbody)" >>/tmp/mail.txt
#Send Email
/usr/sbin/curl --url $PROTOCOL://$SMTP:$PORT \
--mail-from "$FROM_ADDRESS" --mail-rcpt "$TO_ADDRESS" \
--upload-file /tmp/mail.txt \
--ssl-reqd \
--user "$USERNAME:$PASSWORD" $SSL_FLAG
rm /tmp/mail.txt
In your script, include two lines: a dot command to pull most of the info from the diversion email.conf command, and then something that extracts the password from the encrypted file.
<snip>
Actually, it is convenient to have a separate email script that accepts a subject line and text file as parameters to use for any email scripting.
<snip>
Skuinet?uiskynet appears to be running great! thanks adam!
Check this morning and its showing properly.....Can't reproduce on my end but I'll look into it, mind sending me a copy of your stats.js file located in your skynet install directory.
You might look at stats.div for how diversion does it with curl.But I could not figure out how to add a subject line using the versions of mime or sendmail included on our routers.
No what I was saying is I made the stick NTFS to make sure to overwrite it all before making it again ext2.Do you happen to have multiple partitions on your USB? Another user a few days ago had similar issues when trying to use NTFS/ext* partitions on the same USB.
nvram show | grep jffs
size: 59238 bytes (6298 left)
jffs2_on=1
jffs2_enable=1
jffs2_format=0
jffs2_scripts=1
log_path=/jffs
No what I was saying is I made the stick NTFS to make sure to overwrite it all before making it again ext2.
Code:nvram show | grep jffs size: 59238 bytes (6298 left) jffs2_on=1 jffs2_enable=1 jffs2_format=0 jffs2_scripts=1 log_path=/jffs
Should I format JFFS partition at next reboot? Maybe @RMerlin can tell me what's stored there. I have manually assigned IPs I would not like to lose. Yet I only run Diversion and uiDivStats.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!