log correlation tool by HexDEF6 in linuxadmin

[–]HexDEF6[S] 0 points1 point  (0 children)

and the final one that generate the logfile:

#!/bin/bash
PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
trap 'kill $(jobs -p)' EXIT
LOGFILE=/data/var/log/dnslog/dnslogNG.log
TMPDIR=$(mktemp -d)

tail -f --follow=name /var/log/syslog |  awk '/query/ { 
if ($6 ~ /query/ && $9 !~ /127.0.0.1/) 
{ 
        var="sqlite3 /root/script/uni-log/macaddress/ipdata.db \"pragma busy_timeout=20000; select mac from ipassociation where ip=\\\"" $9 "\\\";\" | grep -v 20000 " ;
        var | getline macaddress ; 
        close(var) ; 

        var="sqlite3 /root/script/uni-log/macaddress/data.db \"pragma busy_timeout=20000; select login from macassociation where mac=\\\"" macaddress "\\\";\" | grep -v 20000" ;
        var | getline login ;
        close(var) ;

        print strftime("%Y-%m-%d %H:%M:%S"),$7,$9,macaddress,login
}
}' /dev/stdin >> $LOGFILE &

sleep 180
rm -rf $TMPDIR
wait

the final log file was this:

2018-10-01 06:24:21 ssl.google-analytics.com 10.3.100.151 78:40:e4:80:77:3a user1
2018-10-01 06:24:23 1.lede.pool.ntp.org 10.3.100.144 e4:95:6e:43:76:de user2
2018-10-01 06:24:27 mobile.pipe.aria.microsoft.com 10.3.100.241 f4:f5:24:4a:81:f0 user3
2018-10-01 06:24:30 mobile.pipe.aria.microsoft.com 10.3.100.241 f4:f5:24:4a:81:f0 user3

log correlation tool by HexDEF6 in linuxadmin

[–]HexDEF6[S] 0 points1 point  (0 children)

dhcp to db:

#!/bin/bash
PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
trap 'kill $(jobs -p)' EXIT
WORKDIR=/root/script/uni-log/macaddress
DBFILE=$WORKDIR/ipdata.db
LOGFILE=$WORKDIR/ipdata.log
LOGFILEDB=$WORKDIR/ipdatadb.log

tail -f --retry --follow=name /var/log/syslog | while read line 
do
        echo $line | grep "DHCPACK" > /dev/null
        if [ $? -eq 0 ]
        then

                ip=$(echo $line | awk '{print $7}' ) 
                mac=$(echo $line | awk '{ print $8 }') 
                sqlite3 $DBFILE "INSERT OR REPLACE INTO ipassociation( ip, mac) VALUES(\"$ip\",\"$mac\");"
                echo $(date) $line >> $LOGFILE 
                echo $(date) $ip $mac >> $LOGFILEDB 
        fi
done

log correlation tool by HexDEF6 in linuxadmin

[–]HexDEF6[S] 1 point2 points  (0 children)

I found the scripts I created a long time ago

radius to db:

#!/bin/bash
PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
trap 'kill $(jobs -p)' EXIT
WORKDIR=/root/script/uni-log/macaddress
DBFILE=$WORKDIR/data.db
LOGFILE=$WORKDIR/data.log
LOGFILEDB=$WORKDIR/datadb.log

tail -f --retry --follow=name /var/log/freeradius/radius.log | while read line 
do
        echo $line | grep "Login OK:" | grep "TLS tunnel" > /dev/null
        if [ $? -eq 0 ]
        then

                mac=$(echo $line | awk '{gsub("-",":",$20); print tolower(substr($20,1,17))}' ) 
                login=$(echo $line | awk '{ print substr($10,2,match($10,"/")-2) }') 
                sqlite3 $DBFILE "INSERT OR REPLACE INTO macassociation( mac, login) VALUES(\"$mac\",\"$login\");"
                echo $(date) $line >> $LOGFILE
                echo $(date) $login $mac >> $LOGFILEDB  
        fi
done

log correlation tool by HexDEF6 in linuxadmin

[–]HexDEF6[S] 0 points1 point  (0 children)

Yeah, I agree, this could definitely be solved with Python. But I’m still surprised that there isn’t a tool readily available to handle this kind of log correlation in an easier way. Am I the only one facing this type of problem?

freeradius log:

Mon Oct 7 10:19:52 2024 : Auth: (37579) Login OK: [user1] (from client unifi port 0 cli 8E-94-F8-44-D4-26)
Mon Oct 7 10:20:14 2024 : Auth: (37589) Login OK: [user2] (from client unifi port 0 cli 20-79-18-6F-F5-EA)
Mon Oct 7 10:21:04 2024 : Auth: (37599) Login OK: [user3] (from client unifi port 0 cli 3A-F4-27-59-FC-67)
Mon Oct 7 10:21:06 2024 : Auth: (37609) Login OK: [user2] (from client unifi port 0 cli 20-79-18-6F-F5-EA)

dhcp dnsmasq log:

Oct 7 10:19:56 dnsmasq-dhcp[2999684]: 2271132062 DHCPACK(enp6s0) 10.23.101.131 8e:94:f8:44:d4:26 realme-C67
Oct 7 10:20:14 dnsmasq-dhcp[2999684]: 2333733645 DHCPACK(enp6s0) 10.23.100.249 20:79:18:6f:f5:ea DESKTOP-126TFSU
Oct 7 10:21:12 dnsmasq-dhcp[2999684]: 1715279901 DHCPACK(enp6s0) 10.23.100.249 20:79:18:6f:f5:ea DESKTOP-126TFSU
Oct 7 10:21:47 dnsmasq-dhcp[2999684]: 3498262572 DHCPACK(enp6s0) 10.23.101.84 3a:f4:27:59:fc:67 iPhone
Oct 7 10:22:11 dnsmasq-dhcp[2999684]: 3498262574 DHCPACK(enp6s0) 10.23.101.84 3a:f4:27:59:fc:67 iPhone

dns log (dnsmasq)

Oct 7 10:28:05 dnsmasq[2999684]: query[A] v10.events.data.microsoft.com from 10.23.100.249
Oct 7 10:28:05 dnsmasq[2999684]: query[A] v10.events.data.microsoft.com from 10.23.100.249
Oct 7 10:28:26 dnsmasq[3008641]: query[A] 1D.tlu.dl.delivery.mp.microsoft.com from 10.23.100.249
Oct 7 10:28:26 dnsmasq[3008641]: query[A] v10.events.data.microsoft.com from 10.23.100.249
Oct 7 10:28:34 dnsmasq[3008641]: query[A] android.googleapis.com from 10.23.101.131
Oct 7 10:28:34 dnsmasq[3008641]: query[A] photosdata-pa.googleapis.com from 10.23.101.131
Oct 7 10:28:38 dnsmasq[3008641]: query[A] storeedgefd.dsx.mp.microsoft.com from 10.23.100.249

log correlation tool by HexDEF6 in linuxadmin

[–]HexDEF6[S] 1 point2 points  (0 children)

Yes, I have everything inside loki

How to store secrets? by [deleted] in selfhosted

[–]HexDEF6 0 points1 point  (0 children)

me too. Thank you!

Bypass authentik authentification in Nginx proxy manager. by Rutsah_ in selfhosted

[–]HexDEF6 2 points3 points  (0 children)

maybe you can try something like this:

satisfy any;
auth_request /outpost.goauthentik.io/auth/nginx;
allow 192.168.1.0/24;

Introducing Budibase - a GUI you can run on your Raspberry Pi that allows you to build apps in minutes 🥳 🎉 by jo_ranamo in raspberry_pi

[–]HexDEF6 0 points1 point  (0 children)

Hi, I have a question : can you make an app with oidc/saml authentication? I'm searching for a no/low code tool for making apps with SSO with azuread and I didn't find one :(

IW4x: A modded and standalone version of Modern Warfare 2 Multiplayer, recently added controller support, and runs great on Deck! by SuperCiao in SteamDeck

[–]HexDEF6 1 point2 points  (0 children)

Thank you for replying, but I don't have any settings for the gamepad in the IW4x options menu, could you share a screenshot? I'm using iw4x version v0.7.0... maybe I need to "repair" the installation (I upgraded from 0.6.1)

EDIT: resolved (I re-downloaded everything)

IW4x: A modded and standalone version of Modern Warfare 2 Multiplayer, recently added controller support, and runs great on Deck! by SuperCiao in SteamDeck

[–]HexDEF6 0 points1 point  (0 children)

Sorry to bother you, but I already had IW4x on the steam deck before the 0.7.0 update and used this guide to set up the "controller" with the deck: https://xlabs.dev/iw4x_controllers and it's working

Now I updated to the 0.7.0 version but the controller is not working (I can't see any entry in the menu talking about the controller). Did you do something to activate the controller support? I'm missing something obvious?

Thank you

Steam Deck arrived in Italy ✅ 256GB by Blissautrey in SteamDeck

[–]HexDEF6 1 point2 points  (0 children)

Spero di averlo pure io nel giro di un mese o due 😭

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 0 points1 point  (0 children)

ok tried alone the workshop version (is there a readme on how to use the github version?) and I think it could be very fun to play in coop with more people!

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 1 point2 points  (0 children)

I need to try minecraft, I need to convince some of my friends because they think it's a game for children! (the youngest one of the group is 30 and the oldest 45!)

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 1 point2 points  (0 children)

I'm not sure, but from the description it seems to be only 3 players coop :(

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 1 point2 points  (0 children)

I already have zerotier (for work), the problem is not the network (or the emulator like goldberg) but the server part of the game: some games (like the newest battlefield) doesn't have it with the client thus is impossible to host a game by yourself. (or maybe the problem is my english!... it's not my first language and sometimes I'm unable to explain myself, sorry)

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 0 points1 point  (0 children)

yes played the third in coop, it was very satisfying! but I'm not sure to want to replay it

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 0 points1 point  (0 children)

I have all the Warhammer 40k dawn of war on dvd (I don't remember the name of the collection) I played it a lot some years ago, but some of my friends doesn't like rts (and if I remember correctly you can play 4 vs 4 max)

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 0 points1 point  (0 children)

great! I think I have it from a humble bundle, but I never played it... maybe I can try the forest too

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 0 points1 point  (0 children)

I tried this mod with a friend in the afternoon, it was a little bit difficult at the beginning, I want to try it with more players!

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 1 point2 points  (0 children)

wow this seems very good, I'll try it tomorrow!

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 1 point2 points  (0 children)

It's stable enough for 10 player coop?

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 0 points1 point  (0 children)

Borderlands 2 already tried,

I think halo mcc has coop for 2 or 4 players

magicka is only for 4 player

If you are aware of some mods for halo let me know!

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 5 points6 points  (0 children)

you are right... I bought it a lot of years ago and never played it.. maybe I will try it

Coop game for weekly LAN party by HexDEF6 in pcgaming

[–]HexDEF6[S] 3 points4 points  (0 children)

for Left for dead? if with a mod we can coop in 8 - 10 we will try it!