Government Security
Network Security Resources

Jump to content

Photo

Disable Mouse

security linux cyber security
  • Please log in to reply
3 replies to this topic

#1 seadhead

seadhead

    Private

  • Members
  • 2 posts

Posted 31 January 2012 - 01:10 PM

I am participating in an acdemic cyber security competition and I am looking to force students to think outside the box. I am inquiring if there is a way a mouse can be disable and re-inabled on a Linux system.

#2 seadhead

seadhead

    Private

  • Members
  • 2 posts

Posted 06 February 2012 - 08:21 AM

I will answer my own question. I found you can unload the associated kernel module and render the mouse useless. Example:

# lsmod | grep mouse
psmouse
# rmmod psmouse
# echo bye bye mouse
bye bye mouse
# locate psmouse.ko
/lib/somewhere/psmouse.ko
# insmod /lib/somewhere/psmouse.ko
# echo mouse is back
mouse is back


#3 vgfeit

vgfeit

    Private

  • Members
  • 1 posts

Posted 21 February 2012 - 06:10 AM

I will answer my own question.  I found you can unload the associated kernel module and render the mouse useless. Example:

# lsmod | grep mouse
psmouse
# rmmod psmouse
# echo bye bye mouse
bye bye mouse
# locate psmouse.ko
/lib/somewhere/psmouse.ko
# insmod /lib/somewhere/psmouse.ko
# echo mouse is back
mouse is back


Interesting problem and solution.I've tested it and realized that you may reduce the steps in the script, i.e. instead using
# locate psmouse.ko
/lib/somewhere/psmouse.ko
# insmod /lib/somewhere/psmouse.ko
# echo mouse is back
mouse is back

you may simple
# modprobe psmouse
# echo mouse is back


#4 hololeap

hololeap

    Private

  • Members
  • 4 posts

Posted 23 April 2012 - 11:34 PM

You can also use the xinput utility.

I made a little script to help you automate this. Just save it as mouse.sh or whatever and run:
# sh mouse.sh disable
or to renable the mouse:
# sh mouse.sh enable

Note: This only works on the current X session unless you change the DISPLAY environment variable to the X server you want to control and have disabled access controls on that session. For example:

x-server # xhost +inet:<your-comp's ip address>
your-comp # DISPLAY=<x-server's ip address>:0 sh mouse.sh disable

mouse.sh
#!/bin/bash
first_arg=$(echo $1 | tr [:upper:] [:lower:])
case $first_arg in
	enable ) enable=1 ;;
	disable ) enable=0 ;;
	* ) echo "Usage: $0 [enable|disable]"; exit 1 ;;
esac
ids=$(xinput list | sed -ne 's/.*id=\(\S\+\).*slave\s\+pointer.*/\1/p')
for i in $ids; do
	xinput set-prop $i 'Device Enabled' $enable
done






Also tagged with one or more of these keywords: security, linux, cyber security