Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 30 Apr 2015 09:31:08 +0300
From: Shinnok <admin@...nnok.com>
To: john-dev@...ts.openwall.com
Subject: Re: [Johnny] Task 1.4.2 fork and OpenMP


> On Apr 30, 2015, at 3:04 AM, Mathieu Laprise <mathlaprise@...il.com> wrote:
> 
> Hey guys,
> I sent SIGTERM, SIGINT or SIGKILL with 2 different ways : with Johnny and by sending signals with the "top" linux command. It seems to me that John only kills its children when ascii code 3 ( CTRL-c) or 'q'. is pushed on the keyboard, not with signals. I looked at the code in "signal.c" of JtR and it seems to be consistent with my tests. So I thought of 3 ways to solve this: 

This is not good news.

> 
> a) I could modify John (signal.c) to forward the sigterm signal to children. Cons: 1)is it a bug or the wished behaviour that sigterm on john main process doesn't kill the children on any sigterm/sigint ? 2) it'll only work for user with the latest version of john, which might be a big con.

Solar, Frank, Aleksey?

> 
> b) I could only modify Johnny. We have access to the main process id in Johnny but not the children, so we could get them with a command like "ps h --ppid XXX -o pid", where XXX egals the pid of the main john. After that, i'll kill(xxx,SIGTERM); Cons : It doesn't have to work on windows because JtR doesnt support fork on windows but I'm not sure it's gonna work on all flavor of linux, it might only works on Unix based. There might be another command that works for all linux. http://superuser.com/questions/286219/unix-list-children-processes-for-a-given-pid <http://superuser.com/questions/286219/unix-list-children-processes-for-a-given-pid>

I don't like this approach and I'd much rather have Johnny work only with a useful JtR version than with loads of hacks upon loads of hacks.

> 
> @Aleksey
> c) Investigate further about why m_johnProcess.write("q");write("q)  or m_johnProcess.write("q\r\n"); etc. doesn't work. @Aleksey, I have seen in johnny code that you have already used the write method in Johnny but it's commented // TODO: However it does not work as of we do not have terminal. . So I guess that you had problem in the past with the write method, do you remember if it worked ? 
> // void MainWindow::on_pushButton_JohnStatus_clicked()
> // {
> //     // When we want to get John status we send enter to John. Then
> //     // John write something to its stdout. We do not need to read its
> //     // output here because when output is ready to be read a signal is
> //     // fired and we read John output with status as any other John's
> //     // output.
> //     // TODO: However it does not work as of we do not have terminal.
> //     // TODO: Why do we write to John even when it is not running?
> //     m_johnProcess.write("a\r\n");
> // }
> 
> 
> I'm currently trying to set up JtR in a IDE and debug mode to put breakpoints to see if it receives something from Johnny's QProcess::write(). I saw some infos about this for Netbeans on the wiki.
> 
> d) Still thinking ??

This might be speculation but I'd like some answers to these two doubts of mine:
1. Is JtR stdin expected as a tty and has code in that regards?
2. Does JtR flush stdout after writing important stuff?(i.e. like a line of status upon request)

Regards,
Shinnok


[ CONTENT OF TYPE text/html SKIPPED ]

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ