CyberKeeda In Social Media
Showing posts with label Linux Security. Show all posts
Showing posts with label Linux Security. Show all posts

Host your website or application on Internet using ngrok.

Ngrok


Ngrok, yet another ultimate free open source and cross-platform reverse proxy server for exposing local servers behind NATs and firewalls Internet over secure tunnels. 


It essentially establishes secure tunnels to your local hosted server that allows us to run demos of web sites before actual deployment, testing mobile apps connected to your locally running backend and building web-hook consumers on your development machine.


Use Case : Are you looking for a ready to go and secure solution to showcase your website or application which is behind NAT gateways or firewall to public facing internet, Ngrok is the way to go ahead.

Lets know, how to install, configure and use it.

Installation.


Installation is pretty much simple and straight, download , unzip and yes you are done.

[root@CKcentos01x ~]# mkdir /usr/local/ngrok

[root@CKcentos01x ~]# cd /usr/local/ngrok

[root@CKcentos01x ~]# wget -c https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip

[root@CKcentos01x ~]# unzip ngrok-stable-linux-amd64.zip

And yes you are done, we are ready to use it.

Lab setup : We have our demo website hosted within our local virtual machine behind NAT network with an IP of 192.168.106.133

We will access the website from Internet after application of ngrok.

Here is how our website looks like.




Now using ngrok, we will host the same website using ngrok's secure tunnel on internet.

Note : Our website is hosted on Apache Webserver on port 80

[root@CKcentos01x ~]# cd /usr/local/ngrok
[root@CKcentos01x ~]# ./ngrok http 80



Our server has been hosted using ngrok secure tunnel, we can access using any of forwarding URL provided by ngrok.

One easy way to inspect the traffic is using the ngrok UI, let's access it.

http://localhost:4040 

We can access it from our local host only and use any one of the URL to access our demo website from internet.



Even we can use ngrok to see stats too.








 
I hope ngrok's above guide looks informative to you, do comment !
Read more ...

How to use encrypted password in Bash Shell script.



If you too feel awful  while keeping your password into plain string within, here is the way it might can help you.

Encrypt your password from OpenSSL using the below command

Assumption : Here i will be encrypting my plain text password as  " mysecretpassword  "

       


[root@cyberkeeda]# echo 'mysecretpassword' | openssl enc -base64 -e -aes-256-cbc -nosalt  -pass pass:garbageKey



You will find a encrypted password output as

O7LX4VmomxrBgNHS+R1FcoNneSrqWFY0oTn3ammEF7w=


Copy the above encrypted string and confirm it by decryption.

       


[root@cyberkeeda]# echo 'O7LX4VmomxrBgNHS+R1FcoNneSrqWFY0oTn3ammEF7w=' | openssl enc -base64 -d -aes-256-cbc -nosalt -pass pass:garbageKey


 

So it must provide a decrypted password as.

"mysecretpassword"

If it works fine, then you can simply save it into a file and use it within your script.

Encrypt it and save it into a hidden file.

       


[root@cyberkeeda]# echo 'mysecretpassword' | openssl enc -base64 -e -aes-256-cbc -nosalt  -pass pass:garbageKey  > .secret.lck




Then further you can call it within your script as.


       

#!/bin/bash

#Myscript.sh

#

#

PASS=`cat .secret.lck | openssl enc -base64 -d -aes-256-cbc -nosalt -pass pass:garbageKey
`
#
#You can use the secret password anywhere within your script.
Read more ...
Designed By Jackuna