Exploiter une injection SQL les doigts dans le nez Exploiter une injection SQL les doigts dans le nez Si au petit-déj, vous aimez manger des injections SQL, voici un petit outil qui va vous permettre de tester votre site afin de voir si celui-ci est vulnérable. Cet outil, c'est The Mole. C'est pratique, car tout automatique et ça gère aussi bien MySQL, SQL Server, Postgres et Oracle. The Mole est téléchargeable ici et pour apprendre à vous en servir, il y a un très bon tuto ici. A utiliser sur votre propre machine, car sur les machines des autres, c'est illégal. Vous avez aimé cet article ?
SQLMap, outil d'injection SQL SQLMap est un outil permettant d’effectuer des requêtes SQL de manières automatisées dans le but de trouver et d’exploiter une mauvaise configuration sur votre serveur Web. Ce dernier a été développé en Python par Bernardo Damele et Miroslav Stampar sous licence GPLv2. Le choix de ce langage de programmation est intéressant car il permet à l’outil d’être utilisable sur n’importe quel système d’exploitation. Pour rappel, les techniques d’injection SQL consistent à introduire du code additif dans une requête SQL de base. Voici quelques caractéristiques de l’outil : Support de MySQL, Oracle, PostgreSQL et Microsoft SQL Server. Pour en avoir la liste complète, veuillez vous rendre sur la documentation officielle : Téléchargement Utilisation Prenons l’exemple d’une page Web ayant une variable ‘num’ non contrôlée : Nous souhaitons lancer une recherche de failles de type injection SQL au moyen de SQLMap : Cas réel
Regular Expressions Regular expressions are used with the RegExp methods test() and exec() and with the String methods match(), replace(), search(), and split(). When you want to know whether a pattern is found in a string, use the test() or search() methods; for more information (but slower execution) use the exec() or match() methods. If you use exec() or match() and if the match succeeds, these methods return an array and update properties of the associated regular expression object and also of the predefined regular expression object, RegExp. If the match fails, the exec() method returns null (which coerces to false). In the following example, the script uses the exec() method to find a match in a string. const myRe = /d(b+)d/g;const myArray = myRe.exec("cdbbdbsbz"); If you do not need to access the properties of the regular expression, an alternative way of creating myArray is with this script: const myArray = /d(b+)d/g.exec("cdbbdbsbz"); However, if you have this script:
File Uploads with PHP What do pictures in an online photo album, email attachments in a web-based mail client, and data files submitted to an online application for batch processing all have in common? They all rely on the ability to upload files across the Internet from the user’s web browser. Indeed, uploading files is an important feature of many of the sites and web-based applications we use on a daily basis. In this post, I show you how to add support for file uploads to your site using PHP. Requirements Handling file uploads isn’t difficult, but there are a handful of small details that must be correct or else the upload will fail. file_uploads = On Uploaded files are first stored in a temporary directory (don’t worry… your PHP script can move the files to a more permanent location afterward). upload_tmp_dir = "/tmp" tboronczyk@zarkov:~$ ls -l / | grep tmp drwxrwxrwt 13 root root 40960 2011-08-31 00:50 tmp Scripting the Upload Process Here’s what markup for a basic file upload form looks like: Summary
PHP IDE :: JetBrains PhpStorm Major frameworks support PhpStorm is perfect for working with Symfony, Laravel, Drupal, WordPress, Zend Framework, Magento, Joomla!, CakePHP, Yii, and other frameworks. All the PHP tools The editor actually 'gets' your code and deeply understands its structure, supporting all the PHP language features for modern and legacy projects. Front-end technologies included Make the most of the cutting edge front-end technologies, such as HTML 5, CSS, Sass, Less, Stylus, CoffeeScript, TypeScript, Emmet, and JavaScript, with refactorings, debugging, and unit testing available. Built-in developer tools Perform many routine tasks right from the IDE, thanks to the Version Control Systems integration, support for remote deployment, databases/SQL, command-line tools, Docker, Composer, REST Client, and many other tools. PhpStorm = WebStorm + PHP + DB/SQL All the features in WebStorm are included into PhpStorm, with full-fledged support for PHP and Databases/SQL support added on top. Fast and Safe Refactoring
Atelier PHP - apprendre le langage php, cours, exercices, ressources Ce site est à votre disposition pour vous permettre d'apprendre facilement et gratuitement les bases du langage PHP.Il comprend actuellement 20 leçons resumant les principaux aspects du langage, et surtout pour chaque chapitre, entre 10 et 30 exercices de différents niveaux de difficulté (*: facile , **: moyen, ***: avancé) et un ensemble de QCM permettant d'apprécier le niveau acquis. Il vous est fortement conseillé : De vous enregistrer (gratuitement, et sans besoin de fournir votre adresse mél) comme "étudiant" en vous créant un identifiant associé à un mot de passe; ceci vous permettra de mémoriser vos résultats de QCM et ainsi de suivre votre progression dans l'apprentissage du langage. De vous inscrire sur la liste de distribution : ceci vous permettra d'être tenu au courant des évolutions du site (nouveaux chapitres de cours, nouveaux exemples, nouvelles applications...)
Tutorial | The Mole In this tutorial, you will learn how to use The Mole to exploit SQL Injections, extracting data from the database and reading files from the vulnerable server. In order to read a complete reference of The Mole's commands and how to use them, please visit (btw, thanks to Sébastien Damaye for writing such a complete guide!). If you happen to encounter some problem when exploiting an SQL Injection, caused by some filter or IPS used by the target server, please visit our filters tutorial. Before we start, you must know what is required in order to exploit a SQL Injection using The Mole. Once you have found a vulnerable script, you have to find a string which normally appears in the web page, but does not appear when you negate the query which is being executed on the database(by modifying the vulnerable parameter). Identifying the injection This example will be shown using this test site: Fine, we see the string "admin" has disappeared. Exploiting the injection
Using PHP 5's XSL extension to perform XSL Transformations By Tony Marston 22nd August 2004 Intended AudiencePrerequisitesA sample XML file- XML file contentsA sample XSL file- XSL file contentsXSL Include files- std.pagination.xsl- std.actionbar.xslPerforming the XSL Transformation- Creating an XSLT processor resource- Identifying and loading the XSL stylesheet- Identifying the XML document- Defining optional parameters- Invoking the XSLT process and displaying the resultSample outputReferences Intended Audience This tutorial is for developers who wish to know how to generate HTML documents using a combination of XML data and XSL stylesheets. The process of combining the content of an XML file and the formatting instructions of an XSL file to produce another document is known as an XSL Transformation (XSLT for short). While XSL files are static in nature XML files can be created 'on the fly' to contain whatever data has just been selected from the database. Prerequisites It is also assumed that you have some knowledge of XML and XSL. <? <? References
$_GET and $_POST in PHP Introduction Using the GET and POST methods, the browser client can send data to the web server. In PHP the GET and POST methods are used to retrieve information from forms, such as user input. Get and Post are methods used to send data to the server. GET Method In the GET method, we can also send data to the server. The main points about the GET method are as follows: The GET method is used to collect values in a form. Example First of all we create a PHP file which is called by the HTML page in later. <html><body bgcolor="pink">Welcome <? The above file is to be saved with the name "get.php", which is called by the HTML page later. <html><body bgcolor="pink"><table><form action="get.php" method="get"><tr><td>Name: <input type="text" name="Name" /></td></tr><tr><td>Class : <input type="text" name="Class" /></td></tr><input type="submit" " value="Submit"/></form> </body></html> This file is saved as "get.html". Output Now you will fill text like as name and class. POST Method Example Conclusion