The solution is as follows,
1) Burn the kali image on sd card
2) Make the wpa_supplicant.conf file
3) make the interfaces file
4) Paste them in boot drive and plug the sd card in raspi and boot.
Example of wpa_supplicant
country=in
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="CAMPUS_SECURED"
key_mgmt=WPA-EAP
identity="Identity_here"
password="PSK here"
priority=1
}
network={
ssid="NETGEAR65"
key_mgmt=WPA-PSK
psk="PSK"
priority=2
}
network={
ssid="Roy"
key_mgmt=WPA-PSK
psk="PSK"
priority=3
}
network={
ssid="Roy_MSI"
key_mgmt=WPA-PSK
psk="PSK"
priority=4
}
higher priority number indicates higher priority, i have included wpa-eap also in case you have such a connection.
example of interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wireless-rate 54M
The wpa_supplicant gets moved to /etc/wpa_supplicant/ and the interfaces gets moved to /etc/network/ by pi so u just need to put them in the boot folder accessible from the system used to flash the card (note if u use a linux system then you can access /etc from it as linux supports reading/writing to ext4).
Now u an just power up pi and it will connect to the WIFI as per the priority and ssh is pre-enabled in kali (in my experience, not sure if its for all versions)