Skip to content

Instantly share code, notes, and snippets.

View IhwanID's full-sized avatar

Ihwan IhwanID

View GitHub Profile

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.

@pitt500
pitt500 / TCA_CounterDemo.swift
Created September 17, 2022 22:00
More context about this demo here: https://youtu.be/SfFDj6qT-xg
import SwiftUI
import ComposableArchitecture
struct State: Equatable {
var counter = 0
}
enum Action: Equatable {
case increaseCounter
@felangel
felangel / main.dart
Created October 6, 2021 15:54
[flutter_bloc_recipes] Navigation: Navigator 2.0
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:flow_builder/flow_builder.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class Book extends Equatable {
const Book(this.title, this.author);
final String title;
import UIKit
import XCTest
struct LoggedInUser {
let name: String
}
class LoginViewController: UIViewController {
var login: (((LoggedInUser) -> Void) -> Void)?
var user: String?
@JSerZANP
JSerZANP / ContentView.swift
Created March 4, 2021 14:01
communication between native(swiftUI) and wkwebview
import SwiftUI
import WebKit
struct WebView: UIViewRepresentable {
class Coordinator: NSObject, WKNavigationDelegate, WKScriptMessageHandler {
var webView: WKWebView?
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.webView = webView
}
@nicnocquee
nicnocquee / pokemon-fetch-combine.swift
Created February 5, 2021 17:41
sample of fetching list of pokemon using swift combine
import UIKit
import Combine
struct PokemonResponse: Codable{
let results: [Pokemon]
}
struct Pokemon: Codable{
let name: String
import SwiftUI
import UIKit
final class DatePickerTextField: UITextField {
@Binding var date: Date?
private let datePicker = UIDatePicker()
init(date: Binding<Date?>, frame: CGRect) {
self._date = date
super.init(frame: frame)
@JohnSundell
JohnSundell / StarPlane.swift
Created July 8, 2020 22:41
A simple game written in SwiftUI. Note that this is just a fun little hack, the code is not meant to be taken seriously, and only works on iPhones in portrait mode.
// A fun little game written in SwiftUI
// Copyright (c) John Sundell 2020, MIT license.
// This is a hacky implementation written just for fun.
// It's only verified to work on iPhones in portrait mode.
import SwiftUI
final class GameController: ObservableObject {
@Published var plane = GameObject.plane()
@Published private(set) var clouds = [GameObject]()
@jordansinger
jordansinger / LockScreen.swift
Created May 11, 2020 23:24
Let’s recreate the iPhone lock screen using SwiftUI and Swift Playgrounds on iPad
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
ScrollView {
VStack {
Text("5:45").font(.system(size: 64, weight: .thin))
Text("Monday, May 11").font(.system(size: 24))
}.padding(.vertical, 32)
@mecid
mecid / Calendar.swift
Last active May 8, 2024 13:30
SwiftUI Calendar view using LazyVGrid
import SwiftUI
extension Calendar {
func generateDates(
inside interval: DateInterval,
matching components: DateComponents
) -> [Date] {
var dates: [Date] = []
dates.append(interval.start)