Stress test on Linux

Download and install the stress test tool

sudo amazon-linux-extras install epel -y
sudo yum install stress -y

Launch the stress test in background (for 800 seconds in that example)

sudo stress --cpu 8 --timeout 800 &

Check the stress test processes with the top command

top

Result for the top command

Manually stop the stress test (if needed)

sudo killall stress

wifi card with monitor mode and packet injections

When you do Wireless pen-testings, you want to use these tools.
airmon-ng
airodump-ng
aireplay-ng

Basically what that means is you want your wireless cards to be able to perform these tasks.
Change monitor mode
Packet capturing
Packet Injection.

If you want to go fancier, you might also want to have a look at TX gain, band etc but nevermind that for now.

Not all wireless cards support above functions.

And its hard to tell if you get the right wireless adapter, because there are many different wifi adapters brands out there, but you need to find one with the right chipset.

Here is a link for you to consult with. See if you wireless card has the right chipset.
https://www.kali.org/docs/nethunter/wireless-cards/
It will help you to find the right wireless cards, but sometimes you can get lucky even if your card is not on that list.

For me, I have a built in Relatek chipset, which is not listed in the link above, but does all the required tasks to perform the wifi testing.
I also happened to buy a TP-Link TL-WN722N which happens to be version 2/3 (only version 1 has the right chipset) but I heard there is a way to get it working with different driver.

So, the best way to get the right wireless card, you need to find the right chipset . Do a bit of research on the card that you have or you are buying.
You wont know what chipset it uses, so you have to dig a bit into that as well.

use lspci to find out what chipset installed for your wireless
use lsusb to find out which chipset your wifi adapter uses.

Start off by changing to monitor mode and see if monitor mode is supported. Then carry on with other tools.
iwconfig wlan0 mode monitor

man info for the tools I mentioned earlier –

airmon-ng This script can be used to enable monitor mode on wireless interfaces. It may also be used to go back from monitor mode to managed mode. Entering the airmon-ng command without parameters will show the interfaces status. It can also list/kill programs that can interfere with the wireless card operation.

airodump-ng is used for packet capturing of raw 802.11 frames for the intent of using them with aircrack-ng. If you have a GPS receiver connected to the computer, airodump-ng is capable of logging the coordinates of the found access points. Additionally, airodump-ng writes out a text file containing the details of all access points and clients seen.

aireplay-ng is used to inject/replay frames. The primary function is to generate traffic for the later use in aircrack-ng for cracking the WEP and WPA-PSK keys. There are different attacks which can cause deauthentications for the purpose of capturing WPA handshake data, fake authentications, Interactive packet replay, hand-crafted ARP request injection and ARP-request reinjection. With the packetforge-ng tool it’s possible to create arbitrary frames.


Cheers

Teza

Zenmap Installation in Debian using ALIEN package converter

If you are familiar with Security tools or Penetration testing, you definitely must have heard of Nmap.

Zenmap is a GUI of Nmap.

However it is no longer included in later version of Security testing OSs.
Below is an instruction on how to install it on Debian machines.

1) Download the latest RPM package at https://nmap.org/download.html
Optional Zenmap GUI (all platforms): zenmap-7.91-1.noarch.rpm

2) Note it is RPM package, so you will need to convert it to install on Debian. For that, you will need a package converter called ALIEN.

man alien >> alien is a program that converts between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats. If you want to use a package from another linux distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it.

3) Latest version of alien (alien_8.95) seems to have a glitch when installing so, if you happened to have installed that, you will need to uninstall and downgrade to alien_8.90.

Download link below.
http://archive.ubuntu.com/ubuntu/pool/main/a/alien/alien_8.90_all.deb

4) Install using your package manager or command line below.
dpkg -i alien_8.90_all.deb

5) Convert your Zenmap RPM package that you downloaded to .deb
sudo alien zenmap-7.91-1.noarch.rpm

6) Now you will get the .deb package. Install it.
sudo dpkg -i zenmapconvertedfile.deb

7) Thats it. Now you can run your Zenmap on your Debian.







E: Package aptitude has no installation candidate

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse"
sudo add-apt-repository deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse" 
sudo add-apt-repository  "deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse" 
sudo add-apt-repository  "deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse" 

# Then install

sudo apt-get install aptitude

Wireless Troubleshooting on Linux (applies for Kali linux and Parrot OS) with Realtek chipset

After installing Parrot Security OS, I was not able to connect to wifi anymore. The reason being Parrot OS not supporting my laptop’s Realtek wifi chipset.

Long story short and get to the troubleshooting steps, that got me going.

ifconfig
See if your wifi interface is up, normally you should see a loopback interface, LAN interface and a WLAN interface.

lspci
Check your chipset model. Below is my wifi card. If you see something similar but WLAN interface is not showing up on ifconfig, then its most likely the driver issue.

03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter


Temporary internet connection
You will need an Internet connection
I know it sounds silly when your WLAN interface is not showing up, but trust me its alot easier to try to connect to internet first. Get a wifi adapter or an Ethernet cable to connect to the internet first.

Step 5 – Disable Secure Boot in Bios

reboot your computer, in Bios configuration, Enable Legacy and disable Secure Boot.
Save and Exit. Depending on your Laptop make, F key will be different. For HP, it is F10.


Git Clone driver for Linux
sudo git clone https://github.com/tomaspinho/rtl8821ce

change to download folder
cd rtl8821ce

Change permissions
chmod +x dkms-install.sh
chmod +x dkms-remove.sh

Run the Installer

sudo bash dkms-install.sh

Reboot your computer

Different ways to run Linux for non – linux users

For many users out there, Linux may not be their main OS.
This may be because of a few reasons –

Most computers you buy come with Windows Pre installed.
Your Job offeres you a laptop with Windows OS pre installed.
The worst of all – Intimidation (probably seen codes and command lines and dont know what they are all about)
Linux is not very hard indeed. These days, there are different Linux distributions that looks alot like Windows interfaces.

And the best of all, unlike Windows, Linux is highly customizable.

These are the few ways you can run Linux

  1. Fresh install on Standalone computer
  2. Dual Boot alongside another OS
  3. Virtual Machines such as Virtual Box or VMWare or Windows Hyper-V
  4. Windows Subsystem for Linux
  5. Cloud instances
  6. Live images


1. Fresh install may not be an option for beginners. There may be issues with drivers and pre configs, backups etc – depending on the Linux distro you want to use.
There are some hardware that come with Linux pre installed. Like System 76. Its got PopOS and I hear good things about those devices.

2. Dual boot although dual boot is my preferred choice of installing, you may need to consider hard ware limitation, legacy support, bootloader etc. This may be for more advanced users.

3. With Virtual Machines, you are sharing resources with host machine. There are different Virtualization engines out there. You can simply install one, download the Linux image and run on it. It may be one of the easiest way when you start to migrate to Linux.

4. WSL provides a Linux-compatible kernel interface developed by Microsoft and allows a user to chose a Linux distribution to install from the Microsoft Store. Since it can be easily downloaded from Microsoft Store, within a few clicks, you can try a taste of linux.
If you try to locate the path, C:\Users\AppData\Local\Packages\YourLinux, you will get a better idea of what its doing. You will also not find wireless interfaces in WSL. So you will need an external wifi adapter for doing some wifi tests.

5. Cloud VMs. If you are already using some cloud services, which in these days many offices are, you may be able to try installing cloud instances and try linux there.

6. Most modern Linux distros these days come with Live images. you can install it on any USB device, and plug it into your laptop and try your flavor of linux before you are actually installing it. It may be the easiest way to try out different flavors of Linux.


Regards
Teza

Changing DNS in Linux

For whatever reason, you want to change your DNS, you need to change it at resolv.conf

First change your directory to /etc.
cd /etc

if you type in ls -l, you will see resolv.conf file.

you have to sudo or su to make changes

sudo nano resolv.conf

if there is existing dns, you can hash it out. Just put # in front of the address

and then type in the new nameservers

you can use openDNS, Googles DNS or any DNS that you prefer.

OpenDNS 1: 208.67.222.222
OpenDNS 2: 208.67.220.220

ctrl + O
Enter

ctrl +x

Configuring Network on Linux VM, updating packages

Quick note on setting up Linux VMs on Hyper V.

Step 1: Check adapters, test internet connectivity
First, check if the network adapters are attached.

ifconfig

you will see Ethernet, loopback or WiFi adapters.
They look like eth0, lo, wi and you should be getting private IP on those adapters.

If you do, proceed on. If you don’t, please watch my video on how to set up Virtual Switch Manager for VMs.

Continue reading “Configuring Network on Linux VM, updating packages”

How to fix Operation not possible due to RF-kill in Linux

you cannot bring back your wireless interface back.

ifconfig wlan up wont work
you get the message
Operation not possible due to RF-Kill.

Error is due to soft block or hard block, wireless card has been switched off from the kernel.

Sudo rfkill list

find out what is being blocked

sudo rfkill unblock wifi
sudo rfkill unblock all


re run sudo rfkill list to check if the wireless has been unblocked.

Changing Desktop Environment on Linux or Laggy mouse cursor

It occurs to me that I had a very sluggish performance with Kali install on Hyper-V.

I have assigned plenty of CPU and memory for this particular VM but when I ran it, the mouse cursor seems to be a bit too laggy.

Continue reading “Changing Desktop Environment on Linux or Laggy mouse cursor”