Hi
Last year i have uploaded how to install kali linux on RaspberryPi headless
But the technique i mentioned was not working on Kali Linux 2020
because the wpa_supplicant method i explained did not work on 2020
I check on multiple forums for workaround but could not find one
I found some comments stating the older technique did not work
this video is to update the working method on Kali 2020
I am going to show how to install kali 2020 on RaspberryPi
I have connected RaspberryPi to the power cable
I am removing the SD card from RaspberryPi
insert the SDcard into an SDcard reader as shown
Connect the card reader now to the laptop USB port
and now lets start how to install the image
Go to this link to download Kali Linux ARM image. Link available on description
Go to RaspberryPi Foundation area and download the exact version
for me it is RaspberryPi 2,3 and 4
I download the version 2020.b
I already have the version downloaded now
plus i have downloaded a tool called Rufus
you can get it by just google search
Click the Rufus file
When the wizard open just press select button
and select the kali linux image downloaded
just ensure that you connect to card reader to laptop
i forgot it and hence connecting now
doing the same again after connecting reader to my laptop
my drive gets detected now
just press select and select the image
click start now
this will give a warning that your data will be formatted just click ok
i starts writing automatically
i pausing the video since its going to take time
ok the image has been written on the SDcard now
it took me 35 to 40 mins approx
i will close this for now
You could see i have F: as USB drive
that has the data which is approx 53.6 MB
This acts as a boot drive
this has ssh file with it which will allow us to SSH to this device. nothing to change here
I am closing the folder
i am connecting the USB drive through Kali linux which is running as VM in my laptop
you could see two drives there
one is 128 MB and other is 14 GB
This 128MB drive was seen on my windows machine
hence i connected through my linux machine to see other drive
i mount the 14GB drive
i open the command prompt and access from there
i enter cd /media/kali
and ls
i could see a folder
i navigate into it
when i ls
you could see all the files required for kali linux to run
we need to do some modification to make it headless on raspberryPi
I navigate to /etc/NetworkManager
and ls
I get into system-connections folder
this is the place where i am going to add a file
if you are going to connect the raspberryPi through wired nothig to change here
if we connect the wire it will automatically work
and also if we have a keyboard and mouse
we can manually configure wifi and start using it
now we dont satisfy both the conditions and need wifi to be configured
without a keyboard,mouse and wired connection the raspberry Pi to work with Wifi connection
 
I am creating a wifi profile file manually
let me first copy and paste the profile file
and will let give a brief description
what content to be added to the profile file
in this machine i have the file
let me copy it
actually last time we tried with wpa_supplicant
i tried also the same on 2020 but did not work
only because of that we are doing this method
i will show what is inside this file
defsecone is the wifi that i am going to connect
ok
i copied the file to the media
the file is the wifi profile for which i am going to connect
it is named defsecone.nmconnection
lets see what is inside this file
it just nano with file name
it has a connection type
it has id
the type is wifi
which wireless interface
in raspberryPi default its named as wlan0
the user permission on kali linux 2020 we have a default user called kali
i leave others to default
i changed the ssid=defsecone
i changed the wifi security psk to by pre shared key
this is what is done on file
nothing to change other than that
if you want a template of this file
you can use the file on your kali running on your laptop
you could see the file
on VM machine we normally have the wired connection profile on same location
we can use the file as template to modify
i will show the file on my laptop
i am navigating to /etc/NetworkManager
into system-connections
this shows my wired connection profile
lets see whats inside it
i need to sudo
it looks almost same as the file i copied to sdcard
it was having the type
we add the SSID information to this file
you can do the same as the file i showed
its not a big file so you can just do it manually
you will get it working automatically if this is done right
i am adding this file to pastebin and link  on description
once your are done with this file
next we need to do some more modification
i just navigate to NetworkManager.conf
i change manged=true
i save the file and exit
i missed a small thing
just navigating to the system-connections folder
type ls -l
you should see the permission to the file created
it has owner read write permission and others and groups as read
if this is default the file was not working when connected to raspberryPi
so changing the permission
adding chmod 600 and changing the permission
now i give ls -l
and could see permission changed
just change like this
as said before change the manged=true
ok
now what to change next is
just navigate to this folder
cd network/
 
nano interfaces
just open the file
i forgot to give sudo
add the entry for wifi here
auto wlan0
this interface gets up during boot
iface wlan0 inet dhcp will allow to get ip from DHCP
I save this file
done
we have one more small modification
we can do that
and then remove the sd card
and insert into raspberrypi and boot
automatically
it connects to wifi and ip address will be assigned
just powering up and wait will allow us to ssh
lets do the modification
the profile file that we created
works only post login hence the kali linux should auto login
since the wpa_supplicant method did not work for us before we are using it
for this method to work
we need to make our kali linux auto-login
so when we connect our sdcard
and powering up the raspberrypi
it should boot, autologin
to kali user
then it connects to wifi (in my case defsecone)
and we can connect through ssh headless
to enable autologin
kali linux has lightdm folder
there is a lightdm.conf inside it
just sudo nano lightdm.conf
we need to uncomment few lines.
i will uncomment autologin-user, auto-login-user-timeout
i will modify the user as kali
next line i am just uncommenting
i am making timeout to 0
if we crawl down further you should see seat:*
just uncomment pam-autologin
crawling further
uncomment autologin-user and add kali
uncomment the next line
and save the file
all modification required is done
lets remove the sdcard and connect to the raspberrypi
and we can power it up
just connect the raspberrypi to power
and wait for sometime
after booting it should connect to wifi automatically
and will get an ip address
and we connect using ssh
i am just removing the sdcard now
it came to my base windows machine
i am ejecting it
now i am connecting the sdcard to the raspberrypi
i am booting up and waiting
may be 3 to 4 mins
its now 3 to 4 min
i am ssh to the device now
let me check my ip address
i am connecting to same network as raspberrypi
the network on which raspberrypi connects is defsecone
i am renewing my ip address post my same wifi connection on laptop
this is on my laptop
i am now connected to same wifi as my raspberrypi
i am in 192.168.43.183
i have raspberry pi on same range. just checked the router for ip information
i am now ssh'ing to raspberry pi ip
it hs 192.168.43.236 hence doing ssh kali@192.168.43.236
i enter. i get an error since i have connected the same machine through different ip and profile stored on kali linux already
you should not get this. i am deleting the known_host entry
because your doing it for first time you should not get this error
i updated the file and ssh'ing again
just giving yes
it will  ask for a password default is kali
you should be able to successfully login
Thank you
