|# Copyright © 2016 Bjarte Johansen <Bjarte.Johansen@gmail.com>|
|# The MIT License (MIT)|
|# Permission is hereby granted, free of charge, to any person obtaining|
|# a copy of this software and associated documentation files (the|
|# “Software”), to deal in the Software without restriction, including|
|# without limitation the rights to use, copy, modify, merge, publish,|
|# distribute, sublicense, and/or sell copies of the Software, and to|
|# permit persons to whom the Software is furnished to do so, subject to|
|# the following conditions:|
|# The above copyright notice and this permission notice shall be|
|# included in all copies or substantial portions of the Software.|
|# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,|
|# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF|
|# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND|
|# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE|
|# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION|
|# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION|
|# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.|
|# Goto System Preferences > Security & Privacy > Accessibility and add|
|# Python to apps allowed to control your computer. If it is not in the|
|# list, the easiest is to run this file first and it should appear.|
|from AppKit import NSApplication, NSApp|
|from Foundation import NSObject, NSLog|
|from Cocoa import NSEvent, NSKeyDownMask|
|from PyObjCTools import AppHelper|
|def applicationDidFinishLaunching_(self, notification):|
|mask = NSKeyDownMask|
|app = NSApplication.sharedApplication()|
|delegate = AppDelegate.alloc().init()|
|if __name__ == '__main__':|
Does it say where it gives that? If you could paste the whole error that would be helpful(, unless that is the whole error; some of the PyObjC errors are really bad).
It might be that you have to enable access for assistive devices in 'System Preferences>Universal Access'.
Hi huys , i enable access for assistive devices , but how can work
@G3n3Rall This codes metasploit to do the heavy lifting. My code uses the Cocoa library calls directly and requires that you enable the access to assistive devices because of that. If you need it to work without the assistive devices enabled you will need to figure out how to work with python and metasploit (or figure out how metasploit does that).
Kinda strange because it generates the following exception when using ^C
@Quentin-M I think pyObjC returned a python KeyboardInterrupt before, but it seems it is not doing that anymore. It should be easy to fix, but I think that should be an exercise for the reader.
@kismet- You should be able to use standard python commands to output to a file, or you can use gurgeh/selfspy.
I get this error :
And before you say somethin bout you gotta install appkit, I have I did all this pip install appkit thingy and it installed I think.