WPA_Supplicant source install

Zeung-il Kim
Mar 21, 2019 · 2 min read
1. 관련 라이브러리 설치
sudo apt-get install libssl-dev libnl-3-dev libnl-genl-3-dev libdbus-1-dev
2. 소스 다운로드 받는다.
https://w1.fi/wpa_supplicant/
현재 최신 버전은 wpa_supplicant-2.7임. 압축을 풀고cd wpa_supplicant
$~/Downloads/wpa_supplicant-2.7/wpa_supplicant$
3. config 파일 복사
cp defconfig .config
4. .config 파일 수정
CONFIG_LIBNL32=y
CFLAGS += -I/usr/include/libnl3
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
CONFIG_DRIVER_NONE=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_SYSLOG=y
5. make 한다.
service network-manager stop
6. 컴파일된 실행 파일 복사하기
cp /sbin/wpa_supplicant /sbin/wpa_supplicant.backup
cp ~/Download/wpa_supplicant2.7/wpa_supplicant/wpa_supplicant /sbin/
service network-manager start

Vendor specific element 확인을 위해서..
bss.c 파일에 다음 추가 하여 Test/**
* wpa_bss_update_scan_res - Update a BSS table entry based on a scan result
* @wpa_s: Pointer to wpa_supplicant data
* @res: Scan result
* @fetch_time: Time when the result was fetched from the driver
*
* This function updates a BSS table entry (or adds one) based on a scan result.
* This is called separately for each scan result between the calls to
* wpa_bss_update_start() and wpa_bss_update_end().
*/
#if 1 //bruno181214 add to check get Vender Specific
#define KT_IE_VSE 0x0017c311
#endif
void wpa_bss_update_scan_res(struct wpa_supplicant *wpa_s,
struct wpa_scan_res *res,
struct os_reltime *fetch_time)
{
const u8 *ssid, *p2p, *mesh;
#if 1 //bruno181214 add to check get Vender Specific
const u8 *kt_vendor_specific;
size_t VSE_length;
#endif
struct wpa_bss *bss;
if (wpa_s->conf->ignore_old_scan_res) {
struct os_reltime update;
calculate_update_time(fetch_time, res->age, &update);
if (os_reltime_before(&update, &wpa_s->scan_trigger_time)) {
struct os_reltime age;
os_reltime_sub(&wpa_s->scan_trigger_time, &update,
&age);
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: Ignore driver BSS "
"table entry that is %u.%06u seconds older "
"than our scan trigger",
(unsigned int) age.sec,
(unsigned int) age.usec);
return;
}
}
ssid = wpa_scan_get_ie(res, WLAN_EID_SSID);
if (ssid == NULL) {
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: No SSID IE included for "
MACSTR, MAC2STR(res->bssid));
return;
}
#if 1 //bruno181214 add to check get Vender Specific
kt_vendor_specific = wpa_scan_get_vendor_ie(res, KT_IE_VSE);
if (kt_vendor_specific != NULL) {
wpa_dbg(wpa_s, MSG_ERROR, "================================================================");
wpa_dbg(wpa_s, MSG_ERROR, "[VSE Test]we found AP which has KT Vendor Specific Element in SCAN Result");
wpa_dbg(wpa_s, MSG_ERROR, "[VSE Test]AP Mac address is "
MACSTR, MAC2STR(res->bssid));
wpa_dbg(wpa_s, MSG_ERROR, "[VSE Test]And AP SSID is %s ",wpa_ssid_txt(ssid + 2, ssid[1]));
VSE_length =kt_vendor_specific[1];
wpa_hexdump(MSG_ERROR, "[VSE Test] VSE Data DUMP", kt_vendor_specific, VSE_length+2);
wpa_dbg(wpa_s, MSG_ERROR, "================================================================");
}
#endif
if (ssid[1] > SSID_MAX_LEN) {
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: Too long SSID IE included for "
###################################################################1) Probe request
wpa_cli -i wlanX VENDOR_ELEM_ADD 13 dd1d0017c31122334455667788990011223344556677889900112233445566
wpa_cli -i wlanX scan2) Association Request
wpa_cli -i wlanX VENDOR_ELEM_ADD 14 dd1d0017c31122334455667788990011223344556677889900112233445566
wpa_cli -i wlanX add_network
wpa_cli -i wlanX setnetwork 0 ssid ‘”VSE_TEST_AP’”
wpa_cli -i wlanX setnetwork 0 psk ‘”1234567890”’
wpa_cli -i wlanX select_network 0
## Probe request, beacon capture하기
sudo ifconfig wlp68s0 down
sudo iwconfig wlp68s0 mode monitor
sudo ifconfig wlp68s0 up
iw dev 로 상태 확인

Wireshark를 열고 interface setting에서 monitor를 check한다.
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade