Skip to content

Criar Script Python para OSINT no WhatsApp#104

Merged
own-boldsbrain merged 1 commit intomainfrom
feat/whatsapp-osint-script
Oct 28, 2025
Merged

Criar Script Python para OSINT no WhatsApp#104
own-boldsbrain merged 1 commit intomainfrom
feat/whatsapp-osint-script

Conversation

@google-labs-jules
Copy link
Copy Markdown

Este script Python utiliza Selenium para automatizar o WhatsApp Web e realizar OSINT em números de telefone brasileiros. Ele verifica a existência de contas e extrai informações de perfil como nome, recado e URL da foto. O código é robusto, inclui tratamento de erros, logging e retorna os dados em formato JSON, com toda a documentação em português.


PR created automatically by Jules for task 18402006962433831865

Este commit adiciona um script Python completo para realizar OSINT em números de telefone do WhatsApp usando automação web com Selenium.

O projeto inclui:
- Uma classe `WhatsAppOSINT` que encapsula a lógica para se conectar ao WhatsApp Web, buscar por um número e extrair informações de perfil (nome, recado, foto).
- Uso de seletores CSS estáveis (`data-testid`) em vez de XPaths frágeis.
- Remoção do modo headless para evitar detecção e bloqueio pelo WhatsApp.
- Tratamento de erros robusto para a inicialização do WebDriver e para a validação de números.
- Logging detalhado para um arquivo `whatsapp_osint.log`.
- Saída de dados estruturada em formato JSON.
- Um `requirements.txt` com as dependências necessárias.
- Um `README.md` detalhado com instruções de instalação, uso e avisos sobre o uso ético.
- Um `.gitignore` para excluir arquivos de log e de sessão.
@google-labs-jules
Copy link
Copy Markdown
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

@own-boldsbrain own-boldsbrain marked this pull request as ready for review October 28, 2025 09:55
Copilot AI review requested due to automatic review settings October 28, 2025 09:55
@own-boldsbrain own-boldsbrain merged commit 127961b into main Oct 28, 2025
0 of 2 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a Python-based OSINT tool for WhatsApp that automates WhatsApp Web using Selenium to verify Brazilian phone numbers and extract publicly available profile information (name, status, profile picture URL). The implementation includes robust error handling, logging, session persistence, and JSON output formatting.

Key Changes:

  • Implementation of a Selenium-based WhatsApp Web automation tool with anti-detection measures
  • Brazilian phone number validation and profile data extraction capabilities
  • Complete project setup with dependencies, documentation, and gitignore configuration

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
whatsapp_osint/whatsapp_osint.py Main script implementing the WhatsAppOSINT class with methods for login, number search, and profile data extraction
whatsapp_osint/requirements.txt Project dependencies including Selenium, webdriver-manager, and argparse
whatsapp_osint/README.md Comprehensive documentation in Portuguese covering installation, usage, examples, and ethical warnings
whatsapp_osint/.gitignore Configuration to exclude logs, session data, virtual environments, and Python cache files

args = parser.parse_args()

# Validação do formato do número.
if not (args.numero.isdigit() and args.numero.startswith('55') and len(args.numero) > 12):
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validation logic is incorrect. Brazilian phone numbers should have exactly 12 or 13 digits (55 + 2-digit area code + 8 or 9 digit number), but the condition uses > 12 which would incorrectly reject valid 12-digit numbers. Change to len(args.numero) >= 12 or more precisely len(args.numero) in [12, 13].

Suggested change
if not (args.numero.isdigit() and args.numero.startswith('55') and len(args.numero) > 12):
if not (args.numero.isdigit() and args.numero.startswith('55') and len(args.numero) in [12, 13]):

Copilot uses AI. Check for mistakes.
chrome_options.add_argument("--disable-blink-features=AutomationControlled")
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
chrome_options.add_experimental_option('useAutomationExtension', False)
chrome_options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36")
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded Chrome 108 user agent is outdated and could trigger detection mechanisms. Consider using a more recent version string or dynamically obtaining the user agent from the installed Chrome version to avoid fingerprinting.

Copilot uses AI. Check for mistakes.
try:
logging.info(f"Iniciando a busca pelo número: {numero_telefone_br}")
# Rate limiting: pausa para simular comportamento humano.
time.sleep(5)
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The hardcoded 5-second delay could be exposed as a configurable parameter (class attribute or method parameter) to allow users to adjust timing based on their network conditions or rate limiting requirements.

Copilot uses AI. Check for mistakes.
WebDriverWait(self.driver, 20).until(
EC.presence_of_element_located((By.CSS_SELECTOR, panel_selector))
)
time.sleep(2) # Pausa para garantir que o conteúdo do painel seja renderizado.
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a fixed 2-second sleep is fragile. Consider using an explicit wait condition (WebDriverWait) to check for specific elements being rendered in the panel instead of an arbitrary time delay.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants