Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Running ncat reverse shell with user login - have network file access

So I have network file access to a Win7 machine so I can browse files etc over the network. I can access areas such as c:\users\username\appdata and so on.

I've copied over ncat.exe to set up a reverse shell and I want this to run, with the relevant IP address and port when a user logs in or boots up.

I tried creating a bat file and adding a shortcut to the startup folder pointing to a bat file in a folder containing netcat.exe, with the correct netcat command. This works however I get two problems:

1. The user gets a warning asking if the want to run this file when they logon
2. The command prompt it spawns is visible, along with the netcat "connected" text, which not much good.

Am I going about this the right way? Can I supress the warning, hide the cmd prompt?

Thanks
I think what you may want to do is try adding ncat to the startup programs through registry editor. I made an Arduino payload for ncat and reverse shell where it also adds ncat to the startup programs (renames it and hides it), making it start silently every time the user starts the computer. I'll try to dig up my code and see what I can give. Hope this goes well.
U can use eternalblue to exploit win7
[Image: W7MJCq1.gif]
you can infect one of the files that are running on startup(PE file infection)
or just write a back-connect file yourself w/ stealth function, if you familiar with WinAPI it's easy - just open a new process with CreateProcess() and use a CREATE_NO_WINDOW flag.
O o
/¯/_____________________________________/¯¯
| 0x41414141 ~~~
\_\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯\__
/█\
/ \
(Jul 1, 2017 03:24 AM)HangMansheart Wrote:  I think what you may want to do is try adding ncat to the startup programs through registry editor. I made an Arduino payload for ncat and reverse shell where it also adds ncat to the startup programs (renames it and hides it), making it start silently every time the user starts the computer. I'll try to dig up my code and see what I can give. Hope this goes well.

I'd defo be interested in seeing your Arduino payload. However not sure how that's going to help in this case since I don't have control of the computer. I only have network access to shares which, in this case, is C:\users

So i don't know how I would edit the registry.


I did it by using Window's own iexpress.exe - used it to create an exe file which runs netcat with arguments. I created a shortcut the startup folder pointing to the exe which I hid in a subfolder somewhere else. What I didn't account for is that when you create the shortcut you have to create the same file structure (c:\users\username\appdata etc. on your own machine as you're using your computer's File Explorer which checks the path against your own machine's file structure.

But it works nicely and now I have a reverse shell which fires up with the user logon.


(Jul 1, 2017 04:37 AM)Zixem Wrote:  * you can infect one of the files that are running on startup(PE file infection)
* or just write a backdoor connect yourself w/ stealth function, if you familiar with WinAPI it's easy - just open a new process with CreateProcess() and use a CREATE_NO_WINDOW flag.

Those are two things I need to learn more about. Thanks for the pointers.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by g_walterpeterMay 30, 2026 04:14 AM 1 76 May 30, 2026 04:14 AM
Last Post: Crum
by lokichNov 29, 2025 10:50 PM 4 156 Nov 29, 2025 10:50 PM
Last Post: lokich
by lloyd1515Aug 7, 2024 11:50 AM 11 366 Aug 7, 2024 11:50 AM
Last Post: BlackSoulZN5006