IV International Conference of Unix at Uninet
  • Presentation
  • Register
  • Program
  • Organizing Comittee
  • Listing of registered people
  • Translators team
Andrés L. Sclippa

pappy-lets talk english
pappy-Andrés L. Sclippa  Argentina. "Unix Application Security Framework"
pappy-*hihi*
pappy-nice name
Humanaqui es la traduccion en espa?ol, cierto ?
damageno al ingles
Humanahh
pappy-errr, yes
pappy-i mean, no
pappy-sorry
damagela charla sera en español
pappy-no clue what you are talking about :-)
Humanahh la va a dar un argentino
damagepappy- lol
Humanoks
damagepappy- Human ask me if the presentation will be in english or not
damageHuman, sep
pappy-i hope so, my spanish is, lets call it, rusty.
damagejeje ok
pappy-but i can work on that
albeirohm, it seems someone like systrace
Humanayy la damaga bilingual
damagejaja
Humani can speak in english too :P
kroczHuman you help in translation at damage ??
albeirobut i will staty for a while
pappy-i came here because somebody on the street outside put a flyer into my hands with the writing on it: free beer if you bring a chick.
damagepappy-, you are waiting for the presentation right ?
Humansure
Humanif you want :P
pappy-well, i did not bring a chick, so i do not qualify for a beer, do i?
Humanlol
pappy-cheer it up folks.
damagepappy-, beer?? i read beer???
Humanhahahah
Humansanta baltica <- !
damageruega por nosotros
Humanhahahah
ACubanitoalguien quiere jugar star craft
ACubanitoalguien quiere jugar star craft
Human...
ACubanitoalguien quiere jugar star craft
ACubanitoalguien quiere jugar star craft
ACubanitoalguien quiere jugar star craft
damageporfavor te dire.. dejate de wuear?
damage:P
krocz:)
kroczACubanito estamos a punto de iniciar una charla
kroczy creo que aqui no es el lugar adecuado
ACubanitoy donde men
damagecual quier parte menos aqui
ACubanitopor que
TigerACubanito prueba en otro servidor.
pappy-pipacs: what am i doing here.  this stuff is spanish.
damagepappy-, no! we will translate the presentation
damageto the english
pappy-is he late?  am i not seeing the star?  where is he, did he step on the red carpet yet?  man, i am really excited!
pappy-this is all spanish to me :-(
pappy-they are talking about me
pappy-i know it!
pappy-its all me they are talking about.
pappy-they are making a fun out of me because my cochones are too small.
damageNice to have you here again
felix!startlog
jaimefelix: Estoy logueando el canal #redes  en [http://felix.zapto.org/jaime/redes.html]
damagefor us is really satisfactory to do this kind of speech
damagebecause of that, in this ocation we will present Andres L. Scippa
damagea "Argentino" from the "Universidad tecnologica nacional Facultad Regional, Resistencia
damagehe is analist of security at www.linuxdevelopment.com.a
damagerecentrly he present a conference to us of "WBEM in Linux"
damageon this time has prepared one presentation related it to
damage"Unix Application Security Framework"
damagewe give the welcome to Andres
damageplease conect to http://170.210.180.9/umeet there you can find the mirrors of the presentation
damageand a log for the people that arrives late
damageyou can make questions at #qc
damagei will answer they here
damagelets start
damageoff all attacks to UNIX systems
damageim going to say when you must change the pic of the presentation, ok
damageat the type of the DoS and buffer overflow are the must popular and dangerous
damage(pic 2)
damageon this presentation i will talk of how delete the second type of attack
damagein UNIX all process run with an a identificator of user and group (UID/GID)
damagethis limits acces of that process to the OS recurses
damagebut its problematic that a lot of applications require a root privileges
damagein *NIX u another privileges
Humanrecurses = resources
damageto work correctly (ej: to change password, need to access to devices
damage<krocz> feistel, you will be based on one SO on special of in general ?
damagein general
damagein effect, determined syscalls privileged or to file systems like /etc
damageso we find that all process run with root pivilegies
damagewhile this process work like they wass designed, any problem
damagei will care, in general, about UNIX
damagethey're asking me to speak a little slow (because of translation [OUR WORK LOL:P])
damagethe problem appears when a attacker gets control of execution of a
damageprocess and execute arbitrary code with process privileges
damageto limit this, *NIX applications have used for years
damagetwo forms, the SUID/SGID and the chroot jailing
damagethe firt idea its the next
damagethe process run normaly with one user with out pivilegies but
damagewhen they require privilegiated access (like root for ex.)
damagewhen they execute a syscall that changes temporaly the user of process
damagefor this motive, the binary must habe S bit activated
damage<trulux> festel, when you speak about in general, chroot jailing
damageyou must speak about another kind of jails, like FreeBSD jails, and dont speak about chroot jails in general, to all Unixes
damagetrulux is right
damagein this case, they refear to chroot jailing, basic in all UNIX
damageavaible in all UNIX
damageon FreeBSD this its more funtional
damage------------------------
damage# ls -aLF /usr/bin/passwd
damage-rwsr-xr-x   1 root     root        44705 Jul  1 00:49 /usr/bin/passwd
damage------------------------
damageyou can see a binary with the activated bit
damagefinished the privilegiated execution the process come up to run with
damagethe limited privileges of the original user
damagechroot jailing what does is to border to the process in filesystem with which if the process is hacked, the attacker
damageit doesnt have access to the rest of filesystems
damagethis techniques offers a limited security
damagethe SUID/SGID and the chroot can change easily once that
damageproccess has been comprometed
damagethe stack-smahing attack or buffer overflow attack appears when the procces
damagerequire that external dates have to put in the buffer
damage(really the buffer overflow its a special type of sttack-smahing,
damagebut we will take like sinonimous here to facilitate)
damage<trulux> fesitel, the chroot can be compromised in execution time to various kinds of "tricks", from do a double chroot even to try kill proceses outside it
damagehow truluix says, chroot is really vulnerable
damageor variable
damageand the vulnerable application dont control exactly
damagethe size of those external data
damagethis makes that if data has a bigger size than buffer size
damagethat contains it
damageat the time of storing it, contiguous parts of the memory
Human<trulux> fesitel, the chroot can be compromised in execution time to various kinds of "tricks", from do a double chroot even to try kill proceses outside it
Humanhow truluix says, chroot is really vulnerable
Humanor variable
Humanand the vulnerable application dont control exactly
Humanthe size of those external data
Humanthis makes that if data has a bigger size than buffer size
Human that contains it
Humanto buffer, they are overwritted with the rest of that data content
Humanthe problem comes when in structure that *NIX uses in memory
Humanof every process, so the area of memory next to buffers contains
Humancritical data, about the process that controls the execution flux of the same
Humantihs allows attackers to insert machine code (shell codes)
Humanin applications vulnerables to buffer overflow, and make that way
Humannot contempled operations, with same privileges as process has
Human(presentation n?4)
Humanin superior graphic, we see structure of area and memory of everything
Humanprocess
Humanthere we found
Humantipical structure of stack
Humanarea of memory where it save temporal data of process
Humanall function C uses stack from stack pointer, upside in this order :
Humanbuffers, local variables, frame pointer to past
Humanin retur direction  (from this on function was called)
damagefinally the arguments of the function with which if the code does not control the size of the data to write
damageon the buffers the next area of the memory(up at the pic)
damagemay be overwrite
damagethe down part of the picture show the tipical function C vulnerable of this attack
Humanthe function strcpy() copies content of the variable inside $HOME enviorement, to
Humanbuffer of 128 bytes
Humanbecause is no control about size of $HOME variable
Humanbut if this one have more than 128 bytes, the ret of string must overwrite the old memory areas
Humanso that momment an attacker in this case can introduce shell code in variable $HOME, starting byte 129
Humanand this shellcode will execute with process privileges
damage<krocz> ouna forms to avoid the execution is leaving stack, in state "no execute"
damageyes, this know at W^X an we will show more less
damagefor that the shell code overwrite the "return address" to the area of memory where is located the arbitraried inyected code
damageand this will be executed when the vulnerable function finalizes and the execution of the process must return to the point
damagefrom where it was called the function by that area of stack the attacker overwrites stack-smashing can
damage<trulux> feister, no, W^X is of OpenBSD, there are more implementations: Stack Guard of Immunity, ExecShield
damageabd Pax for example
damagenot an implementation
damage is a technique
damagecan be classified in :
damage* return adress: modify return direction
damage*local variables or arguments: modifies that variables
damage*previous frame pointer : modify pointer to previous frame
damagenow well
damageone solution its audit the source code of the aplication for detect the vulnerable code, this mean the code that
damagenot are controling the size of the strings
damagethe tecnical series and the mechanism presentated here will form a framework
damagewhere can run your *NIX applications with a proactive security
damageas say, in case that doesnt occur a buffer overflow for a non detected vulnerability
damagethis attack will ve eliminated and confined or limited
damage(diapo 6)
damageok, the first technic that conform our framework is a thing of design
damagethe technic of the separation of privilegies
damagethe idea is separate the code of the procces in two parts:
damage1 - the privilegiated process: use the syscall that require privilegiated permitions
damage2 - the non-privilegiated process: access to the rest of all syscall, this not require of a privilegiated acount
damageso when the privilegiated process start make a fork of theyself and his son past to be a non-privilegiated process
damagethe idea is that interaction with user or with local or remote processes
damagemust be maked by NON-PRIVILEGED son
damagebecause if this one is compromised
damagethe attacker must have his action range limited
damageto understand this technique better
damagethat uses this technique
damagethe ntp engine process is the NON-PRIVILEGED process (this one runs as _ntp)
damagethat process comunicates throught a UNIX-domain socket (not tcp/ip accesable)
damagewith his father process, the ntpd master running as root
damage and the ntpd master only uses two privileged syscalls
HumanIMSG_ADJTIME and IMSG_HOST_DNS (set time and call resolver library)
damagenow if the attacker inyect by the UDP 123 shell code only the process
damagentp engine will be comprometed
damagein this case the ntp engine process run in chroot on /var/empty
damagewith which the same one that directory has left prisoner
damage(diapo 7)
damageto now so our aplications have:
damage* SUID/GUID bits
damage* chroot jailing
damage* privilegiated separation
damagewe see now a mechanism to protect the memory
damagethe mechanism W^X (less W xor X)
damagethe idea is that  the areas of memory have a control of access
damagesimilar to RWX bits of UNIX filesystem
damageso, with W^X, the OS defines a default politc in determinated areas of memory
damagethis way both areas are execution or writte access, but never both
damageexcepting if the application requires it explicitly
damageMMU=memory management unit (unidad de administracion de memoria)
damagea bit X in each page of memory          
damagethe OS only it must activate o deactivate this bit and ready
damagebut i386 haven't  this bit  
damagebut W^X, we can emulate in this architecture, thanks to support of
damage segmentation memory
damageand a DATA (high memory area)
damagewhen it starts process (every part of code is in DATA)
damagethe code pass to low area
damagewhile the data pass to high area DATA
damageand the OS keeps a politics aobut W in DATA and X in CODE
damageas say, in a i386, the W^X is emulated by software
damageand the techniques seen until now doesnt generate a overhead, and not require to modify the code
damagethe two next make overhead and one of this modify the code
damage(diapo 8)
damageshow the aplications now, and it see more secure:
damage* SUID/GUID bits
damage* chroot jailing
damage* privilege separation
damage* W^X
damagethe problem in the last case its that we depending of exclusivly of the OS and the arch
damagealthough the execution of code us limited, stack still can be altered
damagethe ProPolice or Stack Smashing Protector (SSP) is a develop of the divition of investigation
damagein Tokio of IBM
damage this works with gcc to transform a
damagevulnerable C function in a no vulnerable C function
damagewith that you obtain a code wich functions are protected against
damagestack corruption
damagefor this, ProPolice realizes two things
damage<trulux> feistel, there are many implementations of SSP:
damagehttp://wiki.debian-hardened.org/SSP/ProPolice_Implementations
damagethe idea of the presentations it work on independent tecnology of the OS
damagefor the many flavors of unix
damage<trulux> feistel, really its not obtain any protected code, still be vulnerable but it call to the function guard
damageof SSP before to execute any type of strange operation, in the start of the execution
damageSSP also orders the memory of the function, also of guard
damagethe fact that you cant make a overflow, maket ist invulnerable
damage1.- Reorder stack
damageup you see classcstack
damagedown you see the rebult stack and modified by propolice
damagethe variables and the fixes are in opposite order
damagein new memory disposal
damage(A) that doesnt contain fixes or variable pointers
damage(B) contain strings and structs
damage(C) no contain strings
damagein the only place where a destruction of the stack can begin is the (B)
damagethe previous thing is the key of ProPolice
damageAnd it adds the code in the prologo and the epilogo of the function
damagelets see how this thing works
damagein the function prologue
damage (code that executes when funcition es claled)
damageProPolice generates a randmo number, the "guard"
damageas you can see, the "guard" is the first that appears in the stack
damageremember that stack grows from up to down)
damageand thats why in prologue it generates
damageand thats why in prologue it generates
damagea "guard" copy, that is keeped in a protected area, outside a overflow range
damagethe functiont not ends untill it returs to the function it calls
damagewhich compares "guard" original with the one of stack if these are different the execution of the process finalizes and log is generated, asi everything shellcode injected is not executed
damageby the location of return address the only form to modify it is by the of overflow in buffers
damage(B)
damagefor the locations of the local vars in (C)
damagethese are protected by modification since the destruction begins in (b)
damagethe arguments (a) on the other hand are protected by "guard".
damageProPolice has some exceptions that are due to consider
damagethat they are listed in the site of ProPolice and is of interest for programmers in C
damagein UNIX that wish to protect themselves with ProPolice
damage(diapos 9)
damageperhaps it would be left if to accounts something on types of "canarios" clearer;
damagethe conference includes many subjects and the idea is to
damagegive a point for a deep investigation but by the interested ones
damageI do not want to enter the qualifications of the canaries (another name for guard) trulux, wants to collaborate with a real example says that it has everything prepared, we will do it at the end of the presentation
damagealso of ProPolice exists other similar implementations but all of them have limitations and weaknesses in the figure can see a comparison -- those interested in the subject, can remain later  ;-) ---
damagea summary of the alternatives
damage* libsafe: is a library that adds a control on some popular functions of strings as strcpy() and gets()
damagework like middleware that intercepts the calls to these functions and makes the necessary control
damage* StackGuard: it uses the same concept of "guard" that it calls "canario" address (during the prologo, after of buffers)
damagewhich is verified in the epilogo, does not use "guard" or "canarios"
damageas much StackGuard and StackShield have famous vulnerabilities and also generates overhead greater than ProPolice
damage"Phrack Magazine - Volume 0xa Issue 0x38"
damagealthough ProPolice is enough safe and robust it generates overhead that there is to consider
damageat the time of deciding if to protect or ours I do not our code with SSP in diapos 10 and 11
damagecan see some benchmark of the equipment of development of ProPolice
damage(diapo 12)
damageour application now already is a framework quite reliable:
damage* SUID/GUID bits
damage* chroot jailing
damage* privilege separation
damage* W^X
damage* ProPolice
damagenevertheless... we suppose that a vulnerability in some of the previous systems is detected, for example in ProPolice (as it were detected before in StackGuard and StackShield)
damagewe needed something include in those circumstances our UNIX applications do not even jeopardize the security
damageof whole system
damagethe last complete component of ours framework so is:
damageSystrace is a mechanism that runs partly in userland and partly in kernel
damagethis mechanism catches all syscalls that a process uses and makes a control of access
damagewith them as if firewall it was is to say
damagewe defined politicas of control of Systrace access at level of syscalls for example,
damagewe can limit that a process connects (bind()) to certain ports TCP and the rest is denied
damageor for example, to prevent the writing,
damagelimiting the use of write() or to limit write() specified archives or filesystem
damageimagines now that a process is it jeopardize and an attacking scale privileges
damagewith since we have limited syscalls that can use the process
Session Time: Thu Dec 16 00:00:00 2004
damageor in the way in which it uses them, the attack is confined or limited which the application was developed to do as they are seen in the figure the applications with Systrace they run in sandbox controlled, where they single can do what we
damagelet to them do
damagein kernel "System Call Gateway" it captures all the calls syscalls of the sandboxed application,
damageas if this was a Proxy is in charge to execute true syscalls and to give back the result to the applications
damageas this is transparante, the application does not find out the presence of syscall gateway but before syscall gateway must determine if the politics allow the execution of so syscall for that I modulate of Systrace in kernel is in charge to communicate
damagewith I modulate of userland, which reviewing the politicas determines if syscall must be allowed or refuse if the politic say "allow" then syscall is executed normally otherwise, no, and the application receives the code of error
damage(<0)
damagesystrace work too like a IDS (Intrusion Detection System)
damageor it can generate alarms or notifications for the case in which syscall something is denied for example an entrance in syslog can be like this
damage<feistel> ------------------------------------
damage<feistel> Dec  2 01:31:11 openbsdtest systrace: deny user: _identd, \
damage<feistel> prog: /usr/libexec/identd, pid: 27046(1)[12989], \
damage<feistel> policy: /usr/libexec/identd, filters: 24, syscall: native-fsread(5), \
damage<feistel> filename: /etc/spwd.db
damage<feistel> Dec  2 01:31:11 openbsdtest identd[27046]: /etc/pwd.db: Operation not permitted
damage<feistel> Dec  2 01:31:11 openbsdtest identd[27046]: \
damage<feistel> getpwuid() could not map uid (25) to name
damage<feistel> --------------------------------------
damageit is important to stress that Systrace works if in kernel there is support for draws up of the applications, is to say to be able to follow the sign of syscalls that a process uses
damage<kroc<> feistel, what status have systrace in linux?
damageits finishing the patch
damage<krocz> feistel that of the ACL to the syscalls, come implemented in the patch of grsec
damage<trulux> krocz, in the must of the MAC systems, RBAC, RSBAC, SELinux, etc..
damageit is right
damagebut my idea its present a framework for UNIX
damagealso like me more Systrace :-)
damageafters everyone can choice how make a framework :-)
damage(diapos 13)
damagehow see a systrace politic ?
damage<feistel> ------------------------------
damage<feistel> Policy: /bin/ls, Emulation: native
damage<feistel>         native-munmap: permit
damage<feistel> [...]
damage<feistel>         native-stat: permit
damage<feistel>         native-fsread: filename match "/usr/*" then permit
damage<feistel>         native-fsread: filename eq "/tmp" then permit
damage<feistel>         native-fsread: filename eq "/etc" then deny[enotdir]
damage<feistel>         native-fchdir: permit
damage<feistel>         native-fstat: permit
damage<feistel>         native-fcntl: permit
damage<feistel> [...]
damage<feistel>         native-close: permit
damage<feistel>         native-write: permit
damage<feistel>         native-exit: permit
damage<feistel> ----------------------------------
damagesoon like in all ACL, there is an expression to evaluate and an action to take in this case
damagepermit or deny sees that this single case /bin/ls has access of reading to filesystem (fsread) /usr/ and
damageto the directory /tmp Systrace brings some utiles tools a first generator of politics
damagea first monitoring generator of politics that the applications to sandboxing and generates one politic
damagewith all syscalls that uses, with action permit during the monitoring you use the application as in
damagethe called production all syscall is registered and so is generated the politics
damagewith all "permit" in your home once you have the politic you apply with something like
damage# systrace to it - /usr/sbin/inetd
damageand ready! /usr/sbin/inetd already this in his sandbox! a grafical tool (to see the figure)
damageanother characteristic can also attend you in the preparation of the politics
damagethat I like of Systrace is the support for scaling of privileges,
damagewhich eliminates the necessity to use the dangerous SUID/GUID these politics see something asi:
damage<feistel> -------------------------------------------
damage<feistel> native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_RAW" then permit as root
damage<feistel>         native-bind: sockaddr eq "inet-[0.0.0.0]:22" then permit as root
damage<feistel> native-fsread: filename eq "/dev/kmem" then permit as :kmem
damage<feistel> -------------------------------------------
damagefinally which there is of the cost of overhead of Systrace because it depends on the application,
damagethere can see some now benchmarks if we have good framework!
damage* (we removed to the dangerous SUID/GUID thanks to Systrace)
damage* chroot jailing: we confined the application to filesystem
damage* privilege separation: we hid I modulate with privileged access of the clients
damage * W^X: we establish politics to the vulnerable areas of memory
damage* ProPolice: we protect our application against stack-smashing attack
damage* Systrace: we bordered to the application in sandbox controlled
damage--fin---
kroczCLAP CLAP CLAP CLAP CLAP
kroczCLAP CLAP CLAP CLAP CLAP
kroczCLAP CLAP CLAP CLAP CLAP
kroczCLAP CLAP CLAP CLAP CLAP
kroczCLAP CLAP CLAP CLAP CLAP
damagepense que no terminaba nunca
kroczexcelent job damage
damagejeje
kroczjajaja
kroczsalio larga
damagesep
kroczpero de nuevo te luciste :)
damagey con human tambien
damage:D
kroczahora chicos a remojar los dedos
kroczen agua
damagevoi a comer algo jejeje
kroczsigue logeando en el #linux
Max:)
damageok

Generated by irclog2html.pl by Jeff Waugh - find it at freshmeat.net!

The Organizing Comittee

Email UsMore information


© 2004 - www.uninet.edu - Contact Organizing Comittee - Valid XHTML - Valid CSS - Based on a Design by Raul Pérez Justicia