Skip to content

Instantly share code, notes, and snippets.

View Mehran's full-sized avatar
🎯
Focusing

Mehran Mehran

🎯
Focusing
View GitHub Profile
@Mehran
Mehran / wireguard.sh
Last active June 16, 2023 11:53
WireGuard setup Server Side
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Release : 2018-10-24
# Update : 2018-12-22
# Description : WireGuard Automation - Server Side
# Version : 1.3
###############
### Color's ###
Get-ADUser -Filter {(Enabled -eq "True") -and (PasswordNeverExpires -eq "True")} -Properties SamAccountName, PasswordNeverExpires | ft Name, SamAccountName, PasswordNeverExpires
Get-ADUser -Filter {(Enabled -eq "True") -and (PasswordNeverExpires -eq "False")} -Properties SamAccountName, PasswordLastSet | Where PasswordLastSet -le (Get-Date).AddDays(-30) | ft Name, SamAccountName, PasswordLastSet
Get-ADUser -Filter {(Enabled -eq "True") -and (PasswordNeverExpires -eq "False")} -Properties SamAccountName, LastLogon | Where-Object {([datetime]::FromFileTime($_.LastLogon) -le (Get-Date).AddDays(-90))} |ft Name, SamAccountName, {[datetime]::FromFileTime($_.LastLogon)}
Get-ADGroupMember 'domain admins' | select name,samaccountname
Get-ADGroupMember 'enterprise admins' | select name,samaccountname
Get-LocalGroupMember "admins local fhbf"
echo "deb http://http.kali.org/kali kali-rolling main contrib non-free" >> /etc/apt/sources.list
apt-get install kali-archive-keyring -y
apt-get update
apt-get upgrade -y --allow-unauthenticated
apt-get install kali-linux
@Mehran
Mehran / gist:d3541a4af0bd7f9226bcaf1072c2adb4
Created February 15, 2021 05:35
Install owncloud Ubuntu 20.04
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Release :2021-02-15
# Description : Install owncloud on ubuntu 20.04
# Version : 1.0
###############
db_name="owncloud"
db_username="ownclouduser"
@Mehran
Mehran / sshtelegram.sh
Last active May 31, 2019 17:27
Bot that posts SSH logins to Telegram
#!/bin/bash
KEY="<your bot token>"
URL="https://api.telegram.org/bot$KEY/sendMessage"
TARGET="<your chat ID>" # Telegram ID of the conversation with the bot, get it from /getUpdates API
TEXT="User *$PAM_USER* logged in on *$HOSTNAME* at $(date '+%Y-%m-%d %H:%M:%S %Z')
Remote host: $PAM_RHOST
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
@Mehran
Mehran / insta_backup.sh
Last active January 9, 2019 05:42
Instapy Backup
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Release : 2019-01-06
# Description : InstaPy Backup
# Version : 1.1
###############
if [ ! -d /root/backup ]; then
mkdir -p /root/backup;
@Mehran
Mehran / instapy-easy.sh
Last active December 18, 2018 13:54
instapy-easy.sh
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Update : 2018-11-12
# Description : Automation Installer (Ubuntu 18.0 & Ubuntu 16.0)
# Version : 1.2
###############
echo -e "[*] General dependencies..."
apt-get update
apt-get -y upgrade
@Mehran
Mehran / uploader.sh
Created December 4, 2018 10:19
Upload files to Dropbox
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Release : 2018-12-04
# Description : File Download then Upload to Dropbox
# Version : 1.2
###############
path_to_upload() {
default_up_path="/Education"
read -p $"Enter Path to upload (Enter to default): " up_path
@Mehran
Mehran / git-update.sh
Last active August 9, 2018 06:20
Automatic Gist update
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Release : 2018-04-07
# Description : Git auto update for repository
# Version : 1.2
###############
### Colors ####