Archive for the ‘Tech hacks’ Category


Steghide is a command line stenography tool. The word stenography is combination of Greek words “Steganos” that means covered or concealed, and “graphein” means writing. Here stenography means we are talking about digital stenography. Digital stenography is a process of concealing a file or message or image or video in another some file or image or video. We can hide any file into another file. Now this is very important to exchange some secret data. Many government secret services and agencies use this kind of security for sending a private data.

We are going to hide a text file into an image file. After doing this the file is looking like a normal picture. We are using steghide tool in our Kali Linux system. So steghide is not comes pre-installed with Kali Linux. To download this we need to open our terminal window and type following command:

apt-get install steghide

The screenshot of the command is following:

This is asking to use 895 of disk space, type “Y” and hit enter.
Then the installation process will start. After a successful install use following command to see the options of steghide tool.

steghide --help

The screenshot is following:

Now we took both image file and secret message in our Desktop. The screenshot is following:

Now we need to go in Desktop directory in command line. We open the terminal window and type following command:

cd Desktop

Then we are checking our files by entering ls command as following:

ls

The screenshot of those commands are below:

Now we are going to hide our text to do this we use following command in terminal window:

steghide --embed -ef msg.txt -cf images.jpeg -sf any-name.jpeg -p 123456

Here we use -ef for embed file remember -ef (embed file) will hide in to the -cf (cover file) then we are creating a new stego file with the same extension name of our cf (cover file), the -p is for creating a password for this file we choose password 123456 for an example.

The screenshot is following,

Here we can see that we have successfully hide our secret message into new stego file any-name.jpeg file, and the both image file is looking same. We found a little bit size increased in the stego file so we suggest to use own clicked images in the place of free online images.

This is the recipe, now how to get back the message from the stego file ?

To extract the secret message we need to type following command in terminal window:

steghide extract -sf any-name.jpeg

The screenshot is following:

Now type the password and we have done successfully extract our secret message.

Feel free to leave a comment below or reach me on Instagram @iamshubhamkumar__.

 


sddefault

Sometime we need to run our localhost website or server over internet. To do this we need to forward our port that other device can access our website from anywhere in the world by internet. Usually we can forward our port by configuring settings in router, but if we don’t have router or don’t wanna use our router or not have static ip, then we have a very easy option. We can remotely forward port using SSH.

To do this we use a free service called serveo.net and localhost.run. This requires no installation and no sign-up. Serveo is a SSH server. Whenever a user connects to this service they got a public URL that URL can be use to connect to their localhost server.

We are in our Kali Linux system. Here we have a website in php. We can use a html file also.

ls command in kali linux

Now we set this in our localhost. For this we check our local ip by using following command:

ifconfig

The screenshot of our local ip is following :

ifconfig in kali linux

Here we start a basic web server using php by using following command:

php -S 192.168.10.100:80

Here the 192.168.10.100 is our local ip and we run this server in port 80. The screenshot of the command is following:

php server localhost

Here we need to remember that we must run this server in the directory where we saved the php/html file. We have successfully started our website or web server in our local network. Let we check this by typing our local ip and port in browser. The screenshot is following :

demo localhost website

We can see in the screenshot that URL is our local ip. That means it is hosted in localhost. Now we want to access our website outside of our network that means from anywhere via internet.

We minimize the terminal window (Don’t close this terminal, because it’s running our server) and open another new terminal window to run SSH.

The Serveo Method

For this we apply following command:

ssh -R 80:192.168.10.100:80 serveo.net

Here 80 is our port and we are using ssh using serveo.net service.

Then we can see that our localhost is forwarding in a unique URL, as following screenshot.

serveo.net tutorial

Now we can access our localhost by using this URL. Copy this URL and paste it in the address bar of browser in any devices and see the magic.

SSH port forwarding tutorial

It’s done. But wait serveo have some other features.

We can request serveo to get back our old URL. If it is free then serveo will assign it for us again.

We have a old serveo connection with lente.servo.net. We try to get it again. So we request for that subdomain by using following command:

ssh -R lente:80:192.168.10.100:80 serveo.net

 

getting old domain

Here we got that subdomain. Now we can access our localhost with this older URL.

If we want to forward random port then our first port fiels in command will be 0. like following command:

ssh -R 0:192.168.10.100:80 serveo.net

The screenshot of this command is following :

serveo random port

We can open our website with serveo.net:our_assigned_port from anywhere.
In the following screenshot we have opened this link in our mobile device.

port forward from mobile

 

Using Localhost.run Method

Well it is almost similar to serveo.net then why we adding this? Because these free services sometimes goes down during overload on the server. If one service is not working then we can try another. So we can use it by applying following command:

ssh -R 80:192.168.10.100:80 ssh.localhost.run

If it prompt for RSA fingerprint we type yes and press enter.

port forwarding using SSH localhost.run method

We got the shareable link in the last line, we can use this link to connect ssh.

That’s it. Using this method we can forward port without VPN or router. This is so easy to configure it and the connection is stable unlike ngrok, ngrok is not much stable in free version.

Feel free to leave a comment below or reach me on Instagram @iamshubhamkumar__.