Home NewsX How to Test Network on Linux Web App with Limited Tools

How to Test Network on Linux Web App with Limited Tools

by info.odysseyx@gmail.com
0 comment 0 views


Some Linux web apps may require testing the network, but the customer’s VNET does not allow external connections and the tools available in the blessed image are limited.

This tutorial shows how to work around this limitation by downloading the required binaries (e.g. tcpping) from the external environment and then transferring them to the restricted environment using base64 encoding.

index:

  • Preparing binaries in a network accessible environment
  • Binary transfer to restricted environments
  • Run binaries in restricted environments
  • conclusion

Preparing binaries in a network accessible environment

Step 1: Find an environment with Internet access and use the wget command to download the required binaries (in this case tcpping) or other required binaries.

wget https://pingpros.com/pub/tcpping

Step 2: Since we are in a restricted environment and do not have direct access to the internet, we will convert the binary to base64 format. If your binary size is less than 1MB, you can transfer it using Terminal.

base64 tcpping > tcpping.txt ; rm tcpping

Step 3: You now have a tcpping.txt file containing the base64 encoded binary. Displays the file contents so you can copy and paste them later in a restricted environment.

cat tcpping.txt ; rm tcpping.txt

Binary transfer to restricted environments

Step 1: If you are in a restricted environment (one without access to an external network), paste the base64 encoded binary into a new text file and save it. Save it as tcpping.txt using the following command:

echo "YOUR_BASE64_HERE" > tcpping.txt

Replace YOUR_BASE64_HERE with the contents of the base64 encoded tcpping.txt copied from a network accessible environment.

Step 2: Decode the base64 encoded file back to binary using the following command:

base64 -d < tcpping.txt > tcpping
chmod 755 tcpping

Run binaries in restricted environments

Step 1: Test your local network by running the binary. For example, you can ping the loopback address (127.0.0.1).

./tcpping 127.0.0.1

Step 2: Check the network test results to verify that the tcpping binary is working properly.

conclusion

The following steps will allow you to successfully transfer and run the binary in a Linux web app environment that does not allow external Internet access. This method uses base64 encoding to move small binaries into restricted environments for network testing or other purposes.

This approach has some limitations, except that the overall file size is not too large.

  1. You should choose a static binary with no dependent libraries, preferably a single file like nslookup or dig.
  2. You must ensure that the file source does not contain malicious code, and you must not sacrifice system and data security for convenient transfer.
  3. Likewise, if your operating unit is a company, you should pay particular attention to whether IT imposes restrictions on its actions.





Source link

You may also like

Leave a Comment

Our Company

Welcome to OdysseyX, your one-stop destination for the latest news and opportunities across various domains.

Newsletter

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

Laest News

@2024 – All Right Reserved. Designed and Developed by OdysseyX