Skip to content

Instantly share code, notes, and snippets.

View shariqmalik's full-sized avatar
:octocat:

Shariq Malik shariqmalik

:octocat:
View GitHub Profile
@shariqmalik
shariqmalik / oneliner_aws_temp_creds_generator.md
Last active August 28, 2023 18:08
Oneliners to generate formated temporary AWS STS credentials based on a preconfigured AWS profile

Oneliners to generate formated temporary AWS STS credentials based on a preconfigured AWS profile.

For Windows (Powershell)

aws sts get-session-token --duration-seconds (Read-Host -Prompt "Session Duration") --serial-number (Read-Host -Prompt "Serial Number") --token-code (Read-Host -Prompt "MFA code") | ConvertFrom-Json | %{$_.Credentials} | %{@{aws_access_key_id=$_.AccessKeyId;aws_secret_access_key=$_.SecretAccessKey;aws_session_token=$_.SessionToken}} | ConvertTo-Json -Compress | %{$_ -replace "{","`n`n[profile-name]`n"} | %{$_ -replace "}",""} |  %{$_ -replace ":"," = "} | %{$_ -replace '"',""} |  %{$_ -replace",","`n"} | %{$_ -replace "profile-name", (Read-Host -Prompt "Profile Name")} | tee -Variable _ | Add-Content $HOME\.aws\credentials

For Linux (bash)

@shariqmalik
shariqmalik / Configure_WSA_for_Pentest.md
Last active July 31, 2024 06:58
Configure WSA (Windows Subsystem for Android) for Pentest
@shariqmalik
shariqmalik / .tmux.conf
Last active February 16, 2023 13:51
My tmux configuration file
# Send prefix
set-option -g prefix C-d
unbind-key C-b
bind-key C-d send-prefix
set -g default-terminal "xterm-256color"
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences