Jump to content

Muling with Sockets


Impensus

Recommended Posts

Hi guys, I am attempting to create a socket based muling system but I have a few questions about the integration.

When using sockets on a certain port will I have to create a multi-threaded listening script on the server? Would it instead work to just send the request and expect a reply and if the server was busy dealing with the request to wait a random amount of time 1-2 seconds and send again? Obviously with 100-200 accounts the chance of two muling at the same time is quite low but still it can happen, especially as my farm scales.

Also I heard occasionally that sockets/ certain aspects of sockets are disabled in Osbot, can anyone clarify what I am limited to with sockets?

 

Thanks guys!

Link to comment
Share on other sites

6 minutes ago, dazeldo said:

The bots all have to be clients, can't run a server from within script. I think making it multi-threaded is your best bet.

I am running an external server and attempting to connect to the server via sockets. The server code will take bot mule requests and return a mule name and location + prompt the mule to login. My question is can I get away with making it not multi-threaded and just listen on one port as there will be very very few times requests would overlap?

Link to comment
Share on other sites

As a server:

-Accepting new clients is a blocking event

-Reading from a client stream is a blocking event

You can combine all client streams into a single stream and listen to that single stream which only requires one thread. In doing so, each message must include data to distinguish one client from another. So that you know who to reply back to as a server.

Regarding accepting clients, this has to be done in another separate thread. You just have to make sure that you continue to accept and not block other requests. If not, a timeout will be caused by the client and the connection will fail.

 

You should just play around in an IDE without any kind of bots and just figure out how to do this. Just basic message passing between client(s) and server.

 

Link to comment
Share on other sites

23 minutes ago, dreameo said:

As a server:

-Accepting new clients is a blocking event

-Reading from a client stream is a blocking event

You can combine all client streams into a single stream and listen to that single stream which only requires one thread. In doing so, each message must include data to distinguish one client from another. So that you know who to reply back to as a server.

Regarding accepting clients, this has to be done in another separate thread. You just have to make sure that you continue to accept and not block other requests. If not, a timeout will be caused by the client and the connection will fail.

 

You should just play around in an IDE without any kind of bots and just figure out how to do this. Just basic message passing between client(s) and server.

 

To combine all client streams would I have to make a sort of 'server'/central application client side that takes the message from the client and then transfers that +messages from any other client to the server then gathers the responses and distributes them accordingly?

Link to comment
Share on other sites

43 minutes ago, Impensus said:

To combine all client streams would I have to make a sort of 'server'/central application client side that takes the message from the client and then transfers that +messages from any other client to the server then gathers the responses and distributes them accordingly?

No, there's a stream or a class that allows you to combine streams into one.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...