mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Fixing Makefile and ansible playbook
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com> Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
@ -92,6 +92,7 @@ def do_auto_mode(agent):
|
|||||||
else:
|
else:
|
||||||
logging.exception("main loop exception (%s)", e)
|
logging.exception("main loop exception (%s)", e)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser = plugins_cmd.add_parsers(parser)
|
parser = plugins_cmd.add_parsers(parser)
|
||||||
@ -119,7 +120,6 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
if plugins_cmd.used_plugin_cmd(args):
|
if plugins_cmd.used_plugin_cmd(args):
|
||||||
config = utils.load_config(args)
|
config = utils.load_config(args)
|
||||||
log.setup_logging(args, config)
|
log.setup_logging(args, config)
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
"name": "pwnagotchi",
|
"name": "pwnagotchi",
|
||||||
"type": "arm-image",
|
"type": "arm-image",
|
||||||
"iso_url": "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-05-03/2023-05-03-raspios-bullseye-arm64-lite.img.xz",
|
"iso_url": "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-05-03/2023-05-03-raspios-bullseye-arm64-lite.img.xz",
|
||||||
"iso_checksum": "sha256:bf982e56b0374712d93e185780d121e3f5c3d5e33052a95f72f9aed468d58fa7"
|
"iso_checksum": "sha256:bf982e56b0374712d93e185780d121e3f5c3d5e33052a95f72f9aed468d58fa7",
|
||||||
|
"target_image_size": 9368709120
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"provisioners": [
|
"provisioners": [
|
||||||
|
@ -137,21 +137,6 @@
|
|||||||
- libnetfilter-queue-dev
|
- libnetfilter-queue-dev
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: download old libpcap packages
|
|
||||||
get_url:
|
|
||||||
url: "http://ports.ubuntu.com/pool/main/libp/libpcap/{{ item }}"
|
|
||||||
dest: /usr/local/src/
|
|
||||||
with_items:
|
|
||||||
- libpcap0.8-dev_1.9.1-_arm64.deb
|
|
||||||
- libpcap0.8_1.9.1-3_arm64.deb
|
|
||||||
- libpcap-dev_1.9.1-3_arm64.deb
|
|
||||||
|
|
||||||
- name: install old libpcap packages
|
|
||||||
apt:
|
|
||||||
deb: /usr/local/src/libpcap*
|
|
||||||
args: allow-downgrades
|
|
||||||
register: libpcap
|
|
||||||
|
|
||||||
- name: change hostname
|
- name: change hostname
|
||||||
hostname:
|
hostname:
|
||||||
name: "{{pwnagotchi.hostname}}"
|
name: "{{pwnagotchi.hostname}}"
|
||||||
@ -173,13 +158,6 @@
|
|||||||
line: 'ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap'
|
line: 'ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: add firmware packages to hold
|
|
||||||
dpkg_selections:
|
|
||||||
name: "{{ item }}"
|
|
||||||
selection: hold
|
|
||||||
with_items: "{{ packages.apt.hold }}"
|
|
||||||
when: libpcap.changed
|
|
||||||
|
|
||||||
- name: update apt package cache
|
- name: update apt package cache
|
||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
@ -202,7 +180,7 @@
|
|||||||
- name: configure dphys-swapfile
|
- name: configure dphys-swapfile
|
||||||
file:
|
file:
|
||||||
path: /etc/dphys-swapfile
|
path: /etc/dphys-swapfile
|
||||||
content: "CONF_SWAPSIZE=2048"
|
content: "CONF_SWAPSIZE=1024"
|
||||||
|
|
||||||
- name: clone papirus repository
|
- name: clone papirus repository
|
||||||
git:
|
git:
|
||||||
@ -337,7 +315,7 @@
|
|||||||
|
|
||||||
- name: clone bettercap caplets
|
- name: clone bettercap caplets
|
||||||
git:
|
git:
|
||||||
repo: https://github.com/bettercap/caplets.git
|
repo: https://github.com/jayofelony/caplets.git
|
||||||
dest: /tmp/caplets
|
dest: /tmp/caplets
|
||||||
register: capletsgit
|
register: capletsgit
|
||||||
|
|
||||||
@ -414,19 +392,13 @@
|
|||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
chdir: /usr/local/src/nexmon/
|
chdir: /usr/local/src/nexmon/
|
||||||
|
|
||||||
- name: choose kernel
|
|
||||||
shell: "uname -r"
|
|
||||||
register: kernel
|
|
||||||
|
|
||||||
- name: copy modified driver
|
- name: copy modified driver
|
||||||
copy:
|
copy:
|
||||||
src: /usr/local/src/nexmon/patches/driver/brcmfmac_6.1.y-nexmon/brcmfmac.ko
|
src: /usr/local/src/nexmon/patches/driver/brcmfmac_6.1.y-nexmon/brcmfmac.ko
|
||||||
dest: "/lib/modules/{{ kernel.stdout }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko"
|
dest: "/lib/modules/{{ ansible_kernel }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko"
|
||||||
|
|
||||||
- name: ensure depmod runs on reboot to load modified driver (brcmfmac)
|
- name: "Update kernel modules"
|
||||||
lineinfile:
|
command: /sbin/depmod -a
|
||||||
dest: /etc/rc.local
|
|
||||||
line: "/sbin/depmod -a"
|
|
||||||
|
|
||||||
# To shrink the final image, remove the nexmon directory (takes 2.5G of space) post build and installation
|
# To shrink the final image, remove the nexmon directory (takes 2.5G of space) post build and installation
|
||||||
- name: Delete nexmon content & directory
|
- name: Delete nexmon content & directory
|
||||||
@ -551,6 +523,28 @@
|
|||||||
apt:
|
apt:
|
||||||
autoremove: yes
|
autoremove: yes
|
||||||
|
|
||||||
|
- name: download old libpcap packages
|
||||||
|
get_url:
|
||||||
|
url: "http://ports.ubuntu.com/pool/main/libp/libpcap/{{ item }}"
|
||||||
|
dest: /usr/local/src/
|
||||||
|
with_items:
|
||||||
|
- libpcap0.8-dev_1.9.1-_arm64.deb
|
||||||
|
- libpcap0.8_1.9.1-3_arm64.deb
|
||||||
|
- libpcap-dev_1.9.1-3_arm64.deb
|
||||||
|
|
||||||
|
- name: install old libpcap packages
|
||||||
|
apt:
|
||||||
|
deb: /usr/local/src/libpcap*
|
||||||
|
args: allow-downgrades
|
||||||
|
register: libpcap
|
||||||
|
|
||||||
|
- name: add firmware packages to hold
|
||||||
|
dpkg_selections:
|
||||||
|
name: "{{ item }}"
|
||||||
|
selection: hold
|
||||||
|
with_items: "{{ packages.apt.hold }}"
|
||||||
|
when: libpcap.changed
|
||||||
|
|
||||||
- name: enable services
|
- name: enable services
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
|
@ -2,11 +2,12 @@ main.name = ""
|
|||||||
main.lang = "en"
|
main.lang = "en"
|
||||||
main.confd = "/etc/pwnagotchi/conf.d/"
|
main.confd = "/etc/pwnagotchi/conf.d/"
|
||||||
main.custom_plugin_repos = [
|
main.custom_plugin_repos = [
|
||||||
"https://github.com/evilsocket/pwnagotchi-plugins-contrib/archive/master.zip"
|
"https://github.com/evilsocket/pwnagotchi-plugins-contrib/archive/master.zip",
|
||||||
|
"https://github.com/PwnPeter/pwnagotchi-plugins/archive/master.zip",
|
||||||
]
|
]
|
||||||
main.custom_plugins = "/usr/local/share/pwnagotchi/custom-plugins/"
|
main.custom_plugins = "/usr/local/share/pwnagotchi/custom-plugins/"
|
||||||
|
|
||||||
main.fix_brcmf_plugin.enabled = true
|
main.plugins.fix_brcmf_plugin.enabled = true
|
||||||
|
|
||||||
main.iface = "wlan0mon"
|
main.iface = "wlan0mon"
|
||||||
main.mon_start_cmd = "/usr/bin/monstart"
|
main.mon_start_cmd = "/usr/bin/monstart"
|
||||||
@ -29,7 +30,7 @@ main.plugins.grid.exclude = [
|
|||||||
|
|
||||||
main.plugins.auto-update.enabled = false
|
main.plugins.auto-update.enabled = false
|
||||||
main.plugins.auto-update.install = false
|
main.plugins.auto-update.install = false
|
||||||
main.plugins.auto-update.interval = 1
|
main.plugins.auto-update.interval = 24
|
||||||
|
|
||||||
main.plugins.net-pos.enabled = false
|
main.plugins.net-pos.enabled = false
|
||||||
main.plugins.net-pos.api_key = "test"
|
main.plugins.net-pos.api_key = "test"
|
||||||
@ -95,7 +96,7 @@ main.plugins.bt-tether.devices.ios-phone.max_tries = 0
|
|||||||
main.plugins.bt-tether.devices.ios-phone.share_internet = false
|
main.plugins.bt-tether.devices.ios-phone.share_internet = false
|
||||||
main.plugins.bt-tether.devices.ios-phone.priority = 999
|
main.plugins.bt-tether.devices.ios-phone.priority = 999
|
||||||
|
|
||||||
main.plugins.memtemp.enabled = true
|
main.plugins.memtemp.enabled = false
|
||||||
main.plugins.memtemp.scale = "celsius"
|
main.plugins.memtemp.scale = "celsius"
|
||||||
main.plugins.memtemp.orientation = "horizontal"
|
main.plugins.memtemp.orientation = "horizontal"
|
||||||
|
|
||||||
@ -145,7 +146,7 @@ main.log.path = "/var/log/pwnagotchi.log"
|
|||||||
main.log.rotation.enabled = true
|
main.log.rotation.enabled = true
|
||||||
main.log.rotation.size = "10M"
|
main.log.rotation.size = "10M"
|
||||||
|
|
||||||
main.plugins.age.enabled = true
|
main.plugins.age.enabled = false
|
||||||
main.plugins.age.age_x_coord = 0
|
main.plugins.age.age_x_coord = 0
|
||||||
main.plugins.age.age_y_coord = 32
|
main.plugins.age.age_y_coord = 32
|
||||||
main.plugins.age.str_x_coord = 67
|
main.plugins.age.str_x_coord = 67
|
||||||
@ -165,7 +166,7 @@ ai.params.learning_rate = 0.001
|
|||||||
ai.params.verbose = 1
|
ai.params.verbose = 1
|
||||||
|
|
||||||
personality.advertise = true
|
personality.advertise = true
|
||||||
personality.deauth = false
|
personality.deauth = true
|
||||||
personality.associate = true
|
personality.associate = true
|
||||||
personality.channels = []
|
personality.channels = []
|
||||||
personality.min_rssi = -200
|
personality.min_rssi = -200
|
||||||
|
@ -67,7 +67,7 @@ class Fix_BRCMF(plugins.Plugin):
|
|||||||
try:
|
try:
|
||||||
self._tryTurningItOffAndOnAgain(agent)
|
self._tryTurningItOffAndOnAgain(agent)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logging.warning("[FixBRCMF turnOffAndfOn] %s" % repr(err))
|
logging.warning("[FixBRCMF turnOffAndOn] %s" % repr(err))
|
||||||
else:
|
else:
|
||||||
logging.info("[FixBRCMF] Logs look good, too:\n%s" % last_lines)
|
logging.info("[FixBRCMF] Logs look good, too:\n%s" % last_lines)
|
||||||
self._status = ""
|
self._status = ""
|
||||||
@ -262,29 +262,29 @@ class Fix_BRCMF(plugins.Plugin):
|
|||||||
# success! now make the mon0
|
# success! now make the mon0
|
||||||
try:
|
try:
|
||||||
cmd_output = subprocess.check_output(
|
cmd_output = subprocess.check_output(
|
||||||
"sudo iw phy \"$(iw phy | head -1 | cut -d' ' -f2)\" interface add mon0 type monitor && sudo ifconfig mon0 up",
|
"airmon-ng start wlan0",
|
||||||
shell=True)
|
shell=True)
|
||||||
self.logPrintView("info",
|
self.logPrintView("info",
|
||||||
"[FixBRCMF interface add mon0] worked #%d: %s" % (tries, cmd_output))
|
"[FixBRCMF interface add wlan0mon] worked #%d: %s" % (tries, cmd_output))
|
||||||
self._status = "up"
|
self._status = "up"
|
||||||
time.sleep(tries + 5)
|
time.sleep(tries + 5)
|
||||||
try:
|
try:
|
||||||
# try accessing mon0 in bettercap
|
# try accessing mon0 in bettercap
|
||||||
result = connection.run("set wifi.interface mon0")
|
result = connection.run("set wifi.interface wlan0mon")
|
||||||
if "success" in result:
|
if "success" in result:
|
||||||
logging.info("[FixBRCMF set wifi.interface mon0] worked: %s" % repr(result))
|
logging.info("[FixBRCMF set wifi.interface wlan0mon] worked: %s" % repr(result))
|
||||||
self._status = ""
|
self._status = ""
|
||||||
self._count = self._count + 1
|
self._count = self._count + 1
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
# stop looping and get back to recon
|
# stop looping and get back to recon
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
logging.info("[FixBRCMF set wifi.interfaceface mon0] failed? %s" % repr(result))
|
logging.info("[FixBRCMF set wifi.interfaceface wlan0mon] failed? %s" % repr(result))
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logging.info(
|
logging.info(
|
||||||
"[FixBRCMF set wifi.interface mon0] except: %s" % (repr(result), repr(err)))
|
"[FixBRCMF set wifi.interface wlan0mon] except: %s" % (repr(result), repr(err)))
|
||||||
except Exception as cerr: #
|
except Exception as cerr: #
|
||||||
if not display: print("failed loading mon0 attempt #%d: %s" % (tries, repr(cerr)))
|
if not display: print("failed loading wlan0mon attempt #%d: %s" % (tries, repr(cerr)))
|
||||||
except Exception as err: # from modprobe
|
except Exception as err: # from modprobe
|
||||||
if not display: print("Failed reloading brcmfmac")
|
if not display: print("Failed reloading brcmfmac")
|
||||||
logging.error("[FixBRCMF] Failed reloading brcmfmac %s" % repr(err))
|
logging.error("[FixBRCMF] Failed reloading brcmfmac %s" % repr(err))
|
||||||
@ -308,7 +308,7 @@ class Fix_BRCMF(plugins.Plugin):
|
|||||||
"face": faces.INTENSE})
|
"face": faces.INTENSE})
|
||||||
else:
|
else:
|
||||||
print("And back on again...")
|
print("And back on again...")
|
||||||
logging.info("[FixBRCMF] mon0 back up")
|
logging.info("[FixBRCMF] wlan0mon back up")
|
||||||
else:
|
else:
|
||||||
self.LASTTRY = time.time()
|
self.LASTTRY = time.time()
|
||||||
|
|
||||||
@ -369,13 +369,13 @@ class Fix_BRCMF(plugins.Plugin):
|
|||||||
|
|
||||||
# run from command line to brute force a reload
|
# run from command line to brute force a reload
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print("Performing brcmfmac reload and restart mon0 in 5 seconds...")
|
print("Performing brcmfmac reload and restart wlan0mon in 5 seconds...")
|
||||||
fb = Fix_BRCMF()
|
fb = Fix_BRCMF()
|
||||||
|
|
||||||
data = {'Message': "kernel: brcmfmac: brcmf_cfg80211_nexmon_set_channel: Set Channel failed: chspec=1234"}
|
data = {'Message': "kernel: brcmfmac: brcmf_cfg80211_nexmon_set_channel: Set Channel failed: chspec=1234"}
|
||||||
event = {'data': data}
|
event = {'data': data}
|
||||||
|
|
||||||
agent = Client('localhost', port=8081, username="pwnagotchi", password="pwnagotchi");
|
agent = Client('localhost', port=8081, username="pwnagotchi", password="pwnagotchi")
|
||||||
|
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
print("3 seconds")
|
print("3 seconds")
|
||||||
|
Reference in New Issue
Block a user