Sindbad~EG File Manager
3
�f3 � @ s0 d dl Z d dlZd dlmZ G dd� de�ZdS )� N)�SoSMapc sL e Zd ZdZddgZdZdZdZdZ� fdd �Z � fd
d�Z
dd
� Z� ZS )� SoSMacMapa� Mapping store for MAC addresses
MAC addresses added to this map will be broken into two halves, vendor and
device like how MAC addresses are normally crafted. For the vendor hextets,
obfuscation will take the form of 53:4f:53, or 'SOS' in hex. The following
device hextets will be randomized, for example a MAC address of
'60:55:cb:4b:c9:27' may be obfuscated into '53:4f:53:79:ac:29' or similar
This map supports both 48-bit and 64-bit MAC addresses.
48-bit address may take the form of either:
MM:MM:MM:SS:SS:SS
MM-MM-MM-SS-SS-SS
For 64-bit addresses, the identifier injected by IPv6 standards is
used in obfuscated returns. These addresses may take either of these forms:
MM:MM:MM:FF:FE:SS:SS:SS
MMMM:MMFF:FESS:SSSS
All mapped mac addresses are converted to lower case.
Dash delimited styles will be converted to colon-delimited style.
zff:ff:ff:ff:ff:ffz00:00:00:00:00:00z53:4f:53:%s:%s:%sz53:4f:53:ff:fe:%s:%s:%sz534f:53ff:fe%s:%s%sFc s* |j dd�j� jd�j� }tt| �j|�S )N�-�:z=.,)�replace�lower�strip�superr �add)�self�item)� __class__� �/usr/lib/python3.6/mac_map.pyr
5 s z
SoSMacMap.addc s* |j dd�j� jd�j� }tt| �j|�S )Nr r z=.,)r r r r r �get)r r )r
r r r 9 s z
SoSMacMap.getc s� d� g }x4t dd�D ]&}|jdj� fdd�t d�D ��� qW t|�}tjd|�r\| j| S tjd |�rr| j| S tjd
|�r�| j| S dS )zVRandomize the device hextets, and append those to our 'vendor'
hextet
Z0123456789abdcefr � � c 3 s | ]}t j� �V qd S )N)�randomZchoice)�.0�x)� hexdigitsr r � <genexpr>D s z*SoSMacMap.sanitize_item.<locals>.<genexpr>� z$(([0-9a-fA-F]{2}:){7}[0-9a-fA-F]{2})z&(([0-9a-fA-F]{4}:){3}([0-9a-fA-F]){4})z([0-9a-fA-F][:_]?){12}N) �range�append�join�tuple�re�match�
mac6_template�mac6_quad_template�mac_template)r r Zhextets�ir )r r �
sanitize_item= s &
zSoSMacMap.sanitize_item)
�__name__�
__module__�__qualname__�__doc__Zignore_matchesr! r r Zcompile_regexesr
r r# �
__classcell__r r )r
r r s r )r r Zsos.cleaner.mappingsr r r r r r �<module> s
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists