how to bind raw socket to specific interface

const char *opt; opt = “eth0”; const len = strnlen(opt, IFNAMSIZ); if (len == IFNAMSIZ) { fprintf(stderr, “Too long iface name”); return 1; } setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, opt, len); First line: set up your variable Second line: tell the program which interface to bind to Lines 3-5: get length of interface name and check if … Read more

How Do I Use Raw Socket in Python?

You do it like this: First you disable your network card’s automatic checksumming: sudo ethtool -K eth1 tx off And then send your dodgy frame from python 2 (You’ll have to convert to Python 3 yourself): #!/usr/bin/env python from socket import socket, AF_PACKET, SOCK_RAW s = socket(AF_PACKET, SOCK_RAW) s.bind((“eth1”, 0)) # We’re putting together an … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)