In order to automatically upgrade packages on a Kali, Ubuntu, or Debian system, I add the following line to my crontab as root:
sudo crontab -e # To edit the root user's crontab
Then add this line to run the updates at 8:00AM:
00 8 * * * /usr/bin/apt-get update > /dev/null 2>&1 && /usr/bin/apt-get -y dist-upgrade > /dev/null 2>&1 && /usr/bin/apt-get -y autoremove > /dev/null 2>&1
Wednesday, January 4, 2017
Optimizing Kali, Ubuntu, or Debian Linux By Disabling Services That are not Required on Boot
Services that are started on boot in Kali Rolling, Ubuntu, or Debian can be removed with the tool rcconf.
To install rcconf, use apt-get:
apt-get install rcconf
Services that start on boot that can be disabled are:
arpwatch (if you aren't looking for people arp poisoning you)
clamav-daemon
clamav-freshclam
gdm3 (if you don't use Gnome)
gdomap
lightdm (if you boot straight to console)
motd
pcscd (if you don't need smart card support)
pppd-dns
rsync
saned (if you don't use a scanner)
smartmontools (if you don't need to monitor your hard drive health)
speech-dispatcher
x11-common (if you boot straight to console)
If after restarting and rcconf still shows a service you removed, then you can force the disabling by issuing the command:
update-rc.d -f service_name remove
To install rcconf, use apt-get:
apt-get install rcconf
Services that start on boot that can be disabled are:
arpwatch (if you aren't looking for people arp poisoning you)
clamav-daemon
clamav-freshclam
gdm3 (if you don't use Gnome)
gdomap
lightdm (if you boot straight to console)
motd
pcscd (if you don't need smart card support)
pppd-dns
rsync
saned (if you don't use a scanner)
smartmontools (if you don't need to monitor your hard drive health)
speech-dispatcher
x11-common (if you boot straight to console)
If after restarting and rcconf still shows a service you removed, then you can force the disabling by issuing the command:
update-rc.d -f service_name remove
Enable SSH Server on Boot in Kali Linux Rolling
To enable the openssh server to start on every boot in Kali Linux Rolling run the following command:
update-rc.d -f ssh enable 2 3 4 5
update-rc.d -f ssh enable 2 3 4 5
Saturday, December 31, 2016
Making Free Phone Calls Using Asterisk and Google Voice
After installing the latest asterisk from source and configuring your dialplan extensions, you can use google voice to make and receive calls for free. Follow this guide to add google voice to your dialplan: Asterisk With Google Voice.
Then add the following to extensions.conf:
[outgoing-motif]
exten => _1XXXXXXXXXX,1,Dial(Motif/google/${EXTEN}@voice.google.com,,r)
[local]
include => incoming-motif
include => outgoing-motif
Now just dial 1+area_code+phone_number to dial a number or change:
exten => _1XXXXXXXXXX,1,Dial(Motif/google/${EXTEN}@voice.google.com,,r)
to
exten => _XXXXXXXXXX,1,Dial(Motif/google/${EXTEN}@voice.google.com,,r)
in order to just dial area_code+phone_number
Then add the following to extensions.conf:
[outgoing-motif]
exten => _1XXXXXXXXXX,1,Dial(Motif/google/${EXTEN}@voice.google.com,,r)
[local]
include => incoming-motif
include => outgoing-motif
Now just dial 1+area_code+phone_number to dial a number or change:
exten => _1XXXXXXXXXX,1,Dial(Motif/google/${EXTEN}@voice.google.com,,r)
to
exten => _XXXXXXXXXX,1,Dial(Motif/google/${EXTEN}@voice.google.com,,r)
in order to just dial area_code+phone_number
Start screen on Boot in Kali Rolling, Ubuntu, or Debian Linux
After booting straight to CLI in Kali Rolling, Ubuntu, or Debian, I also wanted to have a screen session started on boot to use for my window manager. In order to do this, I had to edit /etc/rc.local and add this command:
/usr/bin/screen -c /root/.screenrc -dmU -h 10000 -S kali_screen_session
Then add the next command to ~/.bashrc:
export HOME="/root"
Then add these lines to ~/.screenrc (the most important being the shell line):
#don't display the copyright page
startup_message off
activity "%C -> %n%f %t activity!"
bell "%C -> %n%f %t bell!~"
pow_detach_msg "BYE"
#visable bell
vbell_msg "*beep*"
# Change scrollback to 100000 lines
defscrollback 100000
# fix the scrollback problem in putty (for windows users)
termcapinfo xterm ti@:te@
shell bash
# Uncomment the following line in Kali Linux in order to start new windows in ~ instead of /
#chdir /root
# programs to auto start
screen -t htop 0 htop
# status line at the bottom
hardstatus on
hardstatus alwayslastline
hardstatus string '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %d/%m/%y %c ]%{W}'
Now to create a new terminal window press control+a then c.
To switch between windows press control+a control+a
/usr/bin/screen -c /root/.screenrc -dmU -h 10000 -S kali_screen_session
Then add the next command to ~/.bashrc:
export HOME="/root"
Then add these lines to ~/.screenrc (the most important being the shell line):
#don't display the copyright page
startup_message off
activity "%C -> %n%f %t activity!"
bell "%C -> %n%f %t bell!~"
pow_detach_msg "BYE"
#visable bell
vbell_msg "*beep*"
# Change scrollback to 100000 lines
defscrollback 100000
# fix the scrollback problem in putty (for windows users)
termcapinfo xterm ti@:te@
shell bash
# Uncomment the following line in Kali Linux in order to start new windows in ~ instead of /
#chdir /root
# programs to auto start
screen -t htop 0 htop
# status line at the bottom
hardstatus on
hardstatus alwayslastline
hardstatus string '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %d/%m/%y %c ]%{W}'
Now to create a new terminal window press control+a then c.
To switch between windows press control+a control+a
Boot Kali Linux Rolling to CLI instead of GUI via systemd
Most of the tools I use in Kali are command line tools, and rarely need a full GUI, so in order to boot straight to CLI and get the maximum performance available on my system, I used this systemd command:
systemctl set-default multi-user.target
If you want to start a GUI, then type this command:
startx
systemctl set-default multi-user.target
If you want to start a GUI, then type this command:
startx
Friday, December 30, 2016
Porting Kali NetHunter to LG G3 US990 with Cyanogenmod 13 Oct-OS-M ROM Android 6.0.1 Marshmallow
My latest project is trying to port Kali NetHunter to the LG G3 Running the latest OCT-OS-M CM13-based ROM (Android 6.0.1 Marshmallow).
I have yet to get the custom kernel to boot without the secure boot error, and am almost out of ideas, so if you can help, please drop me a line.
On your Android device:
Step 1. Root your phone.
Step 2. Unlock your bootloader and install TWRP.
Step 3. Install latest OCT-OS-M ROM.
On your Linux machine:
Step 4. Install Android toolchain as per kali wiki: here. (Note: An x86-64 machine is needed)
Step 5. Clone the OCT-OS kernel source github project named: platform_kernel_lge_us990
Step 6. Make kernel modifications and apply patches as per kali wiki: here. (Note: I had to disable Bluetooth USB HCI in order for the kernel to compile).
Step 7. Clone Kali NetHunter Source: here.
Step 8. Clone cbump source and cross-compile: here.
Step 9. Add cbump binary to kali-nethunter/nethunter-installer/boot-patcher/arch/armhf/tools/cbump
Step 10. Add
"$bin/cbump" boot-new.img || abort "Bumping boot image failed"
to kali-nethunter/nethunter-installer/boot-patcher/boot-patcher.sh (last line of build_boot() function.
Step 11. Add your device and build your zip as per wiki: here, and the README.md file in kali-nethunter/nethunter-installer/devices
In kali-nethunter/nethunter-installer/devices/devices.cfg add:
# LG G3 us990 for Cyanogenmod 13
[us990cm]
author = "mcraze123"
version = "1.0"
devicenames = us990
Copy your compiled and patched kernel image zImage to kali-nethunter/nethunter-installer/devices/marshmallow/us990cm
mkdir -p kali-nethunter/nethunter-installer/devices/marshmallow/us990cm
cp platform_kernel_lge_us990/kImage kali-nethunter/nethunter-install/devices/marshmallow/us990cm/
To get the lates apk's run:
python build.py -f
Then to build the zip, run:
python build.py -d us990cm -m
On Android:
boot into twrp, mount as mtp, copy zip to device, install zip
UPDATE:
I have managed to get past the secure boot error by flashing this zip, and removing the cross compiled version of cbump and modifications to boot-patcher.sh. Now the device recognizes on my mac as a keyboard but goes into a boot loop. I'm going to start with a known working kernel, then add features one by one in order to find what is causing the issues. Nethunter should be coming to the LG G3 US990 soon!
I have yet to get the custom kernel to boot without the secure boot error, and am almost out of ideas, so if you can help, please drop me a line.
On your Android device:
Step 1. Root your phone.
Step 2. Unlock your bootloader and install TWRP.
Step 3. Install latest OCT-OS-M ROM.
On your Linux machine:
Step 4. Install Android toolchain as per kali wiki: here. (Note: An x86-64 machine is needed)
Step 5. Clone the OCT-OS kernel source github project named: platform_kernel_lge_us990
Step 6. Make kernel modifications and apply patches as per kali wiki: here. (Note: I had to disable Bluetooth USB HCI in order for the kernel to compile).
Step 7. Clone Kali NetHunter Source: here.
Step 8. Clone cbump source and cross-compile: here.
Step 9. Add cbump binary to kali-nethunter/nethunter-installer/boot-patcher/arch/armhf/tools/cbump
Step 10. Add
"$bin/cbump" boot-new.img || abort "Bumping boot image failed"
to kali-nethunter/nethunter-installer/boot-patcher/boot-patcher.sh (last line of build_boot() function.
Step 11. Add your device and build your zip as per wiki: here, and the README.md file in kali-nethunter/nethunter-installer/devices
In kali-nethunter/nethunter-installer/devices/devices.cfg add:
# LG G3 us990 for Cyanogenmod 13
[us990cm]
author = "mcraze123"
version = "1.0"
devicenames = us990
Copy your compiled and patched kernel image zImage to kali-nethunter/nethunter-installer/devices/marshmallow/us990cm
mkdir -p kali-nethunter/nethunter-installer/devices/marshmallow/us990cm
cp platform_kernel_lge_us990/kImage kali-nethunter/nethunter-install/devices/marshmallow/us990cm/
To get the lates apk's run:
python build.py -f
Then to build the zip, run:
python build.py -d us990cm -m
On Android:
boot into twrp, mount as mtp, copy zip to device, install zip
UPDATE:
I have managed to get past the secure boot error by flashing this zip, and removing the cross compiled version of cbump and modifications to boot-patcher.sh. Now the device recognizes on my mac as a keyboard but goes into a boot loop. I'm going to start with a known working kernel, then add features one by one in order to find what is causing the issues. Nethunter should be coming to the LG G3 US990 soon!
Subscribe to:
Posts (Atom)