Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetHunter OK, /system/xbin/hid-keyboard not found [Mi 9T] #38

Open
ErSeraph opened this issue Jun 15, 2021 · 24 comments
Open

NetHunter OK, /system/xbin/hid-keyboard not found [Mi 9T] #38

ErSeraph opened this issue Jun 15, 2021 · 24 comments

Comments

@ErSeraph
Copy link

NetHunter succesfully installed, HID Attack from NetHunter app works very well.

/system/xbin/hid-keyboard not found when using Android-PIN-Bruteforce, where is this file?

@urbanadventurer
Copy link
Owner

Are you using an official release of NetHunter from https://www.kali.org/get-kali/#kali-mobile ?

Try this command to test whether you have the file but it was installed at an alternative location:

find / -name hid-keyboard 2>/dev/null

Note that if you are using NetHunter Lite or NetHunter Rootless you won't have HID support, which is required for that file.

image

@ErSeraph
Copy link
Author

ErSeraph commented Jun 15, 2021

Yes, I have full Nethunter release official, my phone appear in the list.

I can actually use hid functions with official Nethunter App and an app called USB Keyboard from Nethunter Store.

I actually found a hid-keyboard file using Android terminal (so not Kali terminal) in /data/data/com.offsec.nethunter/files/scripts/bin but I cant use it with Android-brute-force because is not the Kali terminal, but typeing "echo a | /data..." it work

@urbanadventurer
Copy link
Owner

Could you try editing the config file to include the following line:

HID_KEYBOARD=/data/data/com.offsec.nethunter/files/scripts/bin/hid-keyboard

I could guess that the difference between the Android terminal and Kali terminal is the PATH variable. You could check this with echo $PATH.

@ErSeraph
Copy link
Author

Can't do this, because Android-brute-force is downloaded in Kali terminal, and Kali cannot access Android internal data

@urbanadventurer
Copy link
Owner

urbanadventurer commented Jun 15, 2021

If the latest version of NetHunter has changed the installed location of hid-keyboard then I will need to change my script. In the meantime you could try these commands from the Android terminal as the root user:

su
mkdir -p /system/xbin/
cp /data/data/com.offsec.nethunter/files/scripts/bin/hid-keyboard /system/xbin/hid-keyboard
chmod 755 /system/xbin/hid-keyboard
exit

@ErSeraph
Copy link
Author

For personal reason I had to wipe, but I will try this when I can. I don't know if it will work, because even if I copy hid-keyboard in the new xbin folder, Android-brute cannot access that folder because your script is in kali terminal and not in Android terminal, and Kali cannot access in Android data. I will try anyway 👍

@urbanadventurer
Copy link
Owner

urbanadventurer commented Jun 15, 2021

I'm sorry but I don't understand why there is any difference between the two terminal apps. Are you using the root user account?

I may have to install the latest version of NetHunter to know what you are experiencing.

@ErSeraph
Copy link
Author

Android contains Kali's data.
Android contains hid-keyboard file.
Kali contains /dev/hidgX.
Android-PIN-bruteforce is downloaded in Kali (/home/kali/Desktop/)

As Kali contained IN Android, Kali cannot go up and reach the hid-keyboard file, with Kali I cannot literally go behind the home folder and reach hid-keyboard.

With Android I can go in /data/local/nh system/kalifs/home/kali/Desktop/Android-PIN... but cannot execute the script

@ErSeraph
Copy link
Author

Sorry if this is difficult, Im not even good with English, its not easy

@urbanadventurer
Copy link
Owner

There are lots of people in the world who do not speak English as their native language. I'm happy that you want to try my code.

@ErSeraph
Copy link
Author

Cannot copy, for error "Read-only file system"

@Wahaj787
Copy link

I can help you with this erro :-)

@rdtm443
Copy link

rdtm443 commented Oct 2, 2021

I can help you with this erro :-)

I have exactly the same error as OT, on Mi 9T Pro, mind helping me please (hidg0 and hidg1 are available, but hid-keyboard is not found)? :)

@Wahaj787
Copy link

Wahaj787 commented Oct 2, 2021

I can help you with this erro :-)

I have exactly the same error as OT, on Mi 9T Pro, mind helping me please (hidg0 and hidg1 are available, but hid-keyboard is not found)? :)

Test me on telegram @dunno_whoami

@MasternodeBrasil
Copy link

Any Solution for hid-keyboard out of reach?

Just copying it to /system/xbin/hid-keyboard doesn't work for me, I have numbers printed on the terminal nothing else and typed into adnroid

@CydeSwype
Copy link

CydeSwype commented Jun 20, 2022

For me I solved this by changing the path to /system/bin/hid in the config file.

Err, nevermind, this just results in a different error. The hid-keyboard file doesn't appear to be anywhere in this distro. Like the others, the USB keyboard app works perfectly, sending key strokes remotely. I just can't get this script to work because hid-keyboard isn't present. Any workaround to have it go through the same interface as whatever USB keyboard uses?

@shadowctrl
Copy link

Try copying /data/data/com.offsec.nethunter/files/scripts/bin/hid-keyboard to /system/xbin/ using any root explorer. Worked for me in oneplus nord.

For /system partition read-only error use custom os. Nowadays by default all OS comes by read-only portion for /system.

@Naster17
Copy link

Naster17 commented Feb 23, 2023

How can I use/run this binary from chroot. During normal startup, an error is generated that the file was not found, although it is located. ./hid-keyboard

Please don't say anything right now. Check the path where you started it. Is there support for HID and blah blah blah. I have it all and it works. I need to run this binary from chroot. That's why I'm asking you because the usual methods don't work.

@apertureless
Copy link

apertureless commented Apr 13, 2023

Try copying /data/data/com.offsec.nethunter/files/scripts/bin/hid-keyboard to /system/xbin/ using any root explorer. Worked for me in oneplus nord.

For /system partition read-only error use custom os. Nowadays by default all OS comes by read-only portion for /system.

Well does not work for me on Nethunter for OnePlus 3, because /system/ is read-only.

But you can copy the hid-keyboard to another location and it will work.

I first copied it with root terminal from /data/data/com.offsec.nethunter/files/scripts/bin/hid-keyboard to /mnt/sdcard/Downloads.

And then in Kali chroot terminal I copied it from /sdcard/Downloads/ to /opt/
If you run into permission erros make sure it is executeable.

chmod +x /opt/hid-keyboard

Then just edit the config file vim /opt/Android-Pin-Bruteforce/config and change the location of hid-keyboard to /opt/hid-keyboard.

And it should work.

@ente0
Copy link

ente0 commented Feb 1, 2024

Yes, I have full Nethunter release official, my phone appear in the list.

I can actually use hid functions with official Nethunter App and an app called USB Keyboard from Nethunter Store.

I actually found a hid-keyboard file using Android terminal (so not Kali terminal) in /data/data/com.offsec.nethunter/files/scripts/bin but I cant use it with Android-brute-force because is not the Kali terminal, but typeing "echo a | /data..." it work

Could you please send me the executable file? Because I didn't find it on my Nothing Phone NetHunter

@Lucifer-cm
Copy link

I am using kali linux in vm there i cant find the hid-keyboard path can you help me to locate it

@vsa77
Copy link

vsa77 commented Jun 13, 2024

I am using kali linux in vm there i cant find the hid-keyboard path can you help me to locate it

It's located in a forum dedicated to Kali Linux.

We are discussing Kali Nethunter, which runs on Android.

@pablocool
Copy link

pablocool commented Aug 6, 2024

This is my solution for /system/xbin/hid-keyboard not found. This is old problem but hopefully someone still would make use of it.

In the nethunter phone start NH Terminal. By default it opens chrooted shell. We need additional android shell. Tap on 3 dots -> New Session -> New Root Shell. In Android Root Shell execute:
mount -o remount,rw /system
Then we may copy hid-keyboard to /system/xbin/ directory. For me it was:
cp /data/data/com.offsec.nethunter/scripts/bin/hid-keyboard /system/xbin/
I saw above different source path so you can just try finding correct for you:
find / -name hid-keyboard 2>/dev/null
Next move to the chrooted terminal. hid-keyboard still won't work here because of missing shared libs. We need to fix that:

mkdir /apex
mount -o bind /system/apex /apex

Now hid-keyboard should work you can test it by simply executing:

/system/xbin/hid-keyboard
Usage: /system/xbin/hid-keyboard devname mouse|keyboard|joystick
        keyboard options:
                hold
                left-ctrl
                right-ctrl
                left-shift
                right-shift
                left-alt
                right-alt
                left-meta
                right-meta

        keyboard values:
                [a-z] or [0-9] or
                a                       b
                c                       d
                e                       f
                g                       h
                i                       j
                k                       l
                m                       n
                o                       p
                q                       r
                s                       t
                u                       v
                w                       x
                y                       z
                1                       2
                3                       4
                5                       6
                7                       8
                9                       0
                return                  enter
                esc                     escape
                bckspc                  backspace
                tab                     space
                minus                   dash
                equals                  equal
                lbracket                rbracket
                backslash               hash
                number                  semicolon
                quote                   backquote
                tilde                   comma
                period                  stop
                slash                   caps-lock
                capslock                f1
                f2                      f3
                f4                      f5
                f6                      f7
                f8                      f9
                f10                     f11
                f12                     print
                scroll-lock             scrolllock
                pause                   insert
                home                    pageup
                pgup                    del
                delete                  end
                pagedown                pgdown
                right                   left
                down                    up
                num-lock                numlock
                kp-divide               kp-multiply
                kp-minus                kp-plus
                kp-enter                kp-return
                kp-1                    kp-2
                kp-3                    kp-4
                kp-5                    kp-6
                kp-7                    kp-8
                kp-9                    kp-0
                kp-period               kp-stop
                application             power
                kp-equals               kp-equal
                f13                     f14
                f15                     f16
                f17                     f18
                f19                     f20
                f21                     f22
                f23                     f24
                execute                 help
                menu                    select
                cancel                  redo
                undo                    cut
                copy                    paste
                find                    mute
                volume-up               volume-down

        mouse options:
                --hold
                --b1
                --b2
                --b3

        mouse values:
                Two signed numbers

        joystick options:
                --b1
                --b2
                --b3
                --b4
                --hat1
                --hat2
                --hat3
                --hat4
                --hatneutral

        joystick values:
                three signed numbers
--quit to close

It is good idea to update .bashrc file and at the bottom of it just add:

[ ! -d /apex ] && mkdir /apex
! mountpoint -q /apex && mount -o bind /system/apex /apex

Then after phone reboot after entering chrooted terminal just enter bash:
bash
And you can just start using hid-keyboard

@Krukosz
Copy link

Krukosz commented Nov 29, 2024

@pablocool it's works perfectly!

I'm working on Nokia 6.1 with Lineage 18.1 (last Nethunter in full version for this phone). I had to adjust mount commands to:

mount -o rw,remount /

and then to
mount -o ro,remount /

@urbanadventurer Could you please add this comment to wiki or something? Or do you accept PR with .md file with this description?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests