mirror of
https://github.com/aljazceru/squatm3gator.git
synced 2025-12-17 06:34:23 +01:00
First release - BlackHat Arsenal tool
This commit is contained in:
18
squatm3-api/wrapper/classes/utils.py
Normal file
18
squatm3-api/wrapper/classes/utils.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import uuid
|
||||
import socket
|
||||
import fcntl
|
||||
import struct
|
||||
|
||||
def get_address_of_interface(ifname):
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
return socket.inet_ntoa(fcntl.ioctl(
|
||||
s.fileno(),
|
||||
0x8915, # SIOCGIFADDR
|
||||
struct.pack('256s', ifname[:15])
|
||||
)[20:24])
|
||||
|
||||
def get_address():
|
||||
return socket.gethostbyname(socket.gethostname())
|
||||
|
||||
def generate_global_uuid():
|
||||
return str(uuid.uuid4())
|
||||
Reference in New Issue
Block a user