mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: Binary decoder base2 string to bytes
This commit is contained in:
parent
e25dd52d64
commit
280e9d8af8
2 changed files with 9 additions and 3 deletions
|
@ -30,9 +30,13 @@ def timeout_handler(signum, frame):
|
|||
|
||||
signal.signal(signal.SIGALRM, timeout_handler)
|
||||
|
||||
def decode_binary_string(s):
|
||||
def decode_binary_string(binary_string):
|
||||
return ''.join(chr(int(s[i*8:i*8+8],2)) for i in range(len(s)//8))
|
||||
|
||||
def decode_binary(binary_string):
|
||||
return bytes(bytearray([int(binary_string[i:i+8], 2) for i in range(0, len(binary_string), 8)]))
|
||||
|
||||
|
||||
def search_binary(content, message, date):
|
||||
find = False
|
||||
binary_list = re.findall(regex_binary, content)
|
||||
|
@ -40,11 +44,11 @@ def search_binary(content, message, date):
|
|||
|
||||
for binary in binary_list:
|
||||
if len(binary) >= 40 :
|
||||
decode = decode_binary_string(binary).encode()
|
||||
print(decode)
|
||||
decode = decode_binary(binary)
|
||||
print(message)
|
||||
|
||||
type = magic.from_buffer(decode, mime=True)
|
||||
print(type)
|
||||
|
||||
find = True
|
||||
hash = sha1(decode).hexdigest()
|
||||
|
|
|
@ -144,6 +144,8 @@ function launching_scripts {
|
|||
sleep 0.1
|
||||
screen -S "Script_AIL" -X screen -t "Base64" bash -c './Base64.py; read x'
|
||||
sleep 0.1
|
||||
screen -S "Script_AIL" -X screen -t "Binary" bash -c './Binary.py; read x'
|
||||
sleep 0.1
|
||||
screen -S "Script_AIL" -X screen -t "Bitcoin" bash -c './Bitcoin.py; read x'
|
||||
sleep 0.1
|
||||
screen -S "Script_AIL" -X screen -t "Phone" bash -c './Phone.py; read x'
|
||||
|
|
Loading…
Reference in a new issue