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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #22 · 19 јан.

Заметка начинающим, которые часто сталкиваются с подобной непоняткой. Ситуация следующая, есть список файлов: names = [ 'image.bmp', 'second.txt.bkp', 'data.db', '.config.cfg', 'file.ext.bkp' ] И мы хотим убрать у них окончание ".bkp". Не знаю зачем, пример довольно надуманный) Но суть он показывает, а это главное. Те, кто еще не очень знаком с библиотекой os.path или pathlib, вероятно решат обработать имена как строки. И тут вполне подойдет метод строки strip(). Что делает этот метод? Он отрезает указанные символы по обеим сторонам строки. Если ничего не указать, то убирает невидимые символы (пробелы, табуляции и переносы строк). В нашем случае будет выглядеть вот так: >>> name.strip('.bkp') То есть просим удалить строку '.bkp' по краям имени файла, если таковая есть. Можно применить аналогичный метод rstrip(), чтобы отрезать только справа, но для этого примера используем обычный. >>> for name in names: >>> print(name.strip('.bkp')) image.bm second.txt data.d config.cfg file.ext Хм, что-то не то с нашими именами! Что случилось??? Видим нежелательное переименование в именах, где и близко не было указанной строки '.bkp' А дело всё в том, что данный метод ищет не указанную строку, а указанные символы, и не важно в каком порядке. Для метода strip() строка '.bkp' это не паттерн для поискаа список символов. Потому он отрезал симовол 'p' от '.bmp' и удалил точку из файла '.config.cfg'. Как тогда правильно заменить именно паттерн? Для начинающего можно посоветовать метод строки replace(), который как раз использует для замены указанную строку целиком. В нашем примере заменим её на пустую строку. >>> for name in names: >>> print(name.replace('.bkp', '')) image.bmp second.txt data.db .config.cfg file.ext Уже лучше, но помните, это лишь пример про strip(). Для работы с именами файлов есть способы и более "правильные", дающие однозначно верный результат. Я взял файлы только в качестве примера. Даже replase() тут может сделать не то что ожидаем. Просто впредь будьте внимательны с этим strip(). #basic

Hashtags

Резултати

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

Пребарај: #attack

当前筛选 #attack清除筛选
GitHub 红队武器库🚨

@githubredteam · Post #84669 · 18.05.2026 г., 11:03

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:DeveloperHub_cyber_Internship 👤项目作者:Suny-Kumar 🛠开发语言: None ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-18 10:58:42 📝项目描述: This project demonstrates a web application security assessment on a User Management System. It identifies vulnerabilities like SQL Injection, XSS, and insecure data storage using OWASP ZAP and manual testing, along with practical recommendations to improve application security and prevent attacks. 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #84631 · 18.05.2026 г., 04:02

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:CyberDox-CTF 👤项目作者:ahamedmohamed 🛠开发语言: None ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-18 03:28:45 📝项目描述: CyberDPX is a Capture The Flag (CTF) style web security training platform designed to help learners practice and understand common web vulnerabilities. The platform includes intentionally vulnerable challenges such as Path Traversal, SQL Injection, and Cross-Site Scripting (XSS) to simulate real-world attack scenarios in a safe environment. 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #84355 · 15.05.2026 г., 16:03

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:DeveloperHub_cyber_Internship-week_ONE 👤项目作者:Suny-Kumar 🛠开发语言: None ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-15 16:01:26 📝项目描述: This project demonstrates a web application security assessment on a User Management System. It identifies vulnerabilities like SQL Injection, XSS, and insecure data storage using OWASP ZAP and manual testing, along with practical recommendations to improve application security and prevent attacks. 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #84194 · 14.05.2026 г., 10:03

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:PROJET_ELK 👤项目作者:Gael-00 🛠开发语言: Python ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-14 10:02:32 📝项目描述: Plateforme de monitoring des attaques web (XSS, SQLi) 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #83973 · 12.05.2026 г., 17:03

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:varbase_ai_safety 👤项目作者:Vardot 🛠开发语言: None ⭐Star数量: 1 | 🍴Fork数量: 0 📅更新时间: 2026-05-12 16:54:54 📝项目描述: Bundles a complete AI safety stack for Varbase: Prompt Safety Liability set (legal advice, medical advice, sensitive topics), Prompt Safety Security set (XSS, HTML/CSS/JavaScript injection, prompt manipulation/jailbreak detection), PII Protection set (email, credit card, IBAN, phone), AI Logging with 90-day retention, and AI Observability 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #83510 · 09.05.2026 г., 11:02

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:cyber-attack-simulator 👤项目作者:zyntrix292545-droid 🛠开发语言: Python ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-09 11:01:33 📝项目描述: A web-based educational cyber attack simulator that demonstrates Phishing, Brute Force, DDoS, SQL Injection, XSS and Man-in-the-Middle attacks built with Python Flask 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #83356 · 08.05.2026 г., 12:03

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:interactive-xss-simulator 👤项目作者:S4MC71 🛠开发语言: HTML ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-08 11:58:41 📝项目描述: An interactive animated simulator designed to visualize the complete lifecycle of Reflected Cross-Site Scripting (XSS) attacks. Built for cybersecurity instructors and students to understand request/response flows and DOM rendering. 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #83220 · 07.05.2026 г., 14:03

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:secure-web-app-attack-simulation 👤项目作者:abieltesfai10-rgb 🛠开发语言: Python ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-07 14:01:59 📝项目描述: Vulnerable web app simulating SQL injection, XSS, and auth bypass — with full attack-to-defense remediation using Python and Flask 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #82617 · 03.05.2026 г., 11:02

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:TryHackMe-x-CyberSecurity101-Burp-Suite 👤项目作者:owen23-ux 🛠开发语言: None ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-03 11:02:05 📝项目描述: A walkthrough of TryHackMe's "Burp Suite: The Basics" room, documenting the setup, configuration, and execution of a reflected XSS attack. This repository translates offensive security techniques into defensive detection and analysis strategies for SOC Analysts. 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #82585 · 03.05.2026 г., 06:02

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:Detecting-web-attack-with-end-to-end-deep-Learning 👤项目作者:ayesha-siddiqua22 🛠开发语言: None ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-03 06:00:36 📝项目描述: Detecting Web Attacks using End-to-End Deep Learning is a project that builds a deep learning model to identify malicious web traffic. It uses LSTM/Neural Networks to automatically learn patterns and detect attacks like SQL Injection and XSS, improving accuracy and reducing reliance on traditional rule-based systems. 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@githubredteam · Post #82323 · 01.05.2026 г., 13:02

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:CTF 👤项目作者:jotepewcyber 🛠开发语言: Python ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-05-01 13:00:31 📝项目描述: Capture the Flag platform for cyber security enthusiasts. Contains various challenges including: SQL injection, XSS, Command execution, Netcat reverse shells, Directory traversal attacks and Steganography. 🔗点击访问项目地址

Hashtags

GitHub 红队武器库🚨

@GithubRedTeam · Post #80555 · 16.04.2026 г., 13:03

🚨 GitHub 监控消息提醒 🚨发现关键词:#XSS#Attack 📦项目名称:DPSSX 👤项目作者:KLSEHB 🛠开发语言: None ⭐Star数量: 0 | 🍴Fork数量: 0 📅更新时间: 2026-04-16 13:01:56 📝项目描述: A Method for Detecting and Preventing SQLi and Stored XSS Induced by Expressions in Web Application SQL Statements via Static-Dynamic Analysis 🔗点击访问项目地址

Hashtags

123•••67
ПретходнаСтраница 1 од 7Следна