Unlock Bootloader Honor 4c + Screenshots

This is a guide on how to unlock the bootloader on Honor 4c running Android 6.0 from a Windows 10 PC.

Requirements:

  1. HiSuite software
  2. Minimal ADB and Fastboot
  3. Unlock code
  4. Your Honor 4c phone- For obvious reasons 😛

Disclaimer: Please follow this guide at your own risk. Following this guide will void your warranty and may result in a bootloop and I assume you would know how to fix bootloop. If your phone gets bricked, don’t blame me.

Step 1. Get required phone details

Model Number:

In your phone, click on Settings>About Phone and you would find “Model Number”. For example, mine is CHM-U01.

IMEI number:

You would have two IMEI numbers, take a note of the 1st IMEI number that you see in the “About Phone” under Settings.

Serial Number:

Go to Settings>About Phone>Status and you should your phone’s serial number.

Product ID:

Open your phone’s dialer and type the following code: *#*#1357946#*#*

Step 2. Enable Developer Mode + USB debugging

  • Go to Settings>About Phone and keep tapping on “Build Number” until it says You’re a developer.
  • Now go back to Settings, you should be able to see “Developer Options”. Click on it and then move the slider next to “USB debugging” to enable it.

Step 3: Install HiSuite

Step 4: Get your unlock code:

honor 4c unlock bootloader link screenshot

  • Login to your Huawei Account, click “I have read and accept all terms above” and then click “Next”.
  • Fill in your phone details and you will get your unlock code Please take a note of it as we will need it to unlock the bootloader.
  • In case you do not get your unlock code, please send an email to Huawei at [email protected] and they should be able to provide you with the unlock code.

Step 5: Install Minimal Adb and fastboot

  • To download and install Minimal ADB and Fastboot, use the download link below:

https://www.androidfilehost.com/?fid=24521665358595410

  • During installation, please take a note of the installation directory. By default it would be installed to “C:\Program Files (x86)\Minimal ADB and Fastboot” for a 32-bit OS and “C:\Program Files\Minimal ADB and Fastboot” for a 64-bit OS.

[Note: For more information about Minimal ADB and Fastboot package, please visit XDA and support the original creators of the software. (XDA Link)]

Step 6: Unlock bootloader

  • Connect your Honor 4c via a USB cable to your PC/laptop and then unlock your phone.
  • Now browse to the Minimal ADB and Fastboot installation directory. Press and hold SHIFT in your keyboard and then right click on any blank space in that folder and click on “Open command window here”.
  • You should be able to see command prompt window like the one below:

adb location

  • Now we need to verify that your phone is accessible via adb run the following command:
adb.exe devices

You may receive a message in your phone to allow the connection, click Allow when prompted. If the above command does not display your device, then something went wrong with the installation of Huawei HiSuite drivers or your phone is not connected properly to your PC. Below is a screenshot when adb was able to detect my device.

adb recogized device screenshot

  • Now type the following to boot into your phone’s bootloader.
adb.exe reboot bootloader
  • You would see a screen with a white background titled “FASTBOOT&RESCUSE MODE” with the message “BOOTLOADER LOCKED”.
  • Verify that you are fastboot is able to recognize your device by running the following command:
fastboot.exe devices
  • To unlock your bootloader, run the following command “fastboot oem unlock keyyourecieved” from your pc after replacing 123456789 with the unlock code that you received from Huewai’s website:
fastboot oem unlock 123456789

You should see the message “Phone Unlocked” message in the bottom after the bootloader has been successfully unlocked.

  • Now, reboot your phone by typing the following command:
fastboot.exe reboot

Congratutaions, you should have unlocked your bootloader by now. I will link another article soon on how to root and install custom recovery TWRP on Honor 4c running Android 6.0 (Marshmallow).

Do leave a comment below and share if you liked this guide. Cheers!

Source:
Minimal ADB and Fastboot: XDA

Protect against vulnerability CVE-2016-5696 in CentOS 6.8

This guide on how to protect against Off-path TCP vulnerability CVE-2016-5696 in a CentOS 6.8 machine.

Run the following command to check the kernel version that your box is running:

uname -r

Run the following to verify your Centos version details:

cat /etc/redhat-release

Below is a screenshot for the outputs for the above commands from my CentOS 6.8 box.

release information screenshot CentOS 6.8

Workaround against the attack:

Open your sysctl.conf file:

vi /etc/sysctl.conf

edit config file command CentOS 6.8

Below is a screenshot of my default sysctl.conf file which does not contain “net.ipv4.tcp_challenge_ack_limit”.

default sysctl.conf in CentOS 6.8

Now add the following line at the end of the config file:

net.ipv4.tcp_challenge_ack_limit = 999999999

Below is a screenshot after editing the config file.

edited-config-file screenshot in CentOS 6.8

Save and exit the file. (Press ESC and then type :wq and hit Enter in your keyboard).

Use the command below to verify if the value of net.ipv4.tcp_challenge_ack_limit is 999999999.

sysctl -p

sysctl -p in CentOS 6.8

If you are able to see the line in the above screenshot, this means that it will make the exploit extremely hard to perform (practically impossible). The above is a workaround to mitigating the Off-Path TCP attack in a CentOS 6.8 machine and will also work for redhat 6.8.

The Fix:

If you are not looking for the workaround but for a permanent fix, then you can upgrade your Linux kernel to 4.6 or above.

If this article helped you, do leave a comment below and like us on Twitter and Facebook. Cheers!

Source: Bobcares

References: Redhat Portal, Redhat Shared Ack Vulnerability

AMD announces RX 470 & RX 460

AMD has announced two more cards RX 470 and the RX 460.

The specs (unconfirmed) that we know so far for the RX 470 and RX 460 are shown below:

rx 470 and rx 480 specs (not confirmed)

If you missed out AMD’s previous announcement about the $199 VR ready card, then you can find it in my previous post here. Now talking about the RX 470, it is meant for 1080p gaming @ 60fps (on a budget) while the RX 460 is suited for games with lower system requirements such as MOBA. The TDP for the RX 460 is speculated to be less than 75W and this is great for gamers who don’t have a beefy PSU and just looking to upgrade to a better GPU.

Personally, I think this was the right time for AMD to announce the RX lineup and I like the direction where they are headed this time. With the RX 480 priced at $199, the RX 470 and RX 460 would be priced lower, these would sell like hot cakes once launched.

Would you buy the RX 480, 470 or the 460? Or would you wait for Nvidia to release their new card? Feel free to leave a comment in the comment section down below.

Do subscribe to get more updates and follow us on Twitter and Facebook. Happy Gaming!

 

Source: videocardz

AMD announces RX 480 at $199

AMD has announced the RX 480 14nm GPU which is VR ready. The RX 480 is meant for gaming at 1440p resolution + VR & its 4GB variant will be priced at $199. (R.I.P. Nvidia)

rx 480 specs
Image Source: engineering.com

Now that’s a brilliant move from AMD and I believe its going to sell like hot cakes. It will be officially launched on 29th June 2016. There will also a RX 480 8GB version which will be released later but its pricing is officially not out yet.

According to reports from gamespot and pcworld, the RX series of graphics card will support DirectX12, Vulkan gaming APIs, HDMI 2.0b, DisplayPort 1.3/1.4, HDR, and H.265 encoding/decoding.

Source: gamespot, pcworld

Use netcat to chat over LAN

This is quick guide on how to use netcat (nc) to chat between two PCs over LAN.

VM 1: CentOS 6.6

My CentOS machine did not have netcat (nc) preinstalled so I had to manually install it.

# yum install nc -y

VM 2: Kali Linux 2016.1 | IP: 192.168.1.11 |

The Kali Linux 2016.1 had netcat tools were pre-installed so i didn’t have to install it. Here, we take any one of the 2 Pcs as the chat server and the other as the chat client.

Here, I am selecting the Kali Linux to listen for connections on a random port 12345.  [Note: The port you select must be higher than the standard port 1024.]

In this case, I will make Kali as the chat server and set it to listen on port 12345.

# nc -lvp 12345

nc listening on port 12345

Now from the 2nd PC i.e. the CentOS machine, we will make a connection to the Kali machine on port 12345.

# nc 192.168.1.11 12345

Once connected, Kali’s terminal would show as message such as shown below:

nc accepting remote connection from LAN

Now, to start chatting type the text and hit ENTER in your keyboard to send chat messages between the two PCs. Pretty sweet uh?

nc output showing chat

FYI, There are practically tons of uses of netcat (nc) other than sending messages.

Other uses of netcat:

  • File Transfer: You can use to transfer file from one PC to another.
  • Port Scanning: Use netcat with the -z flag to run a port scan of the desired IP.
  • Clone & transfer entire partitions: This comes handy if you need to take a backup and transfer it to another PC in your LAN. You can use the dd command to clone a partition or an entire hard disk and then transfer it across to another PC.
  • Run a simple Web server.

Have you found any another use with netcat? Post it in the comment section down below. If your on a Linux machine, check out the man page for netcat for more info. Happy exploring!

If you liked this article, don’t forget to subscribe and follow us on Twitter and Facebook.

Source: Cybrary.it

Useful Linux Terminal shortcuts

Here are some useful Linux Terminal Shortcuts:

Shortcut 1: Run previous typed command

In your Linux terminal, type:

# ls -l

Now, if you want to run this command again i.e the (previous command), type the following and hit ENTER:

# !!

This will run the command which was previously typed i.e ‘ls -l’.

Shortcut 2: Run command with last argument from previous command

For this example, lets create an empty file one.txt:

# touch one.txt

Now, lets use the following command:

# cp one.txt one.bak

Lets break down this command according to its arguments:

1st argument – one.txt

2nd argument / last argument – one.bak

[ Note: We can logically say that the 0th argument is the command cp itself. ]

Lets say we want to edit the file “one.bak” (which is the last argument for command cp, we can use:

# vi !$

The above command is same as running ‘vi one.back‘. Also note that the !$ passes the last argument of the previous command to the current command vi.

Shortcut 2 (Alternative):

Now, lets use the following command:

# cp one.txt one.bak

An alternative way to provide an argument from the previous command to another command is by using !:<argument number>. For example, to pass the 2nd argument of the last command, we use !:2 as follows:

# vi !:2

Here !:2 means that we are passing the 2nd argument of the previous command.

Shortcut 3 : Linux Terminal Keyboard shortcuts

To get the previous command: Press the UP arrow in the keyboard.

To kill a process when you are in the Linux terminal: Press <CTRL> + C in your keyboard.

Shortcut 4 : Autocomplete:

Trust me when I say this, this shortcut makes your life easier. If you need to auto complete a command, you can use the TAB key in your keyboard. This is one the shortcuts that is used by most Linux users.

Example:

If you want to type ifconfig in your Linux terminal, you can start typing the command and then press the TAB key to auto complete it. In this case, type ifcf and then press TAB and it will autocomplete the command.

The TAB feature can also be used to autocomplete known information such as file names which are passed as arguments.

For example: Lets assume in the current directory that you are on has only two files first.txt and second.txt. Now, if you need to type this command ‘cat first.txt second.txt‘, then you can use the TAB shortcut to auto-complete it by following these steps:

Type cat and then type f and then press TAB to autocomplete it to:

 cat first.txt

Then type the first letter of the next argument i.e. type s and then press TAB, which it autocomplete the command to:

cat first.txt second.txt

Shortcut 5: Move between words

  • Navigate to the next word from current position:

Press <CTRL> and <Right Arrow key> in your keyword to move to the next word(towards the right side of current cursor position) in your terminal. This is also applicable in Linux editors such as vi or vim.

  • Move to previous word in terminal from current position:

Press <CTRL> and <Left Arrow key> in your keyword to move to the previous word/the word to the left side from current cursor position in your Linux terminal (or most editors). You can press it again accordingly, if you need to move the cursor one word at a time towards the left direction.

The above two shortcuts are useful when you are entering commands in the Linux terminal and need to correct a particular word in the command. This helps navigating back and forth between words/parameters in the command with ease.

Other Bash Shortcuts:

To go to the 1st terminal, press CTRL, ALT and the function key F1 in your keyboard.

To go the nth terminal, press CTRL, ALT and Fn (where Fn can be function keys F1, F2, F3 etc).

To paste previously copied text to your Linux terminal/editor, you can press the middle button in your mouse. Now, How cool is that uh? 🙂

To lock your Linux machine press <CTRL> <ALT> and the letter l in your keyboard.

And that’s it for now, hope its been informative. I will be updating this article in the future with more Linux terminal shortcuts  as soon as I find new ones, so stay tuned! If this article helped you, do leave a comment below and like us on Twitter and Facebook. Cheers!

Hope this helps!

How to display a file from one line number to another in Linux

If you need to read a file and print from a range of line numbers (including the last one), you can use the command as shown below.

cat <filename> | awk 'NR >=linenumber1 && NR <=linenumber2'

To read and display a file along with the line numbers, you can use the following format:.

cat -n <filename>

Example:

cat -n sample.txt

display line number
For example:

To print lines starting from line 2 to line 7, then you can use the following command.

cat sample.txt | awk 'NR >=2 && NR <=7'

Sample Output:

use cat and awk to print range of line numbers in linux
If for any reason you need to display the line numbers along with the output, then you can pass the -n argument to cat before piping it to awk as shown below.

cat -n sample.txt | awk 'NR >=2 && NR <=7'

Sample Output:

print with line numbers

[Note: There are multiple methods to do the same procedure. This method is intended for beginners who are just getting started in Linux.]

Hope this helps!

If this article helped you, do leave a comment below and like us on Twitter and Facebook. Cheers!

Source: Link

How to fix “mysqld dead but subsys locked” EC2

My webserver’s mysqld service went down with the error message “mysqld dead but subsys locked”. The wordpress website was displaying the error “error establishing a database connection”. This is how I fixed it.

Upon visiting my website, I got the error message as shown below.

error establishing database connection ec2

Verify Issue – Check mysqld status:

To check the status of the mysqld database service, connect to your Amazon EC2 instance and then type the following command.

sudo service mysqld status

mysqld dead but subsys locked ec2

Investigate log files:

I checked my mysqld log files and found that the mysqld service was malfunctioning due to low memory.

sudo cat /var/log/messages | grep mysqld | less

check mysqld events in /var/log/messages
To check further events of mysqld , you can check mysqld.log using the following command:

sudo cat /var/log/mysqld.log | less

In my case, I found the mysqld service was panicking and got shutdown due to memory problems. [Note: The above outputs would differ from mine.]

Check if swap is present or not:

Run the below command to check if you have swap on your EC2 instance.

free -m

check if swap is present in ec2 using 'free -m' command

You can see here that Swap is 0. [Note: Swap is by default not created in your Amazon EC2 micro instance (free tier).]

Solution:

To resolve this issue, we need to create a swap file, mount it and make it persistent on boot.

Create swap file (1GB):

Type the following commands to create and activate the swap.

sudo dd if=/dev/zero of=/swapfile bs=1M count=1024

create swap file ec2

sudo mkswap /swapfile

mkswap command

Secure the swapfile:

To secure the swapfile from unauthorized access, type the following commands:

sudo chown root:root /swapfile

sudo chmod 600 /swapfile

chmod command to set swap file permission ec2

 

Finally, type the following command to load the swapfile and hit Enter.

sudo swapon /swapfile

Make swap persistent on boot:

To make the swap persistent on boot, edit the file /etc/fstab using the following command:

sudo vi /etc/fstab

Add the following at the end of the fstab file:

/swapfile swap swap defaults 0 0

Save and exit the file. Press ESC  and then type :wq and hit Enter.

Check if swap is active:

You can run the command below to check if swap is active or not.

free -m

check if swap is active free -m

As you can see highlighted section, the swap of size 1023MB is activated. It would use the swap file whenever necessary.

Restart / Start mysqld service:

You can type the following command to start the mysql service.

sudo service mysqld start

service mysqld start

Voila! You should now be able to access your website.

Change swappiness (Optional):

This step is purely optional. I would like my EC2 to use the RAM majority of the time and use the swap file when necessary. As you may know, its faster to access data from in the RAM rather than switching to the swap file which is stored in a mechanical drive in cloud.

sudo sysctl vm.swappiness=10

change swappiness

And that’s it folks, this should resolve the problem with the mysqld service crashing in your EC2 instance.

If this article helped you, do leave a comment below and follow us on Twitter, Facebook and Tumbler. You can also subscribe to our email subscription list to get latest updates right to your email. Cheers!

References: isitablog

Install Kali Linux in virtualbox (using ova file)

This is how I installed Kali Linux in virtualbox using the ova file method in my windows 10 PC along with its screenshots.

Requirements:

  1. Kali Linux 2019.1 Preinstalled ImageDownload Link (Torrent)  (~3.2 GB) [Updated link o latest Kali Version]
  2. VirtualBox: Download Link (~200 MB)
  3. CPU that supports Virtualization.
  4. Atleast 8GB of free disk space
  5. 7-zip: Download Link (~1.4 MB) [ Note: Winrar is another alternative you could use instead of 7-zip.]
  6. Virtual Box Extension Pack: Download Link (~22 MB) [Optional]

Installation Procedure:

The first thing you need to do is go ahead download and install Virtualbox in your system. Then download the Kali Linux ova file mentioned above and extract it using 7-zip or Winrar. The extracted file would be a .ova file format which is a pre-installed Kali Linux machine. Using a pre-installed file saves us a lot of time as we don’t have to go through the whole installation process.

Now, open VirtualBox:

open virtualbox

Then click on “File” and then click on “Import Appliance“.

click file import appliance

Click on the folder icon as shown below.

import ova file window

Now, browse to and select the extract .ova Kali Linux image file and click on “Open“.

select kali linux ova file

You would now see a window called “Appliance settings” where you can configure stuff like the name of your VM, the amount of RAM to be allocated to your Kali Linux VM etc.

kali linux appliance settings

If you want to change the name of the VM, simply click on the text and you can change it according to your will.

changing vm name

Finally, click on “Import” and wait for a few moments to import the Kali Linux Appliance.

click import to load kali linux appliance

importing kali linux appliance progress bar

Now, right click on your Kali Linux Virtual machine as shown below and click on “Settings“.

open kali linux virtual machine Settings

If you need to adjust the amount of RAM, click on “System” and you can move the slider accordingly. I would suggest atleast a minimum of 2048 MB (2GB) of RAM.

select ram for your Kali Linux VM

Now, click on “Network” as shown below and select “Bridged Adapter” and then click on “OK“.

Select Kali Linux network mode to Bridged Adapter

Click on your Kali Linux VM and then click on Start as shown below.

start kali linux in virtualbox

You should now be able to see the grub menu. Hit “Enter” in your keyboard.

kali linux grub menu

Now, login to your Kali Linux machine with the default username as root and password toor.

Note: If you are using newer Kali versions (from year 2020 ), the username and password is “kali”.

Ref: https://www.kali.org/docs/introduction/default-credentials/

kali username

kali password

You should now be booted into your Kali Linux desktop.

kali linux logged in

Customize Kali (Optional): 

I would like to make some minor changes to make sure the VM is not interrupted during pen testing. This section is purely optional, you can skip to the next section if you don’t want to customize it.

Click on the triangle pointing downwards in the upper right corner and then click on the “Settings” icon.

Kali Linux drop down menu

This will bring you the “All Settings” window as shown below. Click on “Date & Time“.

all settings menu

You can change the time zone to your time zone.

change time zone

Now, go back to the “All Settings” window and then click on “Privacy“.

select privacy in all setting menu

You would see a screen similar to the one below:

default privacy settings

Now, disable “Automatic Screen Lock” by moving the slider.

disable auto screen lock

Go back to “All Settings“, then click on “Power“.

click on power in all settings

Now, select Blank Screen option as “Never” and turn off  “Automatic Suspend” as shown below.

disable blank screen and automatic suspend

Update Kali Linux:

Open the terminal window by clicking on the icon as shown below:

open terminal

This is what the terminal window would look like in a Kali Linux system.

Kali Linux Terminal

Enter the following commands in the terminal to update your Kali Linux system.

apt-get clean && apt-get update -y
apt-get upgrade -y && apt-get dist-upgrade -y

This may take a while depending on your internet connection for the update to complete.

And that is it for setting up Kali Linux in virtualbox to get started with pentesting (only for ethical hacking and for purely educational purposes).

If you have any sort of queries regarding this installation, just leave a comment and will get back to you. I will be posting some ethical hacking tutorials in the future, so stay tuned.

WordPress 4.5 released! Here’s whats new

WordPress 4.5 has been released and some of the new features.

Logo Support in Theme Customizer:

With wordpress 4.5, you can now see how the theme will look in a PC, tablet and mobile within the theme customizer itself. I have added a screenshot of how to check the different modes below.

wordpress 4.5 desktop, tablet and mobile mode selection

I have added some screenshots of theme customizer in different modes below.

WordPress customizer in Desktop Mode:

wordpress 4.5 customizer displaying theme in desktop mode

WordPress customizer in Tablet Mode:

wordpress 4.5 customizer displaying theme in tablet mode

WordPress customizer in Mobile Mode:

wordpress 4.5 customizer displaying theme in mobile mode

Theme Logo upload feature:

You can upload a theme logo and add it using customizer itself. You can find in under the “Site Identity” section. [Note: Not all themes will have this capability. If your theme supports it, you will be able to use this feature. The theme ‘twenty sixteen’ wordpress theme supports adding theme logo, do check it out.]

wordpress 4.5 site logo upload option

New Visual Editor features:

Now, you can easily link to your previous articles by using the searching while you are in the visual editor page. To use this feature, click on the ‘Insert/Edit link‘ button then start typing to search for your previously published articles. Finally click on the desired article and it would be linked. Now that a sweet feature. I love it! What do think?

add link

Other Inline Text Shortcuts:

There are a few new shortcuts added with the new wordpress update. You can either choose to use them or disable shortcuts completely. According to the wordpress website, some of the shortcuts include:

— transforms to <hr />

Use `your code` to transform <code>my code</code>

Optimized Images:

WordPress 4.5 can now optimize images and reduce image size by almost 50% without reducing quality.  Personally, I use http://tinypng.com to optimize my images before uploading to wordpress to get the best possible results while preserving the original quality.

Comment Refinement:

In the new comment moderation for wordpress include several bug fixes and new features. Comment content will now be formatted for display instead of a block of escaped text. Other improvements for comment moderation include updated message styles.

There are also limits specified for the comment fields such as a comment can have a max 65525 characters. Similarly, name can be max up to 254 characters, email of 100 characters and URL of 200 characters.

Security during Installation:

Now wordpress 4.5 installations will generate keys and salts locally rather than using the wordpress.org API.

New Developer Features:

Selective Refresh:

This feature allows only specific portions to be refreshed rather than the whole page in the customizer. This makes live previews a whole lot faster.

Script Loader:

With wordpress 4.5, you can now add inline scripts using the wp_add_inline_script() function. Also according to wordress changelog, support for scripts with depenedincies in different groups have been added.

To see the entire list of change, bug fixes, features and other improvements you can visit wordpress blog post mentioned in the source down below.

If you liked this article, please share this article. Do like us on Facebook and follow us on Twitter to show your support. Feel free to leave a comment down below. Happy Blogging! Cheers!

Source: WordPressJoe McGill (WordPress)