Skip to content

Commit

Permalink
Applied some fixes (should solve #36)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhondta committed Nov 23, 2024
1 parent e4e8ae3 commit 6db6f12
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pip3 install dronesploit
## :notebook_with_decorative_cover: Documentation

- [Black Hat Europe Arsenal 2019 presentation](https://dhondta.github.io/dronesploit/docs/pages/blackhat-eu19-arsenal.pdf)
- [Black Hat Europe Arsenal 2019 presentation](https://raw.githubusercontent.com/dhondta/dronesploit/main/docs/pages/blackhat-eu19-arsenal.pdf)
- [*Black Hat Europe: New tool offers Metasploit-like framework for hacking into drones*, The Daily Swig](https://portswigger.net/daily-swig/black-hat-europe-new-tool-offers-metasploit-like-framework-for-hacking-into-drones)
- [*Dronesploit, a pentesting console framework dedicated to drones*, Hakin9](https://hakin9.org/dronesploit-a-pentesting-console-framework-dedicated-to-drones/)

Expand Down
2 changes: 1 addition & 1 deletion src/dronesploit/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.15
1.1.16
2 changes: 2 additions & 0 deletions src/dronesploit/__conf__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding: UTF-8 -*-
import builtins as bi
from prompt_toolkit import print_formatted_text
from sploitkit import *


bi.print_formatted_text = print_formatted_text
bi.Command = Command
bi.Config = Config
bi.FrameworkConsole = FrameworkConsole
Expand Down
1 change: 1 addition & 0 deletions src/dronesploit/_src/commands/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class State(Command):
requirements = {'config': {'DEBUG': True}}

def run(self):
from prompt_toolkit import print_formatted_text
self.console.root.interfaces
for k, v in self.console.state.items():
print_formatted_text("\n{}:".format(k))
Expand Down
6 changes: 3 additions & 3 deletions src/dronesploit/_src/commands/wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def run(self, essid=None):
class Password(Command):
""" Manually set the password of an Access Point """
def complete_keys(self):
targets = self.console.state['TARGETS']
return [t for t in targets.keys() if 'password' in targets[t]]
return [t for t, d in self.console.state['TARGETS'].items() if 'password' in d.keys()]

def complete_values(self, target=None):
return self.console.state['PASSWORDS'].values()
Expand Down Expand Up @@ -103,6 +102,7 @@ def run(self):
continue
data.append(r)
if len(data) > 1:
from prompt_toolkit import print_formatted_text
t = BorderlessTable(data, "Available Targets")
print_formatted_text(ANSI(t.table))
else:
Expand Down Expand Up @@ -151,7 +151,7 @@ def run(self, interface):
self.console._jobs.run("sudo rfkill unblock %s" % parts[0])
self.console._jobs.run("service network-manager restart")
self.console.root.interfaces # this refreshes the state with INTERFACES
Entity.check()
self.__class__.check()

def validate(self, interface):
if interface not in self.console.root.interfaces:
Expand Down
8 changes: 4 additions & 4 deletions src/dronesploit/wifi/drone.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__all__ = ["drone_filter", "re"]


__r = lambda x: re.compile(x + r"[_\-][0-9A-Z]{4,20}")
__r = lambda x, suffix=r"[_\-][0-9A-Z]{4,20}": re.compile(x + suffix)


DRONE_REGEX = {
Expand All @@ -15,11 +15,11 @@
'DJI Spark': __r(r"Spark"),
'DJI Tello': __r(r"TELLO"),
'FPV Racing Drone': __r(r"WIFI_FPV"),
'Generic': __r(r"Drone\d?"),
'Hobbico C-me': __r(r"C-me"),
'Hobbico Flitt': __r(r"Flitt"),
'Hubsan': __r(r"HUBSAN_[A-Z]{1,2}\d+[A-Z]?"),
'Hobbico Flitt': __r(r"Flitt_[a-zA-Z]{6-8}", ""),
'Hubsan': __r(r"HUBSAN_[A-Z]{1,2}\d+[A-Z]?", ""),
'Parrot Bebop': __r(r"Bebop\d?"),
'Unknown': __r(r"Drone\d?"),
}


Expand Down

0 comments on commit 6db6f12

Please sign in to comment.