Python Forum
Python threads and aircrack-ng
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python threads and aircrack-ng
#1
Hi guys,

I'm working on a college project the project is basically a GUI wrapper around the infamous password/wifi key cracking tool aircrack-ng, I have been working on the project for about 5-6 hours today and have got no further with it,

the problem is the crack network method/function does not seem to be capturing the hand shake. When I run the commands normally in the terminal(two separate terminals,one running a deauth attack targeted at my phone and another terminal listening for the handshake which is airodump-ng) when I do this manually I successfully capture the handshake 10/10 times

but when I run the Python script the handshake does not seem to get captured, I try to capture the handshake in with the code and then I manually use aircrack-ng but no luck what so ever.

The issue may lie with the threads I have running, I have one thread capturing traffic(airodump-ng) and writing that data to a file, and the other thread is running aireplay-ng

any ideas as to why the handshake is not being captured? or any theories? , the code looks perfectly fine to me and the running time of the threads also seems to be in sync

def execute_command_terminate(self,command,count):
     
        process = Popen(command,stdout = PIPE,stderr = PIPE)
        time.sleep(count) 
        process.terminate()

def crack_network(self):

        handshake_file = 'files/wpa_handshake'

        #run airodump-ng
        command = ['airodump-ng', "wlan0", '--write', handshake_file, 
        '--bssid','70:55:21:24:6B:A3','--channel','11']
        thread = threading.Thread(target=self.execute_command_terminate,args=(command, 60))
        thread.start()
        thread.join(20)

        # run deauth
        cmd = (['aireplay-ng','--deauth','4','-a','70:55:21:24:6B:A3',
        '-c','C0:75:02:72:6A:BA','wlan0'])
        deauth_thread = threading.Thread(target=self.execute_command_terminate,args=(command,10 ))
        deauth_thread.start()
        deauth_thread.join

        print("cracking over")
thanks
Reply


Messages In This Thread
Python threads and aircrack-ng - by adam2020 - Apr-01-2019, 07:43 PM
RE: Python threads and aircrack-ng - by nilamo - Apr-01-2019, 08:30 PM
RE: Python threads and aircrack-ng - by adam2020 - Apr-01-2019, 08:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Update old Python version because of security threads SanderV 2 1,590 Jun-06-2022, 07:49 PM
Last Post: SanderV
  How to get a count of -Python- threads from the outside (or via code instrumentation) dstromberg 0 1,842 Jul-15-2019, 06:58 PM
Last Post: dstromberg
  Python - Make Json objects to work concurrently through Threads? WeInThis 0 2,637 Sep-22-2017, 11:31 AM
Last Post: WeInThis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020