Browse Author: dayz

Hey welcome to my lab! My name is Kamil and I do a lot of repetitive things when it comes to my projects. I decided to make a blog about the things I do, so that I can find the things I do constantly easier. Since this is on the web you all will be able to benefit from this and learn news things as I learn them. The site will focus on arduino and raspberry pi tutorials as well as some basic hacking and programming. Thanks for visiting!

How to install Fail2Ban on the Raspberry Pi

About: Fail2Ban is a daemon that scans defined log files and bans IP Addresses that show the malicious signs. It protects your Raspberry Pi from too many password failures or hackers seeking for exploits. It is a must have tool to protect your from intruders to your server or network especially if you allow outside SSH traffic or any traffics from an outside network to your Raspberry Pi. Fail2Ban supports a lot of services (sshd, apache, qmail, proftpd, sasl, asterisk, etc) and can be integrated with your IPTables.

Fail2Ban is very easy to install and setup and will drastically improve security on your Raspberry Pi. Fail2Ban works by monitoring your logs for failures and depending on the settings you setup it will ban or timeout an IP Address for a certain amount of time if it fails to login to your server. It is a great tool and a must have tool to protect your from brute-force attacks.

Objective: To install and setup Fail2Ban to increase security on the Raspberry Pi

Material: You will need the following:

  • Raspberry Pi (Click the link to check out the price on Amazon. Usually around $37 with free shipping)

Instructions: Let’s start off by opening the terminal on your Raspberry Pi or by connecting to it over SSH

Continue Reading

How to change your SSH Port on the Raspberry Pi

About: The latest version of Raspbian disables SSH by default to improve security of the Raspberry Pi. This is a great step of improving internet and network security and I congratulate the Raspberry Pi team for moving forward with this step and making it super easy to enable SSH by simply adding a file called “ssh” into the /boot/ directory.

Enabling SSH allows you to use your Raspberry Pi headless, meaning you can use it without a keyboard and monitor by connecting to it from another computer. The problem still persists that if you have SSH enabled on port 22 hackers can still scan your network looking for an open port 22. They can then attempt to enter your network from the Raspberry Pi and attempt to brute force your username and password.

Changing your SSH port will increase your security assuming a hacker scans your network for default ports only. You will still need to have a secure password and think of using SSH keys to improve security even further. Changing your port number will simply decrease the amount of probe attempts on your port. A non-standard port means that you don’t automatically show up in Shodan or other places that list machines listening on port 22.

Objective: To change our default SSH port number from 22 to another random port number to increase security

Material: You will need the following:

  • Raspberry Pi (Click the link to check out the price on Amazon. Usually around $37 with free shipping)

Instructions: Let’s start off by opening the terminal on your Raspberry Pi or by connecting to it over SSH

Continue Reading

How to Phish Usernames and Passwords from a Rogue Access Point using the Raspberry Pi

About: Setting up a Rogue Access Point on the Raspberry Pi is very easy. Our Access Point will act as a fake network providing free WiFi for our victim. It will have a captive portal which means any website that a user visits will be redirected to our login page where they will need to enter in their credentials to login. You can set the login page up to look like a Facebook or Google login page and name your network “Free Facebook WiFi”. The network I am setting up will not have any internet so everything will be contained on the Raspberry Pi. You can eventually bridge your connection with a 4G network or Ethernet to provide full internet access for users.

The tutorial today will demonstrate how unsafe public WiFi’s are and to never send any personal information over a public WiFi network. We can also setup our Access Point SSID to “attwifi” or “Starbucks”. If you set your access point’s SSID to a popular WiFi SSID then your victims phone will automatically connect to your network if they have been connected to the same SSID before.  The reason for this is that your phone just looks at SSID names and not a MAC Address for a wireless network. This doesn’t apply to phones only, laptops or any WiFi enabled devices will all act the same way.

Objective: To setup a Rogue Access Point and make our network act as a Captive Portal to Phish Passwords

Material: You will need the following:

  • Raspberry Pi (Click the link to check out the price on Amazon. Usually around $36 with free shipping)
  • USB Wireless Adapter (I use the Alpha AWUS036H in this tutorial)

Instructions: Lets start off with a fresh Raspbian install. I installed Rasbian-Lite on my Raspberry Pi since I will be running it headless and will use SSH to connect to my Raspberry Pi.  After you setup your Raspberry Pi lets run the update and upgrade Continue Reading

How to disable WPS on the Netgear WNDR4500 Router

About: WPS stands for Wi-Fi Protected Setup and it is a wireless networking standard that tries to make connections between a router and wireless devices faster and easier. It works only for wireless networks that have WPA/WPA2 security. That’s great, however there is a problem with WPS, it can easily be cracked and allow a hacker access to your home WiFi network.

WPA2 security is very secure and there really is no way of hacking WPA2 without using a dictonary attack which can take months depending on the hardware you are using to bruteforce. It can also be a waste of time if your password is very long and includes many special characters, however if you have WPS enabled on your router (which it usually is by default) there is a faster way to hack your WiFi and it can be usually done in a maximum of 12 hours.

Objective: To disable WPS on our Netgear WNDR4500 router to improve WiFi security.

Material: You will need the following:

Instructions: You will need to begin by opening your browser and typing in the IP address for your router. The default is usually http://192.168.1.1 on Netgear routers. Type in the username and password. The default username is ‘admin’ and the default password is ‘password’.

Login screen for the Netgear WNDR4500 Router

Continue Reading

How to schedule Cron Jobs on the Raspberry Pi

About: I have recently been working on a MMORPG turn based text game and needed a way to run a php script every 2 hours to generate a turn. Since I use the Raspberry Pi as a LAMP server for testing out my game before releasing official updates I figured it would work well as a cron job to call a website page every 2 hours.

You can schedule many types of cron jobs using your Raspberry Pi. Cron is basically the Linux version of the Windows Task Scheduler. You can schedule commands to run at certain times of the day or only run once a month. The shortest time a cron job can run is 1 minute in between commands. If you need a command to repeat every 30 seconds then a cron job will not work.

Objective: To create and schedule a cron job using the terminal on the Raspberry Pi

Material: You will need the following:

  • Raspberry Pi (Click the link to check out the price on Amazon. Usually around $36 with free shipping)

Instructions: Open up a terminal window and type the following command to create a cron job

Continue Reading

How to get the PSK or Password of a WiFi network if you have the WPS Pin

About: I have previously discussed how easily a router that has WPS enabled can be hacked. You can check out my post on how to perform a Pixie Dust Attack and attempt to grab a WPS pin from a unsecured router.  The attack takes a matter of seconds not days and will expose your WiFi password. It doesn’t matter if you are using WPA or WPA2 security since the WPS pin completely bypasses this security. Since you already have the WPS Pin you should be able to connect to the users SSID but you will not know their network password. The method I will show you today will expose their SSID password. If you have their SSID password, they may be using the same password for Facebook or Google or any other website.

A little knowledge about WPS. WPS stands for Wi-Fi Protected Setup and it is a wireless networking standard that tries to make connections between a router and your wireless devices faster and easier. It only works for wireless networks that have WPA/WPA2 security. It is suppose to make it easier to connect devices without a keyboard, like a TV, to your home network. Most routers come with WPS enabled and work by pushing the WPS button on your router and connecting your device. I personally have never heard or WPS before doing this research and have never used it in my personal life.

Objective: To demonstrate how to retrieve the PSK (password) of a WiFi network if you have the WPS Pin

Material: You will need the following:

  • Raspberry Pi (I have PwnPi 3.0 running on mine)
  • USB WiFi Adapter – I used the Panda USB WiFi adapter in this tutorial
  • PwnPi or Kali Linux distro on your Raspberry Pi or Linux machine
  • WPS Pin for the Network you are attempting to steal the PSK (Password)

Instructions: I am using PwnPi distro on my Raspberry Pi which has the tools I will need to get the PSK of the victims WiFi. You will pretty much need ‘WPA_Supplicant’ and ‘WPA Cli’ installed on your distro to expose the PSK so using PwnPi or Kali isn’t really necessary if you want to install those packages separately.
Continue Reading