question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is passive scanning implemented in the Linux backend?

See original GitHub issue
  • bleak version: 0.12.1
  • Python version: 3.8.10
  • Operating System: Ubuntu 20.04.2 LTS
  • BlueZ version (bluetoothctl -v) in case of Linux: 5.53

Description

I wanted to do a passive scan with Bleak. Issue https://github.com/hbldh/bleak/issues/500 seemed to suggest that this is possible with the keyword argument scanning_mode='passive' to the BleakScanner constructor. So I added this argument while initializing the BleakScanner. However, Wireshark still shows me SCAN_REQ packets coming from my computer and SCAN_RSP packets as replies from my BLE devices, which suggests that Bleak is still doing an active scan.

What I Did

My Minimal Workable Example is:

import asyncio
from bleak import BleakScanner


async def run():
    devices = await BleakScanner(scanning_mode='passive').discover()
    for device in devices:
        print(device)


loop = asyncio.get_event_loop()
loop.run_until_complete(run())

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
balloobcommented, Jul 7, 2022

I sent you an email 👍

1reaction
dlechcommented, Jul 7, 2022

If a company that uses Bleak want to sponsor me to take a week off of work, I can have a go at it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is passive scanning? | Definition from TechTarget
Passive scanning may be conducted by a network administrator scanning for security vulnerabilities or by an intruder as a preliminary to an active...
Read more >
Passive Scan - OWASP ZAP
Passive Scan. ZAP by default passively scans all HTTP messages (requests and responses) sent to the web application being tested. Passive scanning does...
Read more >
Linux backend — bleak 0.20.0a1 documentation
The Linux backend of Bleak communicates with BlueZ over DBus. ... scanning_mode – Set to "passive" to avoid the "active" scanning mode.
Read more >
Active vs. passive scanning - Network World.com
What are the differences between active and passive scanning? Active scanning for system inventory information and vulnerability data is a powerful tool ...
Read more >
Passive Fingerprinting - an overview | ScienceDirect Topics
Nmap does not use a passive style of fingerprinting. Instead it performs its Operating System Fingerprinting Scan (OSFS) via active methodologies. The active ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found