

{"id":97869,"date":"2021-07-07T09:00:42","date_gmt":"2021-07-07T03:30:42","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=97869"},"modified":"2021-07-03T18:10:57","modified_gmt":"2021-07-03T12:40:57","slug":"pre-connection-attacks","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/","title":{"rendered":"Pre-connection Attacks | Ethical Hacking"},"content":{"rendered":"<p>Interconnection of two or more devices that share all resources creates a network. The devices may share physical connections or wireless connections. The wireless connection comes from a router that uses the internet to function.<\/p>\n<p>These networks have become highly vulnerable in the last few years. This is mainly due to an increase in cybercrimes. To overcome this problem, companies go for network penetration testing.<\/p>\n<p>Pen testing is a method of identifying potential risks and vulnerabilities in a system or a network. It includes performing a real-time attack to see how strong the network security really is. The network testing is divided into three parts &#8211; Pre connection attack, gaining access, and post connection attack.<\/p>\n<p>We will look at all the parts briefly to understand their relevance in the process.<\/p>\n<h3>Network Penetration Testing Parts<\/h3>\n<h4>Pre-connection Attacks<\/h4>\n<p>This is the first step of network penetration testing which works on identifying networks around us. This includes details about all the connected devices in a network. Knowing these details helps in easy disconnection during the attack. Tools needed for pre-connection attacks are &#8211;<\/p>\n<p>1. A wifi adaptor in monitor mode<br \/>\n2. airodump-ng<br \/>\n3. aireplay-ng<br \/>\n4. An Operating System<\/p>\n<h4>Gaining Access<\/h4>\n<p>This is the next step in network penetration testing that requires a network connection. This step allows the implementation of stronger attacks with reliable information sources. The networks without encryption are easier to get in and sniff unencrypted data. If there is encryption, we decrypt the information in all network types like WEP\/WPA\/WPA2.<\/p>\n<h4>Post-connection attacks<\/h4>\n<p>This the last step in network penetration testing. After we get access to the network and the information, we start placing bugs. We break in through the network to get everything we need. We can also place malware, virus, and more in it to test how the security reacts to it. Netdiscover and Zetmap are the two famous tools used in this process.<\/p>\n<h3>Steps in Pre-connection Attack<\/h3>\n<h4>1. Wireless Interface in Monitor mode and Change MAC Address<\/h4>\n<p>This is the first step in the process of a pre-connection attack. The aim is to put wireless cards into monitor mode so that all packets in the network are audible.<\/p>\n<p>The wireless devices have \u201cmanaged\u201d mode by default allowing access to packets with our device&#8217;s MAC address as the destination.<\/p>\n<p>To make it simple, packets directed to your personal machine are the only ones you can access. But the entire point is to capture all packets within our range even if they don&#8217;t have our MAC address. This is possible by changing the device&#8217;s setting to Monitor mode.<\/p>\n<p>Use iwconfig to get access to wireless interfaces. You will see that it is in Managed mode. Change it using the following command.<\/p>\n<ul>\n<li>ifconfig wlan0 &#8211; disable the Managed mode<\/li>\n<li>airmon-ng check kill &#8211; remove any interference and stop the internet connection<\/li>\n<li>iwconfig wlan0 mode monitor &#8211; enable monitor mode<\/li>\n<li>ifconfig wlan0 up &#8211; enable the interface<\/li>\n<li>iwconfig &#8211; check the Monitor mode<\/li>\n<\/ul>\n<p>Now we can easily capture all the Wi-Fi packets within our range. The packet sniffing attack begins with this step. The second part of the step is to change the MAC Address.<\/p>\n<p>MAC address refers to the physical static address of a network card. The purpose is to use it for identifying devices while packet transmission. The reason why we change the MAC address is to increase anonymity and impersonation. The steps to change MAC Address are &#8211;<\/p>\n<p>i. Click on the network card\u2019s adapter<br \/>\nii. Select Properties from the menu<br \/>\niii. Select the Advanced tab under it<br \/>\niv. Click on Network Address<br \/>\nv. Now type the new MAC address<\/p>\n<h4>2. The Packet Sniffing Tool &#8211; airodump-ng<\/h4>\n<p>This tool allows the collection of networks in our range and then collects useful information about them. It is made to capture all packets in these networks using the Monitor mode. You can collect information like &#8211; mac address, encryption type, number of clients, etc. You can use an Access point too in case of a certain Wi-Fi network.<\/p>\n<h5>Some Key Point to Remember while Using airodump-ng<\/h5>\n<ul>\n<li>The name of the wifi is at the left top of the screen.<\/li>\n<li><strong>BSSID<\/strong> has the MAC addresses of the network under it.<\/li>\n<li><strong>PWR<\/strong> displays the signal strength of the network. Higher the better.<\/li>\n<li>Frames sent by the network are under <strong>Beacons.<\/strong><\/li>\n<li><strong>#Data<\/strong> is for the number of data packets.<\/li>\n<li><strong>#\/s<\/strong> is for data packets captured in the last 10 seconds.<\/li>\n<li><strong>CH<\/strong> has the information of network channels.<\/li>\n<li><strong>ENC<\/strong> is for the type of encryption used.<\/li>\n<li><strong>CIPHER<\/strong> is literally for cipher use.<\/li>\n<li><strong>AUTH<\/strong> stands for authentication type.<\/li>\n<li><strong>ESSID<\/strong> has the network names under it.<\/li>\n<li><strong>STATION<\/strong> is for devices under the network.<\/li>\n<li><strong>Rate<\/strong> signifies the speed.<\/li>\n<li><strong>Lost<\/strong> has data loss information.<\/li>\n<\/ul>\n<p>The next step is to run airodump-ng and target a particular network. This is done using the command &#8211;<\/p>\n<p><strong>( airodump-ng&#8211;Name of the Network&#8211;Channel Number&#8211;write test Interface name in monitor mode )<\/strong><\/p>\n<p>After the execution of this command, we get information about the connected networks and all the subheads mentioned above.<\/p>\n<h4>3. Deauthenticate the Wireless client<\/h4>\n<p>This also refers to de-authentication attacks. We can disconnect any device from the network using its private encryption key. We impersonate the client by changing the MAC address and send a packet to the router.<\/p>\n<p>Also, we disconnect the client using the router&#8217;s MAC address leading to connection failure. Aireplay-ng. is the tool used in this process. It begins with running airodump-ng on the target network to get a list of connections. After getting the information, we disconnect the device using the aireplay-ng.<\/p>\n<p>The command for the process is &#8211;<br \/>\n<strong>aireplay-ng &#8211;#DeauthPackets -NetworkMac -TargetMac Interface<\/strong><\/p>\n<p>This command will disconnect the device till you press Ctrl + C to quit it. The \u201cdeauth\u201d in the command instructs the program to send de-authentication packets to the router and client, keeping the client disconnected.<\/p>\n<h3>Conclusion<\/h3>\n<p>Ethical hackers are mainly famous for performing pen tests for organizations. Pen testing is an important precautionary step to safeguard the company. It is important to know about it in detail before you start practicing. This tutorial is useful for beginners in the field of ethical hacking and even the students who want to pursue a career in it. This is the most basic framework you follow for pre-connection attacks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Interconnection of two or more devices that share all resources creates a network. The devices may share physical connections or wireless connections. The wireless connection comes from a router that uses the internet to&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":97899,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23787],"tags":[24664,24696],"class_list":["post-97869","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cyber-security","tag-ethical-hacking","tag-pre-connection-attacks"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Pre-connection Attacks | Ethical Hacking - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn about pre-connection attacks in ethical hacking. This is the first step of network penetration testing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pre-connection Attacks | Ethical Hacking - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn about pre-connection attacks in ethical hacking. This is the first step of network penetration testing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-07T03:30:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/Pre-connection-Attack.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pre-connection Attacks | Ethical Hacking - DataFlair","description":"Learn about pre-connection attacks in ethical hacking. This is the first step of network penetration testing.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/","og_locale":"en_US","og_type":"article","og_title":"Pre-connection Attacks | Ethical Hacking - DataFlair","og_description":"Learn about pre-connection attacks in ethical hacking. This is the first step of network penetration testing.","og_url":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-07-07T03:30:42+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/Pre-connection-Attack.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"Pre-connection Attacks | Ethical Hacking","datePublished":"2021-07-07T03:30:42+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/"},"wordCount":1044,"commentCount":2,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/Pre-connection-Attack.jpg","keywords":["Ethical Hacking","Pre-connection attacks"],"articleSection":["Cyber Security Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/","url":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/","name":"Pre-connection Attacks | Ethical Hacking - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/Pre-connection-Attack.jpg","datePublished":"2021-07-07T03:30:42+00:00","description":"Learn about pre-connection attacks in ethical hacking. This is the first step of network penetration testing.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/Pre-connection-Attack.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/Pre-connection-Attack.jpg","width":1200,"height":628,"caption":"Pre-connection Attacks"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/pre-connection-attacks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Cyber Security Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/cyber-security\/"},{"@type":"ListItem","position":3,"name":"Pre-connection Attacks | Ethical Hacking"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/97869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=97869"}],"version-history":[{"count":2,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/97869\/revisions"}],"predecessor-version":[{"id":97900,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/97869\/revisions\/97900"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/97899"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=97869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=97869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=97869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}