TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #241 · 5 мај

Можно ли в Python создавать бинарные файлы? Конечно можно. Для этого в Python есть следующие инструменты: ▫️ тип данных bytes и bytearray ▫️ открытие файла в режиме wb (write binary) или rb (read binary) ▫️ модуль struct Про модуль struct поговорим в первую очередь. Файл в формате JSON или Yaml внутри себя содержит разметку данных. Всегда можно определить где список начался а где закончился. Где записана строка а где словарь. То есть формат записи данных содержит в себе элементы разметки данных. В binary-файле данные не имеют визуальной разметки. Это просто байты, записанные один за другим. Правила записи и чтения находятся вне файла. Модуль struct как раз и помогает с организацией данных в таком файле с помощью определения форматов записи для разных частей файла. Модуль struct преобразует Python-объекты в массив байт, готовый к записи в файл и имеющий определённый вид. Для этого всегда следует указывать формат преобразования (или, как оно здесь называется - запаковки). Формат нужен для того, чтобы выделить достаточное количество байт для записи конкретного типа объекта. В последствии с помощью того же формата будет производиться чтение. При этом следует помнить что мы говорим о типах языка С а не Python. Именно формат определяет, что записано в конкретном месте файла, число, строка или что-то еще. Вот какие токены формата у нас есть. Помимо этого, первым символом можно указать порядок байтов. На разных системах одни и те же типы данных могут записываться по-разному, поэтому желательно указать конкретный способ из доступных. Если этого не сделать, то используется символ '@', то есть нативный для текущей системы. В строке формата мы пишем в каком порядке и какие типы собираемся преобразовать в байты. Запакуем в байты простое число, токен "i". >>> import struct >>> struct.pack('=i', 10) b'\n\x00\x00\x00' Теперь несколько float, при этом нужно передавать элементы не массивом а последовательностью аргументов. >>> struct.pack('=fff', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Вместо нескольких токенов можно просто указать нужное количество элементов перед одним токеном, результат будет тот же. >>> struct.pack('=3f', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Теперь запакуем разные типы >>> data = struct.pack('=fiQ', 1.0, 4, 100500) я запаковал типы float, int и unsigned long long (очень большой int, на 8 байт) b'\x00\x00\x80?\x04\x00\x00...' Распаковка происходит аналогично, но нужно указать тот же формат, который использовался при запаковке. Результат возвращается всегда в виде кортежа. >>> struct.unpack('=fiQ', data) (1.0, 4, 100500) Как видите, ничего страшного! #lib#basic

Hashtags

Резултати

Пронајдени 7 слични објави

Пребарај: #vulnerability

当前筛选 #vulnerability清除筛选
Libreware

@libreware · Post #1262 · 28.03.2024 г., 15:59

#Bluetooth#vulnerability allows unauthorized user to record & play audio on Bluetooth speaker via #BlueSpy Prevention section explains how you can check if your Bluetooth LE speakers/headsets are vulnerable to this attack using nRF Connect app https://www.mobile-hacker.com/2024/03/22/bluetooth-vulnerability-allows-unauthorized-user-to-record-and-play-audio-on-bluetooth-speakers/ #BlueDucky automates exploitation of Bluetooth pairing vulnerability that leads to 0-click code execution ▪️automatically scans for devices ▪️store MAC addresses of devices that are no longer visible but have enabled Bluetooth ▪️uses Rubber Ducky payloads https://www.mobile-hacker.com/2024/03/26/blueducky-automates-exploitation-of-bluetooth-pairing-vulnerability-that-leads-to-0-click-code-execution/ Demonstration of using BlueDucky to exploit 0-click Bluetooth vulnerability of unpatched Android smartphone (CVE-2023-45866) Exploit was triggered by Raspberry Pi 4 and then by Android running NetHunter https://youtu.be/GOGW7U1f2RA @androidMalware

Libreware

@libreware · Post #1568 · 28.03.2026 г., 14:31

https://securityonline.info/telegram-critical-zero-click-vulnerability-zdi-can-30207/ its real apparently, just thankfully not in the wild https://www.zerodayinitiative.com/advisories/upcoming/ In the search result of "ZDI-CAN-30207": https://old.reddit.com/r/Android/comments/1s5xyi1/critical_alert_telegram_vulnerability_zdican30207/ https://news.ycombinator.com/item?id=47546545 #telegram#tg#0click#exploit#vulnerability

GitHub Trends

@githubtrending · Post #15201 · 06.10.2025 г., 12:00

#python#security#security_tools#vulnerability#vulnerability_databases#vulnerability_management#vulnerability_scanners OSV is a free, open-source database and toolset that helps you find and manage security vulnerabilities in open source software you use. It collects vulnerability data from many sources, including official advisories and automated scans, and presents it in a clear, machine-readable format. You can use the OSV scanner tool to automatically check your software dependencies for known security issues, helping you fix them quickly. This improves your software’s security by focusing on real risks and making vulnerability management easier and more efficient. OSV also offers APIs and integrates with other tools for automation and alerts. https://github.com/google/osv.dev

Crypto M - Crypto News

@CryptoM · Post #64770 · 09.04.2026 г., 21:12

🚀 Android SDK Vulnerability Poses Risk to Crypto Wallet Apps A vulnerability in an Android Software Development Kit (SDK) could potentially expose sensitive data from crypto wallet applications, according to Microsoft Defender researchers. The flaw, which affects apps downloaded over 30 million times, may lead to the leakage of personally identifiable information, user credentials, and financial data. According to NS3.AI, there have been no reported instances of attackers exploiting this vulnerability so far. #AndroidSDK#vulnerability#cryptowallet#MicrosoftDefender#NS3AI#dataleak#personallyidentifiableinformation#usercredentials#financialdata#cybersecurity

Crypto M - Crypto News

@CryptoM · Post #65081 · 10.04.2026 г., 20:37

🚀 AI TRENDS | Wall Street Banks Test Anthropic's Mythos Model for Vulnerability Detection Wall Street banks have begun internal testing of Anthropic's Mythos model, as reported by Bloomberg on X. The initiative comes amid encouragement from U.S. President Donald Trump's administration officials, who are advocating for its use in identifying potential vulnerabilities. The Mythos model, developed by Anthropic, is designed to enhance security measures within financial institutions by leveraging advanced AI capabilities. This move reflects a growing trend among major banks to integrate cutting-edge technology to bolster their defenses against emerging threats. #AI#trends#WallStreet#banks#Anthropic#Mythos#model#vulnerability#detection#security#financialinstitutions#AItechnology#emergingthreats

GitHub Trends

@githubtrending · Post #14877 · 28.06.2025 г., 13:30

#python#bounty#bugbounty#bypass#cheatsheet#enumeration#hacking#hacktoberfest#methodology#payload#payloads#penetration_testing#pentest#privilege_escalation#redteam#security#vulnerability#web_application Payloads All The Things is a comprehensive collection of useful payloads and bypass techniques for web application security testing and penetration testing. It offers detailed documentation for each vulnerability, including how to exploit it and ready-to-use payloads, plus files for tools like Burp Intruder. You can contribute your own payloads or improvements, making it a collaborative resource. It also links to related projects for internal network and hardware pentesting, and provides learning resources like books and videos. Using this resource helps you efficiently find and test security weaknesses in web applications, improving your pentesting effectiveness and knowledge. https://github.com/swisskyrepo/PayloadsAllTheThings