Privilege Escalation: Writing a User to /etc/passwd
Sometimes an application will be misconfigured and will have the capability to read/write to the /etc/passwd file. This code below creates a hashed password and demonstrates how to echo that into the /etc/passwd file.
Further Reading
https://www.cyberciti.biz/faq/understanding-etcpasswd-file-format/
Parrot OS Configuration
This is how I set up my Parrot OS after installation. There are a few things I believe are missing that should be installed or done. I like to keep things as real as possible so this will be hackers set up.
UFW VPN Kill Switch
This script will disallow traffic through the ethernet and WiFi port and allow...
Enumerating Samba/SMB Servers
Unintentionally leaving port 445 open or misconfiguring Samba can risk catastrophic damage to a corporation. Enumerating the Samba/SMB port can return critical information about file shares, users, printers and network groups. This can be a cornerstone for brute forcing accounts and accessing unprotected Samba shares.
enum4linux
Enum4Linux comes installed on Parrot OS 4.7 by default. You may have to...
PowerShell for Hackers
As I'm learning more PowerShell and dabbling into hacking I will be composing a list of techniques and scripts that I find very beneficial for administration and pen-testing.
Basics
Linux Like Watch Command
System Running Processes
IP to Hostname
Is Server Virtual or Physical?
Lookup User Information
Change File Modified Date and Time
Find Apps Running on Port
Base64
Querying Databases
https://gist.github.com/cmatskas/08411b916ab01e3f1439#file-powershellsqlquery-ps1
Domain Controllers
Downloading Files with PowerShell
PowerShell Reverse Shells
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#powershell
Kubernetes
kubectl...
Customize PowerShell in Windows Terminal
The all-new Windows Terminal is truly amazing and packed with many features. It is also fully customizable! I highly recommend configuring Windows Terminal to have a customized background and to install Oh My Posh.
Setting a Custom Background
If you go to the settings under Windows Terminal it will open a "settings.json" file that is editable.
Settings
Vim
I'm a...
How to Learn Penetration Testing
I personally believe people who want to get into penetration testing should have a very strong foundation in computer science and have either worked professionally as a programmer or an individual in infrastructure.
If you still feel like you are cut out for hacking then here's a guide to how you can approach learning. All of...
Upgrading Firmware on a Ubiquiti Edgerouter Lite with SSH
The Ubiquiti Edgerouter Lite provides the ability to create a virtual LAN (vLAN) for $129 dollars. This is a quality VPN solution that was highly recommend from someone who owns a data center. Seriously... well worth the money.
Upgrading my router from firmware version 1.2 was difficult because there is a bug...
Can you trace an IP Address to a hacker?
This is a very open-ended question with a lot of variables that come into play. Depending upon how skilled the hacker is, determines how and if the hacker can mask or hide their true identity. It's also very critical to know exactly when the hacker was using that IP address because...
SSH Tunneling
When you need to access a server/client behind a firewall that doesn't allow port forwarding you can use SSH tunneling to bypass that if an SSH server is running. Pivoting is a sneaky technique that hackers use to access computers, servers, and services behind firewalls. These examples will use OpenSSH. I think most examples don't explain this well...
CTF: PwnLab Init Walkthrough
https://www.vulnhub.com/entry/pwnlab-init,158/
In this walkthrough, I'll be using Parrot OS. I'll break each vulnerability down and explain it. The video won't demonstrate all of the techniques that could have been applied. I will also list the techniques I've learned from others.
Exploits / Techniques
Local File Inclusions (LFI)Password ReusePrivilege Elevation through compiled code.Remote Code ExecutionReverse ShellSpawning Interactive Shells
Pre-Attack
NetDiscover
First Identify...