<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>tutorial Archives - Tech Antidote</title>
	<atom:link href="https://techantidote.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>‎ &#124; LINUX &#124; Tech &#124; Security &#124;</description>
	<lastBuildDate>Tue, 29 Oct 2024 22:48:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://techantidote.com/wp-content/uploads/2016/02/cropped-google-plus-profile-picture-32x32.png</url>
	<title>tutorial Archives - Tech Antidote</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">106369530</site>	<item>
		<title>Setup Wireguard VPN Server and Client in Ubuntu 20.04</title>
		<link>https://techantidote.com/wireguard-vpn-server-setup-ubuntu/</link>
					<comments>https://techantidote.com/wireguard-vpn-server-setup-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Fri, 01 Jul 2022 20:12:46 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux / Ubuntu]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[mint]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ubuntu 20.04]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[wireguard]]></category>
		<guid isPermaLink="false">https://techantidote.com/?p=3599</guid>

					<description><![CDATA[<p>This a guide on how to setup Wireguard VPN on Ubuntu and setting up a Wireguard client. Requirements: 1. Ubuntu Server 20.04 used in my lab. (20.04 or higher is required for Policy routing) 2. Ubuntu Client (Ubuntu 20.04) 3. Root access to the server. 4. Network Access Note: This should also work on Linux &#8230; <a href="https://techantidote.com/wireguard-vpn-server-setup-ubuntu/" class="more-link">Continue reading <span class="screen-reader-text">Setup Wireguard VPN Server and Client in Ubuntu 20.04</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://techantidote.com/wireguard-vpn-server-setup-ubuntu/">Setup Wireguard VPN Server and Client in Ubuntu 20.04</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This a guide on how to setup Wireguard VPN on Ubuntu and setting up a Wireguard client.</p>
<p><span style="color: #3366ff;"><strong>Requirements:</strong></span></p>
<p>1. Ubuntu Server 20.04 used in my lab. (20.04 or higher is required for Policy routing)</p>
<p>2. Ubuntu Client (Ubuntu 20.04)</p>
<p>3. Root access to the server.</p>
<p>4. Network Access</p>
<p><strong>Note:</strong> This should also work on Linux Mint 20.04</p>
<h3><span style="color: #3366ff;">Setting up the Wireguard Server</span></h3>
<p>Login to the In my lab, I have set up a EC2 instance and below is the current IP configuration before setting up Wireguard.</p>
<pre>root@ip-172-31-20-229:~# <strong>ip a
</strong>1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: <strong>eth0</strong>: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 9001 qdisc fq_codel state UP group default qlen 1000
    link/ether 02:ca:92:5f:0e:80 brd ff:ff:ff:ff:ff:ff
    inet <strong>172.31.20.229/20</strong> brd 172.31.31.255 scope global dynamic eth0
       valid_lft 2617sec preferred_lft 2617sec
    inet6 fe80::ca:92ff:fe5f:e80/64 scope link 
       valid_lft forever preferred_lft forever
</pre>
<p>From above, I have a single interface with IP 172.31.20.229 assigned to eth0.</p>
<pre><strong>sudo apt update &amp;&amp; sudo apt upgrade -y
sudo apt install wireguard -y
</strong></pre>
<p>-Switch to root and run the following:</p>
<p><strong> sudo su &#8211; </strong></p>
<p>Below are the default permissions on the wireguard dir:</p>
<pre>root@ip-172-31-20-229:~# <strong>ls -l /etc/ | grep wireguard
</strong>drwx------ 2 root root       4096 Aug  4  2020 wireguard
</pre>
<p>-You could set permissions to the directory as follows:</p>
<pre><strong>chmod 0700 /etc/wireguard/</strong>
root@ip-172-31-20-229:~# <strong>ls -l /etc/ | grep wireguard
drwx------</strong> 2 root root       4096 Aug  4  2020 wireguard
</pre>
<p>To check the version of Wireguard installed:</p>
<pre>root@ip-172-31-20-229:/etc/wireguard# <strong>wg --version
</strong>wireguard-tools v1.0.20200513 - https://git.zx2c4.com/wireguard-tools/
</pre>
<p>-Generate public and private key pairs:</p>
<pre><strong>cd /etc/wireguard/
umask 077; wg genkey | tee privatekey | wg pubkey &gt; publickey
</strong></pre>
<p>This should generate the private and the public key:</p>
<pre>root@ip-172-31-20-229:/etc/wireguard# <strong>ls -l
</strong>total 8
-rw------- 1 root root 45 Jun 30 20:23 <strong>privatekey</strong>
-rw------- 1 root root 45 Jun 30 20:23 publickey
</pre>
<p>-Take a note of the private key &#8220;<strong>privatekey</strong>&#8221; <strong>cat privatekey</strong> . You will need to add this to the WG server&#8217;s conf file.</p>
<p><strong>Setting up the Wireguard Server&#8217;s configuration file</strong></p>
<pre><strong>vim /etc/wireguard/wg0.conf</strong></pre>
<p>Add below content. (Here, I chose the IP as <strong>192.168.6.1</strong> which is the new VPN private address that will be assigned to the interface)</p>
<pre><em>[Interface]
## My VPN server private IP address ##
Address = <strong>192.168.6.1
</strong> 
## My VPN server port ##
ListenPort = 41194
 
## VPN server's private key i.e. string from /etc/wireguard/privatekey ##
PrivateKey = <strong>ADD_PRIVATE_KEY_HERE
</strong></em></pre>
<p>-Allow the port in the Server&#8217;s Firewall:</p>
<pre>root@ip-172-31-20-229:~# <strong>sudo ufw allow 41194/udp</strong>
Rules updated
Rules updated (v6)
</pre>
<p>-To check the status:</p>
<pre><strong>sudo ufw status
</strong></pre>
<p>&#8211; Enable wireguard service on boot on the server and start the service:</p>
<pre>ubuntu@ip-172-31-20-229:~$ <strong>sudo systemctl enable wg-quick@wg0</strong>
Created symlink /etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service → /lib/systemd/system/wg-quick@.service.

ubuntu@ip-172-31-20-229:~$ <strong>sudo systemctl start wg-quick@wg0
</strong></pre>
<p>To check the status of the wireguard service, use the following:</p>
<pre>root@ip-172-31-20-229:~# <strong>sudo systemctl status wg-quick@wg0
</strong>● wg-quick@wg0.service - WireGuard via wg-quick(8) for wg0
     Loaded: <strong>loaded</strong> (/lib/systemd/system/wg-quick@.service; enabled; vendor preset: enabled)
     Active: <strong>active</strong> (exited) since Thu 2022-06-30 21:29:01 UTC; 8min ago
       Docs: man:wg-quick(8)
             man:wg(8)
             https://www.wireguard.com/
             https://www.wireguard.com/quickstart/
             https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
             https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
    Process: 2230 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=0/SUCCESS)
   Main PID: 2230 (code=exited, status=0/SUCCESS)

Jun 30 21:29:01 ip-172-31-20-229 systemd[1]: wg-quick@wg0.service: Succeeded.
Jun 30 21:29:01 ip-172-31-20-229 systemd[1]: Stopped WireGuard via wg-quick(8) for wg0.
Jun 30 21:29:01 ip-172-31-20-229 systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
Jun 30 21:29:01 ip-172-31-20-229 wg-quick[2230]: [#] <strong>ip link add wg0 type wireguard</strong>
Jun 30 21:29:01 ip-172-31-20-229 wg-quick[2230]: [#] wg setconf wg0 /dev/fd/63
Jun 30 21:29:01 ip-172-31-20-229 wg-quick[2230]: [#] <strong>ip -4 address add 192.168.6.1/24 dev wg0</strong>
Jun 30 21:29:01 ip-172-31-20-229 wg-quick[2230]: [#] ip link set mtu 8921 up dev wg0
Jun 30 21:29:01 ip-172-31-20-229 systemd[1]: Finished WireGuard via wg-quick(8) for wg0.
</pre>
<p>Checking the ifconfig output, you would see a <strong>new interface</strong> <strong>wg0 </strong>is created automatically which is expected.</p>
<pre>root@ip-172-31-20-229:~# <strong>ip a
</strong>1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: <strong>eth0</strong>: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 9001 qdisc fq_codel state UP group default qlen 1000
    link/ether 02:ca:92:5f:0e:80 brd ff:ff:ff:ff:ff:ff
    inet <strong>172.31.20.229/20</strong> brd 172.31.31.255 scope global dynamic eth0
       valid_lft 2235sec preferred_lft 2235sec
    inet6 fe80::ca:92ff:fe5f:e80/64 scope link 
       valid_lft forever preferred_lft forever
5: <strong>wg0</strong>: &lt;POINTOPOINT,NOARP,UP,LOWER_UP&gt; mtu 8921 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none 
    inet <strong>192.168.6.1/24</strong> scope global wg0
       valid_lft forever preferred_lft forever

</pre>
<p>&#8211; You can check wireguard information/stats using the below command:</p>
<pre>ubuntu@ip-172-31-20-229:~$ <strong>sudo wg
interface</strong>: <strong>wg0</strong>
  public key: pHrkGojLiNZy2GwshmdEXMaaOmowXXXXXXXXXXXXXXX=
  private key: (hidden)
  listening port: 41194
</pre>
<h3><span style="color: #3366ff;"><strong>Configuring the VPN Client</strong></span></h3>
<ul>
<li>Login to the client and install Wireguard.</li>
</ul>
<pre><strong>sudo apt install wireguard -y
</strong></pre>
<p>&#8211; Create the configuration file</p>
<pre>root@wg-client:~# <strong>sudo sh -c 'umask 077; touch /etc/wireguard/wg0.conf'
</strong>
root@wg-client:~# <strong>ls -l /etc/wireguard/wg0.conf 
</strong>-rw------- 1 root root 0 Jun 30 20:58 /etc/wireguard/wg0.conf</pre>
<ul>
<li><strong>Create a key pair in the client</strong></li>
</ul>
<p>&#8211; In the client machine, create a key pair:</p>
<pre>root@wg-client:~# <strong>cd /etc/wireguard/
</strong>
root@wg-client:/etc/wireguard# <strong>umask 077; wg genkey | tee privatekey | wg pubkey &gt; publickey
</strong>
root@wg-client:/etc/wireguard# <strong>ls -l 
</strong>total 8
-rw------- 1 root root 45 Jun 30 21:01 privatekey
-rw------- 1 root root 45 Jun 30 21:01 publickey
-rw------- 1 root root  0 Jun 30 20:58 wg0.conf
root@wg-client:/etc/wireguard# 
</pre>
<p>&#8211; Take a note of the client&#8217;s public key. (This will be added in the server&#8217;s config later)</p>
<p>-Take a note of the private key from the client. This will be added in its own config file.</p>
<pre><strong>cat privatekey</strong></pre>
<ul>
<li><strong>Edit config</strong></li>
</ul>
<blockquote><p><strong>vim /etc/wireguard/wg0.conf</strong></p></blockquote>
<p>&#8211; On the client, create the wireguard config file as below:</p>
<pre>[Interface]
## Add the client's private key which is from /etc/wireguard/publickey ##
PrivateKey = <strong>CLIENT_PRIVATE_KEY_HERE</strong>
 
## Client ip address that will be set by this Client ##
Address = <strong>192.168.6.2/24
</strong>  
[Peer]
## Ubuntu 20.04 server public key ##
PublicKey = <strong>SERVER_PUBLIC_KEY_HERE</strong>
 
## set ACL ##
AllowedIPs = 192.168.2.0/24
  
## Your Ubuntu 20.04 LTS server's public IPv4/IPv6 address and port ##
Endpoint = <strong>PUBLIC_IP_OF_YOUR_WIREGUARD_SERVER</strong>:41194
   
##  Key connection alive ##
PersistentKeepalive = 15

</pre>
<p>-On the client, enable and start the Wireguard service:</p>
<pre>root@wg-client:/etc/wireguard# <strong>sudo systemctl enable wg-quick@wg0
</strong>Created symlink /etc/systemd/system/multi-user.target.wants/wg-quick@wg0.service -&gt; /lib/systemd/system/wg-quick@.service.

root@wg-client:/etc/wireguard# <strong>sudo systemctl start wg-quick@wg0
</strong></pre>
<p>&#8211; Check the status of the service in the client:</p>
<pre>root@wg-client:~# <strong>sudo systemctl status wg-quick@wg0
</strong>* wg-quick@wg0.service - WireGuard via wg-quick(8) for wg0
     Loaded: <strong>loaded</strong> (/lib/systemd/system/wg-quick@.service; enabled; vendor preset: enabled)
     Active: <strong>active</strong> (exited) since Thu 2022-06-30 21:35:17 UTC; 5min ago
       Docs: man:wg-quick(8)
             man:wg(8)
             https://www.wireguard.com/
             https://www.wireguard.com/quickstart/
             https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
             https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
    Process: 123 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=0/SUCCESS)
   Main PID: 123 (code=exited, status=0/SUCCESS)
        CPU: 28ms

Jun 30 21:35:17 wg-client systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
Jun 30 21:35:17 wg-client wg-quick[123]: [#] <strong>ip link add wg0 type wireguard
</strong>Jun 30 21:35:17 wg-client wg-quick[123]: [#] wg setconf wg0 /dev/fd/63
Jun 30 21:35:17 wg-client wg-quick[123]: [#] <strong>ip -4 address add 192.168.6.2/24 dev wg0
</strong>Jun 30 21:35:17 wg-client wg-quick[123]: [#] ip link set mtu 1420 up dev wg0
Jun 30 21:35:17 wg-client systemd[1]: Finished WireGuard via wg-quick(8) for wg0.
</pre>
<p>-From the above output, we can see that the <strong>wireguard</strong> service has <strong>created</strong> the <strong>interface</strong> <strong>wg0</strong> and assigned the IP <strong>192.168.6.2/24</strong> to it. You could also verify this by checking by checking the device ip conf as below:</p>
<pre>root@wg-client:~# <strong>ip a
</strong>1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0@if114: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether aa:3c:37:57:21:8a brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.168.1.143/24 brd 192.168.1.255 scope global dynamic eth0
       valid_lft 86010sec preferred_lft 86010sec
    inet6 fe80::a83c:37ff:fe57:218a/64 scope link 
       valid_lft forever preferred_lft forever
3: <strong>wg0</strong>: &lt;POINTOPOINT,NOARP,UP,LOWER_UP&gt; mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none 
    inet <strong>192.168.6.2/24</strong> scope global wg0
       valid_lft forever preferred_lft forever
</pre>
<p>So far, we can configured the client to talk to the server. But the Server does not know about the client. So, next we need to update the Server&#8217;s Wireguard configuration file with the details of the wireguard client.</p>
<p>-Login to the Wireguard Server and add the below block to the server&#8217;s wireguard conf:</p>
<pre>[Peer]
## Desktop/client VPN public key ##
PublicKey = <strong>CLIENT_PUB_KEY_HERE</strong>

## client VPN IP address (note  the /32 subnet) ##
AllowedIPs = <strong>192.168.6.2/32
</strong></pre>
<p>-So, your Wireguard server&#8217;s configuration file will be as follows:</p>
<pre>[Interface]
## My VPN server private IP address ##
Address = <strong>192.168.6.1
</strong> 
## My VPN server port ##
ListenPort = 41194
 
## VPN server's private key i.e. /etc/wireguard/privatekey ##
PrivateKey = <strong>ADD_PRIVATE_KEY_HERE</strong>

[Peer]
## Desktop/client VPN public key ##
PublicKey = <strong>CLIENT_PUB_KEY_HERE</strong>

## client VPN IP address (note  the /32 subnet) ##
AllowedIPs = <strong>192.168.6.2/32
</strong></pre>
<p>&#8211; Start the service again on the server:</p>
<pre><strong>sudo systemctl start wg-quick@wg0
</strong></pre>
<p><span style="color: #3366ff;"><strong>Verify connectivity from the client =&gt; server:</strong></span></p>
<p>&#8211; If the server is in the cloud, then update the security groups tallow the port.</p>
<p>&#8211; From the client, ping the server 192.168.6.1</p>
<pre>root@wg-client:~# <strong>ping 192.168.6.1
</strong>PING 192.168.6.1 (192.168.6.1) 56(84) bytes of data.
64 bytes from 192.168.6.1: icmp_seq=1 ttl=64 time=81.9 ms
64 bytes from 192.168.6.1: icmp_seq=2 ttl=64 time=82.5 ms
^C
--- 192.168.6.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 81.886/82.172/82.458/0.286 ms
</pre>
<p><strong>Checking active connections from Wireguard server:</strong></p>
<p>&#8211; To see which clients are connected to the server and the statistics, you can run the below:</p>
<pre>root@ip-172-31-20-229:~# <strong>sudo wg
</strong>interface: wg0
  public key: pHrkGojLiNZy2GwshmdEXMaaOmowXXXXXXXXXXXXXXX=
  private key: (hidden)
  listening port: 41194

<strong>peer</strong>: 8Zp7Cji5Aseew3L0P3c35sUzJNIPYYYYYYYYYYYYYYY=
  endpoint: <strong>1.2.3.4</strong>:33395
  allowed ips: 192.168.6.2/32
  latest handshake: 1 minute, 12 seconds ago
  transfer: 3.94 KiB received, 1.47 KiB sent
</pre>
<p><span style="color: #3366ff;"><strong>Additional Information:</strong></span></p>
<p>For debugging issue with wireguard, you could check the logs:</p>
<pre><strong>sudo journalctl -eu wg-quick@wg0</strong></pre>
<p>Here is a little cronjob to monitor the tunnel via ping and restart tunnel: (Credits to linuxbabe)</p>
<pre><strong>sudo crontab -e</strong></pre>
<p>-Add the below:</p>
<pre>SHELL=/bin/bash
* * * * * for ((i=1; i&lt;=6; i++)) do (ping -c9 192.168.6.1 &gt; /dev/null || systemctl restart wg-quick@wg0) done
</pre>
<p>Hope this helps! Cheers!</p>
<p><strong>Sources/References:</strong></p>
<p>https://www.cyberciti.biz/faq/ubuntu-20-04-set-up-wireguard-vpn-server/</p>
<blockquote class="wp-embedded-content" data-secret="32BYiyMmZq"><p><a href="https://www.linuxbabe.com/ubuntu/wireguard-vpn-server-ubuntu">Set Up Your Own WireGuard VPN Server on Ubuntu 24.04/22.04</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Set Up Your Own WireGuard VPN Server on Ubuntu 24.04/22.04&#8221; &#8212; LinuxBabe" src="https://www.linuxbabe.com/ubuntu/wireguard-vpn-server-ubuntu/embed#?secret=fha41Gk5Ja#?secret=32BYiyMmZq" data-secret="32BYiyMmZq" width="474" height="267" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>The post <a href="https://techantidote.com/wireguard-vpn-server-setup-ubuntu/">Setup Wireguard VPN Server and Client in Ubuntu 20.04</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techantidote.com/wireguard-vpn-server-setup-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3599</post-id>	</item>
		<item>
		<title>Hexadecimal basics using basic Linux utilities</title>
		<link>https://techantidote.com/hexadecimal-basics-using-basic-linux-utilities/</link>
					<comments>https://techantidote.com/hexadecimal-basics-using-basic-linux-utilities/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sat, 21 Aug 2021 20:29:30 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[hex]]></category>
		<category><![CDATA[hexadecimal]]></category>
		<category><![CDATA[reverse engineering]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xxd]]></category>
		<guid isPermaLink="false">https://techantidote.com/?p=3529</guid>

					<description><![CDATA[<p>A beginner friendly guide to hexadecimal in Linux using xxd and printf.</p>
<p>The post <a href="https://techantidote.com/hexadecimal-basics-using-basic-linux-utilities/">Hexadecimal basics using basic Linux utilities</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">This is short guide on how to convert strings  and decimal values to hexadecimal and vice-versa using simple Linux utilities such as xxd and printf.</p>



<ol class="wp-block-list"><li><strong>To convert a string to hexadecimal, you can use xxd in Linux.</strong></li></ol>



<p class="wp-block-paragraph">For example: To convert a string &#8220;<strong>kali</strong>&#8221; to hexadecimal, you can use the below format. </p>



<pre class="wp-block-preformatted">extr3me@op3n:~$ <strong><span style="color: #ff0000;">echo -n kali | xxd</span></strong>
00000000: <span style="color: #ff0000;">6b61 6c69</span> kali
</pre>



<p class="wp-block-paragraph">To group and display the output a single character at a time, use -c&nbsp; flag with argument 1.</p>



<pre class="wp-block-preformatted">extr3me@op3n:~$ <span style="color: #ff0000;"><strong>echo -n kali | xxd -c1</strong>
</span>00000000: <span style="color: #ff0000;">6b</span> k
00000001: <span style="color: #ff0000;">61</span> a
00000002: <span style="color: #ff0000;">6c</span> l
00000003: <span style="color: #ff0000;">69</span> i
</pre>



<p class="wp-block-paragraph">This means the following:</p>



<pre class="wp-block-preformatted">00000000: <strong>6b k</strong>&nbsp;&lt;- <strong>k</strong> is a single character and its <strong>hexadecimal value is</strong> <strong>6b</strong>
00000001: <strong>61 a</strong> &lt;- <strong>a</strong> is a single character and its <strong>hexadecimal value is 61</strong>
00000002: <strong>6c l</strong> &lt;- <strong>l</strong> is a single character and its <strong>hexadecimal value is 6c</strong>
00000003: <strong>69 i</strong> &lt;- <strong>i</strong> is a single character and its <strong>hexadecimal value is 69</strong>
</pre>



<p class="wp-block-paragraph">2.<strong> Convert Hexadecimal value back to string:</strong></p>



<pre class="wp-block-preformatted">extr3me@op3n:~$ <span style="color: #ff0000;">echo -n "6b61 6c69" | xxd -r -p
kali
</span></pre>



<p class="wp-block-paragraph">Dont worry about the spaces, it should still work.</p>



<pre class="wp-block-preformatted">extr3me@op3n:~$<span style="color: #ff0000;"> echo -n "6b616c69" | xxd -r -p
kali</span>extr3me@op3n:~$</pre>



<p class="wp-block-paragraph">3. <strong>Convert decimal (number) to hexadecimal</strong></p>



<p class="wp-block-paragraph">-Lets say you want to convert number 12 to decimal value. To do so, you could use <strong>printf</strong> as shown below.</p>



<pre class="wp-block-preformatted">extr3me@op3n:~$ <span style="color: #ff0000;">printf "%x\n" 12
c
</span></pre>



<p class="wp-block-paragraph">From above output, the hexadecimal value for number <strong>12</strong> (aka decimal 12) is character <strong>c</strong>.</p>



<p class="has-text-align-justify wp-block-paragraph"><strong>To find hexadecimal values for values from 1 to 255, you could run through it in a loop </strong></p>



<pre class="wp-block-code"><code>for num in {1..255}; do printf "%x\n" $num ; done | less</code></pre>



<p class="wp-block-paragraph">Hope these help. </p>



<p class="wp-block-paragraph">PS: Knowing hexadecimal does come in handy while learning/debugging different protocols.</p>
<p>The post <a href="https://techantidote.com/hexadecimal-basics-using-basic-linux-utilities/">Hexadecimal basics using basic Linux utilities</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techantidote.com/hexadecimal-basics-using-basic-linux-utilities/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3529</post-id>	</item>
		<item>
		<title>GDB basics with C</title>
		<link>https://techantidote.com/gdb-basics-with-c/</link>
					<comments>https://techantidote.com/gdb-basics-with-c/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sun, 01 Nov 2020 23:35:11 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[reverse engineering]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">https://techantidote.com/?p=3391</guid>

					<description><![CDATA[<p>This is a beginner level tutorial on learning basics of debugging using GDB by debugging an executable. This post will cover writing a very simple C code, compiling it and then opening the generated executable in GDB for inspecting the working/debugging. The primary objective here is to get familiar with the basics of using GDB. &#8230; <a href="https://techantidote.com/gdb-basics-with-c/" class="more-link">Continue reading <span class="screen-reader-text">GDB basics with C</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://techantidote.com/gdb-basics-with-c/">GDB basics with C</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a beginner level tutorial on learning basics of debugging using GDB by debugging an executable. This post will cover writing a very simple C code, compiling it and then opening the generated executable in GDB for inspecting the working/debugging. The primary objective here is to get familiar with the basics of using GDB.</p>
<p><span style="color: #3366ff;"><strong>Requirements:</strong></span></p>
<ol>
<li>Any Linux x64 OS. (Linux Mint 20 used in this tutorial)</li>
<li>C compiler &#8211; gcc</li>
<li>gdb &#8211; for debugging / reverse engineering.</li>
<li>GDB Dashboard (Optional &#8211; Makes GDB easier to read)</li>
</ol>
<p>[Disclaimer: This is blog post adapted from recurse&#8217;s original gdb tutorial.(All Credits/References added in the Credits section)]</p>
<p><span style="color: #3366ff;"><strong>Setting up the Environment:</strong></span></p>
<ul>
<li>Install the following tools to setup the basic environment:</li>
</ul>
<p><span style="color: #993366;"><strong>sudo apt install vim gcc gdb git python3 python3-pip -y</strong></span></p>
<p><span style="color: #3366ff;"><strong>GDB Dashboard:</strong></span></p>
<ul>
<li>To make GDB easier to understand and make it non-alien, use <strong>GDB Dashboard</strong> which is a really good python plugin  for GDB.  Its epic!</li>
<li>Run the following to get the gdbinit dotfile.</li>
</ul>
<pre><span style="color: #993366;"><strong>wget -P ~ https://git.io/.gdbinit</strong></span></pre>
<p>If you would like to check out the source, you can find it  @ https://github.com/cyrus-and/gdb-dashboard</p>
<p>For syntax highlighting, you would need the pygments module. If you are using Python2.x:</p>
<p><span style="color: #ff0000;"><strong>pip install pygments</strong></span></p>
<p>If you are using Python3.x, then use pip3 to install it:</p>
<p><span style="color: #ff0000;"><strong>pip3 install pygments</strong></span></p>
<p>To run gdb without providing any executable, run &#8220;gdb&#8221; and you should see the something like below:</p>
<pre>extr3me@w4rl0ck:gdb$ <span style="color: #ff0000;"><strong>gdb</strong></span>
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
    &lt;http://www.gnu.org/software/gdb/documentation/&gt;.

For help, type "help".
Type "apropos word" to search for commands related to "word".
&gt;&gt;&gt; 
</pre>
<p>To exit out of gdb, type  &#8220;<strong>quit</strong>&#8221; .</p>
<p>-Below is a simple C program that initializes an integer value and then returns 0.</p>
<pre><strong><span style="color: #ff0000;">cat minimal.c</span>
int main()
{
int i = 1337;
return 0;
}
</strong></pre>
<p>-Compile the C code and make an executable, using the following flags:</p>
<pre><span style="color: #ff0000;"><strong>gcc -g minimal.c -o minimal</strong></span></pre>
<p>-The directory should now have a executable with filename <strong>minimal</strong>.</p>
<pre>extr3me@w4rl0ck:gdb$ <span style="color: #ff0000;"><strong>file minimal</strong></span>
minimal: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=c918c072d119be6a9d18991e812a5414ecae67e1, for GNU/Linux 3.2.0, with debug_info, not stripped
</pre>
<p><span style="color: #3366ff;"><strong>Debugging the binary using GDB:</strong></span></p>
<p>-To examine an executable in GDB, use the following format:</p>
<pre><span style="color: #ff0000;"><strong>gdb &lt;executable_file&gt;</strong></span></pre>
<p>-Here, I would run the following to open the executable for debugging:</p>
<p><span style="color: #ff0000;"><strong>gdb minimal</strong></span></p>
<p><img fetchpriority="high" decoding="async" data-attachment-id="3437" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-1/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-1.png" data-orig-size="700,328" data-comments-opened="1" data-image-title="gdb-1" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-1.png" class="alignnone wp-image-3437 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-1.png" alt="gdb minimal output" width="700" height="328" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-1.png 700w, https://techantidote.com/wp-content/uploads/2020/11/gdb-1-300x141.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Lets check the functions in this program, to do run &#8220;info functions&#8221;. You should be able to see that this executable has function main().</p>
<pre>&gt;&gt;&gt; <span style="color: #ff0000;"><strong>info functions</strong></span>
All defined functions:

File minimal.c:
<span style="color: #ff0000;"><strong>1: int main();</strong></span>

Non-debugging symbols:
0x0000000000001000 _init
0x0000000000001030 __cxa_finalize@plt
0x0000000000001040 _start
0x0000000000001070 deregister_tm_clones
0x00000000000010a0 register_tm_clones
0x00000000000010e0 __do_global_dtors_aux
0x0000000000001120 frame_dummy
0x0000000000001140 __libc_csu_init
0x00000000000011b0 __libc_csu_fini
0x00000000000011b8 _fini
</pre>
<pre>Here is a screenshot:
</pre>
<p><img decoding="async" data-attachment-id="3438" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-info-functions/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-info-functions.png" data-orig-size="818,636" data-comments-opened="1" data-image-title="gdb-info-functions" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-info-functions.png" class="alignnone wp-image-3438 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-info-functions.png" alt="gdb info functions output screenshot" width="818" height="636" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-info-functions.png 818w, https://techantidote.com/wp-content/uploads/2020/11/gdb-info-functions-300x233.png 300w, https://techantidote.com/wp-content/uploads/2020/11/gdb-info-functions-768x597.png 768w" sizes="(max-width: 818px) 100vw, 818px" /></p>
<p>The output also shows that the <em>line number</em> at which <em>main() function</em> is present in the source minimal.c.</p>
<p>From the <em>info functions</em> output, we can also see that function main() is present at <em>line number 1 </em>in source minimal.c<em>.</em></p>
<p><span style="color: #3366ff;"><strong>Breakpoints:</strong></span></p>
<p>-Lets say we need to examine what a executable is going at a given point of time or to inspect the value of a variable, then we can set one or more breakpoints and run the code upto that breakpoint. You can then examine the the value of a variable upto that breakpoint or directly examine the memory etc.</p>
<p><span style="color: #3366ff;"><strong>Breakpoints example: Setting breakpoints using function name</strong></span></p>
<p>From the previous section,we know that the executable has function main(). Lets start examining the binary using gdb to see the value of &#8220;i&#8221; at different stages of the execution. To start with,  set a breakpoint at function main using the syntax <em>break &lt;function_name&gt;</em>:</p>
<p>&gt;&gt;&gt; <span style="color: #ff0000;"><strong>break main</strong></span><br />
Breakpoint 1 at <span style="color: #ff9999;"><strong>0x1129</strong></span>: file minimal.c, line 2.<br />
&gt;&gt;&gt;</p>
<p>To get the list of breakpoints that were set, you can use &#8220;info breakpoints&#8221;.</p>
<p>&gt;&gt;&gt; <span style="color: #ff9999;"><strong>info breakpoints</strong></span><br />
Num Type Disp Enb Address What<br />
1 breakpoint keep y <span style="color: #ff9999;">0x0000000000001129</span> in main at <span style="color: #ff9999;">minimal.c:2</span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="3439" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-info-breakpoints/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-info-breakpoints.png" data-orig-size="602,417" data-comments-opened="1" data-image-title="gdb-info-breakpoints" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-info-breakpoints.png" class="alignnone wp-image-3439 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-info-breakpoints.png" alt="gdb info breakpoints" width="602" height="417" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-info-breakpoints.png 602w, https://techantidote.com/wp-content/uploads/2020/11/gdb-info-breakpoints-300x208.png 300w" sizes="auto, (max-width: 602px) 100vw, 602px" /></p>
<p>The above shows that there is one breakpoint which is set at function main() whose starting address in memory is &#8220;<strong>0x1129</strong>&#8221; or &#8220;<strong>0x0000000000001129</strong>&#8220;.</p>
<p><em><strong>Note</strong>:</em> You can have create multiple breakpoints and they are numbered.</p>
<p>So we have a breakpoint in place, we can run the binary upto the breakpoint that was set. To run the program, use &#8220;<span style="color: #e3abc7;">run&#8221;</span> or &#8220;<span style="color: #993366;">r</span>&#8220;.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="3440" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-run/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-run.png" data-orig-size="1268,474" data-comments-opened="1" data-image-title="gdb-run" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-run-1024x383.png" class="alignnone wp-image-3440 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-run.png" alt="gdb screenshot" width="1268" height="474" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-run.png 1268w, https://techantidote.com/wp-content/uploads/2020/11/gdb-run-300x112.png 300w, https://techantidote.com/wp-content/uploads/2020/11/gdb-run-1024x383.png 1024w, https://techantidote.com/wp-content/uploads/2020/11/gdb-run-768x287.png 768w" sizes="auto, (max-width: 1268px) 100vw, 1268px" /></p>
<p>This is what it looks like now. (You could now see the GDB dashboard with an insane amount of matrix looking stuff. :P)</p>
<p>[<strong>Note:</strong>  Right click the image and click on &#8220;View Image&#8221; / &#8220;Open image in new tab&#8221; if the image for better visibility. ]</p>
<p><img loading="lazy" decoding="async" data-attachment-id="3441" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-run-dashboard/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-run-dashboard.png" data-orig-size="1908,992" data-comments-opened="1" data-image-title="gdb-run-dashboard" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-run-dashboard-1024x532.png" class="alignnone wp-image-3441 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-run-dashboard.png" alt="GDB Dashboard screenshot" width="1908" height="992" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-run-dashboard.png 1908w, https://techantidote.com/wp-content/uploads/2020/11/gdb-run-dashboard-300x156.png 300w, https://techantidote.com/wp-content/uploads/2020/11/gdb-run-dashboard-1024x532.png 1024w, https://techantidote.com/wp-content/uploads/2020/11/gdb-run-dashboard-768x399.png 768w, https://techantidote.com/wp-content/uploads/2020/11/gdb-run-dashboard-1536x799.png 1536w" sizes="auto, (max-width: 1908px) 100vw, 1908px" /></p>
<p>For this tutorial, we are more interested in few sections of Dashboard as of now &#8211;   &#8220;Source&#8221; , &#8220;Threads&#8221;, &#8220;Variables&#8221; and &#8220;Assembly&#8221; sections.</p>
<p>-The &#8220;Source&#8221; section has a blip on the line number which shows where exactly in the code where gdb is looking into. So, here, it shows that its in line 2 of the source. After you ran the program, if you re-run &#8220;info breakpoints&#8221; you can see that the message &#8220;<em>breakpoint already hit 1 time</em>&#8220;.</p>
<blockquote><p>&gt;&gt; <span style="color: #ff9999;"><strong>info breakpoints</strong></span><br />
Num Type Disp Enb Address What<br />
1 breakpoint keep y <span style="color: #ff9999;"><strong>0x0000555555555129</strong></span> in main at minimal.c:2<br />
<span style="color: #ff0000;"><strong>breakpoint already hit 1 time</strong></span></p></blockquote>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" data-attachment-id="3442" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-after-run-info-breakpoints/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-after-run-info-breakpoints.png" data-orig-size="1909,899" data-comments-opened="1" data-image-title="gdb-after-run-info-breakpoints" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-after-run-info-breakpoints-1024x482.png" class="alignnone wp-image-3442 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-after-run-info-breakpoints.png" alt="" width="1909" height="899" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-after-run-info-breakpoints.png 1909w, https://techantidote.com/wp-content/uploads/2020/11/gdb-after-run-info-breakpoints-300x141.png 300w, https://techantidote.com/wp-content/uploads/2020/11/gdb-after-run-info-breakpoints-1024x482.png 1024w, https://techantidote.com/wp-content/uploads/2020/11/gdb-after-run-info-breakpoints-768x362.png 768w, https://techantidote.com/wp-content/uploads/2020/11/gdb-after-run-info-breakpoints-1536x723.png 1536w" sizes="auto, (max-width: 1909px) 100vw, 1909px" /></p>
<p>[<strong>Note:</strong>  Right click the image and click on &#8220;View Image&#8221; / &#8220;Open image in new tab&#8221; if the image for better visibility. ]</p>
<p>As of now, the debugger is in line 2 where the variable &#8220;i&#8221; is not yet yet initiated in the program. So, if you try to print the value of &#8220;i&#8221;, then it should show a value = 0.</p>
<p>To print value of a variable, use the format &#8220;<span style="color: #e3abc7;">print var</span>&#8221; or &#8220;<span style="color: #993366;">p var</span>&#8220;.</p>
<blockquote><p>&gt;&gt; <span style="color: #ff9999;"><strong>p i</strong></span><br />
$1 = <span style="color: #ff0000;">0</span></p></blockquote>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" data-attachment-id="3443" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-print-variable/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-print-variable.png" data-orig-size="1906,990" data-comments-opened="1" data-image-title="gdb-print-variable" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-print-variable-1024x532.png" class="alignnone wp-image-3443 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-print-variable.png" alt="print i output screenshot" width="1906" height="990" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-print-variable.png 1906w, https://techantidote.com/wp-content/uploads/2020/11/gdb-print-variable-300x156.png 300w, https://techantidote.com/wp-content/uploads/2020/11/gdb-print-variable-1024x532.png 1024w, https://techantidote.com/wp-content/uploads/2020/11/gdb-print-variable-768x399.png 768w, https://techantidote.com/wp-content/uploads/2020/11/gdb-print-variable-1536x798.png 1536w" sizes="auto, (max-width: 1906px) 100vw, 1906px" /></p>
<p>To go to the next line of code and execute it, use command &#8220;<span style="color: #e3abc7;"><strong>next</strong></span>&#8221; or &#8220;<span style="color: #e3abc7;"><strong>n</strong></span>&#8220;.  [Note: If the next line of code was a function, it would execute the full function). In this example, once we ran &#8220;<span style="color: #993366;">r</span>&#8220;, the &#8220;Source&#8221; section now highlights line number 3.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="3444" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-next-1/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-next-1.png" data-orig-size="1908,995" data-comments-opened="1" data-image-title="gdb-next-1" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-next-1-1024x534.png" class="alignnone wp-image-3444 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-next-1.png" alt="gdb print i screenshot 2" width="1908" height="995" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-next-1.png 1908w, https://techantidote.com/wp-content/uploads/2020/11/gdb-next-1-300x156.png 300w, https://techantidote.com/wp-content/uploads/2020/11/gdb-next-1-1024x534.png 1024w, https://techantidote.com/wp-content/uploads/2020/11/gdb-next-1-768x401.png 768w, https://techantidote.com/wp-content/uploads/2020/11/gdb-next-1-1536x801.png 1536w" sizes="auto, (max-width: 1908px) 100vw, 1908px" /></p>
<p>At this point, if you print variable &#8220;i&#8221;, it still shows value as &#8220;<span style="color: #e3abc7;">0</span>&#8221; as the initialization is not complete.</p>
<p>You can also check the &#8220;<em>Assembly</em>&#8221; section in the GDB Dashboard which shows the disassembled code. So, the highlighted section in green in the  &#8220;<em>Assembly</em>&#8221; shows the following:</p>
<p>0x0000555555555131 main+8 <span style="color: #ff0000;">movl $<strong>0x539</strong>,-0x4(%rbp)</span></p>
<p>This is the disassembled code (in AT&amp;T syntax) for &#8220;int i = 1337&#8221;. We will come back to reviewing the assembly code later.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="3445" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-run-3/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-run-3-e1604273604939.png" data-orig-size="658,271" data-comments-opened="1" data-image-title="gdb-run-3" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-run-3-e1604273494969-1024x258.png" class="alignnone wp-image-3445 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-run-3-e1604273604939.png" alt="" width="658" height="271" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-run-3-e1604273604939.png 658w, https://techantidote.com/wp-content/uploads/2020/11/gdb-run-3-e1604273604939-300x124.png 300w" sizes="auto, (max-width: 658px) 100vw, 658px" /></p>
<p>Run command &#8220;<span style="color: #993366;"><strong>n</strong></span>&#8221; again in gdb. Now, checking the &#8220;Source&#8221; section in GDB dashboard, should that we are now on <em>line 4</em>.</p>
<p>Now. check the value of  variable &#8220;i&#8221; using print.</p>
<p>&gt;&gt;&gt;<span style="color: #993366;"><strong> p i</strong></span><br />
$3 = <span style="color: #993366;"><strong>1337</strong></span></p>
<p>This shows that the value variable &#8220;i&#8221; is 1337.</p>
<pre>(gdb) <span style="color: #e3abc7;"><strong>print i</strong></span>
$2 = <span style="color: #993366;">1337</span></pre>
<p>Here is the screenshot for reference.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="3446" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-print-i-value-after-assign/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-print-i-value-after-assign.png" data-orig-size="1908,992" data-comments-opened="1" data-image-title="gdb-print-i-value-after-assign" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-print-i-value-after-assign-1024x532.png" class="alignnone wp-image-3446 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-print-i-value-after-assign.png" alt="GDB print i after initialized" width="1908" height="992" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-print-i-value-after-assign.png 1908w, https://techantidote.com/wp-content/uploads/2020/11/gdb-print-i-value-after-assign-300x156.png 300w, https://techantidote.com/wp-content/uploads/2020/11/gdb-print-i-value-after-assign-1024x532.png 1024w, https://techantidote.com/wp-content/uploads/2020/11/gdb-print-i-value-after-assign-768x399.png 768w, https://techantidote.com/wp-content/uploads/2020/11/gdb-print-i-value-after-assign-1536x799.png 1536w" sizes="auto, (max-width: 1908px) 100vw, 1908px" /></p>
<pre>To find the type of the variable and the starting memory address of that variable in memory:</pre>
<pre><span style="color: #ff9752;">&gt;&gt;&gt; <span style="color: #ff0000;">print &amp;i
</span>$4 = (<span style="color: #00ffff;">int</span> *) <span style="color: #e3abc7;"><strong>0x7fffffffdb8c</strong>
</span></span>
<img loading="lazy" decoding="async" data-attachment-id="3449" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-start-address-of-i/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-start-address-of-i.png" data-orig-size="1906,865" data-comments-opened="1" data-image-title="gdb-start-address-of-i" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-start-address-of-i-1024x465.png" class="alignnone wp-image-3449 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-start-address-of-i.png" alt="GDB print directly using variable address output" width="1906" height="865" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-start-address-of-i.png 1906w, https://techantidote.com/wp-content/uploads/2020/11/gdb-start-address-of-i-300x136.png 300w, https://techantidote.com/wp-content/uploads/2020/11/gdb-start-address-of-i-1024x465.png 1024w, https://techantidote.com/wp-content/uploads/2020/11/gdb-start-address-of-i-768x349.png 768w, https://techantidote.com/wp-content/uploads/2020/11/gdb-start-address-of-i-1536x697.png 1536w" sizes="auto, (max-width: 1906px) 100vw, 1906px" /></pre>
<p><span style="color: #ffffff;">-The above shows that &#8220;i&#8221; is of &#8220;<span style="color: #00ffff;">int</span>&#8221; type. Additionally, &#8220;i&#8221; is stored at memory location starting at address <span style="color: #993366;"><strong>0x7fffffffdb8c</strong></span></span></p>
<p>-To check maximum size of int type in memory using the sizeof() function.</p>
<pre>&gt;&gt;&gt; <span style="color: #ff0000;">p sizeof(int)</span>
$5 = <span style="color: #993366;">4</span>
</pre>
<p>The above output shows that int would occupy <span style="color: #ff0000;">4 bytes</span> of space in memory.</p>
<p>To examine memory using gdb use &#8220;<strong>x</strong>&#8220;.</p>
<p>-From above outputs, we know that variable &#8220;i&#8221; is stored in memory with starting address as <span style="color: #993366;"><strong>0x7fffffffdb8c</strong></span>. We also do know that i is of type <em>integer</em> and integer type would occupy a maximum of 4 bytes in memory.</p>
<p>To examine a specific memory address, you could use the following format</p>
<pre><strong><span style="color: #ff0000;">(gdb) x/FMT &lt;starting_memory_address&gt;</span> 
</strong></pre>
<p>Here is information from &#8220;help x&#8221; section:<command></command></p>
<pre>(gdb) <span style="color: #ff9999;"><strong>help x</strong></span>
<strong>Examine memory: <span style="color: #3366ff;">x/FMT ADDRESS</span>.</strong>
<span style="color: #8fabff;">ADDRESS</span> is an expression for the <span style="color: #8fabff;">memory address to examine</span>.
<span style="color: #8fabff;">FMT</span> is a <span style="color: #3366ff;"><strong>repeat count</strong></span> followed by a <span style="color: #3366ff;">format letter </span>and a<span style="color: #3366ff;"> size letter</span>.
<span style="color: #8fabff;">Format letters</span> are o(octal), <span style="color: #8fabff;"><strong>x(hex)</strong></span>, d(decimal), u(unsigned decimal),
t(binary), f(float), a(address), i(instruction), c(char), s(string)
and z(hex, zero padded on the left).
<span style="color: #8fabff;">Size letters</span> are <span style="color: #8fabff;">b(byte)</span>, h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format. If a negative number is specified, memory is
examined backward from the address.

Defaults for format and size letters are those previously used.
Default count is 1. Default address is following last thing printed
with this command or "print".
(gdb)</pre>
<p>Here, is an example, to examine data from memory location 0x7fffffffdb8c upto the next bytes (or 4 bytes above 0x7fffffffdb8c) ,  use the following:</p>
<pre>&gt;&gt;&gt; <span style="color: #e3abc7;"><span style="color: #ff0000;">x/4xb</span> <span style="color: #e3abc7;">0x7fffffffdb8c</span></span>
0x7fffffffdb8c: <span style="color: #993366;">0x39 0x05 0x00 0x00</span>
</pre>
<p>Alternatively, you can access provide the memory location directly by passing &#8220;<strong>&amp;i</strong>&#8221; i.e.  &#8220;<span style="color: #993366;"><strong>x/4xb &amp;i&#8221;</strong></span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="3447" data-permalink="https://techantidote.com/gdb-basics-with-c/gdb-examine-memory/" data-orig-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-examine-memory.png" data-orig-size="1910,994" data-comments-opened="1" data-image-title="gdb-examine-memory" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2020/11/gdb-examine-memory-1024x533.png" class="alignnone wp-image-3447 size-full" src="https://techantidote.com/wp-content/uploads/2020/11/gdb-examine-memory.png" alt="GDB examine memory location screenshot" width="1910" height="994" srcset="https://techantidote.com/wp-content/uploads/2020/11/gdb-examine-memory.png 1910w, https://techantidote.com/wp-content/uploads/2020/11/gdb-examine-memory-300x156.png 300w, https://techantidote.com/wp-content/uploads/2020/11/gdb-examine-memory-1024x533.png 1024w, https://techantidote.com/wp-content/uploads/2020/11/gdb-examine-memory-768x400.png 768w, https://techantidote.com/wp-content/uploads/2020/11/gdb-examine-memory-1536x799.png 1536w" sizes="auto, (max-width: 1910px) 100vw, 1910px" /></p>
<p>The above output shows raw byte by byte representation in memory. Here, <span style="color: #ff9999;">0x39</span> is one byte in memory and <span style="color: #ff9999;">0x05</span> is another byte etc.<br />
We also know that int would occupy 4 bytes in memory. Here, this integer takes only 2 bytes out of 4 bytes in memory.</p>
<p><strong>Important:</strong> This raw memory representation &#8220;<span style="color: #ff9999;">0x39 0x05 0x00 0x00</span>&#8221; is in &#8220;<strong>little-endian</strong>&#8221; format(the least significant bytes of a number come first in memory).<br />
So, you would need to read the hex bytes  &#8220;<span style="color: #ff9999;">0x39 0x05 0x00 0x00</span>&#8221; in reverse order. Hence, the value reversed <span style="color: #e3abc7;">0x00 0x00 0x05 0x39</span> is <span style="color: #ff00ff;"><strong>00000539</strong></span>.<br />
To get the actual value, we need to convert the hex value to decimal.</p>
<p>You could use trusty bash  to covert hex to decimal by using format &#8220;<span style="color: #993366;"><em><strong>echo $(( 16#$<span style="color: #ff00ff;">hexNum</span> ))</strong></em></span>&#8220;. Here is what it does look like:</p>
<pre>extr3me@w4rl0ck:~$ <span style="color: #993366;"><strong>echo $(( 16#<span style="color: #ff00ff;">00000539</span> ))</strong></span>
<span style="color: #ff0000;"><strong>1337
</strong></span></pre>
<p>So, &#8220;1337&#8221; is the decimal value stored in memory location 4 bytes starting from <span style="color: #993366;"><strong>0x7fffffffdb8c</strong></span>.</p>
<p>So, we now know the value of integer variable starting at memory location <span style="color: #993366;"><strong>0x7fffffffdb8c</strong></span> is <strong>1337</strong>. (i.e. the decimal value of i stored in memory is 1337).</p>
<p>An alternative is to use a online hex to decimal converter such as https://www.binaryhexconverter.com/hex-to-decimal-converter to covert 00000539 to decimal.</p>
<p>-You can also print the raw data using the variable itself by using the following format:</p>
<pre>(gdb) <span style="color: #ff0000;"><strong>x/4xb &amp;i</strong></span>

0x7fffffffdb5c: <span style="color: #ff0000;">0x39 0x05 0x00 0x00</span>
</pre>
<p><span style="color: #3366ff;"><strong>Other formats in GDB:</strong></span></p>
<p>-To print in decimal format, use <strong><em>x/1dw</em></strong>:</p>
<pre>(gdb)<span style="color: #ff9999;"><strong> x/1dw &amp;i</strong></span>
0x7fffffffdb7c: <span style="color: #ff0000;">1337
</span></pre>
<p>-Alternatively, give the memory location as well.</p>
<pre>(gdb) <span style="color: #ff9999;"><strong>x/1dw 0x7fffffffdb7c</strong></span>
0x7fffffffdb7c: <span style="color: #ff9999;">1337
</span></pre>
<p><span style="color: #8fabff;"><strong>Misc Information:</strong></span></p>
<p>To check the number of threads, run &#8220;<strong>info threads</strong>&#8220;.</p>
<pre>&gt;&gt;&gt; <span style="color: #ff0000;"><strong>info threads</strong></span>
Id Target Id Frame <span style="color: #ff9999;">
* 1 process 6570 "minimal" main () at minimal.c:4
&gt;&gt;&gt; 
</span></pre>
<p>This shows there is 1 thread with PID 6570.</p>
<p><strong>Other Interesting Stuff:</strong></p>
<p>Here is a screenshot of the dissembled code of &#8220;minimal&#8221; binary.</p>
<p>#gdb-assembly.png</p>
<p>The one that we are interested in for now is the instruction highlighted below:</p>
<pre>0x0000555555555129 main+0 endbr64
0x000055555555512d main+4 push %rbp
0x000055555555512e main+5 mov %rsp,%rbp
0x0000555555555131 main+8 <span style="color: #ff00ff;">movl $0x539,-0x4(%rbp)</span>
0x0000555555555138 main+15 mov $0x0,%eax
0x000055555555513d main+20 pop %rbp
0x000055555555513e main+21 retq
</pre>
<p>The instruction &#8220;<span style="color: #993366;"><strong>movl $0x539,-0x4(%rbp)</strong></span>&#8221; means =&gt; move the value &#8220;0x539&#8221; to the memory location of register rbp -4.</p>
<p><strong>Differences between AT&amp;T and Intel Syntax:</strong></p>
<p>By default, GDB defaults to displaying in AT&amp;T syntax. Here is what main function dissembled looks like in AT&amp;T syntax:</p>
<pre>extr3me@w4rl0ck:gdb$ <span style="color: #ff9999;"><strong>gdb minimal</strong></span>
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
&lt;http://www.gnu.org/software/gdb/documentation/&gt;.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from minimal...
&gt;&gt;&gt; <span style="color: #ff9999;"><strong>disass /m main</strong></span>
Dump of assembler code for function main:
2 {
0x0000000000001129 &lt;+0&gt;: endbr64
0x000000000000112d &lt;+4&gt;: push %rbp
0x000000000000112e &lt;+5&gt;: mov %rsp,%rbp

3 int i = 1337;
0x0000000000001131 &lt;+8&gt;: <span style="color: #ff0000;">movl $0x539,-0x4(%rbp)</span>

4 return 0;
0x0000000000001138 &lt;+15&gt;: mov $0x0,%eax

5 }
0x000000000000113d &lt;+20&gt;: pop %rbp
0x000000000000113e &lt;+21&gt;: retq

End of assembler dump.
&gt;&gt;&gt;
</pre>
<p>-If you don&#8217;t like this syntax, you can make GDB use Intel syntax using &#8220;<span style="color: #ff0000;">set disassembly-flavor intel</span>&#8220;.</p>
<p>Here, is an example of main function dissasembled in Intel syntax:</p>
<pre>extr3me@w4rl0ck:gdb$ <span style="color: #ff9999;"><strong>gdb minimal</strong></span>
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
&lt;http://www.gnu.org/software/gdb/documentation/&gt;.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from minimal...
&gt;&gt;&gt; <span style="color: #ff9999;"><strong>set disassembly-flavor intel</strong></span>
&gt;&gt;&gt; <span style="color: #ff9999;"><strong>disass /m main</strong></span>
Dump of assembler code for function main:
2 {
0x0000000000001129 &lt;+0&gt;: endbr64
0x000000000000112d &lt;+4&gt;: push rbp
0x000000000000112e &lt;+5&gt;: mov rbp,rsp

3 int i = 1337;
0x0000000000001131 &lt;+8&gt;: <span style="color: #ff0000;">mov DWORD PTR [rbp-0x4],0x539</span>

4 return 0;
0x0000000000001138 &lt;+15&gt;: mov eax,0x0

5 }
0x000000000000113d &lt;+20&gt;: pop rbp
0x000000000000113e &lt;+21&gt;: ret

End of assembler dump.
&gt;&gt;&gt;
</pre>
<p>Here, you should see subtle differences  such as the <span style="color: #e3abc7;">AT&amp;T syntax</span> displays &#8220;<span style="color: #e3abc7;">movl $0x539,-0x4(%rbp)</span>&#8221; while the same in <span style="color: #8fabff;">Intel syntax</span> is &#8220;<span style="color: #3366ff;">mov DWORD PTR [rbp-0x4],0x539</span>&#8220;.</p>
<p>Thats it for now. I will add more tutorials on GDB in the near future.</p>
<p><span style="color: #00ffff;"><strong>Happy Debugging!</strong></span></p>
<p><span style="color: #0000ff;"><strong>Sources/References/Credits:</strong></span></p>
<p>Below are all the credits/references/sources that made writing this blog post possible.</p>
<p>https://www.recurse.com/blog/5-learning-c-with-gdb &lt;- Credits to recurse. I used this as my primary resource to learn GDB and then post my understanding of GDB and C here. Do check them out.<br />
https://github.com/cyrus-and/gdb-dashboard &lt;- Creator of the Epic GDB dashboard<br />
https://www.tutorialspoint.com/gnu_debugger/ &lt;- Great place to start.<br />
https://sourceware.org/gdb/current/onlinedocs/gdb/Set-Breaks.html#Set-Breaks<br />
https://stackoverflow.com/questions/209534/how-to-highlight-and-color-gdb-output-during-interactive-debugging<br />
https://bob.cs.sonoma.edu/IntroCompOrg-RPi/sec-gdb1.html<br />
https://www.binaryhexconverter.com &lt;- Simple online convertor<br />
https://stackoverflow.com/questions/13280131/hexadecimal-to-decimal-in-shell-script<br />
https://www.ibm.com/developerworks/library/l-ia/index.html<br />
Credits to my m8 @bytesareana for decoding the stuff with the memory location.</p>
<p>The post <a href="https://techantidote.com/gdb-basics-with-c/">GDB basics with C</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techantidote.com/gdb-basics-with-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3391</post-id>	</item>
		<item>
		<title>How to display a file from one line number to another in Linux</title>
		<link>https://techantidote.com/how-to-display-a-file-from-one-line-number-to-another-in-linux/</link>
					<comments>https://techantidote.com/how-to-display-a-file-from-one-line-number-to-another-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sun, 22 May 2016 21:00:46 +0000</pubDate>
				<category><![CDATA[Linux / Redhat]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[line number to number]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[print from]]></category>
		<category><![CDATA[range of line numbers]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://techantidote.com/?p=2190</guid>

					<description><![CDATA[<p>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 &#60;filename&#62; &#124; awk 'NR &#62;=linenumber1 &#38;&#38; NR &#60;=linenumber2' To read and display a file along with the line numbers, you can use the following format:. cat -n &#60;filename&#62; &#8230; <a href="https://techantidote.com/how-to-display-a-file-from-one-line-number-to-another-in-linux/" class="more-link">Continue reading <span class="screen-reader-text">How to display a file from one line number to another in Linux</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://techantidote.com/how-to-display-a-file-from-one-line-number-to-another-in-linux/">How to display a file from one line number to another in Linux</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>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.</p>
<pre><strong>cat &lt;filename&gt; | awk 'NR &gt;=linenumber1 &amp;&amp; NR &lt;=linenumber2'</strong></pre>
<p>To read and display a file along with the line numbers, you can use the following format:.</p>
<pre><strong>cat -n &lt;filename&gt;</strong></pre>
<p><span style="color: #0000ff;"><strong><span style="text-decoration: underline;">Example</span>:</strong></span></p>
<pre><strong>cat -n sample.txt</strong></pre>
<p><img loading="lazy" decoding="async" data-attachment-id="2197" data-permalink="https://techantidote.com/how-to-display-a-file-from-one-line-number-to-another-in-linux/display-line-number/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/display-line-number.png" data-orig-size="715,193" data-comments-opened="1" data-image-title="display line number" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/display-line-number.png" class="alignnone size-full wp-image-2197" src="http://techantidote.com/wp-content/uploads/2016/05/display-line-number.png" alt="display line number" width="715" height="193" srcset="https://techantidote.com/wp-content/uploads/2016/05/display-line-number.png 715w, https://techantidote.com/wp-content/uploads/2016/05/display-line-number-300x81.png 300w" sizes="auto, (max-width: 715px) 100vw, 715px" /><br />
<span style="color: #0000ff;"><strong><span style="text-decoration: underline;">For example</span>:</strong></span></p>
<p>To <strong>print</strong> lines starting from <strong>line 2 to line 7</strong>, then you can use the following command.</p>
<pre><strong>cat sample.txt | awk 'NR &gt;=2 &amp;&amp; NR &lt;=7'
</strong></pre>
<p><span style="color: #0000ff;"><strong><span style="text-decoration: underline;">Sample Output</span>:</strong></span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="2196" data-permalink="https://techantidote.com/how-to-display-a-file-from-one-line-number-to-another-in-linux/awk-from-line-number-to-another-line-number/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/awk-from-line-number-to-another-line-number.png" data-orig-size="715,138" data-comments-opened="1" data-image-title="awk from line number to another line number" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/awk-from-line-number-to-another-line-number.png" class="alignnone size-full wp-image-2196" src="http://techantidote.com/wp-content/uploads/2016/05/awk-from-line-number-to-another-line-number.png" alt="use cat and awk to print range of line numbers in linux" width="715" height="138" srcset="https://techantidote.com/wp-content/uploads/2016/05/awk-from-line-number-to-another-line-number.png 715w, https://techantidote.com/wp-content/uploads/2016/05/awk-from-line-number-to-another-line-number-300x58.png 300w" sizes="auto, (max-width: 715px) 100vw, 715px" /><br />
If for any reason you need to display the line numbers along with the output, then you can pass the <strong>-n</strong> argument to cat<strong> before piping</strong> <strong>it to</strong> <strong>awk</strong> as shown below.</p>
<pre><strong>cat -n sample.txt | awk 'NR &gt;=2 &amp;&amp; NR &lt;=7'</strong></pre>
<p><strong><span style="color: #0000ff;"><span style="text-decoration: underline;">Sample Output</span>:</span></strong></p>
<p><img loading="lazy" decoding="async" data-attachment-id="2198" data-permalink="https://techantidote.com/how-to-display-a-file-from-one-line-number-to-another-in-linux/print-with-line-numbers/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/print-with-line-numbers.png" data-orig-size="718,307" data-comments-opened="1" data-image-title="print with line numbers" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/print-with-line-numbers.png" class="alignnone size-full wp-image-2198" src="http://techantidote.com/wp-content/uploads/2016/05/print-with-line-numbers.png" alt="print with line numbers" width="718" height="307" srcset="https://techantidote.com/wp-content/uploads/2016/05/print-with-line-numbers.png 718w, https://techantidote.com/wp-content/uploads/2016/05/print-with-line-numbers-300x128.png 300w" sizes="auto, (max-width: 718px) 100vw, 718px" /></p>
<p>[<strong>Note</strong>: There are multiple methods to do the same procedure. This method is intended for beginners who are just getting started in Linux.]</p>
<p>Hope this helps!</p>
<p>If this article helped you, do leave a comment below and like us on <a href="http://twitter.com/techantidote">Twitter</a> and <a href="http://facebook.com/techantidote">Facebook</a>. Cheers!</p>
<p>Source: <a href="http://unix.stackexchange.com/questions/47407/cat-line-x-to-line-y-on-a-huge-file">Link</a></p>
<p>The post <a href="https://techantidote.com/how-to-display-a-file-from-one-line-number-to-another-in-linux/">How to display a file from one line number to another in Linux</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techantidote.com/how-to-display-a-file-from-one-line-number-to-another-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2190</post-id>	</item>
		<item>
		<title>Install Kali Linux in virtualbox (using ova file)</title>
		<link>https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/</link>
					<comments>https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/#comments</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sat, 14 May 2016 13:44:32 +0000</pubDate>
				<category><![CDATA[Kali Linux / Pentesting]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[8.1]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[how to install]]></category>
		<category><![CDATA[kali linux]]></category>
		<category><![CDATA[ova file]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[vm]]></category>
		<category><![CDATA[windows 10]]></category>
		<guid isPermaLink="false">http://techantidote.com/?p=2096</guid>

					<description><![CDATA[<p>This is how I installed Kali Linux in virtualbox using the ova file method in my windows 10 PC along with its screenshots. Requirements: Kali Linux 2019.1 Preinstalled Image: Download Link (Torrent)  (~3.2 GB) [Updated link o latest Kali Version] VirtualBox: Download Link (~200 MB) CPU that supports Virtualization. Atleast 8GB of free disk space.  7-zip: Download Link (~1.4 MB) [ Note: Winrar &#8230; <a href="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/" class="more-link">Continue reading <span class="screen-reader-text">Install Kali Linux in virtualbox (using ova file)</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/">Install Kali Linux in virtualbox (using ova file)</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is how I installed<strong> Kali Linux</strong> in virtualbox using the ova file method in my <strong>windows 10</strong> PC along with its screenshots.</p>
<p><strong>Requirements:</strong></p>
<ol>
<li><span style="color: #3366ff;">Kali Linux 2019.1 Preinstalled Image</span>: <span style="color: #ff0000;"><a style="color: #ff0000;" href="https://images.offensive-security.com/virtual-images/kali-linux-2019.1-vbox-amd64.ova.torrent" target="_blank" rel="noopener noreferrer">Download Link (Torrent)</a></span>  (<strong>~3.2 GB</strong>) [Updated link o latest Kali Version]</li>
<li><span style="color: #0000ff;"><span style="color: #3366ff;">VirtualBox</span>:</span> <a href="https://www.virtualbox.org/wiki/Downloads" target="_blank" rel="noopener noreferrer"><span style="color: #ff0000;">Download Link</span></a> (<strong>~200 MB</strong>)</li>
<li><span style="color: #3366ff;">CPU that supports Virtualization.</span></li>
<li><span style="color: #0000ff;"><span style="color: #3366ff;">Atleast 8GB of free disk space</span>. </span></li>
<li><span style="color: #3366ff;">7-zip</span>: <span style="color: #ff0000;"><a style="color: #ff0000;" href="https://www.7-zip.org/a/7z1900-x64.exe" target="_blank" rel="noopener noreferrer">Download Link</a></span> (<strong>~1.4 MB</strong>) [ Note: Winrar is another alternative you could use instead of 7-zip.]</li>
<li><span style="color: #0000ff;"><span style="color: #3366ff;">Virtual Box Extension Pack</span>: <span style="color: #ff0000;"><a style="color: #ff0000;" href="https://www.virtualbox.org/wiki/Downloads" target="_blank" rel="noopener noreferrer">Download Link</a> (<span style="color: #ffffff;"><strong>~22 MB</strong></span>) <span style="color: #ffffff;">[<strong>Optional</strong>]</span></span></span></li>
</ol>
<p><strong>Installation Procedure:</strong></p>
<p>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 .<strong>ova file</strong> <strong>format</strong> which is a pre-installed Kali Linux machine. Using a pre-installed file saves us a lot of time as we don&#8217;t have to go through the whole installation process.</p>
<p>Now, open VirtualBox:</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2104" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/open-vb/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/open-vb.png" data-orig-size="772,582" data-comments-opened="1" data-image-title="open vb" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/open-vb.png" class="alignnone wp-image-2104 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/open-vb.png" alt="open virtualbox" width="772" height="582" srcset="https://techantidote.com/wp-content/uploads/2016/05/open-vb.png 772w, https://techantidote.com/wp-content/uploads/2016/05/open-vb-300x226.png 300w, https://techantidote.com/wp-content/uploads/2016/05/open-vb-768x579.png 768w" sizes="auto, (max-width: 772px) 100vw, 772px" /></p>
<p>Then click on &#8220;<strong>File&#8221; </strong>and then click on &#8220;<strong>Import Appliance</strong>&#8220;.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2105" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/click-file-import-appliance/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/click-file-import-appliance.png" data-orig-size="277,259" data-comments-opened="1" data-image-title="click file import appliance" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/click-file-import-appliance.png" class="alignnone size-full wp-image-2105" src="http://techantidote.com/wp-content/uploads/2016/05/click-file-import-appliance.png" alt="click file import appliance" width="277" height="259" /></p>
<p>Click on the folder icon as shown below.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2106" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/import-appliance-window/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/import-appliance-window.png" data-orig-size="423,460" data-comments-opened="1" data-image-title="import appliance window" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/import-appliance-window.png" class="alignnone wp-image-2106 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/import-appliance-window.png" alt="import ova file window" width="423" height="460" srcset="https://techantidote.com/wp-content/uploads/2016/05/import-appliance-window.png 423w, https://techantidote.com/wp-content/uploads/2016/05/import-appliance-window-276x300.png 276w" sizes="auto, (max-width: 423px) 100vw, 423px" /></p>
<p>Now, browse to and select the extract <strong>.ova </strong>Kali Linux <strong>image</strong> file and click on &#8220;<strong>Open</strong>&#8220;.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2107" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/select-ova/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/select-ova.png" data-orig-size="626,505" data-comments-opened="1" data-image-title="select ova" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/select-ova.png" class="alignnone wp-image-2107 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/select-ova.png" alt="select kali linux ova file" width="626" height="505" srcset="https://techantidote.com/wp-content/uploads/2016/05/select-ova.png 626w, https://techantidote.com/wp-content/uploads/2016/05/select-ova-300x242.png 300w" sizes="auto, (max-width: 626px) 100vw, 626px" /></p>
<p>You would now see a window called &#8220;<strong>Appliance settings</strong>&#8221; where you can configure stuff like the name of your VM, the amount of RAM to be allocated to your Kali Linux VM etc.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2108" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/appliance-settings/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/appliance-settings.png" data-orig-size="423,460" data-comments-opened="1" data-image-title="appliance settings" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/appliance-settings.png" class="alignnone wp-image-2108 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/appliance-settings.png" alt="kali linux appliance settings" width="423" height="460" srcset="https://techantidote.com/wp-content/uploads/2016/05/appliance-settings.png 423w, https://techantidote.com/wp-content/uploads/2016/05/appliance-settings-276x300.png 276w" sizes="auto, (max-width: 423px) 100vw, 423px" /></p>
<p>If you want to change the name of the VM, simply click on the text and you can change it according to your will.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2109" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/changing-vm-name/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/changing-vm-name.png" data-orig-size="423,460" data-comments-opened="1" data-image-title="changing vm name" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/changing-vm-name.png" class="alignnone size-full wp-image-2109" src="http://techantidote.com/wp-content/uploads/2016/05/changing-vm-name.png" alt="changing vm name" width="423" height="460" srcset="https://techantidote.com/wp-content/uploads/2016/05/changing-vm-name.png 423w, https://techantidote.com/wp-content/uploads/2016/05/changing-vm-name-276x300.png 276w" sizes="auto, (max-width: 423px) 100vw, 423px" /></p>
<p>Finally, click on &#8220;<strong>Import</strong>&#8221; and wait for a few moments to import the Kali Linux Appliance.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2110" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/click-import/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/click-import.png" data-orig-size="423,460" data-comments-opened="1" data-image-title="click import" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/click-import.png" class="alignnone wp-image-2110 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/click-import.png" alt="click import to load kali linux appliance" width="423" height="460" srcset="https://techantidote.com/wp-content/uploads/2016/05/click-import.png 423w, https://techantidote.com/wp-content/uploads/2016/05/click-import-276x300.png 276w" sizes="auto, (max-width: 423px) 100vw, 423px" /></p>
<p><img loading="lazy" decoding="async" data-attachment-id="2111" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/importing-appliance-progress-bar/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/importing-appliance-progress-bar.png" data-orig-size="504,139" data-comments-opened="1" data-image-title="importing appliance progress bar" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/importing-appliance-progress-bar.png" class="alignnone wp-image-2111 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/importing-appliance-progress-bar.png" alt="importing kali linux appliance progress bar" width="504" height="139" srcset="https://techantidote.com/wp-content/uploads/2016/05/importing-appliance-progress-bar.png 504w, https://techantidote.com/wp-content/uploads/2016/05/importing-appliance-progress-bar-300x83.png 300w" sizes="auto, (max-width: 504px) 100vw, 504px" /></p>
<p>Now, right click on your Kali Linux Virtual machine as shown below and click on &#8220;<strong>Settings</strong>&#8220;.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2112" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/vm-settings/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/vm-settings.png" data-orig-size="455,244" data-comments-opened="1" data-image-title="vm settings" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/vm-settings.png" class="alignnone wp-image-2112 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/vm-settings.png" alt="open kali linux virtual machine Settings" width="455" height="244" srcset="https://techantidote.com/wp-content/uploads/2016/05/vm-settings.png 455w, https://techantidote.com/wp-content/uploads/2016/05/vm-settings-300x161.png 300w" sizes="auto, (max-width: 455px) 100vw, 455px" /></p>
<p>If you need to adjust the amount of RAM, click on &#8220;<strong>System</strong>&#8221; and you can move the slider accordingly. I would suggest atleast a minimum of 2048 MB (2GB) of RAM.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2113" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/ram-settings/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/ram-settings.png" data-orig-size="651,428" data-comments-opened="1" data-image-title="ram settings" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/ram-settings.png" class="alignnone wp-image-2113 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/ram-settings.png" alt="select ram for your Kali Linux VM" width="651" height="428" srcset="https://techantidote.com/wp-content/uploads/2016/05/ram-settings.png 651w, https://techantidote.com/wp-content/uploads/2016/05/ram-settings-300x197.png 300w" sizes="auto, (max-width: 651px) 100vw, 651px" /></p>
<p>Now, click on &#8220;Network&#8221; as shown below and select &#8220;<strong>Bridged Adapter</strong>&#8221; and then click on &#8220;<strong>OK</strong>&#8220;.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2114" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/bridged-adapter/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/Bridged-Adapter.png" data-orig-size="651,428" data-comments-opened="1" data-image-title="Bridged Adapter" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/Bridged-Adapter.png" class="alignnone wp-image-2114 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/Bridged-Adapter.png" alt="Select Kali Linux network mode to Bridged Adapter" width="651" height="428" srcset="https://techantidote.com/wp-content/uploads/2016/05/Bridged-Adapter.png 651w, https://techantidote.com/wp-content/uploads/2016/05/Bridged-Adapter-300x197.png 300w" sizes="auto, (max-width: 651px) 100vw, 651px" /></p>
<p>Click on your Kali Linux VM and then click on Start as shown below.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2132" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/start-kali/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/start-kali.png" data-orig-size="772,582" data-comments-opened="1" data-image-title="start kali" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/start-kali.png" class="alignnone wp-image-2132 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/start-kali.png" alt="start kali linux in virtualbox" width="772" height="582" srcset="https://techantidote.com/wp-content/uploads/2016/05/start-kali.png 772w, https://techantidote.com/wp-content/uploads/2016/05/start-kali-300x226.png 300w, https://techantidote.com/wp-content/uploads/2016/05/start-kali-768x579.png 768w" sizes="auto, (max-width: 772px) 100vw, 772px" /></p>
<p>You should now be able to see the grub menu. Hit &#8220;<strong>Enter</strong>&#8221; in your keyboard.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2133" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/kali-grub/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/kali-grub.png" data-orig-size="642,554" data-comments-opened="1" data-image-title="kali grub" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/kali-grub.png" class="alignnone wp-image-2133 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/kali-grub.png" alt="kali linux grub menu" width="642" height="554" srcset="https://techantidote.com/wp-content/uploads/2016/05/kali-grub.png 642w, https://techantidote.com/wp-content/uploads/2016/05/kali-grub-300x259.png 300w" sizes="auto, (max-width: 642px) 100vw, 642px" /></p>
<p>Now, login to your Kali Linux machine with the default username as <strong>root </strong>and password<strong> toor.</strong></p>
<p>Note: If you are using newer Kali versions (from year 2020 ), the username and password is &#8220;kali&#8221;.</p>
<p><strong>Ref</strong>: https://www.kali.org/docs/introduction/default-credentials/</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2134" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/kali-username/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/kali-username.png" data-orig-size="436,216" data-comments-opened="1" data-image-title="kali username" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/kali-username.png" class="alignnone size-full wp-image-2134" src="http://techantidote.com/wp-content/uploads/2016/05/kali-username.png" alt="kali username" width="436" height="216" srcset="https://techantidote.com/wp-content/uploads/2016/05/kali-username.png 436w, https://techantidote.com/wp-content/uploads/2016/05/kali-username-300x149.png 300w" sizes="auto, (max-width: 436px) 100vw, 436px" /></p>
<p><img loading="lazy" decoding="async" data-attachment-id="2135" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/kali-password/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/kali-password.png" data-orig-size="413,189" data-comments-opened="1" data-image-title="kali password" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/kali-password.png" class="alignnone size-full wp-image-2135" src="http://techantidote.com/wp-content/uploads/2016/05/kali-password.png" alt="kali password" width="413" height="189" srcset="https://techantidote.com/wp-content/uploads/2016/05/kali-password.png 413w, https://techantidote.com/wp-content/uploads/2016/05/kali-password-300x137.png 300w" sizes="auto, (max-width: 413px) 100vw, 413px" /></p>
<p>You should now be booted into your Kali Linux desktop.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2136" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/kali-gui/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/kali-gui.png" data-orig-size="1261,903" data-comments-opened="1" data-image-title="kali gui" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/kali-gui-1024x733.png" class="alignnone wp-image-2136 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/kali-gui.png" alt="kali linux logged in" width="1261" height="903" srcset="https://techantidote.com/wp-content/uploads/2016/05/kali-gui.png 1261w, https://techantidote.com/wp-content/uploads/2016/05/kali-gui-300x215.png 300w, https://techantidote.com/wp-content/uploads/2016/05/kali-gui-768x550.png 768w, https://techantidote.com/wp-content/uploads/2016/05/kali-gui-1024x733.png 1024w" sizes="auto, (max-width: 1261px) 100vw, 1261px" /></p>
<p><strong>Customize Kali (Optional): </strong></p>
<p>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&#8217;t want to customize it.</p>
<p>Click on the triangle pointing downwards in the upper right corner and then click on the &#8220;<strong>Settings</strong>&#8221; icon.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2137" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/menu/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/menu.png" data-orig-size="298,337" data-comments-opened="1" data-image-title="menu" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/menu.png" class="alignnone wp-image-2137 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/menu.png" alt="Kali Linux drop down menu" width="298" height="337" srcset="https://techantidote.com/wp-content/uploads/2016/05/menu.png 298w, https://techantidote.com/wp-content/uploads/2016/05/menu-265x300.png 265w" sizes="auto, (max-width: 298px) 100vw, 298px" /></p>
<p>This will bring you the &#8220;All Settings&#8221; window as shown below. Click on &#8220;<strong>Date &amp; Time</strong>&#8220;.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2138" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/all-settings/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/all-settings.png" data-orig-size="741,588" data-comments-opened="1" data-image-title="all settings" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/all-settings.png" class="alignnone wp-image-2138 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/all-settings.png" alt="all settings menu" width="741" height="588" srcset="https://techantidote.com/wp-content/uploads/2016/05/all-settings.png 741w, https://techantidote.com/wp-content/uploads/2016/05/all-settings-300x238.png 300w" sizes="auto, (max-width: 741px) 100vw, 741px" /></p>
<p>You can change the time zone to your time zone.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2139" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/change-time-zone/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/change-time-zone.png" data-orig-size="744,384" data-comments-opened="1" data-image-title="change time zone" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/change-time-zone.png" class="alignnone wp-image-2139 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/change-time-zone.png" alt="change time zone" width="744" height="384" srcset="https://techantidote.com/wp-content/uploads/2016/05/change-time-zone.png 744w, https://techantidote.com/wp-content/uploads/2016/05/change-time-zone-300x155.png 300w" sizes="auto, (max-width: 744px) 100vw, 744px" /></p>
<p>Now, go back to the &#8220;All Settings&#8221; window and then click on &#8220;<strong>Privacy</strong>&#8220;.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2140" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/privacy/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/privacy.png" data-orig-size="743,625" data-comments-opened="1" data-image-title="privacy" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/privacy.png" class="alignnone wp-image-2140 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/privacy.png" alt="select privacy in all setting menu" width="743" height="625" srcset="https://techantidote.com/wp-content/uploads/2016/05/privacy.png 743w, https://techantidote.com/wp-content/uploads/2016/05/privacy-300x252.png 300w" sizes="auto, (max-width: 743px) 100vw, 743px" /></p>
<p>You would see a screen similar to the one below:</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2141" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/default-privacy/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/default-privacy.png" data-orig-size="735,485" data-comments-opened="1" data-image-title="default privacy" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/default-privacy.png" class="wp-image-2141 size-full alignnone" src="http://techantidote.com/wp-content/uploads/2016/05/default-privacy.png" alt="default privacy settings" width="735" height="485" srcset="https://techantidote.com/wp-content/uploads/2016/05/default-privacy.png 735w, https://techantidote.com/wp-content/uploads/2016/05/default-privacy-300x198.png 300w" sizes="auto, (max-width: 735px) 100vw, 735px" /></p>
<p>Now, disable &#8220;<strong>Automatic Screen Lock</strong>&#8221; by moving the slider.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2142" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/disable-auto-screen-lock/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/disable-auto-screen-lock.png" data-orig-size="741,489" data-comments-opened="1" data-image-title="disable auto screen lock" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/disable-auto-screen-lock.png" class="alignnone wp-image-2142 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/disable-auto-screen-lock.png" alt="disable auto screen lock" width="741" height="489" srcset="https://techantidote.com/wp-content/uploads/2016/05/disable-auto-screen-lock.png 741w, https://techantidote.com/wp-content/uploads/2016/05/disable-auto-screen-lock-300x198.png 300w" sizes="auto, (max-width: 741px) 100vw, 741px" /></p>
<p>Go back to &#8220;<strong>All Settings</strong>&#8220;, then click on &#8220;<strong>Power</strong>&#8220;.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2143" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/click-on-power/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/click-on-power.png" data-orig-size="739,621" data-comments-opened="1" data-image-title="click on power" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/click-on-power.png" class="alignnone wp-image-2143 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/click-on-power.png" alt="click on power in all settings" width="739" height="621" srcset="https://techantidote.com/wp-content/uploads/2016/05/click-on-power.png 739w, https://techantidote.com/wp-content/uploads/2016/05/click-on-power-300x252.png 300w" sizes="auto, (max-width: 739px) 100vw, 739px" /></p>
<p>Now, select Blank Screen option as &#8220;<strong>Never</strong>&#8221; and turn <strong>off</strong>  &#8220;Automatic Suspend&#8221; as shown below.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2144" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/power-settings/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/power-settings.png" data-orig-size="744,361" data-comments-opened="1" data-image-title="power settings" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/power-settings.png" class="alignnone wp-image-2144 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/power-settings.png" alt="disable blank screen and automatic suspend " width="744" height="361" srcset="https://techantidote.com/wp-content/uploads/2016/05/power-settings.png 744w, https://techantidote.com/wp-content/uploads/2016/05/power-settings-300x146.png 300w" sizes="auto, (max-width: 744px) 100vw, 744px" /></p>
<p><strong>Update Kali Linux:</strong></p>
<p>Open the terminal window by clicking on the icon as shown below:</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2145" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/open-terminal/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/open-terminal.png" data-orig-size="373,505" data-comments-opened="1" data-image-title="open terminal" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/open-terminal.png" class="alignnone wp-image-2145 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/open-terminal.png" alt="open terminal" width="373" height="505" srcset="https://techantidote.com/wp-content/uploads/2016/05/open-terminal.png 373w, https://techantidote.com/wp-content/uploads/2016/05/open-terminal-222x300.png 222w" sizes="auto, (max-width: 373px) 100vw, 373px" /></p>
<p>This is what the terminal window would look like in a Kali Linux system.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2146" data-permalink="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/terminal/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/05/terminal.png" data-orig-size="736,488" data-comments-opened="1" data-image-title="terminal" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/05/terminal.png" class="alignnone wp-image-2146 size-full" src="http://techantidote.com/wp-content/uploads/2016/05/terminal.png" alt="Kali Linux Terminal" width="736" height="488" srcset="https://techantidote.com/wp-content/uploads/2016/05/terminal.png 736w, https://techantidote.com/wp-content/uploads/2016/05/terminal-300x199.png 300w" sizes="auto, (max-width: 736px) 100vw, 736px" /></p>
<p>Enter the following commands in the terminal to update your Kali Linux system.</p>
<pre>apt-get clean &amp;&amp; apt-get update -y
apt-get upgrade -y &amp;&amp; apt-get dist-upgrade -y
</pre>
<p>This may take a while depending on your internet connection for the update to complete.</p>
<p><span style="color: #3366ff;">And that is it for setting up Kali Linux in virtualbox to get started with pentesting</span> (only for ethical hacking and for purely educational purposes).</p>
<p>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.</p>
<p>The post <a href="https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/">Install Kali Linux in virtualbox (using ova file)</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techantidote.com/install-kali-linux-in-virtualbox-using-ova-file/feed/</wfw:commentRss>
			<slash:comments>65</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2096</post-id>	</item>
		<item>
		<title>How to install apache from source in Centos 6.7</title>
		<link>https://techantidote.com/how-to-install-apache-from-source-in-centos-6-7/</link>
					<comments>https://techantidote.com/how-to-install-apache-from-source-in-centos-6-7/#comments</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Fri, 26 Feb 2016 23:23:57 +0000</pubDate>
				<category><![CDATA[Linux / Redhat]]></category>
		<category><![CDATA[2.4.18]]></category>
		<category><![CDATA[apr]]></category>
		<category><![CDATA[centos 6.7]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[install apache from source]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pcre]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[util]]></category>
		<guid isPermaLink="false">http://techantidote.com/?p=1854</guid>

					<description><![CDATA[<p>This is a simple guide on how to configure Apache from source in Centos 6.7 + installing APR, APR-UTIL and PCRE to make it work. Step 1. Install gcc: Open up your terminal window and type the following command: yum install gcc gcc-c++ Now, change to following directory: cd /usr/src/ Step 2: Download and configure APR : To download the &#8230; <a href="https://techantidote.com/how-to-install-apache-from-source-in-centos-6-7/" class="more-link">Continue reading <span class="screen-reader-text">How to install apache from source in Centos 6.7</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://techantidote.com/how-to-install-apache-from-source-in-centos-6-7/">How to install apache from source in Centos 6.7</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a simple guide on how to configure Apache from source in Centos 6.7 + installing APR, APR-UTIL and PCRE to make it work.</p>
<p><strong>Step 1. Install gcc</strong>:</p>
<p>Open up your terminal window and type the following command:</p>
<blockquote><p>yum install gcc gcc-c++</p></blockquote>
<p>Now, change to following directory:</p>
<blockquote><p>cd /usr/src/</p></blockquote>
<p><strong>Step 2: Download and configure APR :</strong></p>
<p>To download the APR file, use the below command:</p>
<blockquote><p>wget http://a.mbbsindia.com//apr/apr-1.5.2.tar.gz</p></blockquote>
<p>Now extract the downloaded file:</p>
<blockquote><p>tar -zxvf apr-1.5.2.tar.gz</p></blockquote>
<p>Change to the extracted folder and run the following commands to configure apr:</p>
<blockquote><p>cd apr-1.5.2<br />
./configure &#8211;prefix=/usr/src/apr<br />
make<br />
make install</p></blockquote>
<p><strong>Step 3. Download and configure apr-utils:</strong></p>
<p>Change to following /usr/src/ directory:</p>
<blockquote><p>cd /usr/src/</p></blockquote>
<p>To download the APR-UTIL file, use the below command:</p>
<blockquote><p>wget http://mirror.fibergrid.in/apache//apr/apr-util-1.5.4.tar.gz</p></blockquote>
<p>To extract file, change to extracted folder and to configure apr, run the following commands:</p>
<blockquote><p>tar -zxvf apr-util-1.5.4.tar.gz</p>
<p>cd apr-util-1.5.4<br />
./configure &#8211;prefix=/usr/src/apr-util &#8211;with-apr=/usr/src/apr/<br />
make<br />
make install</p></blockquote>
<p><strong>Step 4. Download and config PCRE</strong>:</p>
<p>Change to /usr/src/ directory:</p>
<blockquote><p>cd /usr/src/</p></blockquote>
<p>To download pcre2-10.21.tar.gz type the following your terminal:</p>
<blockquote><p>wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.gz</p></blockquote>
<p>To extract file, change to extracted folder and to configure pcre2-10.21, run the following commands:</p>
<blockquote><p><span style="line-height: 1.6;">tar -zxvf pcre2-10.21.tar.gz</span></p>
<p>cd pcre2-10.21<br />
./configure &#8211;prefix=/usr/src/pcre2<br />
make<br />
make install</p></blockquote>
<p><strong>Step 5. Download Apache / httpd</strong>:</p>
<p>Now, change to following directory:</p>
<blockquote><p>cd /usr/src/</p></blockquote>
<p>To download httpd tar ball type the following your terminal:</p>
<blockquote><p>wget http://a.mbbsindia.com//httpd/httpd-2.4.18.tar.gz</p></blockquote>
<p>To extract file, change to extracted folder and to configure httpd, run the following commands:</p>
<blockquote><p>tar -zxvf httpd-2.4.18.tar.gz</p>
<p>cd httpd-2.4.18<br />
./configure &#8211;prefix=/usr/local/apache2 &#8211;with-apr=/usr/src/apr &#8211;with-apr-util=/usr/src/apr-util &#8211;with-pcre=/usr/src/pcre2/bin/pcre2-config<br />
make<br />
make install</p></blockquote>
<p><strong>Step 6. Start and test your apache server </strong></p>
<blockquote><p>service httpd start<br />
httpd -v</p></blockquote>
<p>You can also open your browser and go to:</p>
<p><a href="http://localhost/" target="_blank">http://localhost/</a></p>
<p>And it should give you the Apache Welcome page.</p>
<p><span style="color: #0000ff;"><strong>And Voila!</strong></span> You have successfully configured apache from source. Hope this helps!</p>
<p>[<strong>DISCLAIMER</strong>: This guide is strictly for the purpose of learning how to configure apache from source for beginners. This should not to be used in a real production server as no security measures has been discussed or implemented in this tutorial.]</p>
<p><span style="color: #000000;"><strong>If you liked this article, do leave a comment below. You can also share this article by clicking on the social media buttons below. </strong></span></p>
<p><span style="color: #000000;">Source: <a style="color: #000000;" href="http://httpd.apache.org/docs/2.4/install.html" target="_blank">Apache</a>, </span>Troubleshooting source: <a href="http://wikisree.com/2015/03/28/apache-httpd-apr-not-found-error-while-installation/" target="_blank">APR troubleshooting</a></p>
<p>The post <a href="https://techantidote.com/how-to-install-apache-from-source-in-centos-6-7/">How to install apache from source in Centos 6.7</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techantidote.com/how-to-install-apache-from-source-in-centos-6-7/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1854</post-id>	</item>
		<item>
		<title>How to setup Cloudflare CDN with Bigrock (manually) + Screenshots</title>
		<link>https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/</link>
					<comments>https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Mon, 08 Feb 2016 12:01:00 +0000</pubDate>
				<category><![CDATA[Webhosting]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[bigrock]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[bluehost]]></category>
		<category><![CDATA[cloudflare]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[domain name]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[godaddy]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[speed up]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[webhosting]]></category>
		<guid isPermaLink="false">http://techantidote.com/?p=1706</guid>

					<description><![CDATA[<p>This is a guide on how to setup Cloudflare CDN with BigRock (similar for Bluehost,Godaddy, Dreamhost, Hostgator) for your website or blog . You can follow the steps below: Step 1. Create an account with Cloudflare: Go to https://www.cloudflare.com and click on the &#8220;Signup&#8221; button. &#160; Fill in your details, tick on &#8220;Agree&#8221; and then click on &#8220;Create &#8230; <a href="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/" class="more-link">Continue reading <span class="screen-reader-text">How to setup Cloudflare CDN with Bigrock (manually) + Screenshots</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/">How to setup Cloudflare CDN with Bigrock (manually) + Screenshots</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a guide on how to setup Cloudflare CDN with BigRock (similar for Bluehost,Godaddy, Dreamhost, Hostgator) for your website or blog . You can follow the steps below:</p>
<p><span style="color: #000000;"><strong>Step 1.</strong></span> <strong><span style="color: #3366ff;">Create an account with Cloudflare:</span></strong></p>
<p>Go to <span style="color: #ff0000;"><a style="color: #ff0000;" href="https://www.cloudflare.com" target="_blank">https://www.cloudflare.com</a></span> and click on the &#8220;<strong>Signup</strong>&#8221; button.</p>
<p>&nbsp;</p>
<p><span style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1720" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/signup/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/signup.jpg" data-orig-size="1288,942" data-comments-opened="1" data-image-title="signup" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/signup-1024x749.jpg" class="alignnone wp-image-1720 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/signup.jpg" alt="cloudlare signup" width="1288" height="942" srcset="https://techantidote.com/wp-content/uploads/2016/02/signup.jpg 1288w, https://techantidote.com/wp-content/uploads/2016/02/signup-300x219.jpg 300w, https://techantidote.com/wp-content/uploads/2016/02/signup-768x562.jpg 768w, https://techantidote.com/wp-content/uploads/2016/02/signup-1024x749.jpg 1024w" sizes="auto, (max-width: 1288px) 100vw, 1288px" /></span></p>
<p><span style="line-height: 1.6;">Fill in your details, tick on &#8220;</span><strong style="line-height: 1.6;">Agree</strong><span style="line-height: 1.6;">&#8221; and then click on &#8220;</span><strong style="line-height: 1.6;">Create Account</strong><span style="line-height: 1.6;">&#8220;.</span></p>
<p><strong style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1721" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/signup-form/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/signup-form.png" data-orig-size="402,649" data-comments-opened="1" data-image-title="signup form" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/signup-form.png" class="alignnone wp-image-1721 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/signup-form.png" alt="cloudflare create account" width="402" height="649" srcset="https://techantidote.com/wp-content/uploads/2016/02/signup-form.png 402w, https://techantidote.com/wp-content/uploads/2016/02/signup-form-186x300.png 186w" sizes="auto, (max-width: 402px) 100vw, 402px" /></strong></p>
<p><strong style="line-height: 1.6;">Step 2. <span style="color: #3366ff;">Add your website</span></strong></p>
<p>Now, in the text box below, type your website address and then click on &#8220;<strong>Scan DNS Records</strong>&#8220;as shown below.</p>
<p><span style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1722" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/add-sites/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/add-sites.jpg" data-orig-size="1003,633" data-comments-opened="1" data-image-title="add sites" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/add-sites.jpg" class="alignnone wp-image-1722 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/add-sites.jpg" alt="cloudflare add site and scan dns" width="1003" height="633" srcset="https://techantidote.com/wp-content/uploads/2016/02/add-sites.jpg 1003w, https://techantidote.com/wp-content/uploads/2016/02/add-sites-300x189.jpg 300w, https://techantidote.com/wp-content/uploads/2016/02/add-sites-768x485.jpg 768w" sizes="auto, (max-width: 1003px) 100vw, 1003px" /></span></p>
<p><span style="line-height: 1.6;">It will take a few moments for the scanning to complete.</span></p>
<p>&nbsp;</p>
<p><span style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1723" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/scanning-dns-records/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/scanning-dns-records.jpg" data-orig-size="1003,787" data-comments-opened="1" data-image-title="scanning dns records" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/scanning-dns-records.jpg" class="alignnone wp-image-1723 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/scanning-dns-records.jpg" alt="cloudflare scanning dns records" width="1003" height="787" srcset="https://techantidote.com/wp-content/uploads/2016/02/scanning-dns-records.jpg 1003w, https://techantidote.com/wp-content/uploads/2016/02/scanning-dns-records-300x235.jpg 300w, https://techantidote.com/wp-content/uploads/2016/02/scanning-dns-records-768x603.jpg 768w" sizes="auto, (max-width: 1003px) 100vw, 1003px" /></span></p>
<p><span style="line-height: 1.6;">Once, the scanning is complete, click on &#8220;</span><strong style="line-height: 1.6;">Continue</strong><span style="line-height: 1.6;">&#8220;.</span></p>
<p>&nbsp;</p>
<p><span style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1724" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/dns-scanning-complete/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/dns-scanning-complete.png" data-orig-size="993,787" data-comments-opened="1" data-image-title="dns scanning complete" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/dns-scanning-complete.png" class="alignnone wp-image-1724 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/dns-scanning-complete.png" alt="cloudflare dns scanning complete" width="993" height="787" srcset="https://techantidote.com/wp-content/uploads/2016/02/dns-scanning-complete.png 993w, https://techantidote.com/wp-content/uploads/2016/02/dns-scanning-complete-300x238.png 300w, https://techantidote.com/wp-content/uploads/2016/02/dns-scanning-complete-768x609.png 768w" sizes="auto, (max-width: 993px) 100vw, 993px" /></span></p>
<p><span style="line-height: 1.6;">Now, click on &#8220;</span><strong style="line-height: 1.6;">Continue</strong><span style="line-height: 1.6;">&#8221; in the bottom corner:</span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="1743" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/after-scan-continue/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/after-scan-continue.jpg" data-orig-size="1280,1024" data-comments-opened="1" data-image-title="after scan continue" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/after-scan-continue-1024x819.jpg" class="alignnone wp-image-1743 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/after-scan-continue.jpg" alt="cloudflare click continue" width="1280" height="1024" srcset="https://techantidote.com/wp-content/uploads/2016/02/after-scan-continue.jpg 1280w, https://techantidote.com/wp-content/uploads/2016/02/after-scan-continue-300x240.jpg 300w, https://techantidote.com/wp-content/uploads/2016/02/after-scan-continue-768x614.jpg 768w, https://techantidote.com/wp-content/uploads/2016/02/after-scan-continue-1024x819.jpg 1024w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong style="line-height: 1.6;">Step 3.</strong><span style="line-height: 1.6;"> </span><span style="color: #3366ff;"><strong>Select Cloudflare Plan</strong></span></p>
<p>Now, select the &#8220;<strong>Free Website</strong>&#8221; package as shown below and click on &#8220;<strong>Continue</strong>&#8220;.</p>
<p>&nbsp;</p>
<p><strong style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1726" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/select-cloudflare-plan/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/select-cloudflare-plan.jpg" data-orig-size="985,741" data-comments-opened="1" data-image-title="select cloudflare plan" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/select-cloudflare-plan.jpg" class="alignnone wp-image-1726 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/select-cloudflare-plan.jpg" alt="select cloudflare free plan" width="985" height="741" srcset="https://techantidote.com/wp-content/uploads/2016/02/select-cloudflare-plan.jpg 985w, https://techantidote.com/wp-content/uploads/2016/02/select-cloudflare-plan-300x226.jpg 300w, https://techantidote.com/wp-content/uploads/2016/02/select-cloudflare-plan-768x578.jpg 768w" sizes="auto, (max-width: 985px) 100vw, 985px" /></strong></p>
<p><strong style="line-height: 1.6;">Step 4. <span style="color: #3366ff;">Get new name servers</span></strong></p>
<p>Now, you will see the Cloudflare name servers as shown below. [This may vary for your website]</p>
<p><img loading="lazy" decoding="async" data-attachment-id="1728" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/cloudflare-name-servers/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/cloudflare-name-servers.png" data-orig-size="987,749" data-comments-opened="1" data-image-title="cloudflare name servers" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/cloudflare-name-servers.png" class="alignnone wp-image-1728 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/cloudflare-name-servers.png" alt="cloudflare name servers" width="987" height="749" srcset="https://techantidote.com/wp-content/uploads/2016/02/cloudflare-name-servers.png 987w, https://techantidote.com/wp-content/uploads/2016/02/cloudflare-name-servers-300x228.png 300w, https://techantidote.com/wp-content/uploads/2016/02/cloudflare-name-servers-768x583.png 768w" sizes="auto, (max-width: 987px) 100vw, 987px" /></p>
<p><span style="line-height: 1.6;">As you see, for my website it is requesting to change the name server from</span></p>
<p style="padding-left: 150px;"><strong>dns1.bigrock.in</strong> to <strong>linda.ns.cloudflare.com</strong><br />
<strong>dns2.bigrock.in</strong> to <strong>rob.ns.cloudflare.com</strong></p>
<p>Also, also to remove the following nameservers:</p>
<p style="padding-left: 210px;"><strong>dns3.bigrock.in </strong><br />
<strong>dns4.bigrock.in </strong></p>
<p>[<strong>Note</strong>: The nameservers that you may see in your screen may be different.]</p>
<p><strong>Step 4: <span style="color: #3366ff;">Change your name servers to Cloudflare</span></strong></p>
<p>Now, open up a new tab and login to your domain host panel (i.e. from where you bought your domain name from eg BigRock, Goddady, Hostgator, Bluehost etc). I have my domain from BigRock so I will be loggin in to my Bigrock account.</p>
<p><span style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1729" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/1-domain-hosting-big-rock-login/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/1.-domain-hosting-big-rock-login.jpg" data-orig-size="381,535" data-comments-opened="1" data-image-title="1. domain hosting &amp;#8211; big rock login" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/1.-domain-hosting-big-rock-login.jpg" class="alignnone wp-image-1729 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/1.-domain-hosting-big-rock-login.jpg" alt="domain hosting bigrock login" width="381" height="535" srcset="https://techantidote.com/wp-content/uploads/2016/02/1.-domain-hosting-big-rock-login.jpg 381w, https://techantidote.com/wp-content/uploads/2016/02/1.-domain-hosting-big-rock-login-214x300.jpg 214w" sizes="auto, (max-width: 381px) 100vw, 381px" /></span></p>
<p>Now, click on the domain you need to change the name servers to.</p>
<p>&nbsp;</p>
<p><span style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1730" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/2-select-domain/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/2.-select-domain.png" data-orig-size="777,791" data-comments-opened="1" data-image-title="2. select domain" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/2.-select-domain.png" class="alignnone wp-image-1730 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/2.-select-domain.png" alt="bigrock select domain" width="777" height="791" srcset="https://techantidote.com/wp-content/uploads/2016/02/2.-select-domain.png 777w, https://techantidote.com/wp-content/uploads/2016/02/2.-select-domain-295x300.png 295w, https://techantidote.com/wp-content/uploads/2016/02/2.-select-domain-768x782.png 768w" sizes="auto, (max-width: 777px) 100vw, 777px" /></span></p>
<p><span style="line-height: 1.6;">Now, click on &#8220;</span><strong style="line-height: 1.6;">Name Servers</strong><span style="line-height: 1.6;">&#8221; </span></p>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" data-attachment-id="1740" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/3-manage-name-servers/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/3.-manage-name-servers.png" data-orig-size="716,481" data-comments-opened="1" data-image-title="3. manage name servers" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/3.-manage-name-servers.png" class="alignnone wp-image-1740 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/3.-manage-name-servers.png" alt="bigrock manage name servers" width="716" height="481" srcset="https://techantidote.com/wp-content/uploads/2016/02/3.-manage-name-servers.png 716w, https://techantidote.com/wp-content/uploads/2016/02/3.-manage-name-servers-300x202.png 300w" sizes="auto, (max-width: 716px) 100vw, 716px" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>And you will see your default nameservers as shown below:</p>
<p><img loading="lazy" decoding="async" data-attachment-id="1731" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/4-default-name-servers/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/4.-default-name-servers.png" data-orig-size="605,379" data-comments-opened="1" data-image-title="4. default name servers" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/4.-default-name-servers.png" class="alignnone wp-image-1731 size-full" style="line-height: 1.6;" src="http://techantidote.com/wp-content/uploads/2016/02/4.-default-name-servers.png" alt="default bigrock name servers" width="605" height="379" srcset="https://techantidote.com/wp-content/uploads/2016/02/4.-default-name-servers.png 605w, https://techantidote.com/wp-content/uploads/2016/02/4.-default-name-servers-300x188.png 300w" sizes="auto, (max-width: 605px) 100vw, 605px" /></p>
<p><span style="line-height: 1.6;">Now, change your nameserver to the ones provided by cloudflare. In my case, after changing the nameserver, it will look like this:</span></p>
<p>&nbsp;</p>
<p><span style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1732" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/5-cloudflare-nameservers-2/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/5.-cloudflare-nameservers-1.png" data-orig-size="602,382" data-comments-opened="1" data-image-title="5. cloudflare nameservers" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/5.-cloudflare-nameservers-1.png" class="alignnone wp-image-1732 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/5.-cloudflare-nameservers-1.png" alt="cloudflare nameservers update" width="602" height="382" srcset="https://techantidote.com/wp-content/uploads/2016/02/5.-cloudflare-nameservers-1.png 602w, https://techantidote.com/wp-content/uploads/2016/02/5.-cloudflare-nameservers-1-300x190.png 300w" sizes="auto, (max-width: 602px) 100vw, 602px" /></span></p>
<p><span style="line-height: 1.6;">Now, click on &#8220;</span><strong style="line-height: 1.6;">Update Name Servers</strong><span style="line-height: 1.6;">&#8220;.</span></p>
<p><strong style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1733" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/6-nameserver-change-success/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/6.-nameserver-change-success.png" data-orig-size="508,206" data-comments-opened="1" data-image-title="6. nameserver change success" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/6.-nameserver-change-success.png" class="alignnone wp-image-1733 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/6.-nameserver-change-success.png" alt="domain bigrock nameserver change success" width="508" height="206" srcset="https://techantidote.com/wp-content/uploads/2016/02/6.-nameserver-change-success.png 508w, https://techantidote.com/wp-content/uploads/2016/02/6.-nameserver-change-success-300x122.png 300w" sizes="auto, (max-width: 508px) 100vw, 508px" /></strong></p>
<p><strong style="line-height: 1.6;">Step 5:</strong><strong style="line-height: 1.6;"> </strong><span style="color: #3366ff;"><strong>Verify in Cloudflare</strong></span></p>
<p>Now, go back to your cloudflare tab and click on &#8220;<strong>Continue</strong>&#8220;.</p>
<p><span style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1734" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/cloudflare-continue/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/cloudflare-continue.png" data-orig-size="977,765" data-comments-opened="1" data-image-title="cloudflare continue" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/cloudflare-continue.png" class="alignnone wp-image-1734 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/cloudflare-continue.png" alt="cloudflare dns nameserver " width="977" height="765" srcset="https://techantidote.com/wp-content/uploads/2016/02/cloudflare-continue.png 977w, https://techantidote.com/wp-content/uploads/2016/02/cloudflare-continue-300x235.png 300w, https://techantidote.com/wp-content/uploads/2016/02/cloudflare-continue-768x601.png 768w" sizes="auto, (max-width: 977px) 100vw, 977px" /></span></p>
<p><span style="line-height: 1.6;">It should show you show you a <strong><span style="color: #00ff00;">green banner </span></strong>with the status: &#8220;</span><strong style="line-height: 1.6;">Active</strong><span style="line-height: 1.6;">&#8221; as shown below.</span></p>
<p>&nbsp;</p>
<p><span style="line-height: 1.6;"><img loading="lazy" decoding="async" data-attachment-id="1735" data-permalink="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/cloudflare-active-status/" data-orig-file="https://techantidote.com/wp-content/uploads/2016/02/cloudflare-active-status.png" data-orig-size="989,779" data-comments-opened="1" data-image-title="cloudflare active status" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2016/02/cloudflare-active-status.png" class="alignnone wp-image-1735 size-full" src="http://techantidote.com/wp-content/uploads/2016/02/cloudflare-active-status.png" alt="cloudflare cdn active status" width="989" height="779" srcset="https://techantidote.com/wp-content/uploads/2016/02/cloudflare-active-status.png 989w, https://techantidote.com/wp-content/uploads/2016/02/cloudflare-active-status-300x236.png 300w, https://techantidote.com/wp-content/uploads/2016/02/cloudflare-active-status-768x605.png 768w" sizes="auto, (max-width: 989px) 100vw, 989px" />[NOTE: If you the status does not show as &#8220;Active&#8221; then you can click on &#8220;<strong>Recheck Status</strong>&#8221; and it then should show that its &#8220;Active&#8221;]</span></p>
<p>[<strong>IMPORTANT</strong>: It would take about 24-48 hours for the DNS to get updated.]</p>
<p><span style="color: #3366ff;"><strong>And Voila!</strong></span> <span style="color: #3366ff;">You have successfully configured Cloudflare CDN for your blog/website and should load faster.</span></p>
<p>Do check the  performance of your website after 24-48 hours and let me know in the <strong>comments</strong> <strong>sections</strong> below if there was any speed improvement.</p>
<p><strong>If this article helped you, then support us by liking us  us on</strong> <a href="https://www.facebook.com/TechAntidote/">Facebook</a>, <a href="https://twitter.com/TechAntidote">Twitter</a>, <a href="https://plus.google.com/+TechAntidote" target="_blank">Google+</a> and  <a href="http://techantidote.tumblr.com/">Tumbler</a>. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Regards,<br />
<strong>ΞXΤЯ3МΞ</strong></p>
<p>The post <a href="https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/">How to setup Cloudflare CDN with Bigrock (manually) + Screenshots</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techantidote.com/how-to-setup-cloudflare-cdn-with-bigrock-manually-screenshots/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1706</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: techantidote.com @ 2026-10-22 22:06:26 by W3 Total Cache
-->