Ubuntu 20.04编译安装 spooftooph

从kali gitlab仓库下载spooftooph源码

链接: https://gitlab.com/kalilinux/packages/spooftooph.

在这里插入图片描述
复制链接,然后使用git 下载(wget、迅雷、浏览器都行)。

git clone https://gitlab.com/kalilinux/packages/spooftooph.git
root@ubuntu:~# git clone https://gitlab.com/kalilinux/packages/spooftooph.git
Cloning into 'spooftooph'...
remote: Enumerating objects: 101, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 101 (delta 7), reused 0 (delta 0), pack-reused 81
Receiving objects: 100% (101/101), 45.31 KiB | 75.00 KiB/s, done.
Resolving deltas: 100% (31/31), done.
root@ubuntu:~# ls
snap  spooftooph
root@ubuntu:~# cd spooftooph/
root@ubuntu:~/spooftooph# ls
bdaddr.c  CHANGELOG  dev_class.c  namelist.c  oui.h   spooftooph.c
btdev.h   debian     makefile     oui.c       README
root@ubuntu:~/spooftooph#

编译并安装spoorftooph

root@ubuntu:~/spooftooph# make 
gcc -lbluetooth -lncurses -pthread dev_class.c namelist.c spooftooph.c bdaddr.c oui.c -o spooftooph
spooftooph.c:35:10: fatal error: bluetooth/bluetooth.h: No such file or directory
   35 | #include <bluetooth/bluetooth.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
bdaddr.c:36:10: fatal error: bluetooth/bluetooth.h: No such file or directory
   36 | #include <bluetooth/bluetooth.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:12: spooftooph] Error 1

出现错误,缺少头文件 bluetooth.h

sudo apt install libbluetooth-dev

然后进入/usr/include/bluetooth目录,查看是不是有了头文件。

root@ubuntu:/usr/include/bluetooth# ls
bluetooth.h  cmtp.h  hci_lib.h  l2cap.h   sco.h  sdp_lib.h
bnep.h       hci.h   hidp.h     rfcomm.h  sdp.h

然后再次编译spoorftooph,发现有很多未定义错误

...
bdaddr.c:(.text+0x952): undefined reference to `hci_open_dev'
/usr/bin/ld: bdaddr.c:(.text+0x9be): undefined reference to `hci_devinfo'
/usr/bin/ld: bdaddr.c:(.text+0xa0b): undefined reference to `hci_close_dev'
/usr/bin/ld: bdaddr.c:(.text+0xa31): undefined reference to `hci_read_local_version'
/usr/bin/ld: bdaddr.c:(.text+0xa7e): undefined reference to `hci_close_dev'
/usr/bin/ld: bdaddr.c:(.text+0xaef): undefined reference to `hci_read_bd_addr'
/usr/bin/ld: bdaddr.c:(.text+0xb3c): undefined reference to `hci_close_dev'
/usr/bin/ld: bdaddr.c:(.text+0xb7e): undefined reference to `bt_compidtostr'
/usr/bin/ld: bdaddr.c:(.text+0xbaa): undefined reference to `ba2oui'
/usr/bin/ld: bdaddr.c:(.text+0xbd3): undefined reference to `ba2str'
/usr/bin/ld: bdaddr.c:(.text+0xc44): undefined reference to `str2ba'
/usr/bin/ld: bdaddr.c:(.text+0xc98): undefined reference to `hci_close_dev'
/usr/bin/ld: bdaddr.c:(.text+0xcfb): undefined reference to `ba2oui'
/usr/bin/ld: bdaddr.c:(.text+0xd24): undefined reference to `ba2str'
/usr/bin/ld: bdaddr.c:(.text+0xde7): undefined reference to `hci_close_dev'
/usr/bin/ld: bdaddr.c:(.text+0xea9): undefined reference to `hci_close_dev'
/usr/bin/ld: bdaddr.c:(.text+0xef2): undefined reference to `hci_close_dev'
collect2: error: ld returned 1 exit status
make: *** [makefile:12: spooftooph] Error 1

这是因为makefile中把lib库引用放到源文件前面了,只要修改一下makefile,或者直接使用gcc编译就可以了。

gcc dev_class.c namelist.c spooftooph.c bdaddr.c oui.c -o spooftooph -lbluetooth -lncurses -pthread

然后就会发现当前目录下多出了一个spoorftooph可执行文件

root@ubuntu:~/spooftooph# ls
bdaddr.c  CHANGELOG  dev_class.c  namelist.c  oui.h   spooftooph
btdev.h   debian     makefile     oui.c       README  spooftooph.c

执行一下试试:

root@ubuntu:~/spooftooph# ./spooftooph 

spooftooph v0.5.2 by JP Dunning (.ronin) 
<www.hackfromacave.com>
(c) 2009-2012 Shadow Cave LLC.

NAME
	spooftooph

SYNOPSIS
	spooftooph -i dev [-mstu] [-nac]|[-R]|[-r file] [-w file]

DESCRIPTION
	-a <address>	: Specify new BD_ADDR
	-b <num_lines>	: Number of Bluetooth profiles to display per page
	-B 		: Disable banner for smaller screens (like phones)
	-c <class>	: Specify new CLASS
	-h		: Help
	-i <dev>	: Specify interface
	-m		: Specify multiple interfaces during selection
	-n <name>	: Specify new NAME
	-r <file>	: Read in CSV logfile
	-R		: Assign random NAME, CLASS, and ADDR
	-s		: Scan for devices in local area
	-t <time>	: Time interval to clone device in range
	-u		: USB delay.  Interactive delay for reinitializing interface
	-w <file>	: Write to CSV logfile
			  (Useful in Virtualized environment when USB must be passed through.)


这样就大功告成了。
或者安装到bin目录

sudo make install
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值