EzDevInfo.com

kali-linux interview questions

Top kali-linux frequently asked interview questions

How can I run a bash script automatically?

I have a script named run.sh:

#!/bin/bash
cd /root/yowsup-master/src/
./yowsup-cli --interactive no --wait --autoack --config config.example

This script executes another script.

I tried adding my script path in /etc/rc.local but it doesn’t seem to work.

I also added it to startup application in Kali Linux it also doesn’t work.

I want my run.sh to execute automatically in the background when the computer starts.


Source: (StackOverflow)

Will installing Kali Linux wipe my system?

I am using Windows 10 right now. I wanted to know that if I use VirtualBox to create a Virtual Machine with Kali Linux on it, will it wipe my system?


Source: (StackOverflow)

Advertisements

How can I encrypt Kali Linux after the install?

Okay so here is some useful background before we get started. I booted a Windows 7 install disk, split the hard drive into two partitions, installed windows. Rebooted, installed Kali, then booted into Windows and encrypted the Windows partition with PGP Desktop.

When I power on I have to enter my PGP pass phrase then it loads grub and from there I can choose between Windows and Kali. While in Kali I can tell Windows is encrypted.

During the Kali install I did not choose to encrypt, So my question is: How do I encrypt Kali without re-installing. A terminal command would be nice.


Source: (StackOverflow)

Virtual Box error after creating new VM

I have followed several tutorials thinking I was doing something wrong while installing virtual machines using VirtualBox.

It is important to say that I'm running Virtual Box on Windows 8.1

The problem is that after creating a virtual machine, I get the following error when trying to start it.

---------------------------
VirtualBox - Error In supR3HardenedWinReSpawn
---------------------------
Error relaunching VirtualBox VM process: 5<br>Command line: '81954AF5-4D2F-31EB-A142-B7AF187A1C41-suplib-2ndchild --comment Kali --startvm 823fc23c-d310-4972-b3ef-6c40742d89f3 --no-startvm-errormsgbox' (rc=-104)
---------------------------
Abort   
---------------------------

I even thought that I could have downloaded a faulty VirtualBox version so I downloaded it again to find out that wasn't problem.

Not only have I tried creating Linux Virtual Machines but Windows virtual machines as well.

I found very little info in google concerning this issue... it is stated that it could be caused by another program such as an antivirus. I have tried uninstalling some programs and disabling my antivirus yet I have found no success.

Thanks for taking the time to read this. Your help is much appreciated.


Source: (StackOverflow)

airodump-ng doesn't see associated machines

Here is the process and results. I am not sure why this isn't working when a few day's ago it was. This is my network, I have full control over it and all the machines on it.

//Step 1 get wlan0 in monitor mode

root@kali:~# ifconfig wlan0 down
root@kali:~# iwconfig wlan0 mode monitor
root@kali:~# ifconfig wlan0 up
root@kali:~# iwconfig wlan0
wlan0     IEEE 802.11bgn  Mode:Monitor  Frequency:2.452 GHz  Tx-Power=20 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

root@kali:~# 


//step two create interface with airmon-ng

root@kali:~# airmon-ng start wlan0
Interface   Chipset     Driver

wlan0       Ralink RT2870/3070  rt2800usb - [phy0]
                (monitor mode enabled on mon0)

root@kali:~# 

//start airodump-ng to target my wifi
root@kali:~# airodump-ng mon0 

CH  5 ][ Elapsed: 2 mins ][ 2015-01-03 19:17  


 BSSID              PWR  Beacons    #Data, #/s  CH  MB   ENC  CIPHER AUTH ESSID

 <MAC Removed>  -17       75       14    0   1  54e  WPA2 CCMP   PSK  <ESSID Removed>  


//Attempt to target my wifi 
root@kali:~# airodump-ng mon0 -c 1 --bssid <MAC From Above>

It's at this point that I can see my wifi with all the correct info. However, NONE of the devices I have associated with my wifi appear? I have a phone, two kindles, a surface pro 3 and an xbox one all on my wifi. I would imagine at least one of them would appear in the associated devices output. Yet, nothing.

I am only about 10 feet from my router so I don't think it's a distance issue. Also, as I mentioned earlier, I tried this about a week ago and had success. I'm not sure what's different. Did I miss something?

UPDATE

Well some interesting results....

I decided to put one of the tablets in front of me and watch it as I sent deauth packets. It, as you would expect, drops it's connection to the wifi and then re-establishes it. What is interesting about this is two things.

First I did a test packet injection with aireplay-ng -9 and it said 0/30 packets made it through. If that's the case then why did the deauth work?

So I wrote all the packets to a cap file and then inspected it with WireShark. Sure enough I can see the deauth packets then shortly after I can see each device re-establishing a connection (no handshake captured though)

It would appear that the airodump-ng script is lying to me. I am not sure why though.

UPDATE Number 2

So further interesting details. I decided to attempt this attack on a separate machine. I booted up my Wifi-Pinapple MK5 and launched an identical attack. Worked first time no questions.

Since I am using a live version of Kali and this attack did work a couple weeks ago, I am lead to one of two conclusions. Either my usb wifi adapter has gone bad or it has some internal setting that was changed. This is beyond any knowledge I have about it so feel free to add input.


Source: (StackOverflow)

Dual-booting Kali Linux and Windows 7, error with file: "\NST\AutoNeoGrub0.mbr"

I have tried to install Kali Linux 1.0.6 alongside my current OS - Windows 7 64 bit. I have a Dell computer, with SSD hard drive only (256 GB). At first I tried installing Kali a few times and made a few mistakes, and I'm afraid I made some damage that prevents it from installing properly now.

Described here are the first few attempts:

First I cleared 25 free GB for the kali partitions. I tried to do it without reading through long tutorials, downloaded the iso file "kali-linux-1.0.6-amd64" and burned it on DVD, went through the installation and choose "Guided – use the largest continuous free space" option in the "Partition disks" step. On the step "install the grub boot loader on a hard disk" the Kali installation didn't recognized my Windows 7 but I told it not to install GRUB in the MBR, but on a random partition. I choose: "/dev/sda5". When configuring the package manager I agreed to use a network mirror. The installation failed in the middle, and I exited though a message said the system may be left in an unstable state.

Everything worked perfectly on Window 7 and I tried again. I deleted the newly created partitions, did it all the same but this time it worked (can't figure out any change I made). I still chose the partition for the GRUB absolutely randomly, and when the installation ended I used EasyBCD 2.2 to be able to load kali, chose "GRUB 2" with the option "Automatically locate and load". Then when I rebooted and chose "kali linux" OS, I got a message that "windows failed to start." and that: "File: \NST\AutoNeoGrub0.mbr Status: 0xc000007b Info: Application or operating system couldn't be loaded because a required file is missing or contains errors" I tried again on EasyBCD with all possible drives for the kali entry, and nothing worked.

Again I deleted the newly created partitions, and I realized that the whole part of choosing the partition for the GRUB is probably important (yes, I'm not very good at installing stuff...), I read about it and then chose the partition called "bios-grub" (or maybe a name similar to this). Still I got the same problem with "windows failed to start" when the installation ended and I tried to boot to Kali.

Last attempt here:

Not giving up yet, I followed this tutorial and did the whole partitioning step manual: http://www.linuxbsdos.com/2013/03/24/dual-boot-windows-7-and-kali-linux/ I don't know exactly what it means, but it didn't show me the choice primary/logical (maybe it's related to the fact I have SSD). Anyway, I'm getting the exact same "window failed to start" message again even when I understand and carefully chose all partitions and definitions manually. I check and I do have a 9 KB file in "C:\NST" called "AutoNeoGrub0.mbr".

What should I do? I really need this Kali OS very soon.

attachments:

If it helps, here's what I currently this in the EasyBCD overview:

There are a total of 6 entries listed in the bootloader.

Default: Windows 7
Timeout: 5 seconds
EasyBCD Boot Device: C:\

Entry #1
Name: Network
BCD ID: {bb2f9fc0-147d-11e3-9630-74867a357b03}
Device: Unknown
Bootloader Path: 

Entry #2
Name: Hard Drive
BCD ID: {bd7b819a-2b07-11e3-be6e-806e6f6e6963}
Device: Unknown
Bootloader Path: 

Entry #3
Name: CD/DVD/CD-RW Drive
BCD ID: {74674154-1466-11e3-8a62-74867a357b03}
Device: Unknown
Bootloader Path: 

Entry #4
Name: EFI USB Device
BCD ID: {bb2f9fbc-147d-11e3-9630-74867a357b03}
Device: Unknown
Bootloader Path: 

Entry #5
Name: Windows 7
BCD ID: {current}
Drive: C:\
Bootloader Path: \Windows\system32\winload.efi

Entry #6
Name: Kali Linux
BCD ID: {bb2f9fd7-147d-11e3-9630-74867a357b03}
Drive: C:\
Bootloader Path: \NST\AutoNeoGrub0.mbr

Source: (StackOverflow)

apt-get update not working: Signing/ Verification errors

When I run apt-get update I get

Ign:1 http://dl.google.com/linux/musicmanager/deb stable InRelease
Ign:2 http://archive-4.kali.org/kali kali-rolling InRelease                
Hit:3 http://archive-4.kali.org/kali-security sana/updates InRelease
0% [3 InRelease gpgv 11.9 kB] [Waiting for headers] [Waiting for headers]Couldn't create tempfiles for splitting up /var/lib/apt/lists/security.kali.org_kali-seErr:3 http://archive-4.kali.org/kali-security sana/updates InRelease     
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Hit:4 http://archive-4.kali.org/kali sana InRelease                      
0% [4 InRelease gpgv 20.3 kB] [Waiting for headers]Couldn't create tempfiles forErr:4 http://archive-4.kali.org/kali sana InRelease_dists_sana_InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Get:5 http://archive-4.kali.org/kali kali-rolling Release [23.7 kB]
Get:6 http://archive-4.kali.org/kali kali-rolling Release.gpg [819 B]          
0% [6 Release.gpg gpgv 23.7 kB]                                    3,846 B/s 0smktemp: failed to create directory via template '/tmp/tmp.XXXXXXXXXX': Permission denied
Err:6 http://archive-4.kali.org/kali kali-rolling Release.gpg                  
  At least one invalid signature was encountered.
Hit:7 http://dl.google.com/linux/musicmanager/deb stable Release               
80% [Release.gpg gpgv 1,345 B]mktemp: failed to create directory via template '/tmp/tmp.XXXXXXXXXX': Permission denied
Err:8 http://dl.google.com/linux/musicmanager/deb stable Release.gpg
  At least one invalid signature was encountered.
Reading package lists... Done 
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive-4.kali.org/kali-security sana/updates InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive-4.kali.org/kali sana InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: GPG error: http://archive-4.kali.org/kali kali-rolling Release: At least one invalid signature was encountered.
E: The repository 'http://http.kali.org/kali kali-rolling Release' is no longer signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://dl.google.com/linux/musicmanager/deb stable Release: At least one invalid signature was encountered.

I have no idea how this happened or how to fix it. I have gnupg, gnupg-agent, gnupg-pkcs11-scd, gnupg2, gnupg-curl, gnupg-pkcs11-scd-dbg installed.


Source: (StackOverflow)

Partitioning worries

So, my laptop currently runs a dual-boot of Windows 10 and Linux Mint. I want to add Kali to that list. I've got my USB set up and ready to roll, but when I went to partition my drive, I started to worry.

My hard drive currently looks like this:

My hard drive. It looks a mess.

I want to shrink my Windows C: drive (/dev/sda4) by around 20gb and then install Kali into that space. However, the free space I create will be between two NTFS, presumably Windows partitions. I know that where partitions are is almost as important as how big they are. Will this break anything?

My initial thought was to shift every other partition left, and install it at the end. However, I heard that that will (possibly) cause me to not be able to boot into one OS, the other, or both. Do I have to risk it?

In short: do I have to move the partitions leftwards and install at the end, or am I overreacting and I should just shrink C:, install Kali slap-bang in the centre of my hard drive and get on with my life?

Cheers.


Source: (StackOverflow)

Boot Kali with custom Filesystem

I'm trying to customize my "filesystem.squashfs" file, for my Kali live system. For modifying I used "unsquash" and for rebuilding "mksquash" without additional parameters. Now I replaced the old Filesystem with the new one. By booting the System stops by trying to mount (I think) the Filesystem.

What did I wrong? Hope for fast reply! Thanks in Advance!

Edit: I'm just trying to change Background Image, Keyboard Layout, install Squashfs-tools and Wine...

EditEdit: Looked at the Error Screen again, seem like the filesystem doesn't have the requested "/sbin/init". Then comes a "Bad File Descriptor" and "Kernel panic - not syncing: Attemped to kill init! exitcode=0x00000200" Would like to post a picture, but for any reason the app won't let me...


Source: (StackOverflow)

How to add persistence to entire Kali filesystem?

So I've set up a live USB with Kali for pentesting, and I'm now trying to get persistence working on it. So far, the USB has been partitioned and an ext2 filesystem installed.

When I open Kali, there is an unusual folder on the desktop with the icon of a hard drive disk whose name is MyPersistence, the name I chose for the persistence partition. The path of this folder is /media/root/MyPersistence. Anything I save in this directory gets persisted correctly.

However, nothing outside the directory gets persisted at all.

At the Kali boot menu, when presented with options, I hit tab and it brings up a small console pre-filled with this command:

.linux /live/vmlinuz noprompt cdrom-detect/try-usb=true boot=live username=root hostname=kali initrd=/live/initrd.img

According to instructions I've followed, I'm supposed to add persistence as a parameter to this at the end, and run it. But this produces no apparent change, nothing is different. What is that parameter? Is it supposed to be the name of the partition, MyPersistence in my case? What is .linux and where can I find more information about the parameters it takes?

Additionally, there was this in the instructions:

mkdir -p /mnt/my_usb
mount /dev/sdc2 /mnt/my_usb
echo "/ union" > /mnt/my_usb/persistence.conf
umount /dev/sdc2 && reboot

But it also has no effect.


Source: (StackOverflow)

Kali Linux Wireless Card not working

I am new to Linux so please bare with me.
I preformed a fresh install of Kali Linux on my laptop,so now the only operating system available is Kali Linux.
Here's my problem: My laptop cannot connect to the Internet through the already built-in wireless card.
My laptop wireless card is: Intel Corporation Centrino Advanced-N 6200 2x2 AGN and although the system says that it using the kernal drivers for iwlwifi there is still no wireless Internet connection.
I tried changing the interfaces file under /etc/network/interfaces and added:
# The primary network interfaces
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
Still no luck.
Here's the ifconfig details:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.77  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::223:18ff:febe:ab8e  prefixlen 64  scopeid 0x20<link>
        ether 00:23:18:be:ab:8e  txqueuelen 1000  (Ethernet)
        RX packets 27689  bytes 27448393 (26.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 15299  bytes 1495734 (1.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xd4600000-d4620000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 2460  bytes 187820 (183.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2460  bytes 187820 (183.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:27:10:94:a8:3c  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Here's the iwconfig details:

lo        no wireless extensions.

wlan0     IEEE 802.11abgn  ESSID:"ATT653"  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=15 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

eth0      no wireless extensions.

NOTE: For the ESSID, I manually added "ATT653" using

ifconfig wlan0 up
iwconfig wlan0 essid "ATT653"
dhclient wlan0

This didn't work because my network is WPA2 encrypted.
Here's the wireless card information:

root@kali:~# lspci
02:00.0 Network controller: Intel Corporation Centrino Advanced-N 6200 (rev 35)


and

root@kali:~# lspci -vq
02:00.0 Network controller: Intel Corporation Centrino Advanced-N 6200 (rev 35)
    Subsystem: Intel Corporation Centrino Advanced-N 6200 2x2 AGN
    Flags: bus master, fast devsel, latency 0, IRQ 29
    Memory at d4400000 (64-bit, non-prefetchable) [size=8K]
    Capabilities: [c8] Power Management version 3
    Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
    Capabilities: [e0] Express Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [140] Device Serial Number 00-27-10-ff-ff-94-a8-3c
    Kernel driver in use: iwlwifi
    Kernel modules: iwlwifi

Please help get this issue resolved.


Source: (StackOverflow)

installing wifi drivers on kali linux laptop?

I have a Qualcomm Atheros AR9285 Wireless Network Adapter. How do I make it work with Kali/Debian Linux. I can't get my OS to recognize the WiFi connections. I'm new to Linux so I would appreciate detailed guidance.


Source: (StackOverflow)

How can I get wifi on virtual machines for Kali Linux?

I want to connect my virtual machine (running Kali Linux) to wifi networks so I can do testing on the network (not through NAT). I have a Asus USB-AC56 wireless adapter but even with this I cannot seem to get wifi and so no wlan0 on programs that need that.

I have tried both Virtual Box and VMware environments.

Thanks


Source: (StackOverflow)

Create rogue AP inside network

so far I've manged to create an evil-twin with Linux using two wireless-cards and bridge them, giving internet access to clients. Problem is that clients have to manually connect to my fake AP. my question is, if i have access to the original wireless network, can i configure the fake AP as a range-extender or something, making clients automatically connect to it, if it has stronger signal? or am i missing something here?


Source: (StackOverflow)

Change number of CPUs in VirtualBox is disabled

I'm using virtualbox with Kali and it's working fine, however I currently only have it using 1 cpu and I'd like to add more.

However when I go to Settings → System → Processor the fields are greyed out and I can't change number of processors (this happens even when kali isn't running). Any help is appreciated


Source: (StackOverflow)