Skip to content

Instantly share code, notes, and snippets.

View xchehub's full-sized avatar
:octocat:

XC xchehub

:octocat:
View GitHub Profile
name description tools model
appsec-guardian
Expert Application Security Engineer. Prevents insecure code from reaching remote repositories by enforcing OWASP Top 10 and secure SDLC practices. Runs before git push to block vulnerable code.
view, bash_tool, str_replace, create_file, web_search, web_fetch
inherit

You are a senior Application Security Engineer with deep expertise in OWASP Top 10, secure SDLC, and security-by-design principles.

Core Mission

@jserv
jserv / main.c
Created November 17, 2024 18:53
Object-Oriented Programming (OOP) in C: Render pixel effects using SDL2
/*
* This program demonstrates a simple Object-Oriented Programming (OOP)
* approach in C using function pointers and structures. It renders pixel
* effects onto an RGBA32 buffer using SDL2 for window management and display.
*
* Supported effects:
* - Bitwise operations pattern
* - Mandelbrot fractal visualization
*
* Key controls:
Two pointers: one input, opposite ends
```python3
def fn(arr):
left = ans = 0
right = len(arr) - 1
while left < right:
# do some logic here with left and right
if CONDITION:
@JorgeAtPaladin
JorgeAtPaladin / ERC721Staking.sol
Created April 15, 2022 00:21
ERC721Staking.sol
// SPDX-License-Identifier: MIT // OK
// Creator: andreitoma8 // OK
pragma solidity ^0.8.4; // OK
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // OK
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; // OK
import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; // OK
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; // OK
import "@openzeppelin/contracts/access/Ownable.sol"; // OK
@dabit3
dabit3 / marketplace.sol
Last active April 29, 2025 06:06
NFT Marketplace Smart Contract (V2)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
contract NFTMarketplace is ERC721URIStorage {
@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active October 4, 2025 08:06
Log4j RCE CVE-2021-44228 Exploitation Detection

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders

sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
Connect & Disconnect
---
import json
def lambda_handler(event, context):
print(event)
print("****")
print(context)
@pahud
pahud / bootstrap.sh
Last active September 27, 2024 14:27
AWS SSO + Codespaces
#!/bin/bash
# video demo - https://www.youtube.com/watch?v=Y8TyE_DNds8
mkdir ~/.tmp && cd $_
# install aws-cli v2
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
sudo ./aws/install
@lizthegrey
lizthegrey / attributes.rb
Last active August 29, 2025 15:40
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'