Operating System - HP-UX
1748246 Members
3044 Online
108760 Solutions
New Discussion юеВ

Keystroke logger needed for HP-UX 11.11

 
Ripstick
Occasional Advisor

Keystroke logger needed for HP-UX 11.11

Hi gang,

I've got an issue with a handful of my users getting knocked out of an application database while entering data. The strange thing is that the menu that launches the application remains intact -- they are simply knocked back into it. Unfortunately their terminal emulation looks to get affected as well since their keystrokes don't appear to be registering any more after this occurs.

The application uses a number of mapped function keys to perform certain things, and they will behave completely randomly when the terminal emulation gets out of whack. They all use WRQ Reflection to access the UNIX server.

Is there some sort of a UNIX script or daemon that I can run or have shadow a user so I can try to determine whether or not a particular keystroke or combination of keys is causing this problem? I'd try to trap for it, but I really don't know what to trap for -- and I'm not going to try and trap for everything.

I cannot use /usr/bin/script because it is practically illegible as a result of the way the menu pages are generated in the log.

Any thoughts?
Game over man... game over.
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: Keystroke logger needed for HP-UX 11.11

If script (or something very much like it) won't work then I don't have any suggestions from the UNIX side. I actually think script will work just fine because you want to see raw data. Anything that "pretties" the data, by definition, alters the data and you need to see exactly the raw data. The answer is not to change tools but rather to change the tool that you are using to examine the /usr/bin/script output. Rather than using vi, for example, use od or hd so that the escape sequences and control characters don't garble the output.
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Keystroke logger needed for HP-UX 11.11

Shalom,

I wonder if the terminal emulation has a tracking function or if you can try another emulation. I'm thinking WRQ bug right now.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: Keystroke logger needed for HP-UX 11.11

Bear in mind that Reflection does have a Trace function and a tool to analyze (Process) the trace file. That will capture every character received and sent by Reflection in a file on the PC. The Trace routines are located under the "Connection" tab of the terminal emulator client.
If it ain't broke, I can fix that.
Doug Burton
Respected Contributor

Re: Keystroke logger needed for HP-UX 11.11

Not real sure if this is something that fits here.....

Open a window and run:
script -a /tmp/STUFF.`date +%Y%m%d`

Open another window and "tail -f /tmp/STUFF.`date +%Y%m%d`" the file above.

Go to the first window and do "ll" or some such thing. EVERYTHING typed AND displayed is in the target file. Even SAM gets displayed correctly if you do a tail -f. If you checkout the file later (cat -v for example), SAM output looks weird. Not sure if you can "really" see SAM window(s) after the fact.

How about putting this into a users .profile?
Ripstick
Occasional Advisor

Re: Keystroke logger needed for HP-UX 11.11

Steven -- It's funny that you should mention that. Since posting this, I've been thinking more and more this might be a problem with WRQ Reflections... either the emulation or configuration got out of whack or perhaps was never configured completely correctly to begin with. This stuff was all set up prior to my now current involvement.

Clay -- I had COMPLETELY forgotten about Reflection's built-in trace feature. Apparently I've never had a need for it in the almost 10 years that I've used their product. Unfortunately, our users use a web-based version of this which doesn't perform the trace correctly. I can do it with my non-web-based version with flying colors (exactly what I was looking for), but the web-based version isn't generating a proper trace log for some reason. I'll look into that a little deeper and post my findings.

Doug -- I've done that exact same thing in the past, but ran into some strange issues when it was being used during the compilation of source code, installing software, or doing certain functions within a database. Not so much problems with the data captured mind you -- more of an issue where the 'script' command was botching up the actual compile, install, etc. All of which ran normally when 'script' wasn't being used to capture the session.

Game over man... game over.
Bill Hassell
Honored Contributor

Re: Keystroke logger needed for HP-UX 11.11

Actually, there are several possibilities. If you are using HP terminal emulation (likely due to the use of function keys), you may have missed some very useful settings for HP-UX (different from MPE and defaults):

All Users and SysAdmins/Programmers:
=========================================

EnqAck=no
HP Use Host Prompt=no
Inhibit DC2=yes
Inhibit Handshake=yes
--Only used for MPE, not HP-UX

Global NumLock=no
--Primarily a problem for laptop users where NumLock comes on when starting Reflection.

Cursor Shape=block
--Makes the cursor much easier to find

Show Terminal Frame=no
Show Toolbar=no
--Remove decorative frame and icons to give a lot more space for the text

Confirm Exit=no
--Saves an extra step when exiting

Window Title="%h &a"
--User choices here--&a=IPaddress and &h=hostname, about a dozen choices plus plain text. Window text shows in icon when minimized.

Connection Setting Exit On Disconnect=yes
--Saves an extra step when closing connection. Combine with ConfirmExit=no and the window goes away at close of connection.

Save Changes on Exit=Never
--This solves a lot of problems. Just start another window to get back correct settings.

SysAdmin/Programmer settings:
====================================
Concatenate Wrapped lines=yes
--Now a long line that splits across multiple lines will copy as 1 line.

PasteDelay=5
--This dramatically speeds up paste of lots of text. In the days of modems and slow computers, delays were needed for buffer overruns. Telnet/ssh does not normally need any delays.

Display Columns=176, Display Rows=66
--Display Columns=132, Display Rows=48
Two settings very useful for looking at logfiles and wide script listings. Run window full screen--WRQ fonts are scalable and easy to read.

Display Memory Blocks=100
--Allows for thousands of lines in display memory--scroll back dozens of pages

Function key F12=Display the HP Device --Control function key label set
This is really useful as it pops up the DisplayFunctions F7 key. This key turns on
a special font which shows every special character including NUL.

Mouse:

Button1 is mapped to MousePositionCursor MouseSelect EditCopy
--This is used to highlight text directly to the ClipBoard (like Xwindows).

Button2 is mapped to Menu Command EditPaste
Insert the Clipboard contents at the cursor position
--This is used to paste with a right-click.

------

Now most of the above settings are utilitarian rather than functional, but pay attention to the first 4 settings regarding host handshakes. Another setting is in HP-UX:

stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixoff

Specifically, -parity and ixoff will solve a lot of problems. Also make sure you use: mesg -n in .profile to prevent talk or write commands from messing up the screen.

Now once the emulation seems to be out of whack, start a trace. You'll miss the events that lead up to the problem but you'll get a list of changed settings and some possible problems. Script can be used but be sure to run the log file through cat -v which will handle special characters. You can also use xd -xc to show every character.

And the best solution is to have the application have a reset and refresh option. You can use tput reset to send the correct reset command, followed by a complete rewrite of the current screen.


Bill Hassell, sysadmin