Skip to content

Instantly share code, notes, and snippets.

"Use the source luke"

Omar Mochtar iomarmochtar

"Use the source luke"
Block or report user

Report or block iomarmochtar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
iomarmochtar /
Last active Dec 31, 2019
Simple way to convert .ini file to dict
from configparser import ConfigParser
from pprint import pprint
def as_dict(ini_file):
config = ConfigParser()
config.read_file(open(ini_file, 'r'))
return { x: dict(config[x]) for x in config.sections() }
pprint( as_dict('main.ini') )
iomarmochtar / ZimbraHelpers.php
Created Nov 17, 2019
A Simple of using zimbra api in yii2 webapp
View ZimbraHelpers.php
// Author: Imam Omar Mochtar (
namespace app\models;
use Yii;
use Zimbra\Admin\AdminFactory;
use Zimbra\Admin\Request\CreateAccount;
use Zimbra\Struct\KeyValuePair;
use Zimbra\Struct\AccountSelector;
use Zimbra\Enum\AccountBy;
iomarmochtar /
Created Nov 16, 2019
Simple script to start & stop pgadmin4 container
## Author: Imam Omar Mochtar (
## Func: Simple script to start and stop pgadmin4 container
iomarmochtar /
Created Nov 8, 2019
Move user's OU by sAMAccountName for samba4
# Author: Imam Omar Mochtar (
# Move user's OU by sAMAccountName for samba4
# arg1 = param name, arg2 = value, arg3 = default value
if [ "$2"x == "x" ] && [ "$3"x == "x" ]; then
echo "$1 dimasukan diset"
exit 1
import smtplib
import random
fromaddr = ''
toaddrs = ''
subject = 'This can be a fraud'
message_id = '%032x@randommail'%random.getrandbits(128)
username = 'mcuser'
password = 'mcpassword'
iomarmochtar /
Created Jul 17, 2019
Utilizing ozpy for doing SSRF
__author__ = 'Imam Omar Mochtar ('
WARNING : For learning purpose only !!!
This is example of utilizing ozpy for gaining zimbra admin rights through SSRF vulnerability
import sys
import requests
iomarmochtar /
Created Jul 4, 2019
a python library to generating xml tag
__author__ = ('Imam Omar Mochar', ('',))
Simple XML builder, i create it for generating HTML tag(s)
# alternative of xml attribute that also become keyword in python side
'klass': 'class'
iomarmochtar / zimbra_after_xxe.txt
Last active Apr 13, 2019
My Zimbra Got Hacked by XXE bug What Should I do ?
View zimbra_after_xxe.txt
- i suggest you for not delete any script or program that intruder put into your server, you can backup it and see how it's works.
so you can learn how it operated and can determine impact in your server.
- before or in parallel you do backup please make sure that your server is clean first by any backdoor !!!.
- you may considering reinstall your OS if the damaged from intruder was quite heavy,
eg: they are replacing some coreutils or some crucial daemon (SSH for instance).
in general you may see by detail any folder that zimbra user has write access to it.
but these are the common way you may check:
iomarmochtar /
Created Jan 15, 2019
Python script to download google fonts
__author__ = ('Imam Omar Mochtar', '')
import urllib2
import sys
import os
import re
FONTS_DIR = 'fonts'
CSS_FILE = 'offline.css'
site = sys.argv[1]
iomarmochtar /
Created Sep 22, 2018
Get all COS (Class Of Service) including user assigned to it. #zimbra
__author__ = ('Imam Omar Mochtar', ('', ''))
Get all COS including user assigned to it. you may run this script inside zimbra's server (LDAP server is recommended)
from com.zimbra.cs.account import Provisioning
You can’t perform that action at this time.