How to Make Your Server Invisible with Knockd

Source: https://www.maketecheasier.com/make-linu…8Make+Tech+Easier%29
Capture Date: 16.09.2018 22:57:40

When you have a server that is publicly accessible, hackers can easily scan your IP address and check for open ports (particularly port 22 that is used for SSH) on your server. One way to hide your server from hackers is knockd. Knockd is a is a port-knock server. It listens to all traffic on an ethernet or other available interfaces, waiting for special sequences of port-hits. Clients such as telnet or Putty initiate port-hits by sending a TCP or packet to a port on the server.

In this article we will look at how we can use knockd to hide services running on a Linux server.

Install Knockd on a Linux Server

Knockd is available in most distro’s repositories. On a Debian/Ubuntu/Ubuntu-based server, you can use the apt-get command to install knockd.

sudo apt-get install knockd

For Fedora, CentOS, or REHL users, you can use the yum command:

Install and Configure Iptables

If you don’t have Iptables installed on your server, install it now.

sudo apt-get install iptables iptables-persistent

The package iptables-persistent takes over the automatic loading of saved iptables.

Next, you need to allow already established connections as well as current sessions through iptables. Use the following command to achieve this task:

iptables -A INPUT -m conntrack --ctstate ESTABLISHED, RELATED -j ACCEPT

Next, you need to block all incoming connections to port 22 SSH.

iptables -A INPUT -p tcp --dport 22 -j REJECT

Now let’s save the firewall rules via the following commands:

netfilter-persistent save netfilter-persistent reload

You can go ahead and check whether you have indeed blocked port 22 by connecting to your server via your computer.

Configure Knockd

Now it is time to configure knockd default settings. It is located at “/etc/knockd.conf.” To do so, change to the knockd configuration file using the following command:

cd /etc sudo leafpad knockd.conf

For illustration purposes, I am using the leafpad editor. On your server you can use nano or Vi.

The screenshot shows the knockd configuration file.

knockd

  • Options: You can find configuration options for Knockd in this field. As you can see in the screenshot above, it uses syslog for logging.
  • OpenSSH: This field is made up of sequence, sequence timeout, command and tcp flags.
  • Sequence: It shows the port sequence that can be used as a pattern by the client to initiate an action.
  • Sequence Timeout: It shows total time allocated to Clients to complete the required port knock sequence.
  • Command: This is the command that will be executed once the knocking sequence by the client matches the pattern in the sequence field.
  • TCP_FLAGS: This is the flag that must be set on the knocks issued by the client. If the flag was incorrect but the knock pattern bcorrect, the action will not be triggered.

Note: The iptables command in the OpenSSH section in Knockd configuration file uses the -A option to append this rule to the end of the INPUT chain. This causes all the remaining connections to drop.

To prevent it, replace it with the following below:

command = /sbin/iptables -I INPUT 1 -s %IP% -p tcp --dport 22 -j ACCEPT

This command ensures that a new rule will be added to the top of the INPUT chain to accept ssh connections.

Enable and Start Knockd Service

Use the following procedure to enable the knockd service in “/etc/default/knock.”

Change value from 0 to 1 as shown in the screenshot.

knockdconf

knockdconf-1

Afterwards, save and close the file “/etc/default/knockd.”

Next, you can start the knockd service by using one of the following commands:

sudo service knockd start

or

sudo systemctl start knockd

Time to Knock-Test Your Linux Server

Now it’s time to test your Linux SSH server. To open port 22 at a specified IP address, use the following on your computer. (You will need to install knockd on your computer, too)

knock -v my-server-ip 7000 8000 9000

You need to replace “my-server-ip” with your server’s IP address.

You can now connect to port 22 SSH by using the following command:

After you have finished with whatever you wanted to do via port 22, you can close it using the following command:

knock -v my-server-ip 9000 8000 7000

Conclusion

With knockd, you are well-assured that your SSH server is secured nad safe from attackers with sophisticated scanners. In addition, you are completely in charge of your SSH server.

How to Create a Hosting-Free Website With Itty Bitty

Source: https://www.makeuseof.com/tag/create-hos…-website-itty-bitty/
Capture Date: 16.09.2018 23:03:49

With programming, online creativity knows no bounds. Every day, programmers across the Internet use their skills to create small projects for the public. Itty Bitty, a website created by former designer for Google and current vice President at Dropbox Nocholas Jitkoff, is one such small project.

Using the Itty Bitty site, you can create a tiny HTML website for free even if you don’t have any web hosting.

An Itty Bitty Explanation

Build a hosting free HTML website with Itty Bitty

Here’s how it works: itty.bitty.site creates small sites by loading them through their URLs. In other words, your site is stored, and presented, within its link.

Because of this, websites created using Itty Bitty require absolutely no web hosting. The URL itself holds the entire data of the site: what it looks like, what it says, etc.

You’ll note that once you receive your Itty Bitty link, it’ll be a bit larger than usual. That’s your entire website.

Link for Link

Build a hosting free HTML website with Itty Bitty

The actual site created by Itty Bitty has a very minimal interface. Keep in mind, every additional page on the site is created using the site itself.

From this page, you can immediately begin using basic HTML for create a simple page.

If you want to create a more robust Itty Bitty site, you can either drag and drop an HTML document directly into the website or link an existing project directly into the prompt.

While your document or link may use other programming languages like CSS or JS, they’ll still be loaded with your Itty Bitty site. That said, the main benefit of using Itty Bitty (and the central reason it can be loaded from an address) is that your page has to be kept under a certain, small size.

How Small Is an Itty Bitty Site?

Build a hosting free HTML website with Itty Bitty

If Itty Bitty is free and requires no web hosting, how big can your site really be? The answer: not very.

The site presents the size of your website to you at the top-right portion of the window. While sites can fluctuate in size, that also means your link will fluctuate in size as well. Some sites won’t allow you to share links larger than a few bytes, which can limit your ability to share bigger sites.

Luckily, the creator has posted the max byte sizes possible for plenty of popular platforms to explain what sizes different platforms will accommodate:

Build a hosting free HTML website with Itty Bitty

If you’re looking to shorten a website using Bitly, for example, you’re going to have to create a very small website. That goes for Microsoft Edge as well. If you’re only looking to share it across browsers, however, you can create a much larger site.

From Link to Itty Bitty Site

While you can also create Itty Bitty sites by dropping HTML files directly into it or by typing the site contents directly, I’ll demonstrate using a Codepen project previously made by Dudley Storey.

Codepen is the easiest way to create your site using Itty Bitty. Codepen provides users with both an easy-to-use developer environment and a convenient linking process.

Build a hosting free HTML website with Itty Bitty

The above is a fantastic example of how a strong HTML backbone—and other subtle programming additions—can create a simple website. Luckily, it’s also small enough to share across many of the platforms listed above.

To convert a Codepen project into an Itty Bitty site, paste the Pen’s link into the Itty Bitty site. Then, mouse over the gray untitled section and edit the text to reflect your site.

Build a hosting free HTML website with Itty Bitty

Next, click on the menu at the top right of the window.

Build a hosting free HTML website with Itty Bitty

This is where you create the link to your Itty Bitty. While it may not seem as though you’ve just created a website, you have!

Once you click the copy link option, you can paste the link into your browser to view the site. Also important to note: by default, Itty Bitty sites can be sent via QR code.

That allows for a slew of options, like attaching a physical reference for lost devices.

Build a hosting free HTML website with Itty Bitty

Congrats, you now have a ready-to-link website that is server-less and free!

Shorten Your Itty Bitty Link Even Further

You can also create a clutter-free link using a link shortening tool. I’ll use Bitly, which not only allows you to shorten links but also allows you to customize the link with your own text if you sign up for a free account.

Our original Codepen example is too large to condense using Bitly, so here’s another fantastic project by JT Helms. I simply followed the process above to convert this Pen to an Itty Bitty site.

Once you have your link, head to Bitly. Paste your link into Bitly’s splash page, or sign into your account and select the Create button. Enter your link in the following prompt.

Build a hosting free HTML website with Itty Bitty

Once you’ve pasted your link, it will automatically be converted. Then, adjust your link as you see fit using Bitly’s editor if you’re logged in.

Build a hosting free HTML website with Itty Bitty

I change the initial link to ITTYBITTYEXAMPLE. You can now head to bit.ly/ITTYBITTYEXAMPLE as you would any other site—except, of course, that it’s free and requires no web hosting or server maintenance.

Security for Itty Bitty Sites

Build a hosting free HTML website with Itty Bitty

While this is a cool and ingenious way to create small HTML sites, it’s not without its flaws. You can misuse an Itty Bitty site as easily as you can any other. That means sites can annoy you with features like alerts.

Since the site is still in an experimental phase, don’t necessarily rely on the site as a main method of establishing a safe web presence.

The Itty Bitty Possibilities Are Endless

Creativity found online is often impressive. Rarely, however, is it as simple, accessible, and easy to use as Itty Bitty. Want to showcase a small application? Messing around with div elements? It’s all readily doable using the Itty Bitty site.

Moreover, you’re not limited to a certain number or sites. Take a note from the site’s creator Nocholas Jitkoff and link a site within a site for a comprehensive, multi-page explanatory website. Or make an ASCII bulldog. The possibilities are small in size, but endless in scope, so try out this little online experiment today!

Go further and make even better sites by improving your knowledge of HTML and CSS before creating an Itty Bitty site!

Learn HTML and CSS with These Step by Step Tutorials Learn HTML and CSS with These Step by Step Tutorials Curious about HTML, CSS, and JavaScript? If you think that you have a knack for learning how to create websites from scratch — here are a few great step-by-step tutorials worth trying. Read More

5 of the Best Self-Hosted URL-Shortener Scripts

Source: https://www.maketecheasier.com/best-self…8Make+Tech+Easier%29
Capture Date: 16.09.2018 22:38:59

URL shortener scripts are the latest buzz in the link-sharing business today. This niche has evolved over the years to become more than a simple service for sharing links. Now they can be used for analytics and more complicated stuff.

After Google decided to end their Goo.gl URL-shortening service, many people started looking for self-hosted alternatives to host their links. The following self-hosted URL shortener scripts grant you absolute control and allow you to tweak and adjust your links to suit your peculiar taste.

The following are five of the best URL shortener scripts available.

1. YOURLS

The ingenious creators of this excellent script prefer a more relatable name. YOURLS stands for “Your Own URL Shortener.” It is a set of optimized PHP scripts that allow you to run your URL shortener on any server of your choosing.

url-shortener-scripts-yourls

Unlike most of the competition, YOURLS is unique for a few reasons. First, it is open source, which has increased the level of refinement the PHP script has undergone over time.

It’s also bundled with features that allow you to decide how accessible your shortened links will be. Now you can set your links to “Private” or “Public” at your discretion.

Other features include the ability to check impressive link statistics. Some of these stats are click rate, the location of visitors and referrals tracking.

url-shortener-scripts-yourls-working

If you are seeking a solidly-coded PHP URL-shortener script, then you should check YOURLS out.

2. POLR

Another excellent solution for a URL-shortening service is POLR. Like YOURLS, it is also open source. The creators tout this tool as lightweight and fast. You’ll be shocked to find out that it is no hype at all.

url-shortener-scripts-polr

POLR is one of the neatest self-hosted URL shortener scripts available on the Web today. It is straightforward to install and takes next to no time to understand.

Its modern interface ensures that managing and controlling your links are a walk in the park. You have the option to tweak and brand it to your taste with minimal effort.

Its robust API is one of the best in the business. Now you can integrate this tool into your other services without any hassle.

If you are looking for a simple yet powerful URL shortener script, look no further. You have POLR!

3. Wurlie

In the business of shortening URLs, simplicity is a real virtue. The makers of Wurlie understand this rule, and they incorporate it into their URL shortener better than the competition. Wurlie is a simple, but incredibly powerful, PHP script.

url-shortener-scripts-wurlie

Despite its simplicity, it offers more features than most other solutions. It is very secure, with provisions for fighting off phishing and malware attacks.

It is also built for heavy site traffic, so if your website needs a tool that can take the onslaught, go for Wurlie. Other features include its robust support for Google Ads as well as social media sharing.

url-shortener-scripts-wurlie-dashboard

The process of installation is painless, too. There is enough documentation to guide a complete novice without much trouble.

4. Z.ips.Me

This self-hosted URL shortener script is one of the simplest to install and run on your website. It is an entirely open-source script that is continuously improved upon by a large community of users.

url-shortener-scripts-zipsme

Z.ips.ME greatly emphasizes privacy. It provides the feature to ensure that your links remain as private as you would want.

Other powerful features include statistics view. Z.ips.ME allows you to view and analyze your links for clicks and referrals. You also get to know which browsers they use to access your links and many more.

url-shortener-scripts-zipsme-statistics

Its responsive design on both mobile and tablet devices is a huge relief. This feature means you can use it without qualms on any screen size.

5. Lessn More

This URL shortening script has been around the block for quite a while now. In fact, it is a modified version of another shortening script – Lessn – but way better.

url-shortener-scripts-lessn-more

Lessn More comes bundled with some of the best features that you’ll need for a self-hosted URL-shortening script. It also comes with an impressive simplicity that allows you to focus on what you need while ignoring everything else.

url-shortener-scripts-lessn-more-mac

It also incorporates smart features to ensure that your links are not getting skipped over. One of these features prevents two similarly-styled alphabets from being used side by side. Another feature screens and blocks offensive words from your shortened URL. It uses a block list that you can edit.

Its support for custom URLs lets you edit your link for your peculiar purpose. Its rich API supports give you the flexibility to leverage multiple services.

Conclusion

URL-shortening scripts have gone past being simple tools used for social media-sharing purposes. Marketers now employ them for sophisticated marketing campaigns as well as data analytics. Whatever solution you decide to adopt, ensure that it suits your purpose well.