最新的backtrack5(bt5)官方网站已经提供下载,backtrack5是基于ubuntu Lucid LTS. 内核2.6.38开发的,完全开源并和GPL兼容。

Backtrack 中文网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 243|回复: 1

[其他] Build nmap on linux (debina/Backtrack)

[复制链接]
桐彦红
单海菡

VERSION='7.70'
DEV='dfsg1'
REV='5Backtrack1'

wget http://http.Backtrack.org/Backtrack/pool/main/n/nmap/nmap_"$VERSION"+"$DEV"-"$REV".dsc
wget http://http.Backtrack.org/Backtrack/pool/main/n/nmap/nmap_"$VERSION"+"$DEV".orig.tar.xz
wget http://http.Backtrack.org/Backtrack/pool/main/n/nmap/nmap_"$VERSION"+"$DEV"-"$REV".debian.tar.xz

DSC=+"$DEV"-"$REV"
DEPENDS=$(cat $DSC | grep "Build-Depends:" | sed 's/Build-Depends: //g' | sed 's/, /\n/g' | sed 's/ (.*//g' | sed 's/\[.*\]//g' | tr "\n" " ")
sudo apt-get install $DEPENDS default-jdk mingw-w64 g++ fakeroot -y

tar Jxvf Nmap_"$VERSION"+"$DEV".orig.tar.xz
tar Jxvf nmap_"$VERSION"+"$DEV"-"$REV".debian.tar.xz

mv debian nmap-"$VERSION"/
cd nmap-"$VERSION"
rm -rf debian/patches

# Linux Patch
sed -i 's/Exec=.*/Exec=pkexec \/usr\/bin\/zenmap %F/g' zenmap/install_scripts/unix/zenmap-root.desktop
sed -i 's/TryExec=.*/TryExec=pkexec/g' zenmap/install_scripts/unix/zenmap-root.desktop
sed -i 's/define NCAT_CA_CERTS_PATH .*/define NCAT_CA_CERTS_PATH "\/etc\/ssl\/certs\/ca-certificates.crt"/g' ncat/ncat_posix.c
sed -i 's/LIBLUA_LIBS="-llua5.3/LIBLUA_LIBS="-llua5.3 -llua5.3-lpeg/g' configure.ac
sed -i '/<libssh2.h>/a #endif' nmap.cc
sed -i '/<libssh2.h>/a #include "libssh2.h"' nmap.cc
sed -i '/<libssh2.h>/a #else' nmap.cc
sed -i '/<libssh2.h>/a #include "libssh2/libssh2v.h"' nmap.cc
sed -i '/<libssh2.h>/a #ifdef LIBSSH2_INCLUDED' nmap.cc
sed -i '/<libssh2.h>/d' nmap.cc
sed -i '/<zlib.h>/a #endif' nmap.cc
sed -i '/<zlib.h>/a #include "zlib.h"' nmap.cc
sed -i '/<zlib.h>/a #else' nmap.cc
sed -i '/<zlib.h>/a #include "libz/libzv.h"' nmap.cc
sed -i '/<zlib.h>/a #ifdef ZLIB_INCLUDED' nmap.cc
sed -i '/<zlib.h>/d' nmap.cc
sed -i '/See the ncat/d' ncat/docs/ncat.1

## Build

fakeroot make -f debian/rules binary

or

cp -rf debian/libpcap .

./configure --build=x86_64-linux-gnu \
--prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man \
--infodir=\${prefix}/share/info --sysconfdir=/etc \
--localstatedir=/var \
--libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu \
--disable-silent-rules --disable-maintainer-mode --disable-dependency-tracking \
--with-liblua --with-liblinear --enable-ipv6 STRIP=/bin/true --with-libpcap=included

make -j2
cd nselib/data/jdwp-class && /usr/lib/jvm/default-java/bin/javac *.java
cd ../psexec && i686-w64-mingw32-gcc -o nmap_service.exe nmap_service.c
cd ../../..

make install DESTDIR=$HOME/Build/$(basename $(pwd))

cd $HOME/Build
mkdir -p nmap-"$VERSION"/DEBIAN

cat > nmap-"$VERSION"/DEBIAN/control << EOF
Package: nmap
Version: "$VERSION"-1
Architecture: amd64
Maintainer: Debian Security Tools <team+pkg-security@tracker.debian.org>
Installed-Size: 29697
Depends: libc6, libgcc1, liblinear3, liblua5.3-0, libpcre3, libssh2-1, libssl1.1, libstdc++6, zlib1g, python-lxml, python-gtk2, python-gobject-2 | python-gobject
Section: net
Priority: optional
Homepage: https://nmap.org/
Description: The Network Mapper
Nmap is a utility for network exploration or security auditing. It
supports ping scanning (determine which hosts are up), many port
scanning techniques, version detection (determine service protocols
and application versions listening behind ports), and TCP/IP
fingerprinting (remote host OS or device identification). Nmap also
offers flexible target and port specification, decoy/stealth scanning,
sunRPC scanning, and more. Most Unix and Windows platforms are
supported in both GUI and commandline modes. Several popular handheld
devices are also supported, including the Sharp Zaurus and the iPAQ.
EOF

cd ..
dpkg-deb --build --uniform-compression -Zgzip nmap-"$VERSION" nmap_"$VERSION"-1_amd64.deb

点评

海!外直播 t.cn/RxlBLRZ 禁闻视频 t.cn/Rxl1r5o 当我用心去了解世界时,惊愕地发现:从小我们被告诉,资本主义才有的邪恶暴力腐败凄惨都被社会主义国家拥有了;而社会主义应有的平等自由福利人权都被资本主义国家拥有   发表于 2019-1-5 11:05
+1
243°C
    沙发哦 ^ ^ 马上
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    BackTrack是一套专业的计算机安全检测的Linux操作系统,简称BT。BackTrack 是一个基于Ubuntu GNU/Linux的发行版本,主要用做数字取证和入侵测试。它的名字引用自回溯法(backtracking)。BackTrack 给用户提供了大量功能强大但简单易用的安全工具软件。BackTrack还支持Live CD和Live USB启动方式,用户可以直接从移动介质启动该系统而不用将系统安装在硬盘上。BackTrack被设计成一体化的旨在安全审计用的livecd,曾经它是被最广泛采用的渗透测试框架并被世界各地的安全社区所使用。现在,BackTrack已被Kali Linux所代替,BT将不再维护。
    快速回复 返回顶部 返回列表