EvilZone

Programming and Scripting => C - C++ => : Hermit March 22, 2014, 03:39:11 AM

: [C] Reverse Connection
: Hermit March 22, 2014, 03:39:11 AM
I just learn about reverse connection and try to implement it yesterday using C. It works correctly when I am using my local IP address to connect. But when I am using public IP address it didn't get accepted on my server. I have done port forwarding on my router. I have also try to connect with my modem. My OS is OSX Mavericks and I use tp-link router. Is there something I miss? Do i need to assign 80 to my port? Sorry i am kinda new to networking.

This is my code.
http://ideone.com/IeJR3a
: Re: [C] Reverse Connection
: NHAS March 22, 2014, 07:51:54 AM
So I take it the server is the program? or is it something else...

Anyway:
Well I tried to do this with a small C++ program I wrote not so long ago.
It didn't work for me ether and talking out of ignorance
I think some ISP's (internet service providers) don't let some kinds on incoming connections to the router even if you have specified that it should be allowed.

So in short, I think your code looks fine its most likely your isp stopping the connection

Oh and if I have this wrong please correct me.

: Re: [C] Reverse Connection
: Hermit March 22, 2014, 08:06:12 AM
Well i am trying to create a simple RAT with reverse connection. I read that the victim computer act as the client and the attacker computer act as the server. I have implement the client. It run well if the computer is on the same LAN. But when i try to run it on my friend's computer with public IP address,it didn't connect. I have also tried to use telnet and still didn't work. Anyway, thanks for your reply and sorry for my poor English
: Re: [C] Reverse Connection
: NHAS March 22, 2014, 08:33:18 AM
The fact that you're starting attempt at a RAT works over local network further supports my idea.
: Re: [C] Reverse Connection
: Kulverstukas March 22, 2014, 09:14:20 AM
Why not make it connect to a webserver instead where it sends data to and receives commands from, would be easier than connecting straight to your computer, not to mention not secure. I had this rant on another thread here: https://evilzone.org/c-c/%28discussion%29-rat-programming-basics/
: Re: [C] Reverse Connection
: Hermit March 22, 2014, 10:09:57 AM
@Kulverstukas I didn't really get it. Is there any free web server out there? . Do you mean using service like http://www.000webhost.com/. Sorry if it a noob question. hehe
: Re: [C] Reverse Connection
: Kulverstukas March 22, 2014, 10:20:59 AM
"sorry me noob" is not an excuse for acting stupid. Search before asking. We had discussions about free webhosts, one of them being: https://evilzone.org/general-discussion/free-web-hosting-support-php-50gb-space/

Also you can just pay for one, free webhosts are complete shit. Just spend a few $ and you'll get a reliable host.
: Re: [C] Reverse Connection
: Hermit March 22, 2014, 10:33:20 AM
@Kulverstukas Okay thanks for your advice. Next time I will do it.
: Re: [C] Reverse Connection
: kenjoe41 March 22, 2014, 01:45:35 PM
But is your problem solved? You are kneeling cos an Admin spoke but i don't think you have the solution yet, i mean you practise with localhost till the code is good then you deploy it. Anyway, i don't know your network design but i hope their aint any NAT in between that might filter your traffic. I haven't looked at your code to be honest since you didn't post it here (i wonder why, am on my phone) so am not sure if this is the problem but consider everything anyway.
: Re: [C] Reverse Connection
: Hermit March 22, 2014, 02:21:39 PM
@kenjoe. I don't think it is because of NAT because i have done port forwarding. I also have tried not to use my router to connect to the Internet but instead use modem. I have posted my code at the link above(ideone) . The application is not finished yet, I just try the connection by sending "Hello" to the client. Well now, i am trying to learn using external web server. It is good knowing something new.

EDIT:
The fact that you're starting attempt at a RAT works over local network further supports my idea.

I checked if there are any open port at www.grc.com and all my port ranging from 1 to 1056 are stealth. I guess my ISP blocks all the port.

-- Double posters get slapped! Use the modify button fool.
: Re: [C] Reverse Connection
: ZeroBoy April 01, 2014, 05:22:21 AM
I don't recommend C&C based RATs  if you want to start one from scratch, because you have to write your own C&C script (you might learn php). even if you willing to use a ready-made one, you MUST customize your rat to be compatible with that script which is pretty much pain in the ass. plus, anyone have your server, can easily inject malicious data in the server you're hosting your C&C Panel

most people using ready-made C&C rats, so they would always recommend newcomers to code a C&C based rats, while they don't realise how time consuming it is.

I would say that C&C based RATs is more suitable for mass infections...
====
Have you forwarded 52142 and test it here (http://canyouseeme.org/) and it says opened?
: Re: [C] Reverse Connection
: Hermit April 02, 2014, 02:17:09 PM
@ZeroBoy I have just changed my ISP(I try four different ISP actually before succeeded), and now it can connect to my server via public ip address. Later i will try to forward that port from my previous ISP and report the result. Thanks for your advice.