Posts

Showing posts with the label SQLite

(My)SQL Injection Attack [Tutorial]

Image
Imagine you're baking a delicious batch of cookies, following your grandma's secret recipe. But then, a mischievous squirrel sneaks in and replaces a pinch of cinnamon with a dash of…mystery powder! That's kind of like an SQL injection (SQLi) attack. Hackers, like mischievous squirrels, exploit website vulnerabilities by sneaking malicious code into user input fields. This "mystery powder" can trick the website's database (the oven) into baking something entirely different – maybe stealing your recipe, adding unwanted ingredients, or even burning the whole batch! Thankfully, website bakers have special tools like data validation and locking cabinets to keep their ovens squirrel-proof and cookies safe. So, next time you trust a website with your information, remember: just like you wouldn't share your grandma's secret recipe with a squirrel, be careful what you input online. Keep your digital cookies safe from sneaky squirrels! Let's crack open the...

Getting started with SQLite database in Perl

Image
SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. The code for SQLite is in the public domain and is thus free for use for any purpose, commercial or private. SQLite is the most widely deployed database in the world with more applications than we can count, including several high-profile projects. [ https://www.sqlite.org/about.html ] Following program demonstrates how to Create a new SQLite database, how to connect to a database with credentials, how to create a table, how to insert values and how to select values. #!/usr/bin/perl use DBI; use strict; use warnings; my $dsn = "DBI:SQLite:test.db"; my $userid = ""; my $password = ""; my $dbh = DBI->connect($dsn, $userid, $password, { RaiseError => 1, AutoCommit => 0})    or die $DBI::errstr; print "Opened database successfully\n";