Skip to content

Instantly share code, notes, and snippets.

View lpsouza's full-sized avatar

Luiz Souza lpsouza

View GitHub Profile
@nikallass
nikallass / check-smb-v3.11.sh
Created March 11, 2020 04:57
CVE-2020-0796. Scan HOST/CIDR with nmap script smb-protocols.nse and grep SMB version 3.11.
#!/bin/bash
if [ $# -eq 0 ]
then
echo $'Usage:\n\tcheck-smb-v3.11.sh TARGET_IP_or_CIDR'
exit 1
fi
echo "Checking if there's SMB v3.11 in" $1 "..."
nmap -p445 --script smb-protocols -Pn -n $1 | grep -P '\d+\.\d+\.\d+\.\d+|^\|.\s+3.11' | tr '\n' ' ' | replace 'Nmap scan report for' '@' | tr "@" "\n" | grep 3.11 | tr '|' ' ' | tr '_' ' ' | grep -oP '\d+\.\d+\.\d+\.\d+'

mlgrm's run ubuntu in crostini

this gist is out of date and remains here only for reference

This is just a modification of this reddit to minimize copying and pasting, make it less interactive, and to allow creation of a username of your choice instead of the default google email address.

# #How to run Ubuntu with full Chrome OS Integration
# Here's a post that shows in detail how to make the default penguin container run Ubuntu instead of Debian:
# [Introduction to Crostini - Part 3: Using Ubuntu by default](https://linuxiumcomau.blogspot.com/2018/08/introduction-to-crostini-part-3-using.html)
@jmassardo
jmassardo / Invoke-WebRequest_Ignore_SSL.ps1
Created February 26, 2019 15:19
PowerShell hack to ignore ssl certificates when using Invoke-WebRequest
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
@reg2k
reg2k / Fallout 4 All Console Commands.txt
Created March 4, 2018 16:29
Dump of all Fallout 4 console commands (with description)
-----------------------------------------------------------------------------------------
ID Full Name Short Name Description
-----------------------------------------------------------------------------------------
256: Show TST Show global scripts and variables.
257: ShowVars SV Show variables on object. You can optionally specified a papyrus variable or script to filter with [player->sv]
258: ShowGlobalVars SGLV Show all global variables.
259: ShowQuestVars SQV Show quest variables. You can optionally specified a papyrus variable or script to filter with [svq QuestID]
260: ShowQuests SQ List quests.
261: ShowQuestAliases Show quest aliases. [ShowQuestAliases QuestID]
262:
@asvignesh
asvignesh / Build_seed_iso
Created January 6, 2018 07:42
Samples to create a cloud-init configuration ISO.
$ genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data
@alexjebens
alexjebens / ghost-network-adapters-powershell.ps1
Last active January 22, 2023 22:55
Remove Ghost Network Adapters with PowerShell only
$T = @"
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Win32
{
public static class SetupApi
{
// 1st form using a ClassGUID only, with Enumerator = IntPtr.Zero
@eberlitz
eberlitz / ng-watchers-list.js
Created June 27, 2016 17:34
Ordered list of angular watchers in a page.
function humanReadableWatchExpression (fn) {
if (fn == null) {
return null;
}
if (fn.exp) {
fn = fn.exp;
} else if (fn.name) {
fn = fn.name;
}
return fn.toString();
@emorin
emorin / ElmahSQLAzureScript.sql
Created February 19, 2016 17:37
Elmah SQL Azure Script
--~Changing index [dbo].[ELMAH_Error].PK_ELMAH_Error to a clustered index. You may want to pick a different index to cluster on.
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo]. [ELMAH_Error]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ELMAH_Error](
[ErrorId] [uniqueidentifier] NOT NULL,
[Application] [nvarchar](60) NOT NULL,
[Host] [nvarchar](50) NOT NULL,
[Type] [nvarchar](100) NOT NULL,
@ppmathis
ppmathis / portknocker.ps1
Last active March 15, 2024 21:13
PowerShell Portknocker
# Remove old readonly constants from session
Remove-Variable -Name KNOCK_DESTINATION -Force -ErrorAction SilentlyContinue
Remove-Variable -Name KNOCK_VALID_TYPES -Force -ErrorAction SilentlyContinue
Remove-Variable -Name KNOCK_PORTS -Force -ErrorAction SilentlyContinue
Remove-Variable -Name KNOCK_EXE_TARGET -Force -ErrorAction SilentlyContinue
# === SCRIPT CONFIGURATION ===
Set-Variable KNOCK_DESTINATION -Option ReadOnly -Value "1.2.3.4"
Set-Variable KNOCK_VALID_TYPES -Option ReadOnly -Value ("TCP", "UDP")
Set-Variable KNOCK_PORTS -Option ReadOnly -Value ((1, "TCP"), (2, "TCP"), (3, "UDP"), (4, "UDP"))
@antoniocapelo
antoniocapelo / bearerHttpInterceptor
Created February 13, 2015 21:14
AngularJS HTTP Interceptor for Bearer Token Auth Requests
app.factory('BearerAuthInterceptor', function ($window, $q) {
return {
request: function(config) {
config.headers = config.headers || {};
if ($window.localStorage.getItem('token')) {
// may also use sessionStorage
config.headers.Authorization = 'Bearer ' + $window.localStorage.getItem('token');
}
return config || $q.when(config);
},