In this tutorial you will learn how to use the SQLite database management system with Python. You will learn how to use SQLite, SQL queries, RDBMS and many more things !
Data is everywhere and software applications use that. Data is either in memory, files or databases.
Python has bindings for many database systems including Mysql, Oracle, Microsoft SQL Server and Maria DB.
One of these database management systems (DBMS) is called SQLite. SQLite was created in the year 2000 and is one of the many management systems in the database zoo.
SQL is a special-purpose programming language designed for managing data held in a database. The language has been around since 1986 and is worth learning. The is an old funny video about SQL
SQLite
SQLite, a relational database management system. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.
It is a self-contained, serverless, zero-configuration, transactional SQL database engine. The SQLite project is sponsored by Bloomberg and Mozilla.
Install SQLite:
Use this command to install SQLite:
$ sudo apt-get install SQLite
Verify if it is correctly installed. Copy this program and save it as test1.py
#!/usr/bin/python # -*- coding: utf-8 -*-
import sqlite3 as lite importsys
con =None
try: con = lite.connect('test.db') cur = con.cursor() cur.execute('SELECT SQLITE_VERSION()') data = cur.fetchone() print"SQLite version: %s" % data except lite.Error, e: print"Error %s:" % e.args[0] sys.exit(1) finally: if con: con.close() Execute with:
$ python test1.py
It should output:
SQLite version: 3.8.2
What did the script above do? The script connected to a new database called test.db with this line:
con = lite.connect('test.db')
It then queries the database management system with the command
SELECT SQLITE_VERSION()
which in turn returned its version number. That line is known as an SQL query.
SQL Create and Insert
The script below will store data into a new database called user.db
#!/usr/bin/python# -*- coding: utf-8 -*-import sqlite3 as lite
importsys
con = lite.connect('user.db')with con:
cur = con.cursor()
cur.execute("CREATE TABLE Users(Id INT, Name TEXT)")
cur.execute("INSERT INTO Users VALUES(1,'Michelle')")
cur.execute("INSERT INTO Users VALUES(2,'Sonya')")
cur.execute("INSERT INTO Users VALUES(3,'Greg')")
SQLite is a database management system that uses tables. These tables can have relations with other tables: it’s called relational database management system or RDBMS. The table defines the structure of the data and can hold the data. A database can hold many different tables. The table gets created using the command:
cur.execute("CREATE TABLE Users(Id INT, Name TEXT)")
We add records into the table with these commands:
cur.execute("INSERT INTO Users VALUES(2,'Sonya')")
cur.execute("INSERT INTO Users VALUES(3,'Greg')")
The first value is the ID. The second value is the name. Once we run the script the data gets inserted into the database table Users:
Learn How To Hack Websites With Different Techniques.. (EDUCATIONAL PURPOSE ONLY) SQL Injection in MySQL Databases:- SQL Injection attacks are code injections that exploit the database layer of the application. This is most commonly the MySQL database, but there are techniques to carry out this attack in other databases such as Oracle. In this tutorial i will be showing you the steps to carry out the attack on a MySQL Database. Step 1: When testing a website for SQL Injection vulnerabilities, you need to find a page that looks like this: http://www.site.com/page=1 or http://www.site.com/id=5 Basically the site needs to have an = then a number or a string, but most commonly a number. Once you have found a page like this, we test for vulnerability by simply entering a ‘ after the number in the url. For example: http://www.site.com/page=1′ If the database is vulnerable, the page will spit out a MySQL error such as; Warning: mysql_num_rows(): supplied argument is not a valid MySQL...
Cloning a card: Sim cards are manufactured on the basis of 3 algorithms COMP128v1,COMP128v2 and COMP128v3 now an important note currently only COMP128v1 version sim cards can be cloned ,since this is the only algorithm which has been cracked by users, bear in mind that 70% of all the sim cards we use are COMP128v1 . 1. Buy a SIM card Reader 2. Need a Blank SIM card or super SIM card 3. Download and install MagicSIM 4. Download and install USB SIM Card Reader Software 3.0.1.5 6. Go in phone tools, select SIM card, then select unlock SIM, it will prompt for a code. 7 Call network provider, they will ask for your phone number, your account info, name and security code, then they will ask why you want to unlock your SIM card, just tell them you need to unlock your SIM to get it to work with your overseas phone or something. 8. Once they give you the SIM unlock code, enter it, and it will say SIM unlocked. 9. Remove the SIM from your phone, place it in the card...
Using Google Dorks For Hacking Google is the most popular search engine on the internet right now. People use it to find their answers, images, videos, news and notes etc. But, did you know that the Google can also help hackers to find vulnerable targets and steal unauthorized information?. Google is as much helpful for hackers as any other general user. Hackers use Google search engine to find Vulnerable systems (Be it a database, website, security cameras, or any IOT gadget) with the help of some special search queries. There are many Google search engine queries that can uncover vulnerable systems and/or sensitive information disclosures. These queries are known as Google Dorks. What is Google Dork or Google Dorking? In 2002, Johnny Long began to collect interesting Google search queries that uncovered vulnerable systems or sensitive information disclosures. He labeled them Google dorks. Some people call it Google hacking. Google Dorking is the method for findi...
Comments
Post a Comment