screen mirroring | screen mirror in kali linux using android scrcpy (without installing any mirroring app).

Concepts:

  • scrcpy
scrcpy is a free and open-source screen mirroring application that allows control of an Android device from a Windows, macOS, or Linux desktop computer. The software is currently developed by Genymobile, which also developed Genymotion, an Android emulator. Communication between the Android device and the computer is primarily performed via a USB connection and Android Debug Bridge (ADB). The software functions by executing a server on the Android device, then communicating with the server via a socket over an ADB tunnel.
  • ADB

Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device. It is a client-server program that includes three components:

  • A client, which sends commands. The client runs on your development machine. You can invoke a client from a command-line terminal by issuing an adb command.
  • A daemon (adbd), which runs commands on a device. The daemon runs as a background process on each device.
  • A server, which manages communication between the client and the daemon. The server runs as a background process on your development machine.

Requirements for screen mirroring:

Linux(i am using kali )

android devive with "USB debugging" on

android charger cable (data cable)

Basic linux understanding

adb

scrcpy


Getting Started:

Open linux terminal to start screen mirroring (as root) , install 'adb'  (sudo apt install adb) and 'scrcpy' (sudo apt install scrcpy) . If scrcpy pre-installed then uninstall it using "sudo apt remove scrcpy" and then reinstall it using "sudo apt install scrcpy", because if it is pre-install then it can gave error on runtime.  


screen mirroring
screen mirroring



I already installed it,  Now come to android device.

Go to "settings" and then "About phone", now in About phone  click on "Build Number (in some devices it is replaced by 'Software version')" seven times , now  "Developer options" can be seen in  settings


screen mirroring
screen mirroring

now, go to Developer options and enable USB debugging . 

Now,

Go back to your linux terminal , attach your charging cable (data cable) from android to your workstation 

screen mirroring
screen mirroring

if pop-up appears on your linux , mark "Connect to virtual machine" radio button and select "Virtual Machine Name" and hit "ok". 

here our setup is completed, now go to terminal and run adb devices and  click ok  'Allow USB debugging' message on your android. 
screen mirroring
screen mirroring

 , now again run adb devices, you see your device is connected using adb.

screen mirroring
screen mirroring

now run scrcpy to screen mirroring and you you can see that screen mirroring of your device successful.


screen mirroring
screen mirroring


Plus point:
you can also connect your device wirelessly using adb  (after connecting device using charger cable from workstation.) by issuing following command.
adb tcpip <port no>  i.e. 5037

adb connect <device ip>:<port no> 


Try it at your own risk:
---------you can also compromise android device using wireless adb method--------


Conclusion:
Here you learned how to mirror android , without installing any mirroring app on android.
If you have any issue you can ask me in comments.


----------Links--------

Linkedin


Comments

Popular posts from this blog

CSL Search writeup

how to create symbolic link in linux. | create symlink | Access any tool from anywhere in Linux distro (kali).