Compare commits

...

5 Commits

Author SHA1 Message Date
cca3e77d50 Version 2.7.6 2024-01-22 14:25:16 +01:00
4fe603bf5e Small edit to net-pos.py 2024-01-22 12:35:21 +01:00
9a9ee70a78 Fixed wigle plugin 2024-01-22 12:06:20 +01:00
7fc8838f76 2.7.5 2024-01-21 11:43:58 +01:00
94b2ff7047 2.7.5 2024-01-21 11:40:27 +01:00
5 changed files with 20 additions and 72 deletions

View File

@ -157,7 +157,7 @@ def pwnagotchi_cli():
sys.exit(0) sys.exit(0)
if args.donate: if args.donate:
print("Donations can made @ https://www.patreon.com/pwnagotchi_torch \n\nBut only if you really want to!") print("Donations can made @ https://github.com/sponsors/jayofelony \n\nBut only if you really want to!")
sys.exit(0) sys.exit(0)
if args.check_update: if args.check_update:

View File

@ -1 +1 @@
__version__ = '2.7.5' __version__ = '2.7.6'

View File

@ -24,6 +24,7 @@ class NetPos(plugins.Plugin):
self.skip = list() self.skip = list()
self.ready = False self.ready = False
self.lock = threading.Lock() self.lock = threading.Lock()
self.options = dict()
def on_loaded(self): def on_loaded(self):
if 'api_key' not in self.options or ('api_key' in self.options and not self.options['api_key']): if 'api_key' not in self.options or ('api_key' in self.options and not self.options['api_key']):
@ -116,6 +117,7 @@ class NetPos(plugins.Plugin):
except OSError as os_e: except OSError as os_e:
logging.error("NET-POS: %s", os_e) logging.error("NET-POS: %s", os_e)
def _get_netpos(self, agent): def _get_netpos(self, agent):
aps = agent.get_access_points() aps = agent.get_access_points()
netpos = dict() netpos = dict()

View File

@ -3,6 +3,7 @@ import logging
import json import json
import csv import csv
import requests import requests
import pwnagotchi
from io import StringIO from io import StringIO
from datetime import datetime from datetime import datetime
@ -24,7 +25,11 @@ def _extract_gps_data(path):
with open(path, 'r') as json_file: with open(path, 'r') as json_file:
tempJson = json.load(json_file) tempJson = json.load(json_file)
d = datetime.utcfromtimestamp(int(tempJson["ts"])) d = datetime.utcfromtimestamp(int(tempJson["ts"]))
return {"Latitude": tempJson["location"]["lat"], "Longitude": tempJson["location"]["lng"], "Altitude": 10, "Updated": d.strftime('%Y-%m-%dT%H:%M:%S.%f')} return {"Latitude": tempJson["location"]["lat"],
"Longitude": tempJson["location"]["lng"],
"Altitude": 10,
"Accuracy": tempJson["accuracy"],
"Updated": d.strftime('%Y-%m-%dT%H:%M:%S.%f')}
else: else:
with open(path, 'r') as json_file: with open(path, 'r') as json_file:
return json.load(json_file) return json.load(json_file)
@ -38,7 +43,7 @@ def _format_auth(data):
out = "" out = ""
for auth in data: for auth in data:
out = f"{out}[{auth}]" out = f"{out}[{auth}]"
return out return [f"{auth}" for auth in data]
def _transform_wigle_entry(gps_data, pcap_data, plugin_version): def _transform_wigle_entry(gps_data, pcap_data, plugin_version):
@ -47,10 +52,10 @@ def _transform_wigle_entry(gps_data, pcap_data, plugin_version):
""" """
dummy = StringIO() dummy = StringIO()
# write kismet header # write kismet header
dummy.write( dummy.write(f"WigleWifi-1.4,appRelease={plugin_version},model=pwnagotchi,release={__pwnagotchi_version__},"
"WigleWifi-1.4,appRelease={},model=pwnagotchi,release={},device=pwnagotchi,display=kismet,board=kismet,brand=pwnagotchi\n".format(plugin_version, __pwnagotchi_version__)) f"device={pwnagotchi.name()},display=kismet,board=RaspberryPi,brand=pwnagotchi\n")
dummy.write( dummy.write("MAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,"
"MAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type") "CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n")
writer = csv.writer(dummy, delimiter=",", quoting=csv.QUOTE_NONE, escapechar="\\") writer = csv.writer(dummy, delimiter=",", quoting=csv.QUOTE_NONE, escapechar="\\")
writer.writerow([ writer.writerow([
@ -64,7 +69,7 @@ def _transform_wigle_entry(gps_data, pcap_data, plugin_version):
gps_data['Latitude'], gps_data['Latitude'],
gps_data['Longitude'], gps_data['Longitude'],
gps_data['Altitude'], gps_data['Altitude'],
0, # accuracy? gps_data['Accuracy'],
'WIFI']) 'WIFI'])
return dummy.getvalue() return dummy.getvalue()
@ -84,7 +89,7 @@ def _send_to_wigle(lines, api_key, donate=True, timeout=30):
headers = {'Authorization': f"Basic {api_key}", headers = {'Authorization': f"Basic {api_key}",
'Accept': 'application/json'} 'Accept': 'application/json'}
data = {'donate': 'on' if donate else 'false'} data = {'donate': 'on' if donate else 'false'}
payload = {'file': dummy, 'type': 'text/csv'} payload = {'file': (pwnagotchi.name()+".csv", dummy), 'type': 'multipart/form-data'}
try: try:
res = requests.post('https://api.wigle.net/api/v2/file/upload', res = requests.post('https://api.wigle.net/api/v2/file/upload',
data=data, data=data,
@ -99,8 +104,8 @@ def _send_to_wigle(lines, api_key, donate=True, timeout=30):
class Wigle(plugins.Plugin): class Wigle(plugins.Plugin):
__author__ = '33197631+dadav@users.noreply.github.com' __author__ = 'Dadav and fixed by Jayofelony'
__version__ = '2.0.0' __version__ = '3.0.0'
__license__ = 'GPL3' __license__ = 'GPL3'
__description__ = 'This plugin automatically uploads collected wifis to wigle.net' __description__ = 'This plugin automatically uploads collected wifis to wigle.net'
@ -109,6 +114,7 @@ class Wigle(plugins.Plugin):
self.report = StatusFile('/root/.wigle_uploads', data_format='json') self.report = StatusFile('/root/.wigle_uploads', data_format='json')
self.skip = list() self.skip = list()
self.lock = Lock() self.lock = Lock()
self.options = dict()
def on_loaded(self): def on_loaded(self):
if 'api_key' not in self.options or ('api_key' in self.options and self.options['api_key'] is None): if 'api_key' not in self.options or ('api_key' in self.options and self.options['api_key'] is None):

View File

@ -1,60 +0,0 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "pwnagotchi"
dynamic = ["version"]
dependencies = [
"Pillow",
"PyYAML",
"RPi.GPIO",
"file-read-backwards",
"flask",
"flask-cors",
"flask-wtf",
"gast",
"gym",
"inky",
"pycryptodome",
"pydrive2",
"python-dateutil",
"requests",
"rpi_hardware_pwm",
"scapy",
"shimmy",
"smbus2",
"spidev",
"stable_baselines3",
"toml",
"torch",
"torchvision",
"tweepy",
"websockets"
]
requires-python = ">=3.9"
authors = [
{name = "Evilsocket", email = "evilsocket@gmail.com"},
{name = "Jayofelony", email = "oudshoorn.jeroen@gmail.com"}
]
maintainers = [
{name = "Jayofelony", email = "oudshoorn.jeroen@gmail.com"}
]
description = "(⌐■_■) - Deep Reinforcement Learning instrumenting bettercap for WiFI pwning."
readme = "README.md"
license = {file = "LICENSE.md"}
classifiers = [
'Programming Language :: Python :: 3',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Environment :: Console',
]
[project.urls]
Homepage = "https://pwnagotchi.ai/"
Documentation = "https://pwnagotchi.ai/"
Repository = "https://github.com/jayofelony/pwnagotchi-bookworm"
"Bug Tracker" = "https://github.com/jayofelony/pwnagotchi-bookworm/issues"
[project.scripts]
pwnagotchi_cli = "bin.pwnagotchi:pwnagotchi_cli"