Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit program on pressing ctrl+d at any time #66

Closed
CodeMaxx opened this issue Jul 13, 2016 · 5 comments
Closed

Exit program on pressing ctrl+d at any time #66

CodeMaxx opened this issue Jul 13, 2016 · 5 comments

Comments

@CodeMaxx
Copy link
Contributor

No description provided.

@Ali-Razmjoo
Copy link
Collaborator

Hi, by pushing 3times ctrl + d or ctrl + c software will exit, is there any recommendation or problem ?

@CodeMaxx
Copy link
Contributor Author

CodeMaxx commented Jul 13, 2016

I recommend that the program should exit the first time when ctrl + d is pressed just like in other softwares. ctrl + d represents EOF, which implies user doesn't want to send any more input...Making the user do it 3 times makes no sense...also the user has no way to know that after how many times the program will exit.

Also ctrl + c should not be used for exiting the program, rather it should be used for abruptly stopping scripts inbetween. For e.g. currently this happens on pressing ctrl + c

zsc> shellcode
zsc/shellcode> generate
zsc/shellcode/generate> linux_x86
zsc/shellcode/generate/linux_x86> exec
zsc/shellcode/generate/linux_x86/exec> file_to_execute
file_to_execute:Traceback (most recent call last):
  File "/usr/share/owasp_zsc/zsc.py", line 22, in <module>
    main() #execute main function
  File "/usr/share/owasp_zsc/zsc.py", line 18, in main
    run.engine(commands) #run engine
  File "/usr/share/owasp_zsc/core/run.py", line 237, in engine
    getcommand(commands)
  File "/usr/share/owasp_zsc/core/run.py", line 140, in getcommand
    data.append(raw_input('%s:'%o))
KeyboardInterrupt
CodeMaxx:~$

Rather pressing ctrl + c should return return to zsc/shellcode/generate/linux_x86/.

@Ali-Razmjoo
Copy link
Collaborator

@CodeMaxx Hi Akash, this issue fixed. thank you.

@CodeMaxx
Copy link
Contributor Author

Have you kept same functionality for ctrl+c as well?
Also why does interrupted by user appear twice before exiting?

zsc/shellcode/generate> windows
zsc/shellcode/generate/windows> [!] interrupted by user!
Exit
[!] interrupted by user!
Exit

Ali-Razmjoo pushed a commit that referenced this issue Jul 17, 2016
@Ali-Razmjoo
Copy link
Collaborator

Ali-Razmjoo commented Jul 17, 2016

I think ctrl + c get handle by readline module, but ctrl + d fixed now. tell me if there is anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants