*TL:DR* Initial Installation of python in system Lets start with simple python program print("Hello World") #---> output ---> Hello world """ Hello world program In python anything inside print() will display on the screen Also the text print to on the screen should be inside "", '' between this """ Python Commands #print a number print(25) # Hash is used to comment out which will ignored on execution # Hash is a single line command """ Multi line command Defined like this can hold multiple lines """ ''' These commands can comment out error making code lines and also declare or define what this particular line of code does explanation For debugging For Future references, as comments are in readable format For collaboration with Peers ''' Python Variables and Literals #variable is the container which holds or store data number = 10 #Number is the var...
PostgreSQL, also known as Postgres, is a powerful open-source object-relational database system. It has earned a strong reputation for its proven architecture, reliability, data integrity, robust feature set, and extensibility. Identify PostgreSQL nmap -sV -p 5432 <target-host> nmap Scanning nmap -sC -sV --script vuln,vulners --script-args mincvss=7.0 -p5432,5433 -Pn 10.10.10.10 #make sure to check for vulnerable versions nmap -sV -p 5432 <target-host> Exploiting Known Vulnerabilities searchsploit postgresql <version> Enumerating Databases and Tables List all databases \l Switch to a database \c <database_name> List tables in the current database: \dt Extract data from a specific table: SELECT * FROM <table_name>; Dumping Hashes SELECT usename, passwd FROM pg_shadow; Accessing File System COPY (SELECT * FROM sensitive_table) TO '/tmp/sensitive_data.txt'; Bruteforcing Postgres Creds #Using Metasploit use auxiliary/scanner/postgr...