Skip to content

Instantly share code, notes, and snippets.

View mehdichaouch's full-sized avatar
🤖
Happiness Developer

Mehdi Chaouch mehdichaouch

🤖
Happiness Developer
View GitHub Profile
@Tjitse-E
Tjitse-E / rector.php
Created January 29, 2024 13:50
Add missing dynamic properties using RectorPHP
<?php
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(CompleteDynamicPropertiesRector::class);
// Define directories to check
$directories = [

GitHub Search Syntax for Finding API Keys/Secrets/Tokens

As a security professional, it is important to conduct a thorough reconnaissance. With the increasing use of APIs nowadays, it has become paramount to keep access tokens and other API-related secrets secure in order to prevent leaks. However, despite technological advances, human error remains a factor, and many developers still unknowingly hardcode their API secrets into source code and commit them to public repositories. GitHub, being a widely popular platform for public code repositories, may inadvertently host such leaked secrets. To help identify these vulnerabilities, I have created a comprehensive search list using powerful search syntax that enables the search of thousands of leaked keys and secrets in a single search.

Search Syntax:

(path:*.{File_extension1} OR path:*.{File_extension-N}) AND ({Keyname1} OR {Keyname-N}) AND (({Signature/pattern1} OR {Signature/pattern-N}) AND ({PlatformTag1} OR {PlatformTag-N}))

Examples:

**1.

@mehdichaouch
mehdichaouch / README.md
Last active November 30, 2023 17:33
🔧 WordPress Plugins Compatibility from command line with WP-CLI
@tschallacka
tschallacka / Seeder.php
Created November 2, 2022 19:39
Bigbridge importer example
<?php
declare(strict_types=1);
use Symfony\Component\Console\Output\OutputInterface;
use BigBridge\ProductImport\Api\Importer;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use BigBridge\ProductImport\Api\Data\SimpleProduct;
use BigBridge\ProductImport\Api\Data\SimpleProductFactory;
use BigBridge\ProductImport\Api\ImportConfigFactory;
use BigBridge\ProductImport\Api\ImporterFactory;
@SeanCannon
SeanCannon / dnsmasq OS X.md
Created July 14, 2022 02:20 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@vbuck
vbuck / magento-config-diff-generator.php
Created March 18, 2021 15:12
Calculate the diff between 2 Magento core_config_data tables and generate as SQL
<?php
namespace MagentoTools;
class Generator
{
private $config = [
'type' => CsvSnapshotConfig::class,
'left' => null,
'right' => null,
@FredericMartinez
FredericMartinez / tinymce4Adapter.js
Last active March 17, 2021 15:10
Remove <p> WYSIWYG Magento 2
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*
* => app/design/adminhtml/Namespace/project_name/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js
*/
/* global popups, tinyMceEditors, MediabrowserUtility, Base64 */
/* eslint-disable strict */
define([
@zulhfreelancer
zulhfreelancer / delete-github-actions-runs.sh
Last active October 11, 2022 13:01
Delete all GitHub Actions runs
# ===========================================================================
# Requirements
# * gh CLI: https://cli.github.com (make sure you are logged-in to the CLI)
# * jq CLI: https://stedolan.github.io/jq
# ===========================================================================
export TARGET_USER=github_user_or_org
export TARGET_REPO=github_repo_name
while :
@fvln
fvln / Jouons avec le phishing Paypal.md
Last active January 7, 2021 11:02
Quelques observations sur les attaques par phishing ciblant Paypal

Jouons avec le phishing Paypal

Courant septembre, j'ai testé un développement qui cherche des patterns parmi (les certificats TLS venant d'être délivrés publiquement)[http://certstream.calidog.io/]. La limite de cette recherche, c'est qu'elle s'applique sur des noms de domaines et pas des URL complètes ! Il suffit de filtrer ces certificats avec le mot-clé « paypal » pour obtenir des dizaines de noms de domaines malveillants par jour, avec parfois... juste un .zip à la racine. Comme j'en ai attrapé quelques-uns (ici 16shop), c'est l'occasion de les décortiquer ;)

Comment ça marche ?

Essayons de comprendre comment les attaquants travaillent !