Posted: Wed 02 Nov 2016, 21:20
Hey, good find! I did select us keymap so hopefully that is the problem. Will test later tonight I hope.
READ-ONLY Archive
https://oldforum.puppylinux.com/
Just removing the -m fixes itgreengeek wrote:Hey, good find! I did select us keymap so hopefully that is the problem. Will test later tonight I hope.
Code: Select all
logkeys -s -m --us-keymap --no-func-keys -o /var/log/kp/secret-keys.log
Code: Select all
logkeys -s --us-keymap --no-func-keys -o /var/log/kp/secret-keys.log
Code: Select all
logkeys -s --us-keymap --no-func-keys -o /var/log/kp/secret-keys.log
Code: Select all
#!/bin/bash
# MyKeylog
# By Geoffrey
ps ax | grep -q '[My]Keylog' && exit 1
KEYLOG=`awk 'NR==2' < /root/Startup/.pkl`
KEYLOG=`echo "$KEYLOG" | awk -F'-o' '{print $1}'`
eval "$KEYLOG"--no-timestamps -o /var/log/kp/secret-keys.log # no timestamps
function my_keylog () {
ps ax | grep -q '[MY]KEYLOG' && kill $(ps -ef | awk '/[MY]KEYLOG/{print $2}') && exit 1
export MYKEYLOG='
<window title="MyKeylog" icon-name="gtk-edit">
<vbox>
<edit file-monitor="true" auto-refresh="true" wrap-mode="3" editable="true">
<variable>MY_KEYLOG</variable>
<input file>/var/log/kp/secret-keys.log</input>
</edit>
<hbox homogeneous="true">
<hbox>
<button>
<label>Save</label>
<input file stock="gtk-save"></input>
<action>`echo "$MY_KEYLOG" > /var/log/kp/secret-keys.log`</action>
</button>
</hbox>
</hbox>
</vbox>
</window>'
gtkdialog -p MYKEYLOG -G 400x200"+`getcurpos | tr " " "+"`"
}
export -f my_keylog
function killkeylog () {
logkeys -k
kill $(ps -ef | awk '/[MY]KEYLOG/{print $2}')
kill $(ps -ef | awk '/[t]ext=MyKeylog/{print $2}')
}
export -f killkeylog
function about () {
yad --title="About MyKeylog" --close-on-unfocus --geometry=200x100"+`getcurpos | tr " " "+"`" --text-align="center" --skip-taskbar --window-icon="gtk-dialog-info" \
--text="
MyKeylog
By Geoffrey
03/11/2016
" --no-buttons --timeout="5"
}
export -f about
mkfifo /tmp/mykeylog >/dev/null 2>&1
exec 3<> /tmp/mykeylog
exec yad --notification --no-middle --text=$"MyKeylog" --image="gtk-edit" --command "sh -c 'my_keylog >/dev/null 2>&1'" --listen <&3 &
echo "menu:About!bash -c about!gtk-about|Exit!sh -c 'killkeylog >/dev/null 2>&1'!gtk-quit" >&3
It needs a recent version of yad to work, precise has yad 0.12.4, yad 0.26.1 will work but not the --close-on-unfocus option in the about menu, not that you need it, also the stock icons gtk-about and gtk-quit aren't found in precise.april wrote:Yes thanks Geoffrey and nilsonmorales . I used /usr/bin/kp-map as was so perhaps he has fixed that. I use the us keyboard anyhow.
Seems to work atm . I put your script in /root/Startup so hopefully it will run forever more . I'll just have to edit it from time to time .
It doesn't happen to RoundRobin does it?
Oh and i don't get an icon in the tray
Using Precise 5.7.1
Code: Select all
if [ "$r" == "2" ];then
chmod +x /root/Startup/.pkl && /root/Startup/.pkl
Xdialog --rc-file /root/.color.rc --title "keylogger" --icon '/usr/share/icons/espia.png' --msgbox "$(gettext 'keylogger Enable -
Log is stored in
/var/log/kp/secret-keys.log ')" 10 40 && /usr/bin/kp
exit ## Exit Script ##
fi
So I am guessing it will start a new file each boot this way.Logging started ...
2016-11-04 15:58:09+1000 > 1<#+7>21<#+65>
Logging stopped at 2016-11-04 16:00:16+1000
Logging started ...
2016-11-04 16:01:22+1000 >
2016-11-04 16:02:54+1000 >
2016-11-04 16:02:54+1000 > I have done this above and just edited out the chunks of the code just to test this . It seems to be starting automatically at least and recording but I would like to get the GUI in the tray. and accessible
Code: Select all
#!/bin/sh
chmod +x /root/Startup/.pkl && /root/Startup/.pkl
So it is adding to the file each boot and I can easily run the clean line if I need it .Logging started ...
2016-11-04 15:58:09+1000 > 1<#+7>21<#+65>
Logging stopped at 2016-11-04 16:00:16+1000
Logging started ...
2016-11-04 16:01:22+1000 >
2016-11-04 16:02:54+1000 >
2016-11-04 16:02:54+1000 > I have done this above and just edited out the chunks of the code just to test this . It seems to be starting automatically at least and recording but I would like to get the GUI in the tray. and accessible
2016-11-04 16:06:13+1000 >
2016-11-04 16:06:13+1000 >
2016-11-04 16:06:25+1000 >
2016-11-04 16:06:26+1000 > So I am guessing it will start a new file each boot this way.##
Logging stopped at 2016-11-04 16:11:16+1000
Logging started ...
2016-11-04 16:12:22+1000 >
2016-11-04 16:13:09+1000 >
2016-11-04 16:13:09+1000 > OK so now I have edited it down to a 1 line script an put this in Startup
2016-11-04 16:13:41+1000 >
2016-11-04 16:14:48+1000 > Giving after reboot
2016-11-04 16:14:59+1000 >
april, nilsonmorales script places /root/Startup/.pkl, the .pkl should run the logger on startup every time by making .pkl executable.april wrote:Tried this on another machine but still have to start it with kp so I don't understand what your script is doing Geoffrey.
nilsonmorales I would like to edit your configuration file to suit me then have it start at boot thereafter and always run. What command can I use in /root/Start/ folder to achieve this .
I see it is option 2 and your code uses the followingIf I make this a script would that start it automatically? or can you suggest a more simple wayCode: Select all
if [ "$r" == "2" ];then chmod +x /root/Startup/.pkl && /root/Startup/.pkl Xdialog --rc-file /root/.color.rc --title "keylogger" --icon '/usr/share/icons/espia.png' --msgbox "$(gettext 'keylogger Enable - Log is stored in /var/log/kp/secret-keys.log ')" 10 40 && /usr/bin/kp exit ## Exit Script ## fi
Thanks
Ok, It's yad, precise yad version is at fault, I can't get a functional right click menu with yad 0.12.4.april wrote:Yes but your script does not appear to run on mine. Should I remove /root/Startup/.pkl .Will that make yours start . I get nothing when I do that atm.
I have your second script in /root/Startup/ and have changed the permissions to executeable but checking running processes there is nothing started?
Code: Select all
#!/bin/bash
# MyKeylog
ps ax | grep -q '[My]Keylog' && exit 1
logkeys -k >/dev/null 2>&1
KEYLOG=`awk 'NR==2' < /root/Startup/.pkl`
KEYLOG=`echo "$KEYLOG" | awk -F'-o' '{print $1}'`
eval "$KEYLOG"--no-timestamps -o /var/log/kp/secret-keys.log
function my_keylog () {
ps ax | grep -q '[MY]KEYLOG' && kill $(ps -ef | awk '/[MY]KEYLOG/{print $2}') && exit 1
export MYKEYLOG='
<window title="MyKeylog" icon-name="gtk-edit">
<vbox>
<edit file-monitor="true" auto-refresh="true" wrap-mode="3" editable="true">
<variable>MY_KEYLOG</variable>
<input file>/var/log/kp/secret-keys.log</input>
</edit>
<hbox homogeneous="true">
<hbox>
<button>
<label>Save</label>
<input file stock="gtk-save"></input>
<action>`echo "$MY_KEYLOG" > /var/log/kp/secret-keys.log`</action>
</button>
</hbox>
</hbox>
</vbox>
</window>'
gtkdialog -p MYKEYLOG -G 400x200"+`getcurpos | tr " " "+"`"
}
export -f my_keylog
function killkeylog () {
logkeys -k
kill $(ps -ef | awk '/[MY]KEYLOG/{print $2}')
kill $(ps -ef | awk '/[t]ext=MyKeylog/{print $2}')
}
export -f killkeylog
mkfifo /tmp/mykeylog >/dev/null 2>&1
exec 3<> /tmp/mykeylog
exec yad --notification --no-middle --text=$"MyKeylog" --image="gtk-edit" --command "sh -c 'my_keylog >/dev/null 2>&1'" --listen <&3 &
echo "menu:Exit!sh -c 'killkeylog >/dev/null 2>&1'!gtk-cancel" >&3
Can you post the content of your /root/Startup/.pkl file.april wrote:OK yad is bringing up a dialog box when I run it but with the new script I still have nothing in the tray.?
Nothing running either and nothing in the log file
Code: Select all
#!/bin/sh
logkeys -s --us-keymap --no-func-keys -o /var/log/kp/secret-keys.log
Code: Select all
wget --no-check-certificate http://repo.gentoo-es.com/PuppyLinux-repositorios/Pupjibaro/3.2.48/pklogger-0.4.pet
I made a pet for the gui, it has a menu entry in Utility and the tray editor has a option to enable it to run at startup.april wrote:Can you just tell me what I should have in /root/Startup/ to run your script please Geoffrey?
Your script runs without any reported error in a terminal but no GUI shows up?
Fine I understand that . I wondered how practical that would be because it is not sustained on boot or shutdown so the user at the time would have to start it after bootup in a terminal each time so you would have to leave your machine running all the time to catch anybody.nilsonmorales wrote:When we began to think about a GUI for logkeys, as a joke we thought of an application to 'spy', something for 'jealous husbands', like secretly checking who and what is writing in our computers, for that reason we didn't thought of putting anything on the system tray. Neither José nor I have experience writing code, that's why the GUI may have bugs, but for the same reason it is in GitHub in the hope that someone is able to improve the code. The application is opensource if you want to improve it, we'll be happy and satisfied for that.
OK we are progressing . I now have a menu entry for Mykeylog and it is recording keystrokes to the log file without timestamps -ThanksGeoffrey wrote:I made a pet for the gui, it has a menu entry in Utility and the tray editor has a option to enable it to run at startup.
Give it try, it works for me ok, make sure you have the new yad installed else it won't work.