![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to read terminal attributes using ioctl() | Sreejesh.S | High Level Programming | 1 | 05-17-2008 10:56 AM |
| How to read lock terminal values in solaris | pankajarora_12 | UNIX for Dummies Questions & Answers | 0 | 07-11-2006 07:31 AM |
| Plz Help : How to use write command to execute command on some other terminal | Aashish | UNIX for Dummies Questions & Answers | 2 | 03-03-2006 09:25 AM |
| read from terminal | rein | Shell Programming and Scripting | 1 | 10-21-2005 07:43 AM |
| Terminal Hungup at the time of read | pkusumam | Shell Programming and Scripting | 1 | 11-30-2001 01:19 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
read terminal command
hi
how to read terminal command, just i want to read all command which write on terminal so please tell me any system call, api avilable in c for above purpose |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
do this
do you wanna of previous commands
which you run in terminal for this type history i dont understand wether your problem about this or not ignore if not |
|
#3
|
|||
|
|||
|
my problem is i want to create one file which store all command or which write on terminals (bad command) in day, for that i read console terminal
now clear problem ............? |
|
#4
|
|||
|
|||
|
chk this out
hi u can write a deamon proc in C to read all the command in the terminal.
use the "system" system call in the c program and redirect all the commands in the history to a file to analyse.writing a deamon allows u to do this in background. system("history>test.$$); include this in the code. mail me if u have any concerns |
|
#5
|
|||
|
|||
|
system ("history >/root/txtx.txt");
not working,it run properly(create file txtx.txt ) but file doent contain any thing |
|
#6
|
|||
|
|||
|
My strange idea:
You can remove ~/.bash_history and then place FIFO of that name: mkfifo ~/.bash_history and then run some program for reading and saving all commands. Or maybe you would like to use "script" command. |
|
#7
|
|||
|
|||
|
If you need a keylooger - the kind of program you're describing - odys mentioned the script utility.
IF this is a real security problem, put something like this in /etc/profile Code:
if [[ $USER = " badguy" ]]; then script <somedirectory the user can write to>/filename fi |
|||
| Google The UNIX and Linux Forums |