add ldap,python and sql workshops

This commit is contained in:
fram3d 2023-04-03 11:17:41 +02:00
parent 5c3009ec6d
commit ee450b6c51
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
8 changed files with 169 additions and 0 deletions

39
Makefile Normal file
View File

@ -0,0 +1,39 @@
all: dnsssh.pdf fediverse.pdf ldap.pdf mrezeosi.pdf python.pdf recon.pdf sql.pdf stajedecentrala.pdf surveillancerequired.pdf tls.pdf uvodulinux.pdf uvodumreze.pdf
dnsssh.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/dnsssh/dnsssh.md -o slides/dnsssh/dnsssh.pdf
fediverse.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/fediverse/fediverse.md -o slides/fediverse/fediverse.pdf
ldap.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/ldap/ldap.md -o slides/ldap/ldap.pdf
mrezeosi.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/mrezeosi/mrezeosi.md -o slides/mrezeosi/mrezeosi.pdf
python.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/python/python.md -o slides/python/python.pdf
recon.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/recon/recon.md -o slides/recon/recon.pdf
sql.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/sql/sql.md -o slides/sql/sql.pdf
stajedecentrala.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/stajedecentrala/stajedecentrala.md -o slides/stajedecentrala/stajedecentrala.pdf
surveillancerequired.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/surveillancerequired/surveillancerequired.md -o slides/surveillancerequired/surveillancerequired.pdf
tls.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/tls/tls.md -o slides/tls/tls.pdf
uvodulinux.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/uvodulinux/uvodulinux.md -o slides/uvodulinux/uvodulinux.pdf
uvodumreze.pdf:
pandoc -t beamer -V theme:Warsaw -i slides/uvodumreze/uvodumreze.md -o slides/uvodumreze/uvodumreze.pdf
clean:
rm -f slides/dnsssh/dnsssh.pdf slides/fediverse/fediverse.pdf slides/ldap/ldap.pdf slides/mrezeosi/mrezeosi.pdf slides/python/python.pdf slides/recon/recon.pdf slides/sql/sql.pdf slides/stajedecentrala/stajedecentrala.pdf slides/surveillancerequired/surveillancerequired.pdf slides/tls/tls.pdf slides/uvodulinux/uvodulinux.pdf slides/uvodumreze/uvodumreze.pdf

BIN
slides/ldap/ldap.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

83
slides/ldap/ldap.md Normal file
View File

@ -0,0 +1,83 @@
# LDAP
# Sta je LDAP?
- Protokol za cuvanje i pristup podatcima
- Uglavnom informacije o korisnicima (username,password)
- Hierarhijska struktura (grupe korisnika)
- Veliki broj servisa ima opciju za LDAP za korisnike
# Hierarhija
![ldap](slides/ldap/ldap.jpg)
# Hierarhija
- Domain component (DC)
- Organizational Unit (OU)
- Korisnici (UID)
# Klase i atributi
- Distinguished Name (dn)
- Object class
- Atributi
# Search
(&(objectClass=person)(givenName=John))
# OpenLDAP
OpenBSD-ova implementacija LDAP-a
# Python
python3-ldap3 biblioteka
# python3-ldap3 setup
CONNECTION TO LDAP SERVER
from ldap3 import Server,Connection,ALL,MODIFY_REPLACE
s=Server('192.168.122.233',use_ssl=True,get_info=ALL)
c=Connection(s,'cn=cn=admin,dc=example,dc=com','secret',auto_bind=True)
# python3-ldap3 setup
ADD DC OBJECT
objectClass = ['dcObject', 'organization']
attributes = {'o' : 'example', 'dc' : 'example'}
c.add('dc=example,dc=com',objectClass, attributes)
# python3-ldap3 setup
ADD ORGANISATIONAL UNIT
objectClass = ['top', 'organizationalUnit']
attributes = {'ou' : 'users'}
c.add('ou=users,dc=example,dc=com', objectClass, attributes)
# python3-ldap3 manage users
ADD USERS
objectClass = ['top', 'person', 'organizationalPerson', 'inetOrgPerson', 'posixAccount', 'shadowAccount']
attributes = {'cn' : 'user1', 'sn' : 'user1', 'givenName' : 'user1', 'uid' : 'user1', 'uidNumber' : 1001, 'gidNumber' : 1001, 'homeDirectory' : '/home/user1', 'loginShell' : '/bin/sh', 'gecos' : 'SystemUser', 'shadowLastChange' : 19433, 'shadowMax' : '45', 'userPassword' : 'password123'}
c.add('uid='user1,ou=users,dc=example,dc=com',objectClass, attributes)
# python3-ldap3 manage users
DELETE USERS
c.delete('user1,ou=users,dc=example,dc=com')

BIN
slides/ldap/ldap.pdf Normal file

Binary file not shown.

21
slides/python/python.md Normal file
View File

@ -0,0 +1,21 @@
# Uvod u programiranje
# Promenjive
- Mesto gde drzimo podatke
- godina=2023
- godina=2022+1
- prethodna=2022
godina=prethodna+1
# Redosled
- 2023=godina (ne moze!)
- godina+1=2023 (ne moze!)
# Tip
- ime="Dragan"
- prezime="Jovanovic"
- punoime=ime+prezime
- godina="2023"
godina=2023

26
slides/sql/sql.md Normal file
View File

@ -0,0 +1,26 @@
# SQL baze podataka
# Tabele
Tabela
![userstable](./slides/sql/table.png)
# Baza
- vise tabela u jednoj bazi
- pristup preko mreze
- SQL jezik
- pozivanje upita iz drugih jezika
# SQL
- SELECT username,password FROM userstable
- SELECT * FROM userstable
- SELECT password FROM userstable WHERE username='korisnik1'
- INSERT INTO userstable (username, password) VALUES (newuser3, pass1)
# Bezbednost
- SQL injection
- PDO

BIN
slides/sql/sql.pdf Normal file

Binary file not shown.

BIN
slides/sql/table.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB