Needed: Program to store key typing into text boxes[Found]

Requests go here. If you fill a request, give it a new thread in the appropriate category and then link to it in the request thread.
Message
Author
User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#16 Post by greengeek »

What puppy are you running? I just compiled logkeys for my slacko 5.6 deivative and it works great.

User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

#17 Post by nilsonmorales »

[b][url=http://nilsonmorales.blogspot.com/]My blog |[/url][/b][b][url=https://github.com/woofshahenzup]| Github[/url][/b]
[img]https://i.postimg.cc/5tz5vrrX/imag018la6.gif[/img]
[img]http://s5.postimg.org/7h2fid8pz/botones_logos3.png[/img]

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#18 Post by greengeek »

Hmmm, looks great - but doesn't seem to log anything on my slacko 5.6

I will keep trying.

EDIT : it seems to create the kp directory but there is no log file inside it.

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#19 Post by Geoffrey »

greengeek wrote:
Hmmm, looks great - but doesn't seem to log anything on my slacko 5.6

I will keep trying.

EDIT : it seems to create the kp directory but there is no log file inside it.
I got it to work from command line

Code: Select all

logkeys -s -u --no-timestamps -o ~/.secret-keys.log
to kill the process

Code: Select all

logkeys -k

Code: Select all

# logkeys
Usage: logkeys [OPTION]...
Log depressed keyboard keys.

  -s, --start               start logging keypresses
  -m, --keymap=FILE         use keymap FILE
  -o, --output=FILE         log output to FILE [/var/log/logkeys.log]
  -u, --us-keymap           use en_US keymap instead of configured default
  -k, --kill                kill running logkeys process
  -d, --device=FILE         input event device [eventX from /dev/input/]
  -?, --help                print this help screen
      --export-keymap=FILE  export configured keymap to FILE and exit
      --no-func-keys        log only character keys
      --no-timestamps       don't prepend timestamps to log file lines
      --post-http=URL       POST log to URL as multipart/form-data file
      --post-size=SIZE      post log file when size equals SIZE [500k]

Examples: logkeys -s -m mylang.map -o ~/.secret-keys.log
          logkeys -s -d event6
          logkeys -k

logkeys version: 0.1.1b-svn
logkeys homepage: <http://code.google.com/p/logkeys/>
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#20 Post by Geoffrey »

greengeek wrote: it seems to create the kp directory but there is no log file inside it.
I found the problem, it trys to use

Code: Select all

-m --us-keymap
when US keyboard is selected, there is no map for the us keyboard, the /usr/bin/kp-map needs to be edited line 38 from this

Code: Select all

logkeys -s -m --us-keymap --no-func-keys -o /var/log/kp/secret-keys.log
to this

Code: Select all

logkeys -s -u --no-func-keys -o /var/log/kp/secret-keys.log
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#21 Post by greengeek »

Hey, good find! I did select us keymap so hopefully that is the problem. Will test later tonight I hope.

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#22 Post by Geoffrey »

greengeek wrote:Hey, good find! I did select us keymap so hopefully that is the problem. Will test later tonight I hope.
Just removing the -m fixes it

from

Code: Select all

logkeys -s -m --us-keymap --no-func-keys -o /var/log/kp/secret-keys.log
to

Code: Select all

logkeys -s --us-keymap --no-func-keys -o /var/log/kp/secret-keys.log
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#23 Post by Geoffrey »

Here's a script that works with nilsonmorales pklogger-0.3.pet, it will put a gtkdialog text edit in the tray.

The keylogger runs on running the script and stops when the tray app is exited, right click the icon for the exit menu, clicking the tray icon toggles the edit window.

You still need to configure pklogger prior to running the script to set the key map, as I mentioned the kp-map script needs the US map fixed to work.

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
Attachments
mykeylog.png
(54.45 KiB) Downloaded 258 times
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

#24 Post by nilsonmorales »

Thank you Geoffrey, i will commit your fixes and update the pklogger.
[b][url=http://nilsonmorales.blogspot.com/]My blog |[/url][/b][b][url=https://github.com/woofshahenzup]| Github[/url][/b]
[img]https://i.postimg.cc/5tz5vrrX/imag018la6.gif[/img]
[img]http://s5.postimg.org/7h2fid8pz/botones_logos3.png[/img]

april

#25 Post by april »

Yes thanks Geoffrey and nilsonmorales .

Seems to work atm only when I start it . I put your script in /root/Startup so hopefully it will run forever more .(Whoops noticed thats not needed so I removed that)(No it does not seem to start automatically from ".pkl" either. I have to run kp in a terminal each time and choose to start it ) Why are these things always marred by problems?
Its pretty easy . I just want it to run automatically every time I run my computer.



It doesn't happen to RoundRobin does it? I'll just have to edit it from time to time .
Oh and i don't get an icon in the tray and no menu entry Geoffrey . Is that what you meant to happen?
Using Precise 5.7.1
Last edited by april on Sun 06 Nov 2016, 18:35, edited 1 time in total.

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#26 Post by Geoffrey »

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
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.

I installed precise 5.7.1 added the pklogger-0.3.pet, mustn't be fixed yet as I had to edit the kp-map script for US keyboard.

T̶h̶i̶s̶ ̶w̶i̶l̶l̶ ̶w̶o̶r̶k̶ ̶w̶i̶t̶h̶ ̶y̶a̶d̶ ̶v̶e̶r̶s̶i̶o̶n̶ ̶0̶.̶1̶2̶.̶4̶

Edit: The old precise yad 0.12.4 doesn't support some feature of newer yad code.
Last edited by Geoffrey on Fri 04 Nov 2016, 23:45, edited 1 time in total.
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

april

#27 Post by april »

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 following

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
If I make this a script would that start it automatically? or can you suggest a more simple way
Thanks

I have done this above and just edited out 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
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
So I am guessing it will start a new file each boot this way.

OK so now I have edited it down to a 1 line script an put this in Startup

Code: Select all

#!/bin/sh
chmod +x /root/Startup/.pkl && /root/Startup/.pkl
Giving after reboot
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 >
So it is adding to the file each boot and I can easily run the clean line if I need it .

Looks like apart from input from nilsonmorales and maybe getting the tray GUI to work which is what I think you intend Geoffrey I'm getting somewhere Thanks Guys

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#28 Post by Geoffrey »

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 following

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
If I make this a script would that start it automatically? or can you suggest a more simple way
Thanks
april, nilsonmorales script places /root/Startup/.pkl, the .pkl should run the logger on startup every time by making .pkl executable.

My script doesn't need the /root/Startup/.pkl to be executable, it reads the content of this script and strips every thing after and including the "-o" then adds " --no-timestamps -o /var/log/kp/secret-keys.log ".

There is no need to have the key logger running as my script starts it and stops the logger when the tray app is closed

This makes for a better looking text that's easier to copy from without all the time stamps on every line.
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

april

#29 Post by april »

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?

april

#30 Post by april »

nilsonmorales- Your pet as installed at present brings up your fine dialog box but takes some 4 keystrokes to get rid of . Yes ,it is still turned on then, but keystrokes are a pain and in its present form it would not last very long before I chucked it.

I would suggest to you that, having it come up as a tray applet only, on boot with the option to start that tray dialog box and an option to have it turn on at bootup ,would be the way to go . The rest of it is excellent .Thanks for the app I will follow you on github.

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#31 Post by Geoffrey »

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?
Ok, It's yad, precise yad version is at fault, I can't get a functional right click menu with yad 0.12.4.

Heres a yad I compiled in precise 5.7.1, yad-0.37.0, it's the latest and afaik the last that supports gtk2.

this revised script will first kill the logger if it is running, then restarts it with the timestamp disabled


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
Attachments
yad-0.37.0.tar.gz
(71.13 KiB) Downloaded 155 times
keylog.jpg
(47.56 KiB) Downloaded 298 times
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

april

#32 Post by april »

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

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#33 Post by Geoffrey »

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
Can you post the content of your /root/Startup/.pkl file.
The yad script should work, I'm running it in a clean install of precise 5.7.1 with only the new yad and pklogger installed, it's working fine for me.
Attachments
mykeylog.tar.gz
(814 Bytes) Downloaded 109 times
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

april

#34 Post by april »

Code: Select all

#!/bin/sh
logkeys -s  --us-keymap --no-func-keys -o /var/log/kp/secret-keys.log
I took the -m out as per your notes

testkp.sh will run the original dialog box-Im using it so its still in now . To see if yours runs I take it out.
Attachments
Keyloggerscreenshot.png
(177.41 KiB) Downloaded 221 times
Last edited by april on Sun 06 Nov 2016, 22:53, edited 1 time in total.

april

#35 Post by april »

Can you just tell me what I should have in /root/Startup/ to run your script please Geoffrey?

BTW You can get pklogger-0.4.pet from github/pklogger or in a terminal --

Code: Select all

 wget --no-check-certificate http://repo.gentoo-es.com/PuppyLinux-repositorios/Pupjibaro/3.2.48/pklogger-0.4.pet
#v0.4 Geoffrey fix added 11032016, orange color
http://repo.gentoo-es.com/PuppyLinux-re ... er-0.4.pet

Post Reply