Wednesday, December 7, 2022

A Simple Screen Sharing Script

I remember when I am still a Developer, whenever I encounter some hardware or network related issues, I would call the Network Admin for assistance and often, they would not come over at my place to troubleshoot my pc but instead, they use root administration tools(RAT). So I researched a little bit about this and found that these tools are also frequently used by hackers, I was scared at first but since I was talking to the Company's Network Admin, probably he will not hack my PC.

While I was researching about RAT, I came across this simple python library by Neural9 called vidstream.  It is a small library that adds screen sharing capability to a python desktop application. If you are familiar with MsTeams or Google Zoom, then you could have used this screen sharing capability of these software. I also tried it myself and it worked(see sample screenshot below).


It was exactly just like in Neural9's youtube video tutorial. And since it so lightweight, it beats msfvenom's screen capture payload. By the way, some rootkit viruses use vidstream.

Here is the code:

Server:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from vidstream import StreamingServer
import threading

server = StreamingServer('192.168.254.184', 8181)
t = threading.Thread(target=server.start_server)
t.start()

# Other Code
while input("") != 'STOP':
    continue

# When You Are Done
server.stop_server()

Client:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
from vidstream import ScreenShareClient
import threading


client3 = ScreenShareClient('192.168.254.184', 8181)
t = threading.Thread(target=client3.start_stream)
t.start()

# Other Code
while input("") != 'STOP':
    continue


client3.stop_stream()

No comments:

Post a Comment