Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
Language support/args input for keyseed.py
Browse files Browse the repository at this point in the history
hid-all.py takes language/os arguments.  Example:

python hid-all.py --es -w7

Will run Windows 7 elevated for spanish keyboards.  This will need to be handled by Nethunter application for passing arguments.

Also removed -- arguments since they were removed from hid-keyboard application.

Signed-off-by: binkybear <binkybear@nethunter.com>
  • Loading branch information
binkybear committed Dec 18, 2014
1 parent 1200727 commit e1bc4ca
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 13 deletions.
28 changes: 15 additions & 13 deletions utils/files/modules/keyseed.py 100755 → 100644
Expand Up @@ -452,19 +452,21 @@ def win7cmd_elevated(locale):
print '''sleep 1'''
findinlist("\x64", locale) #d
if (locale=="us") | (locale=="fr"):
print '''echo --left-ctrl --left-shift --return | hid-keyboard /dev/hidg0 keyboard'''
print '''sleep 1'''
if locale=="us" : print '''echo --left-alt y | hid-keyboard /dev/hidg0 keyboard'''
elif locale=="fr": print '''echo --left-alt o | hid-keyboard /dev/hidg0 keyboard'''
elif locale=="de" : print '''echo --left-alt y | hid-keyboard /dev/hidg0 keyboard''' #to be confirmed
elif (locale=="es"):
print '''echo -ne "\\x17\\x20\\x00\\x00\\x28\\x00\\x00\\x00" > /dev/hidg0'''
print '''sleep 1'''
print '''echo -ne "\\xA4\\x00\\x00\\x00\\x16\\x00\\x00\\x00" > /dev/hidg0'''
print '''sleep 1'''
print '''echo -ne "\\x10\\x00\\x00\\x00\\x00\\x00\\x00\\x00" > /dev/hidg0'''
print '''sleep 3'''

print '''echo --left-ctrl --left-shift --return | hid-keyboard /dev/hidg0 keyboard'''
print '''sleep 1'''
if (locale=="us"):
print '''echo --left-alt y | hid-keyboard /dev/hidg0 keyboard'''
elif (locale=="fr"):
print '''echo --left-alt o | hid-keyboard /dev/hidg0 keyboard'''
elif (locale=="de"):
print '''echo --left-alt y | hid-keyboard /dev/hidg0 keyboard'''
elif (locale=="es"):
print '''echo -ne "\\x17\\x20\\x00\\x00\\x28\\x00\\x00\\x00" > /dev/hidg0'''
print '''sleep 1'''
print '''echo -ne "\\xA4\\x00\\x00\\x00\\x16\\x00\\x00\\x00" > /dev/hidg0'''
print '''sleep 1'''
print '''echo -ne "\\x10\\x00\\x00\\x00\\x00\\x00\\x00\\x00" > /dev/hidg0'''
print '''sleep 3'''

def win8cmd_elevated(locale):
print '''sleep 1'''
Expand Down
49 changes: 49 additions & 0 deletions utils/hid/hid-all.py
@@ -0,0 +1,49 @@
#!/usr/bin/python
import argparse
import sys
sys.path.append("/sdcard/files/modules/")
from keyseed import *

parser = argparse.ArgumentParser(description='Nethunter HID language/launcher')
parser.add_argument('--us', help='Select US keyboard mapping', action='store_true')
parser.add_argument('--fr', help='Select FR keyboard mapping', action='store_true')
parser.add_argument('--es', help='Select ES keyboard mapping', action='store_true')
parser.add_argument('--de', help='Select DE keyboard mapping', action='store_true')
parser.add_argument('--wincmd', '-w', help='Windows CMD', action='store_true')
parser.add_argument('--win7cmd', '-w7', help='Windows 7 CMD', action='store_true')
parser.add_argument('--win8cmd','-w8', help='Windows 8 CMD', action='store_true')

args = parser.parse_args()

if (args.us):
locale='us'
elif (args.fr):
locale='fr'
elif (args.de):
locale='de'
elif (args.es):
locale='es'

if (args.wincmd):
wincmd(locale)
elif (args.win7cmd):
win7cmd_elevated(byte, locale)
elif (args.win8cmd):
win8cmd_elevated(byte, locale)

# open up payload file
f = open("/sdcard/files/hid-cmd.conf", "rb")
try:
byte = f.read(1)
while byte != "":
byte = f.read(1)
findinlist(byte, locale)

finally:
f.close()

#Hit enter
enterb()



0 comments on commit e1bc4ca

Please sign in to comment.