LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-31-2008, 02:58 PM   #1
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 410

Rep: Reputation: 30
Trapping control-c for netcat


Hi,
I am using netcat for a shell, and I will be connected, but when inside the shell, if I need to use "ctrl-c", it will end up killing netcat instead of the program I am running in the shell on the other machine. I've tried playing around with trap, and I read the man pages for netcat, but I can't figure out a way to have netcat not die on ctrl-c. Any ideas?

Thanks,
Marshall
 
Old 03-31-2008, 03:42 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
If you are using bash as netcat’s parent shell, try Ctrl-V then Ctrl-C.
 
Old 03-31-2008, 04:14 PM   #3
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 410

Original Poster
Rep: Reputation: 30
That doesn't work. It just says ^C in the terminal, but doesn't send the signal to the process inside the terminal.
 
Old 03-31-2008, 06:19 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Why not just log in with a proper service like ssh? Note that hacking (as in system cracking, not the original technology enthusiast definition) discussions are not welcome on LQ. My apologies for the implication if your purpose is good, it's just that this is a very classic h@x0r technique for getting a remote shell.

Last edited by matthewg42; 03-31-2008 at 06:22 PM.
 
Old 04-01-2008, 12:39 AM   #5
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
i'm not sure if that will work.. even though you'll be able to configure netcat to handle ^C in the local machine and be able to send the ^C character.. you still won't be able to summon the signal.. i think it can only be done in the remote machine.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get to consoles, X trapping Fx keys Oxagast Linux - Software 3 01-06-2006 10:10 AM
trapping packets mohit_garg Linux - Networking 6 07-10-2005 05:29 PM
Trapping NFS requests Jayendra Linux - Networking 0 03-01-2004 09:17 AM
Trapping keystrokes in C k4zau Programming 3 03-09-2003 01:13 PM
trapping signals at bootup Xpolloloco Slackware 4 08-23-2002 09:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:22 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