step to run 1: npm install 2: npm install https://github.com/mapbox/node-sqlite3/tarball/master 3: node restapi.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$uri = "https://urlscan.io/api/v1/scan/" | |
$apikey = #insert secure method to retreive api key | |
$url = #insert suspect url here | |
$header = @{ | |
"API-Key" = $apikey | |
} | |
$body = @{ | |
"url"=$url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import urllib.parse | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
# Configure Database URI: | |
params = urllib.parse.quote_plus("DRIVER={SQL Server};SERVER=sqlhost.database.windows.net;DATABASE=pythonSQL;UID=username@sqldb;PWD=password56789") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"final_space": true, | |
"console_title": true, | |
"console_title_style": "folder", | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"horizontal_offset": 0, | |
"vertical_offset": 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Homebrew Script for OSX | |
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh` | |
echo "Installing brew..." | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
echo "Installing brew cask..." | |
brew tap homebrew/cask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a super **SIMPLE** example of how to create a very basic powershell webserver | |
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity. | |
# Http Server | |
$http = [System.Net.HttpListener]::new() | |
# Hostname and port to listen on | |
$http.Prefixes.Add("http://localhost:8080/") | |
# Start the Http Server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This regex matches anything that's like an IP address (even invalid ones) | |
$regexIPAddress = '\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b' | |
#This regex matches anything like an IP address that starts 10, 172 or 192 | |
$regexIPSpace = '(10|172|192).\d{1,3}\.\d{1,3}\.\d{1,3}\b' | |
#Returns the first IP address in each line of the log file/s then sorts and removes duplicates. | |
Select-String -Path *.log -Pattern $regexIPAddress | ForEach-Object { $_.Matches } | % { $_.Value } | Sort-Object -Unique | Out-File 'UniqueIPs.txt' | |
#Returns from a selection of Log files any lines which match a certain string pattern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -OutputAssembly hello.exe -TypeDefinition @' | |
using System; | |
public class Hello { | |
public static void Main(string[] Args) { | |
System.Console.WriteLine("Hello, world!"); | |
System.Console.Read(); | |
} | |
} | |
'@ |
This is always my answer to all those "compile your .ps1" solutions that are floating around. Why would you wrap your PowerShell in an exe and some custom host?
Just paste this header on the top of your PowerShell script, and then before you share it, rename it with the .cmd
extension. While you're writing, it's a nice syntax-highlighted PowerShell script, and when you rename it, *poof*
it's double-clickable. Drop it in the PATH and you can execute it from the Run dialog or from PowerShell, batch, whatever.
Because there are still people around who actually use CMD, I've updated it to show how to handle passing parameters.
A couple of notes:
- It runs with
ExecutionPolicy
unrestricted because if you're still using CMD you probably haven't configured your ExecutionPolicy - It uses
-NoProfile
to make sure the environment is the same on everyone's PC... - It only creates
function :: {}
because that allows us to ignore the :: on the first line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com> | |
# MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
#Requires -Module MSAL.PS | |
Function New-EXOPSSession { | |
<# | |
.SYNOPSIS | |
Will open a PSSession to Exchange Online. |
OlderNewer