Python Network Programming 10 - Multiple Client ( Socket Programming )

Share this & earn $10
buildwithpython
Published at : 16 Dec 2020
39275 views
354
26

In this section we are going to be taking our reverse shell program to the next level. For starters, Previously, we had one server and one client and we connected both of them using a connection object. But what if we wanted to connect to multiple clients? That is, what if we wanted to control more than one computer from our single server?

Right now if you want to have multiple clients you will have to create multiple servers.But that is going to be costly and not every feasible. I'll take the example of hacker again. Lets say the hacker wants to affect hundreds of computers. Will he make hundreds of servers? Obviously no.

-

Another example would be, lets say you are a system administrator and you need to have remote access to all computers in the lab or in workstation. In this case too our current reverse shell program won't work!

So In this video, We will add the functionality of handling all the clients from one single server python file and build the multiple client support system.

-

Before we get into that, let me explain it to out how it's going to work. Every time we accept a connection we get back two outputs. First is a connection object and second is the address list. Using the connection object we can send commands to another computer and the address list contains the information like port and IP address.

So what we are going to do is that we are going to create an empty list or you can call it an array of connection objects and address. And every time we connect to client we are going to append it or add it to that list.

Then we can loop through the list of clients connected to our server and choose the one that we want.

-

So we have write a program that two tasks at once.
1) The first task is to listen and accept connections from other clients and store them in a list
2) The second task is sending commands to an already connected client

But you must be thinking how can we do two tasks from the same program at the same time? This is achieved by a concept known as threading. You can think of threads as a multitasking support system. For example, I am talking to you right now and thinking at the same time. So one of my thread is handling my speaking abilities and the other thread is handling my thinking. In the same way the first thread is going to listen and accept connections from other clients and the second thread is going to handle  connection with an already connected client and send commands

Github Code - https://github.com/attreyabhatt/Reverse-Shell
Next Video - Handling Connections
Python Network/Socket Programming Playlist - https://www.youtube.com/playlist?list=PLhTjy8cBISErYuLZUvVOYsR1giva2payF

Subscribe - https://www.youtube.com/channel/UCirPbvoHzD78Lnyll6YYUpg?sub_confirmation=1
Website - www.buildwithpython.com
Instagram - http://instagram.com/buildwithpython

#python
python networkingpython networking projectspython network programming

Spin Rewriter 11 - Sneak Peek (Side-by-Side Feature)

Spin Rewriter 11 - Sneak Peek (Side-by-Side Feature)

Exclusive | Why have George Kutty and Rani grown thin? Jeethu Joseph reveals the reason

Exclusive | Why have George Kutty and Rani grown thin? Jeethu Joseph reveals the reason

New Brock Gadget is Unbelievable 😮

New Brock Gadget is Unbelievable 😮

Toyota Tacoma Outfitted with the Thule 500XTB BLACK Xsporter Pro

Toyota Tacoma Outfitted with the Thule 500XTB BLACK Xsporter Pro

BMW X5 45e PHEV - the kind of hybrid you want

BMW X5 45e PHEV - the kind of hybrid you want

How to Create a Discussion Board on Blackboard

How to Create a Discussion Board on Blackboard

Best Faithful Texture Packs • 128x128 / 64x64 / 32x32 / 8x8

Best Faithful Texture Packs • 128x128 / 64x64 / 32x32 / 8x8

[HOT] Appear like a fighter,  나 혼자 산다 20180817

[HOT] Appear like a fighter, 나 혼자 산다 20180817

back cover is compatible with Vivo Y50 phone model, which is made by Vivo brand.You can Design and C

back cover is compatible with Vivo Y50 phone model, which is made by Vivo brand.You can Design and C

How to Make Things Better Wherever You Are, However You Can - Jordan Peterson

How to Make Things Better Wherever You Are, However You Can - Jordan Peterson

World's 10 Greatest Magic Tricks Finally Revealed #5 | Dynamo | AGT | David Blaine | FactoFusion

World's 10 Greatest Magic Tricks Finally Revealed #5 | Dynamo | AGT | David Blaine | FactoFusion

Mathematics - Grade 10 - Exhaustive Events

Mathematics - Grade 10 - Exhaustive Events

Moderat - Bad Kingdom (Live)

Moderat - Bad Kingdom (Live)

הרב יוסף מזרחי - עם ישראל בסכנת קיום! נבואת אחרית הימים!

הרב יוסף מזרחי - עם ישראל בסכנת קיום! נבואת אחרית הימים!

Destiny - Animation Short

Destiny - Animation Short

Dan + Shay, Justin Bieber - 10,000 Hours (LYRICS)

Dan + Shay, Justin Bieber - 10,000 Hours (LYRICS)

Pookins Gets Her Way – A Story About Being Considerate

Pookins Gets Her Way – A Story About Being Considerate

Boosie Badazz "A Problem" (WSHH Exclusive - Official Music Video)

Boosie Badazz "A Problem" (WSHH Exclusive - Official Music Video)

Tasha Cobbs Leonard - "For Your Glory"

Tasha Cobbs Leonard - "For Your Glory"

Can you Guess The "HISTORICAL FIGURE"? Test/Trivial/Quiz

Can you Guess The "HISTORICAL FIGURE"? Test/Trivial/Quiz

TOP 10 POKER WEBSITES IN INDIA - TOTAL REVIEW & OPINION - IN HINDI

TOP 10 POKER WEBSITES IN INDIA - TOTAL REVIEW & OPINION - IN HINDI

LAZARBEAM GAVE ME CONTENT

LAZARBEAM GAVE ME CONTENT

A Simple Explanation about the Coffee Variety

A Simple Explanation about the Coffee Variety

Being Biden: A Senate Swearing-In

Being Biden: A Senate Swearing-In

Обзор браузера Cryptotab - майнинговый браузер!

Обзор браузера Cryptotab - майнинговый браузер!

Long bob haircut

Long bob haircut

Hail The Sun "Burn Nice and Slow (The Formative Years)" (Official Music Video)

Hail The Sun "Burn Nice and Slow (The Formative Years)" (Official Music Video)

Coldplay: Everyday Life Live in Jordan - Sunset Performance

Coldplay: Everyday Life Live in Jordan - Sunset Performance

How To Properly Wash the Dishes

How To Properly Wash the Dishes

5 Easy Ways to Beat Your Friends at Smash Bros.

5 Easy Ways to Beat Your Friends at Smash Bros.

The Gullible Narcissist #Narcs Manipulate Each Other

The Gullible Narcissist #Narcs Manipulate Each Other

We Don't Need Another Hero (Thunderdome)

We Don't Need Another Hero (Thunderdome)

Joshua Colley - "Go the Distance" (Hercules; Alan Menken & David Zippel)

Joshua Colley - "Go the Distance" (Hercules; Alan Menken & David Zippel)

Horace Martin - If You Are Regarded As A Fool

Horace Martin - If You Are Regarded As A Fool

Browser hacking: Let's build a simple ad blocker

Browser hacking: Let's build a simple ad blocker

Tumblr's Greatest Conspiracy: The Story of TJLC

Tumblr's Greatest Conspiracy: The Story of TJLC

How to make a budget fancy dress outfit

How to make a budget fancy dress outfit

Lions, Tigers and Ligers! | World's Weirdest

Lions, Tigers and Ligers! | World's Weirdest

We Could Happen by AJ Rafael (Lyrics Video)

We Could Happen by AJ Rafael (Lyrics Video)

10,000 USD Cash Give Away.  Watch Video For Info

10,000 USD Cash Give Away. Watch Video For Info

Bobby "Blue" Bland - Get Your Money Where You Spend Your Time

Bobby "Blue" Bland - Get Your Money Where You Spend Your Time

Pick a Card 🥰 Love Reading | Who Is Melting/Falling For You? 😍 ☃️

Pick a Card 🥰 Love Reading | Who Is Melting/Falling For You? 😍 ☃️

how to take pretty notes for lazy people

how to take pretty notes for lazy people

James Hype - Afraid (Lyrics) ft. HARLEE

James Hype - Afraid (Lyrics) ft. HARLEE

Is this to some extent okay..?

Is this to some extent okay..?

Seemed Like A Good Idea At The Time

Seemed Like A Good Idea At The Time

Kenny Chesney - Someone to Fix (Audio)

Kenny Chesney - Someone to Fix (Audio)

Affirmations That Positively, Absolutely, Probably (Most Likely) Won’t Make Your 2020 Worse.

Affirmations That Positively, Absolutely, Probably (Most Likely) Won’t Make Your 2020 Worse.

Leaving Modeling to Go Back Home

Leaving Modeling to Go Back Home