Skip to content

Instantly share code, notes, and snippets.

@soheilsec
soheilsec / CISCO PAM IBSng
Created October 23, 2023 17:18
CISCO PAM IBSng
#!/bin/bash
#cisco PAM
#comment privious installation
sed -e '/exclude=ocserv libev/ s/^#*/#/' -i /etc/yum.conf
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
read -p "IP address: " -e -i $IP IP
if echo "$IP" | grep -qE '^(10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|192\.168)'; then
echo
echo "Enter Public IPv4 Address"
@soheilsec
soheilsec / cisco passwd ubuntu
Created October 22, 2023 11:14
cisco passwd ubuntu
#!/bin/bash
#cisco
read -p "Port cisco : " PORT
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
read -p "IP address: " -e -i $IP IP
# If $IP is a private IP address, the server must be behind NAT
if echo "$IP" | grep -qE '^(10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|192\.168)'; then
echo
echo "Enter Public IPv4 Address"
@soheilsec
soheilsec / openconnect or cisco VPN centos Script
Created October 18, 2023 05:41
openconnect or cisco VPN centos Script
#!/bin/bash
#cisco
read -p "Port cisco : " PORT
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
read -p "IP address: " -e -i $IP IP
# If $IP is a private IP address, the server must be behind NAT
if echo "$IP" | grep -qE '^(10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|192\.168)'; then
echo
echo "Enter Public IPv4 Address"
@soheilsec
soheilsec / softether
Last active October 15, 2023 05:17
softether
https://www.softether-download.com/en.aspx
اگر زمان اتصال مشکل داشتید
اررور
"The time on the server and the client does not match"
sudo timedatectl set-timezone Asia/Tehran
بزنید تایم با ایران سینک بشه
softether / L2tp / SSTP / OPENVPN
@soheilsec
soheilsec / Letsencrypt Mikrotik
Created October 5, 2023 15:30
Letsencrypt Mikrotik
/certificate enable-ssl-certificate dns-name=domain.com
@soheilsec
soheilsec / Mikrotik Split Tunnel
Created October 5, 2023 12:33
Mikrotik Split Tunnel
/system scheduler
add interval=1d name="address lists IR1" on-event=\
    "/tool fetch url=http://www.iwik.org/ipcountry/mikrotik/IR\r\
    \n/import file-name=IR" policy=read,write,test start-time=startup
/tool fetch url=http://www.iwik.org/ipcountry/mikrotik/IR
/import file-name=IR
@soheilsec
soheilsec / Warp Mikrotik
Last active April 9, 2025 18:33
WARP Mikrotik
اول باید یک ای پی ورژن 6 مجانی برای میکروتیک بگیرید
https://tunnelbroker.net
بعدش بیاید بر اساس سیستم عامل فایل اجرایی دانلود کنید باهاش اکانت وارپ بسازید
https://github.com/ViRb3/wgcf/releases/tag/v2.2.19
باید 2 تا فیل بگیرید
[Interface]
PrivateKey = 4FbzCmwpi6eQ+hdwfI1PB7MERe7n9epNA0YJsGWbSHg=
@soheilsec
soheilsec / IBSng Install
Created October 4, 2023 16:32
IBSng Install
yum install httpd php postgresql postgresql-server postgresql-python perl iptables-services tar zip unzip wget nano bzip2 install nano lsof net-tools -y
nano /etc/selinux/config
wget https://managedway.dl.sourceforge.net/project/ibsng/IBSng-A1.24.tar.bz2
tar -xvjf IBSng-A1.24.tar.bz2 -C /usr/local
@soheilsec
soheilsec / IKEV2 Mikrotik
Created October 3, 2023 14:36
IKEV2 Mikrotik
0. install usermanager mikrotik IRAN
1. clock
/system clock
set time-zone-name=Asia/Tehran
/system clock manual
set time-zone=+03:30
2. ntp
/system ntp client
@soheilsec
soheilsec / Linux SSH VPN
Last active October 2, 2023 17:44
Linux SSH VPN
if [ $(id -u) -eq 0 ]; then
read -p "Enter username : " username
egrep "^$username" /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
echo -e "user $username exists!"
exit 1
fi
read -p "Enter expire date ( y-m-d ) example 2023-06-10 : " date
read -p "Enter traffic (GB) : " traffic
read -p "Enter password : " password