LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-28-2009, 07:38 AM   #1
manchester
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Rep: Reputation: 0
capture text from current screen


i want to capture text which the user types as well as text from any application which the user may open eg: mozilla...
whats the approach to be taken ..? any ideas?
 
Old 01-29-2009, 06:52 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
To capture user input in a terminal, use the "read" command. "man read" for details. You can also call various utilities which generate a GUI dialog box for entering test. Look at things like dialog, kdialog, and zenity.

As for capturing from an application, you will need to clarify what you are doing. What exactly do you need to capture?
 
Old 01-29-2009, 09:53 AM   #3
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
What you're talking about is a keylogger, which in itself is in a gray area at best, and in my opinion, in the darker shade.
 
Old 01-29-2009, 09:58 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Just put a hidden webcam over the user's screen!


Edit: sorry I didn't resist....
 
Old 01-29-2009, 11:40 PM   #5
manchester
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
To capture user input in a terminal, use the "read" command. "man read" for details. You can also call various utilities which generate a GUI dialog box for entering test. Look at things like dialog, kdialog, and zenity.

As for capturing from an application, you will need to clarify what you are doing. What exactly do you need to capture?
Now suppose a user opens an application, then what ever text is present on the screen , i should be able to capture that. Does it have anything to do with XDrawstring function OR Xlib libraries ?
 
Old 01-30-2009, 12:25 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Seriously now. Just out of curiosity I did a little search in Google and I found these:
http://sourceforge.net/projects/lkl/
http://freshmeat.net/projects/uberkey/
The first was last update in 2005, the second just 10 months ago. Even if they don't work due to bugs or for some other reason, you can always look at the open source code and see if they offer some good ideas.
 
Old 01-30-2009, 12:51 AM   #7
manchester
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colucix View Post
Seriously now. Just out of curiosity I did a little search in Google and I found these:
http://sourceforge.net/projects/lkl/
http://freshmeat.net/projects/uberkey/
The first was last update in 2005, the second just 10 months ago. Even if they don't work due to bugs or for some other reason, you can always look at the open source code and see if they offer some good ideas.
Well thnx fr that... but i also want to capture text displayed on other applications.. where can i look for that. in the sense, which functions or API's can i use.. i guess one has to hook up libraries for that, bt dnt kwn how to do that or which ones to hook.
 
Old 01-30-2009, 12:25 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by manchester View Post
i also want to capture text displayed on other applications..
If you don't mind, could you please explain with examples what purpose that serves?
 
Old 01-31-2009, 03:51 AM   #9
manchester
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
If you don't mind, could you please explain with examples what purpose that serves?
consider a monitoring software for eg.. so like if some one opens an internet page or any application with some non desired words present on that page and if suppose i wanna track that....
so for that i need to some how get the text appearing on the application to look for such words.
eg 2: now suppose u open google.com and type in 'sex' in the search link
i wanna capture that and display warning ..

any idea on how to acheive that? and key logger is nt what i want coz it will capture only text entered by user..

Last edited by manchester; 01-31-2009 at 03:57 AM.
 
Old 01-31-2009, 06:29 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Widen your scope I'd say. Because for instance network traffic (your browser example) is easy to filter for as long as you have the right payload dissectors. A keylogger could be used to retrieve keypresses. 'rootsh' could be used to log console text. However text as displayed by graphical applications is rendered on screen. The hard way could be to dump screen (see 'xwd' for the idea), run the resultant image through OCR SW (Tesseract, Ocrad, Gocr) and *then* filter. Saying such a kludge would be not that performant on a single multi-user machine at a resolution of 30 images per second for 20 simultaneous users would be a slight understatement, LOL. Let alone resolving on which $DISPLAY exactly what is displayed by what application and timely interact with it.
 
Old 02-01-2009, 12:54 AM   #11
manchester
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
Widen your scope I'd say. Because for instance network traffic (your browser example) is easy to filter for as long as you have the right payload dissectors. A keylogger could be used to retrieve keypresses. 'rootsh' could be used to log console text. However text as displayed by graphical applications is rendered on screen. The hard way could be to dump screen (see 'xwd' for the idea), run the resultant image through OCR SW (Tesseract, Ocrad, Gocr) and *then* filter. Saying such a kludge would be not that performant on a single multi-user machine at a resolution of 30 images per second for 20 simultaneous users would be a slight understatement, LOL. Let alone resolving on which $DISPLAY exactly what is displayed by what application and timely interact with it.
Actually what i was looking for was hooking the functions which the application must be calling to display the text on the screen, and then catch the text before it is geting displayed.
Eg: XEditor uses XDrawString function in the Xlib before displaying any text entered by the user ... we hooked that function and were able to capture the text appearing on it as well as typed by the user. But the problem is its application specific... ie other applications are using some other functions which are like Xdraw. Need to find out the same..
( The above procedure is working for all apps in Linux, But on Xandros flavour its not.)
any idea about this approach?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen Capture DeanSlotness General 7 07-18-2007 02:23 PM
Bash script- capture cdparanoia text output code-breaker Linux - Software 7 08-03-2006 10:13 PM
Can any of the current Bsd systems do mpeg2 dvd capture format? maximalred *BSD 0 10-10-2004 04:05 PM
Screen Capture LosT ClusteR Linux - General 3 07-26-2003 09:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration