File size: 288 Bytes
239d4ec
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import socket

NETLINK_USERSOCK = 18

def send_to_kernel(data):
    try:
        s = socket.socket(socket.AF_NETLINK, socket.SOCK_RAW, NETLINK_USERSOCK)
        s.bind((0, 0))
        s.send(data.encode())
        s.close()
    except Exception as e:
        print(f"Netlink error: {e}")