Adamm00 / IPSet_ASUS

Skynet - Advanced IP Blocking For ASUS Routers Using IPSet.
https://www.snbforums.com/threads/release-skynet-router-firewall-security-enhancements.16798/
348 stars 61 forks source link

/opt/bin/firewall: line 41: arithmetic syntax error #153

Closed yelkarama closed 3 months ago

yelkarama commented 3 months ago
Brief Description Of Issue

I started getting the following error when I run firewall: /opt/bin/firewall: line 41: arithmetic syntax error

Steps To Reproduce Issue

run firewall

Expected Behaviour

Display the menu

Output of ( sh /jffs/scripts/firewall debug info )

`

Router Model; Skynet Version; (17/06/2024) (5d71c099938403b46604270b8dd8f011) iptables v1.4.15 - (eth0 @ 192.168.1.1) ipset v7.6, protocol version: 7 IP Address; (x.x.x.x) FW Version; 388.7_0 (Apr 26 2024) (4.1.51) Install Dir; /tmp/mnt/ext/skynet (7.6G / 219.1G Space Available) Syslog Location; () () Uptime; 7 days, 4 hours, 2 minutes. Ram Available; (276M / 882M)

--------------- ------------ --------------- ---------- Device Name Local IP MAC Address Status

REMOVED

-------------------- ---------- Test Description Result

Internet-Connectivity | [Passed] Public IP Address | [Passed] Write Permission | [Passed] Config File | [Passed] Firewall-Start Entry | [Passed] Services-Stop Entry | [Passed] Service-Event Entry | [Passed] Profile.add Entry | [Passed] SWAP File | [Passed] Cron Jobs | [Passed] NTP Sync | [Passed] Log Level 5 Settings | [Passed] Duplicate Rules In RAW | [Passed] IPSets | [Passed] IPTables Rules | [Passed]

----------- ---------- Setting Status

Skynet Auto-Updates | [Disabled] Malware List Auto-Updates | [Disabled] Logging | [Disabled] Filter Traffic | [Selective] Unban PrivateIP | [Disabled] Log Invalid Packets | [Disabled] Import AiProtect Data | [Disabled] Secure Mode | [Disabled] Fast Switch List | [Disabled] Syslog Location | [Custom] IOT Blocking | [Disabled] IOT Logging | [Disabled] Country Lookup For Stats | [Disabled] CDN Whitelisting | [Disabled] Display WebUI | [Disabled]

15/15 Tests Sucessful

=============================================================================================================

/jffs/scripts/firewall: line 5846: arithmetic syntax error `

yelkarama commented 3 months ago

The issue happens at one of the following 2 lines:

Lines 1046: hits2="$(($(iptables -xnvL PREROUTING -t raw | grep -Fv "LOG" | grep -F "Skynet-Master dst" | grep -vF "tun"| grep -vF "wgs" | awk '{print $1}') + $(iptables -xnvL OUTPUT -t raw | grep -Fv "LOG" | grep -F "Skynet-Master dst" | awk '{print $1}')))" and Line 1391: hits2="$(($(iptables -xnvL PREROUTING -t raw | grep -Fv "LOG" | grep -F "Skynet-Master dst" | grep -vF "tun"| grep -vF "wgs" | awk '{print $1}') + $(iptables -xnvL OUTPUT -t raw | grep -Fv "LOG" | grep -F "Skynet-Master dst" | awk '{print $1}')))"

For me, I get no output when I run the following command: iptables -xnvL PREROUTING -t raw | grep -Fv "LOG" | grep -F "Skynet-Master dst" | grep -vF "tun"| grep -vF "wgs"

This is what I get when I run the following command: iptables -xnvL PREROUTING -t raw | grep -Fv "LOG" | grep -F "Skynet-Master dst"

0 0 DROP all -- tun2+ * 0.0.0.0/0 0.0.0.0/0 ! match-set Skynet-MasterWL dst match-set Skynet-Master dst 0 0 DROP all -- wgs+ * 0.0.0.0/0 0.0.0.0/0 ! match-set Skynet-MasterWL dst match-set Skynet-Master dst

yelkarama commented 3 months ago

Issue fixed after I completely uninstalled skynet, rebooted, and reinstalling it. Now, the following command: iptables -xnvL PREROUTING -t raw | grep -Fv "LOG" | grep -F "Skynet-Master dst" | grep -vF "tun"| grep -vF "wgs" returns: 0 0 DROP all -- br+ * 0.0.0.0/0 0.0.0.0/0 ! match-set Skynet-MasterWL dst match-set Skynet-Master dst