Skip to main content

Building mdk4 for the Hak5 WiFi Pineapple Pager

· 6 min read
Roy Firestein
CEO at Autohost.ai

Complete guide for cross-compiling mdk4 for the Hak5 WiFi Pineapple Pager using the OpenWrt SDK.

Target Device Specifications

  • Device: Hak5 WiFi Pineapple Pager
  • CPU: 580 MHz MIPS 24KEc (MediaTek MT7628AN)
  • Architecture: mipsel_24kc (MIPS32r2, little-endian)
  • OS: Pineapple Pager 24.10.1 (based on OpenWrt 24.10.1)
  • Board: ramips/mt76x8
  • Kernel: Linux 6.6.86

Prerequisites

Build Host Requirements

This guide uses AWS Linux 2023 as the build host, but should work on any modern Linux distribution.

Install Build Dependencies

# Update package manager
sudo dnf update -y

# Install build essentials
sudo dnf install -y gcc make gcc-c++

# Install Perl modules (required by OpenWrt build system)
sudo dnf install -y perl-FindBin perl-Thread-Queue perl-IPC-Cmd

# Install additional build tools
sudo dnf install -y wget tar zstd file

Step 1: Download the OpenWrt SDK

Download the SDK matching your device's OpenWrt version and architecture.

# Navigate to home directory
cd ~

# Download OpenWrt SDK for ramips/mt76x8 (24.10.1)
wget https://downloads.openwrt.org/releases/24.10.1/targets/ramips/mt76x8/openwrt-sdk-24.10.1-ramips-mt76x8_gcc-13.3.0_musl.Linux-x86_64.tar.zst

# Extract the SDK (requires zstd)
tar --zstd -xf openwrt-sdk-24.10.1-ramips-mt76x8_gcc-13.3.0_musl.Linux-x86_64.tar.zst

# Navigate into SDK directory
cd openwrt-sdk-24.10.1-ramips-mt76x8_gcc-13.3.0_musl.Linux-x86_64

Note: If using a different OpenWrt version, find the matching SDK at: https://downloads.openwrt.org/releases/<version>/targets/<board>/<subtarget>/

Step 2: Install Required Dependencies

Install the libraries that mdk4 depends on.

# Update package feeds
./scripts/feeds update -a

# Install dependencies
./scripts/feeds install libnl-core libnl-genl libpcap

Step 3: Create mdk4 Package Directory

# Create package directory
mkdir -p package/mdk4

Step 4: Create Package Makefile

Create the OpenWrt package Makefile with proper configuration:

cat > package/mdk4/Makefile << 'EOF'
include $(TOPDIR)/rules.mk

PKG_NAME:=mdk4
PKG_VERSION:=4.2
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/aircrack-ng/mdk4.git
PKG_SOURCE_VERSION:=master
PKG_MIRROR_HASH:=skip

PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING

PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk

define Package/mdk4
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libnl-core +libnl-genl +libpcap +libpthread
TITLE:=MDK4 WiFi Testing Tool
URL:=https://github.com/aircrack-ng/mdk4
endef

define Package/mdk4/description
MDK4 is a Wi-Fi testing tool from E7mer, ASPj of k2wrlz,
it uses the osdep library from the aircrack-ng project
to inject frames on several operating systems.
endef

TARGET_CPPFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3

TARGET_LDFLAGS += \
-L$(STAGING_DIR)/usr/lib

MAKE_FLAGS += \
PREFIX=/usr \
LIBNL="-lnl-3 -lnl-genl-3"

define Package/mdk4/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mdk4 $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,mdk4))
EOF

Key Points About the Makefile

Critical: The Makefile uses TARGET_CPPFLAGS += instead of overriding CFLAGS. This is essential because:

  • mdk4's internal build system adds -I.. in the osdep directory
  • Overriding CFLAGS breaks this, causing missing header errors
  • Using TARGET_CPPFLAGS += appends paths without breaking internal flags

Step 5: Install Package Dependencies

Before compiling, ensure all dependencies are built:

# Build dependencies
make package/libnl-core/compile V=s
make package/libnl-genl/compile V=s
make package/libpcap/compile V=s

Step 6: Compile mdk4

# Clean any previous builds (if recompiling)
rm -rf build_dir/target-*/mdk4*

# Compile mdk4 with verbose output
make package/mdk4/compile V=s

The compilation will take a few minutes. You should see:

  • Source code being downloaded from GitHub
  • Compilation of osdep library
  • Compilation of attack modules
  • Linking of final binary
  • Package creation

Step 7: Verify the Build

Check that the package was created successfully:

# Find the package
ls -lh bin/packages/mipsel_24kc/base/mdk4*.ipk

# Expected output:
# -rw-r--r-- 1 user user 53K <date> mdk4_4.2-r1_mipsel_24kc.ipk

Verify the binary architecture:

# Extract package to verify
cd /tmp
mkdir mdk4_test && cd mdk4_test
tar -xzf ~/openwrt-sdk-24.10.1-ramips-mt76x8_gcc-13.3.0_musl.Linux-x86_64/bin/packages/mipsel_24kc/base/mdk4_4.2-r1_mipsel_24kc.ipk
tar -xzf data.tar.gz
file ./usr/sbin/mdk4

# Expected output:
# ./usr/sbin/mdk4: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1 (SYSV),
# dynamically linked, interpreter /lib/ld-musl-mipsel-sf.so.1, no section header

Step 8: Deploy to WiFi Pineapple Pager

Copy Package from Build Server

# From your local machine, copy from the build server
scp -i ~/path/to/key.pem \
user@build-server:~/openwrt-sdk-24.10.1-ramips-mt76x8_gcc-13.3.0_musl.Linux-x86_64/bin/packages/mipsel_24kc/base/mdk4_4.2-r1_mipsel_24kc.ipk \
./

Transfer to Pineapple Pager

# Copy to device (adjust IP/hostname as needed)
scp mdk4_4.2-r1_mipsel_24kc.ipk root@pager:/tmp/

Install on Device

SSH into the Pineapple Pager:

ssh root@pager

Install the package:

# Navigate to package location
cd /tmp

# Install dependencies (if not already installed)
opkg update
opkg install libnl-core libnl-genl libpcap

# Install mdk4
opkg install mdk4_4.2-r1_mipsel_24kc.ipk

# Verify installation
which mdk4
mdk4 --version

Troubleshooting

Issue: Missing pcap.h or LINKTYPE errors

Symptoms:

error: 'LINKTYPE_IEEE802_11' undeclared
error: 'TCPDUMP_MAGIC' undeclared

Cause: The Makefile is completely overriding CFLAGS, breaking mdk4's internal include paths.

Solution: Use TARGET_CPPFLAGS += instead of CFLAGS= in the Makefile (already implemented in Step 4).

Issue: libnl errors

Symptoms:

error: netlink/genl/genl.h: No such file or directory

Solution: Install libnl dependencies:

./scripts/feeds install libnl-core libnl-genl
make package/libnl-core/compile V=s
make package/libnl-genl/compile V=s

Issue: libpcap errors

Symptoms:

undefined reference to 'pcap_*'

Solution: Install and compile libpcap:

./scripts/feeds install libpcap
make package/libpcap/compile V=s

Issue: Perl module errors

Symptoms:

Can't locate FindBin.pm

Solution: Install Perl modules:

# AWS Linux 2023 / Amazon Linux / Fedora
sudo dnf install -y perl-FindBin perl-Thread-Queue perl-IPC-Cmd

# Ubuntu / Debian
sudo apt install -y perl-base libfindbin-libs-perl

# Manual CPAN install (if packages unavailable)
sudo cpan FindBin Thread::Queue IPC::Cmd

Build Output Details

Files Created

  • Package: bin/packages/mipsel_24kc/base/mdk4_4.2-r1_mipsel_24kc.ipk (53KB)
  • Binary: usr/sbin/mdk4 (147KB stripped, inside package)

Binary Specifications

  • Format: ELF 32-bit LSB executable
  • Architecture: MIPS, MIPS32 rel2
  • Linking: Dynamically linked
  • Libc: musl (ld-musl-mipsel-sf.so.1)
  • Dependencies: libnl-3, libnl-genl-3, libpcap, libpthread

Additional Notes

Build Time

  • First build: ~5-10 minutes (includes downloading source)
  • Subsequent builds: ~2-3 minutes

Disk Space Requirements

  • OpenWrt SDK: ~1GB extracted
  • Build directory: ~200MB
  • Final package: 53KB

Alternative: Quick Rebuild

If you need to rebuild after making changes:

# Clean mdk4 only
rm -rf build_dir/target-*/mdk4*

# Rebuild
make package/mdk4/compile V=s

Using Different mdk4 Versions

To build a specific version instead of master:

Edit package/mdk4/Makefile and change:

PKG_SOURCE_VERSION:=master

To:

PKG_SOURCE_VERSION:=v4.2  # or specific commit hash

References

Building a Serverless Antivirus Scanner for S3 - A Journey from Lambda Layers to Container Images

· 18 min read
Roy Firestein
CEO at Autohost.ai

Ever tried to fit an elephant into a suitcase? That's what it felt like when we first attempted to create a serverless virus scanning solution for S3 uploads. Our journey took us through Lambda layers, container images, and some interesting discoveries about the limitations of serverless computing. Here's our story.

Smart Documentation: Leveraging AI to Build a Dynamic Knowledge Base

· 13 min read
Roy Firestein
CEO at Autohost.ai

Imagine a world where your product documentation updates itself, always staying fresh and relevant. A world where customer support tickets automatically transform into valuable knowledge resources. Sound like science fiction? Not anymore.

In the fast-paced realm of customer support, keeping documentation up-to-date can feel like a never-ending battle. But what if we could harness the power of AI to turn this challenge into an opportunity?

A few weeks ago, my VP of Support and Customer Success approached me with an intriguing question: How can we utilize cutting-edge AI technology to create product documentation from the wealth of information hidden in our support tickets? Their quarterly project to update our knowledge base was looming, and they were looking for a way to automate the process, save time, and ensure our documentation always reflected the latest customer needs.

This sparked an exciting journey into the world of AI-powered documentation. In this article, I'll take you step-by-step through the process of building a system that uses Large Language Models (LLMs) to transform HubSpot support tickets into a dynamic, ever-evolving knowledge base.

Get ready to revolutionize your documentation process. Let's dive in!

From Ghosted to Booked: Mastering B2B Sales Follow-Through

· 6 min read
Roy Firestein
CEO at Autohost.ai

In the fast-paced world of B2B sales, one of the most frustrating challenges sales professionals face is the dreaded "no-show" or being ghosted by prospects after the initial meeting. This issue not only wastes valuable time but can also significantly impact your bottom line. According to a recent Forrester report, nearly 90% of global business buyers indicate that their purchase process was stalled in 2023 [1]. This statistic underscores the importance of maintaining momentum in the sales process.

As sales leaders, it's crucial to equip our teams with the right strategies to minimize these occurrences and maintain momentum in the sales process. At Autohost, we've developed a comprehensive approach to tackle this problem head-on. Here's our guide to reducing no-shows and ghosting in your B2B sales process:

  1. Set Clear Expectations with an Up-Front Contract
    The Sandler Selling Methodology emphasizes the importance of establishing an up-front contract at the end of each interaction. This contract sets clear expectations for the next steps and ensures both parties are on the same page.

    Example: "Thanks for your time today, [Prospect Name]. Based on our discussion about [specific pain points], what do you think should be our next step?"

  2. Secure Commitment for the Next Meeting

    Once you've agreed on the next step, lock in a firm commitment:

    "Great, let's schedule our next meeting to [discuss/demo/etc.]. How does [specific date and time] work for you? I'll send a calendar invite right after our call."

  3. Set Expectations for Communication

    Clearly communicate what will happen between now and the next meeting:

    "Before our next meeting, I'll send you [specific materials/information]. Is there anything else you need from me to prepare?"

  4. Address Potential No-Shows Proactively

    Use a friendly, non-confrontational approach to address the possibility of a no-show:

    "I know things can get busy. If something comes up and you can't make our scheduled meeting, would you mind letting me know? That way, we can reschedule and make the most of both our time."

  5. Establish a Follow-Up Protocol

    Agree on how to handle follow-ups:

    "If I don't hear from you by [agreed date], would it be okay if I reach out to check in? What's the best way to do that - email, phone, or something else?"

  6. Confirm the Prospect's Commitment

    Ensure the prospect is truly committed to moving forward:

    "Just to confirm, are you still seeing this as a priority for your team? Is there anything that might prevent us from moving forward with our next steps?"

  7. Summarize and Reaffirm

    Before ending the call, summarize the agreed-upon next steps:

    "To recap, we've agreed to [next steps]. I'll send you [materials] by [date], and we'll meet again on [date/time]. If anything changes, we'll [agreed follow-up method]. Does this sound correct to you?"

  8. Post-Meeting Follow-Up

    Immediately after the meeting, send a follow-up email that:

    • Provides three highlights from the call
    • Confirm our company can solve their challenge(s)
    • Reiterates the agreed-upon next steps and timeline
    • Includes any promised materials or information

    Here's an example:

    3 highlights from our call today:

    • Manual guest screening process in place, but opportunity to automate and enhance verification
    • Chargebacks have been reduced, but still an ongoing issue, especially for product quality disputes
    • Concerns around longer-term stays and evictions in multiple states

    I’m confident Autohost can help address these priorities with our comprehensive guest screening and fraud prevention solution.

    Next steps:

    • Follow-up call scheduled for Tuesday, June 25th at 10am
    • Review current screening processes and pain points in more detail

    Looking forward to continuing the conversation!

  9. Pre-Meeting Reminder

    A day before the scheduled follow-up meeting, send a friendly reminder:

    "Looking forward to our meeting tomorrow at [time]. I've attached [relevant materials] for your reference. Please let me know if you need to reschedule for any reason."

  10. If a No-Show Occurs

    If despite these efforts, a no-show occurs, follow up with a non-confrontational message:

    "Hi [Prospect Name], I hope everything is okay. We missed our scheduled meeting today. I know things can get hectic. Would you like to reschedule, or has anything changed regarding the priority of this project?"

Implementing these strategies can significantly reduce no-shows and ghosting in your B2B sales process. Remember, the key is to be proactive, clear in your communication, and always maintain a professional and understanding tone.

It's also important to note that the B2B buying process has become increasingly complex. According to a study by Drip, 77% of B2B buyers say their latest purchase was either "difficult" or "very complex" [2]. By providing a clear, structured follow-up process, you're not only reducing no-shows but also simplifying the buying journey for your prospects.

Moreover, with the rise of digital selling, it's crucial to adapt your follow-up strategies to align with modern buying behaviors. Research from Thinkific shows that 62% of B2B buyers engaged with three to seven pieces of content before connecting with a sales rep [3]. This underscores the importance of providing valuable, relevant content throughout the follow-up process to keep prospects engaged.

The shift towards digital and omnichannel selling is further emphasized by McKinsey's research, which found that B2B buyers now use up to ten or more channels, including online and digital, as part of any given purchase. This is double the number of channels used five years ago [4].

By implementing these strategies and staying attuned to the evolving B2B sales landscape, you can significantly reduce no-shows, minimize ghosting, and ultimately improve your sales team's effectiveness and close rates.

Remember, persistence and professionalism are key. As sales leaders, it's our responsibility to guide our teams in mastering the art of follow-through, ensuring that every prospect interaction moves the sales process forward efficiently and effectively.

How to Create Trust with Prospects Like a Doctor

· 3 min read
Roy Firestein
CEO at Autohost.ai

As a salesperson, building trust with your prospects is crucial for closing deals and establishing long-term relationships. But how can you create that trust quickly and effectively? One approach is to take a cue from the medical profession and treat your sales conversations more like a doctor's visit.

When you go to the doctor, they don't just sit down and start prescribing medication or treatments. Instead, they ask probing questions to diagnose your condition and understand your unique needs. They want to get to the root of the problem before offering any solutions.

As a salesperson, you should adopt a similar mindset. Rather than launching straight into your pitch, focus on asking insightful questions that uncover your prospect's true challenges, goals, and motivations. This shows you care about understanding their situation, not just making a sale.

Doctors also aren't afraid to ask tough, even uncomfortable questions when needed. They know that getting the full picture is essential for making an accurate diagnosis and recommendation.

Likewise, don't shy away from probing deeper with prospects when you sense there's more to the story. Asking challenging questions demonstrates confidence and expertise. It positions you as a trusted advisor, not just another vendor. Prospects will respect your thoroughness.

Just like a good doctor, aim to prescribe solutions that are tailored to each prospect's specific "symptoms" or needs. Cookie-cutter approaches erode trust. Prospects want to feel you've carefully considered their unique situation.

Finally, remember that patients don't necessarily expect their doctor to be their best friend. While bedside manner is important, it's secondary to being a competent professional who asks the right questions and provides appropriate guidance.

The same is true in sales. Focus first on demonstrating credibility, insight and leadership through great questions and attentive listening. Build trust by showing prospects you're a safe pair of hands to guide them to the right solution.

Conclusion

To create trust like a doctor, salespeople should:

  1. Ask tough, challenging questions: Doctors ask patients uncomfortable questions to diagnose the problem accurately. Similarly, salespeople should ask prospects questions that they may not know the answer to, but feel the salesperson should. This demonstrates expertise and helps the salesperson understand the prospect's true needs and motivations.
  2. Focus on the process, not the outcome: Doctors follow a systematic process to diagnose and treat patients. Salespeople should also have a structured approach to selling, focusing on the steps that lead to a successful outcome rather than being overly attached to the final result.
  3. Provide leadership, a safe pair of hands, and insight: Prospects look for these three qualities in a salesperson. By demonstrating leadership, competence, and valuable insights, salespeople can establish trust and credibility, much like a doctor does with their patients.
  4. Avoid being needy or overly adaptive: Doctors don't change their approach to please patients; they do what is necessary to help them. Salespeople should similarly maintain their professionalism and not be overly concerned with being liked or adapting to every whim of the prospect.
  5. Be willing to challenge the prospect: Doctors often have to convince patients to make difficult lifestyle changes for their health. Salespeople should also be prepared to challenge their prospects' assumptions and guide them towards the best solution, even if it may be uncomfortable.

By adopting these doctor-like behaviors, salespeople can shift their focus from being liked to being trusted. This approach may not always be comfortable, but it is more likely to lead to successful long-term relationships with clients who view the salesperson as a credible expert and partner in achieving their goals.