#!/bin/sh # ===================================================================== # Projet : DARKWALL # Fichier : lib/log6 # Auteur : Nicolas "DarkHack" Chapuis (c) 2026 # ================== DARKHACK ================== # [ darkweb.fr - system online ] # Powered by Perplexity, your AI assistant # https://www.perplexity.ai # ============================================== # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ===================================================================== if ! type "shInclude" > /dev/null 2>&1; then racineSh="${racineSh:-/etc/darksh}"; . "$racineSh/lib/shTools"; shDebugEnable="1";fi rootDarkWall="${rootDarkWall:-/etc/darkwall}" [ ! -d "$rootDarkWall" ] && shDebug 0 "exit cause rootDarWall is not dir:$rootDarkWall" && exit 0 #requiresCmd="" #requiresCmd="printf timeout sleep kill cat echo sh rm mkdir grep md5sum" #requiresCmd="${requiresCmd} cut tr rev sort uniq awk head tail" #requiresCmd="${requiresCmd} ip iptables sed ping sh" #shWhichCmd $requiresCmd >/dev/null #shErrorOnMissing $( shWhichCmd $requiresCmd | $cmdTr '_' ' ' ) # #requiresCmd="" #requiresCmd="brctl ifup ifdown dhclient" #shWhichCmd $requiresCmd >/dev/null #shWarnOnMissing $( shWhichCmd $requiresCmd | $cmdTr '_' ' ' ) $(shInclude $rootDarkWall/lib/ip6Tools) ip6tablesLogInit() { local rsyslogPath="/etc/rsyslog.d/ip6tables.conf" if [ ! -f "$rsyslogPath" ];then echo ":msg,contains,\"NETFILTER6_OUTPUT\" $firewallDrop6Dir/output.log" >> $rsyslogPath echo ":msg,contains,\"NETFILTER6_INPUT\" $firewallDrop6Dir/input.log" >> $rsyslogPath echo ":msg,contains,\"NETFILTER6_FORWARD\" $firewallDrop6Dir/forward.log" >> $rsyslogPath echo ":msg,contains,\"NETFILTER6_\" stop" >> $rsyslogPath /etc/init.d/rsyslog restart fi # echo "" > /var/log/ip6tables/drop/forward.log # echo "" > /var/log/ip6tables/drop/input.log # echo "" > /var/log/ip6tables/drop/output.log } ip6tablesLogStart() { local log="ip6tablesLogStart:" local globalRule="-j LOG --log-uid --log-ip-options --log-tcp-options" # local globalRule="-j LOG --log-uid --log-ip-options --log-headers" ip6tablesLogInit ip6toolsRuleCreate "filter" ""$rulesLogWriterInput"" ip6toolsRuleAdd "filter" "INPUT -j "$rulesLogWriterInput"" ip6toolsRuleInsert "filter" ""$rulesLogWriterInput" ""$globalRule"" --log-prefix NETFILTER6_INPUT" ip6toolsRuleCreate "filter" ""$rulesLogWriterForward"" ip6toolsRuleAdd "filter" "FORWARD -j "$rulesLogWriterForward"" ip6toolsRuleAdd "filter" ""$rulesLogWriterForward" ""$globalRule"" --log-prefix NETFILTER6_FORWARD" ip6toolsRuleCreate "filter" ""$rulesLogWriterOutput"" ip6toolsRuleAdd "filter" "OUTPUT -j "$rulesLogWriterOutput"" ip6toolsRuleInsert "filter" ""$rulesLogWriterOutput" ""$globalRule"" --log-prefix NETFILTER6_OUTPUT" } ip6tablesLogStop() { local log="ip6tablesLogStop:" ip6toolsRuleDelete "filter" "INPUT" ""$rulesLogWriterInput"" "" ip6toolsRuleDelete "filter" "FORWARD" ""$rulesLogWriterForward"" "" ip6toolsRuleDelete "filter" "OUTPUT" ""$rulesLogWriterOutput"" "" }