Bind an existing process to a socket
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I want to bind an existing process to a socket listenning on a specific port with nc
and send input to it (a python interactive shell, an editor...) whatever process, just send a pid and bind it, since file descriptors are meaningless for another process rather than the existing process and can't use /proc/<pid>/fd/0
to send input to process (the fds
are just symlinks to a terminal).
The last statement is too conclusive to be true since strace -p<pid> -s9999 -e write
can spy STDIN and STDOUT (don't know how)of a process but that's something I will investigate later, from now I want to bind an existing process to a socket and send data to it via a socket.
process socket file-descriptors
add a comment |Â
up vote
1
down vote
favorite
I want to bind an existing process to a socket listenning on a specific port with nc
and send input to it (a python interactive shell, an editor...) whatever process, just send a pid and bind it, since file descriptors are meaningless for another process rather than the existing process and can't use /proc/<pid>/fd/0
to send input to process (the fds
are just symlinks to a terminal).
The last statement is too conclusive to be true since strace -p<pid> -s9999 -e write
can spy STDIN and STDOUT (don't know how)of a process but that's something I will investigate later, from now I want to bind an existing process to a socket and send data to it via a socket.
process socket file-descriptors
1
âÂÂThe last statement is too conclusive to be trueâ â nice... Why repeat a statement if you donâÂÂt believe it then?
â Stephen Kitt
Apr 11 at 14:45
Pointer: combine two things: 1/ pass around fd descriptors through unix sockets 2/ use a tool like gdb to execute the missing code from your running processes to just implement 1/ . random links: 1/ stackoverflow.com/questions/28003921/⦠2/ unix.stackexchange.com/questions/208617/⦠. I'm quite sure SO or reverseengineering SE have other examples for both
â A.B
Apr 11 at 18:28
let's say nano is pid 18541 and I want to send its input over a socket. I have a listening nc on port 5555 and type/proc/18541/fd/0 > /dev/tcp/localhost/5555
I gotbash: /proc/18541/fd/0: Permission denied
even though I'm root
â aDoN
Apr 12 at 11:02
I have been able to send data to another process withgdb -p <pid>
withcall write(0,"test",4)
but I want to bind the process to a port and send data through it (it doesn't matter if I get the stdout or the process in question does, those are details I don't want to delve into right now, just the input is what interests me)
â aDoN
Apr 12 at 13:37
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to bind an existing process to a socket listenning on a specific port with nc
and send input to it (a python interactive shell, an editor...) whatever process, just send a pid and bind it, since file descriptors are meaningless for another process rather than the existing process and can't use /proc/<pid>/fd/0
to send input to process (the fds
are just symlinks to a terminal).
The last statement is too conclusive to be true since strace -p<pid> -s9999 -e write
can spy STDIN and STDOUT (don't know how)of a process but that's something I will investigate later, from now I want to bind an existing process to a socket and send data to it via a socket.
process socket file-descriptors
I want to bind an existing process to a socket listenning on a specific port with nc
and send input to it (a python interactive shell, an editor...) whatever process, just send a pid and bind it, since file descriptors are meaningless for another process rather than the existing process and can't use /proc/<pid>/fd/0
to send input to process (the fds
are just symlinks to a terminal).
The last statement is too conclusive to be true since strace -p<pid> -s9999 -e write
can spy STDIN and STDOUT (don't know how)of a process but that's something I will investigate later, from now I want to bind an existing process to a socket and send data to it via a socket.
process socket file-descriptors
asked Apr 11 at 14:39
aDoN
2862515
2862515
1
âÂÂThe last statement is too conclusive to be trueâ â nice... Why repeat a statement if you donâÂÂt believe it then?
â Stephen Kitt
Apr 11 at 14:45
Pointer: combine two things: 1/ pass around fd descriptors through unix sockets 2/ use a tool like gdb to execute the missing code from your running processes to just implement 1/ . random links: 1/ stackoverflow.com/questions/28003921/⦠2/ unix.stackexchange.com/questions/208617/⦠. I'm quite sure SO or reverseengineering SE have other examples for both
â A.B
Apr 11 at 18:28
let's say nano is pid 18541 and I want to send its input over a socket. I have a listening nc on port 5555 and type/proc/18541/fd/0 > /dev/tcp/localhost/5555
I gotbash: /proc/18541/fd/0: Permission denied
even though I'm root
â aDoN
Apr 12 at 11:02
I have been able to send data to another process withgdb -p <pid>
withcall write(0,"test",4)
but I want to bind the process to a port and send data through it (it doesn't matter if I get the stdout or the process in question does, those are details I don't want to delve into right now, just the input is what interests me)
â aDoN
Apr 12 at 13:37
add a comment |Â
1
âÂÂThe last statement is too conclusive to be trueâ â nice... Why repeat a statement if you donâÂÂt believe it then?
â Stephen Kitt
Apr 11 at 14:45
Pointer: combine two things: 1/ pass around fd descriptors through unix sockets 2/ use a tool like gdb to execute the missing code from your running processes to just implement 1/ . random links: 1/ stackoverflow.com/questions/28003921/⦠2/ unix.stackexchange.com/questions/208617/⦠. I'm quite sure SO or reverseengineering SE have other examples for both
â A.B
Apr 11 at 18:28
let's say nano is pid 18541 and I want to send its input over a socket. I have a listening nc on port 5555 and type/proc/18541/fd/0 > /dev/tcp/localhost/5555
I gotbash: /proc/18541/fd/0: Permission denied
even though I'm root
â aDoN
Apr 12 at 11:02
I have been able to send data to another process withgdb -p <pid>
withcall write(0,"test",4)
but I want to bind the process to a port and send data through it (it doesn't matter if I get the stdout or the process in question does, those are details I don't want to delve into right now, just the input is what interests me)
â aDoN
Apr 12 at 13:37
1
1
âÂÂThe last statement is too conclusive to be trueâ â nice... Why repeat a statement if you donâÂÂt believe it then?
â Stephen Kitt
Apr 11 at 14:45
âÂÂThe last statement is too conclusive to be trueâ â nice... Why repeat a statement if you donâÂÂt believe it then?
â Stephen Kitt
Apr 11 at 14:45
Pointer: combine two things: 1/ pass around fd descriptors through unix sockets 2/ use a tool like gdb to execute the missing code from your running processes to just implement 1/ . random links: 1/ stackoverflow.com/questions/28003921/⦠2/ unix.stackexchange.com/questions/208617/⦠. I'm quite sure SO or reverseengineering SE have other examples for both
â A.B
Apr 11 at 18:28
Pointer: combine two things: 1/ pass around fd descriptors through unix sockets 2/ use a tool like gdb to execute the missing code from your running processes to just implement 1/ . random links: 1/ stackoverflow.com/questions/28003921/⦠2/ unix.stackexchange.com/questions/208617/⦠. I'm quite sure SO or reverseengineering SE have other examples for both
â A.B
Apr 11 at 18:28
let's say nano is pid 18541 and I want to send its input over a socket. I have a listening nc on port 5555 and type
/proc/18541/fd/0 > /dev/tcp/localhost/5555
I got bash: /proc/18541/fd/0: Permission denied
even though I'm rootâ aDoN
Apr 12 at 11:02
let's say nano is pid 18541 and I want to send its input over a socket. I have a listening nc on port 5555 and type
/proc/18541/fd/0 > /dev/tcp/localhost/5555
I got bash: /proc/18541/fd/0: Permission denied
even though I'm rootâ aDoN
Apr 12 at 11:02
I have been able to send data to another process with
gdb -p <pid>
with call write(0,"test",4)
but I want to bind the process to a port and send data through it (it doesn't matter if I get the stdout or the process in question does, those are details I don't want to delve into right now, just the input is what interests me)â aDoN
Apr 12 at 13:37
I have been able to send data to another process with
gdb -p <pid>
with call write(0,"test",4)
but I want to bind the process to a port and send data through it (it doesn't matter if I get the stdout or the process in question does, those are details I don't want to delve into right now, just the input is what interests me)â aDoN
Apr 12 at 13:37
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437035%2fbind-an-existing-process-to-a-socket%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
âÂÂThe last statement is too conclusive to be trueâ â nice... Why repeat a statement if you donâÂÂt believe it then?
â Stephen Kitt
Apr 11 at 14:45
Pointer: combine two things: 1/ pass around fd descriptors through unix sockets 2/ use a tool like gdb to execute the missing code from your running processes to just implement 1/ . random links: 1/ stackoverflow.com/questions/28003921/⦠2/ unix.stackexchange.com/questions/208617/⦠. I'm quite sure SO or reverseengineering SE have other examples for both
â A.B
Apr 11 at 18:28
let's say nano is pid 18541 and I want to send its input over a socket. I have a listening nc on port 5555 and type
/proc/18541/fd/0 > /dev/tcp/localhost/5555
I gotbash: /proc/18541/fd/0: Permission denied
even though I'm rootâ aDoN
Apr 12 at 11:02
I have been able to send data to another process with
gdb -p <pid>
withcall write(0,"test",4)
but I want to bind the process to a port and send data through it (it doesn't matter if I get the stdout or the process in question does, those are details I don't want to delve into right now, just the input is what interests me)â aDoN
Apr 12 at 13:37