Adventures after installing Kali Linux, guide to the Windows immigrate

install kali... on computer, or dual boot, or just vm or Hyper-V...

and then....

I'm talking today about Kali 2018.1, some things has changes, they removed "gdebi" and "gsku" which suppose to have some problems, there is instead "apt-get install", "dpkg".

all those are... with linux you download Packages, source code, or built source code, and install them. so all those programs knows to extract the package and install them, so it doesn't really matter which you use.

"pkexec" is supposed to replace "sux" or any of "kdesudo/gksu/gksudo", but not doing such a good job, so back to the original "sudo".

the point is that when using kali you usually want to use the root user, but for many programs like chrome you prefer to use another user to protect yourself, so they are wrappers to the "sudo" command for graphical programs, so eventually using "sudo" will do the job most of the time.


1. Updates

you need to update your sources.list files to the repo according to here. this is a repo the kali dev team manage so you will only have stuff they know that works well with kali.

   leafpad /etc/apt/sources.list
today is
   deb http://http.kali.org/kali kali-rolling main contrib non-free


2. chrome

simplest way to install chrome, (instead of downloading from the google download page)

   wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

   sudo dpkg -i google-chrome-stable_current_amd64.deb

now, the browser can do many things, so its really better to run it with another user, and for stuff needed "root", use FF.

1st lets create a new user, (you can use another name, and unlike me give it a password), use this syntax to give it its own folders, its part of your download safety

   useradd -m chromeuser
now to test it, run in terminal
   sudo -u chromeuser google-chrome

and finally to create a desktop shorcut create a file (you can name it whatever you want, with any ext or not at all)
   leafpad Desktop/chrome.desktop
and pour this code inside and save
   [Desktop Entry]
   Name=Chrome
   Encoding=UTF-8
   Exec=sh -c "sudo -u chromeuser google-chrome"
   Icon=/opt/google/chrome/product_logo_256.png
   StartupNotify=false
   Terminal=false
   Type=Application

as you can the, in the exec i use sudo. in case you get some of these errors
"cannot open display:", "cannot open display:1", "No protocol specified", 
you should try and run "xhost +". if its solves your problem, you should decide if you want it as a startup script or run it every time again, or just change the shortcut exec to "xhost +; sudo...".

SOUND?

running chrome via another user means that the sound server needs to be told to accept clients requests...
with kali 2018.1 you have installed PusleAudio so you need edit the server's config and create (per user, except the one you login with) client config.

add unix socket to pulse (make server multi)
   leafpad /etc/pulse/default.pa
add in the end
   load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/pulse-socket

add client for chromeuser, create file
   leafpad /home/chromeuser/.config/pulse/client.conf
write
   default-server = unix:/tmp/pulse-socket

and restart the service (debian)
   pulseaudio --kill
   pulseaudio --start


3. learn some basics Linux!

just read this, simple, readable, fast, you can finish the whole thing in 2 hrs or less.
find all files having name starting with leafpad
   find /usr -iname leafpad*
list all files including hidden ones
   ls -al /root

4. the profile file

as detailed here and here you have a file that can a file to run any script you want on startup, you can have a global one (/etc/profile) or local one (/home/chromeuser/.profile or /root/.profile) so you can always set the "xhost +" there. 


5. printer

in order to use printers you need to install a service for them. the recommended one is CUPS, running the following commands will install (if needed) and run it

   apt-get install cups cups-client "foomatic-db"
   adduser root lpadmin
   sudo apt install cups
   /etc/init.d/cups start 

1st line installs client, 2nd puts root in the service permissions group, 3rd install service, 4th starts the service.

the service runs at localhost:631, so to test if anything listens there
   netstat -ant | grep 631
see if your printer is found by usb (if not just replug)
   lsusb

to open the service browse to "http://127.0.0.1:631/" and go to
"CUPS for Administrators -> Adding Printers and Classes -> add printer"


6. put some desktop shortcuts

run this
   nautilus /usr/share/applications
you'll see many default apps there to just copy-paste to desktop
btw, nautilus is your explorer...


7. keyboard shortcuts

like terminal...
hit the Window key, settings, there start typing Keyboard, in the end there is a "+" sign, click, and give you shortcut a name, choose the kb shortcut, and for terminal "gnome-terminal"


8. more apps

hit the Window key, and start typing for your app name, if its not there the gnome might give you a suggestion to install it from there.



BONUS

ffmpeg

if you tried to install ffmpeg and get errors like
"ffmpeg unknown encoder 'libx264'", "ffmpeg Unrecognized option 'crf'."
its just not installed right, and run
   apt-get purge ffmpeg
and if "ffmpeg" is still a valid command delete it from the bin directory
then
   sudo apt-get install ffmpeg 


edit file from terminal without locking the terminal
just add " &" to the end of the command like leafpad myfile &


TOR
download your tor version and "unzip" it with tar like  tar -xf tor-browser... you can press the "tab" button for auto-complete after start writing "tor"

create tor user (like with chrome)
    useradd -m toruser
now the thing is, that tor is meant NOT to be used as root, and since it runs a bit differently we need some extra steps

start by making a folder for tor under the new user's dir, something like toruser/tor and copy paste the .tar.xz file there.

now we need to give our "toruser" permissions to the folder and files to execute them
    chown toruser tor-browser-linux64-7.5.3_en-US.tar.xz
    chmod u=rwx tor-browser-linux64-7.5.3_en-US.tar.xz
    chown toruser tor

now lets go as "toruser" user and extract and run the tor
    tar -xf tor-browser-linux64-7.5.3_en-US.tar.xz
    cd tor-browser_en-US
    ./start-tor-browser.desktop

this way you'll HAVE to goto the dir from terminal, "su", and exec the desktop file EVERY time, but if you user tor, thats what you want. oh, and do yourself a favor and turn off javascript (safest on settings), otherwise you can get detected very easily.






Comments

Popular posts from this blog

c# Service Play Sound with NAudio example by Moshe

Asp.Net Ending Response options, Response.End() vs CompleteRequest()

JS/JQ simulate Enter event