Skip to content

Instantly share code, notes, and snippets.

View saikatsgupta's full-sized avatar
at ease in my own 'shell' 8-)

Saikat Sengupta saikatsgupta

at ease in my own 'shell' 8-)
View GitHub Profile
saikatsgupta /
Created October 18, 2023 15:26
Test the connectivity
import socket
def check_conn():
conn_data = [
('', '', 443),
('', '', 8080)
for name, host, port in conn_data:
saikatsgupta /
Created August 21, 2023 05:05
Extract Cert and Key from PFX
  • Extract the CA certs only: openssl pkcs12 -in mtf.pfx -out ca_certs.pem -cacerts -nokeys

  • Extract the Client certs only: openssl pkcs12 -in mtf.pfx -out client_certs.pem -clcerts -nokeys

  • Extract Private Key Only: openssl pkcs12 -in mtf.pfx -nocerts -out private.key -nodes

saikatsgupta /
Created October 27, 2022 15:59
bash script template
#!/usr/bin/env bash
# ref -
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
saikatsgupta / Domain Enumeration Commands
Created October 9, 2020 08:11 — forked from its-a-feature/Domain Enumeration Commands
Common Domain Enumeration commands in Windows, Mac, and LDAP
View Domain Enumeration Commands
Domain: TEST.local
User Enumeration:
net user
net user /domain
net user [username]
net user [username] /domain
wmic useraccount
dscl . ls /Users
saikatsgupta / index.html
Created August 9, 2020 09:16
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src=""></script>
<link rel="stylesheet" href=""
integrity="sha384-cg6SkqEOCV1NbJoCu11+bm0NvBRc8IYLRGXkmNrqUBfTjmMYwNKPWBTIKyw9mHNJ" crossorigin="anonymous">
saikatsgupta / TestCafeAssertions.js
Last active January 19, 2020 14:47
TestCafe Assertions
View TestCafeAssertions.js
import { Selector } from 'testcafe';
fixture `Getting Started`
.page ``;
* Docs:
* Signature: await t.expect( actual ).eql( expected, message, options );
saikatsgupta / windows-app-installs.bat
Last active March 24, 2019 13:22
admin powershell script to install all my apps using chocolatey after a fresh OS installation
View windows-app-installs.bat
REM script to install all required apps post fresh OS installation
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString(''))
choco -?
choco feature enable -n allowGlobalConfirmation
choco install 7zip
choco install jdk8
choco install groovy
choco install maven
choco install python
choco install cmdermini
View Jenkinsfile
def getProjectName() {
return 'JenkinsPipeline'
def getJDKVersion() {
return 'jdk1.8.0_101'
def getMavenConfig() {
return 'maven-config'
saikatsgupta /
Created January 20, 2019 08:22
Converts multiple csv files in a singe json file
package com.sai;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
package com.saiko;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;