garycnew
Senior Member
NOTE: After finally being convinced by the Entware & OpenWRT Developers that neither Build Environment was meant to be Compiled Natively on a Router (Neutered C Libraries), I decided to pursue this Cross-Compile ProxyChains-NG Entware Package via Debian Live DVD solution; which, is presumably a bit slower, but ultimately successful. It wasn't too terrible after finding the right cross-compiling platform and combining a few different build references.
Requirements/Assumptions:
Cross-Compiling Host Machine:
1. Plenty of Physical Memory (RAM)
2. Debian Live (Testing) DVD
3. Flash Drive >= 32GB (Preferably USB 3.0/3.1)
ProxyChains-NG Installation Machine:
1. An Asuswrt-Merlin Compatible Router (i.e., Asus RT-AC66U)
2. Asuswrt-Merlin Compatible Firmware (i.e., 384.19)
3. Formated JFFS Partition and Enabled JFFS Custom Scripts and Configs
4. Entware installed on USB 3.0 Interface Device via Asuswrt-Merlin Terminal Menu (AMTM) with Swap File created
NOTE: Not sure if it matters... At the time of this writing, Debian Bullseye (Testing) Live DVD contained the same package versions as the current Entware repository, opposed to the Debian Buster (Stable) Live DVD, so we opted to use the Debian Bullseye (Testing) Live DVD.
### Download & Burn Debian Live (Testing) DVD ###
### Boot Debian Live (Testing) DVD on the Cross-Compiling Host Machine ###
Our Cross-Compiling Host Machine required the [F12] key to be pressed during boot to enter into the Boot Menu and select the Debian Live (Testing) DVD. Make sure you setup and have Internet access on the Cross-Compiling Host Machine.
### Open Terminal ###
### Mount Flash Drive (Repeat after each DVD Boot) ###
### Download & Install Build System (Repeat after each DVD Boot) ###
### Clone, Setup, & Make Entware Build Env ###
### Download, Prepare, & Compile Test Package from OpenWRT Feed ###
### Download & Prepare OpenWRT Feed Package modified for Entware (When Available) ###
### Edit the Makefile to use the /opt directory prefix ###
### Select proxychains-ng for [M]odular inclusion under the SECTION => CATEGORY => SUBMENU of menuconfig ###
### Compile OpenWRT Feed Package modified for Entware ###
### SFTP & SSH proxychains-ng Package to ProxyChains-NG Installation Machine(s) ###
Congratulations! You've Cross-Compiled a ProxyChains-NG Entware Package via Debian Live (Testing) DVD! The Possibilities are Endless with Good-Times Ahead!
References:
### Full Edited proxychains-ng Makefile ###
Requirements/Assumptions:
Cross-Compiling Host Machine:
1. Plenty of Physical Memory (RAM)
2. Debian Live (Testing) DVD
3. Flash Drive >= 32GB (Preferably USB 3.0/3.1)
ProxyChains-NG Installation Machine:
1. An Asuswrt-Merlin Compatible Router (i.e., Asus RT-AC66U)
2. Asuswrt-Merlin Compatible Firmware (i.e., 384.19)
3. Formated JFFS Partition and Enabled JFFS Custom Scripts and Configs
4. Entware installed on USB 3.0 Interface Device via Asuswrt-Merlin Terminal Menu (AMTM) with Swap File created
NOTE: Not sure if it matters... At the time of this writing, Debian Bullseye (Testing) Live DVD contained the same package versions as the current Entware repository, opposed to the Debian Buster (Stable) Live DVD, so we opted to use the Debian Bullseye (Testing) Live DVD.
### Download & Burn Debian Live (Testing) DVD ###
Code:
$ curl -L -O -C - http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/weekly-live-builds/amd64/iso-hybrid/debian-live-testing-amd64-gnome+nonfree.iso
### Boot Debian Live (Testing) DVD on the Cross-Compiling Host Machine ###
Our Cross-Compiling Host Machine required the [F12] key to be pressed during boot to enter into the Boot Menu and select the Debian Live (Testing) DVD. Make sure you setup and have Internet access on the Cross-Compiling Host Machine.
### Open Terminal ###
### Mount Flash Drive (Repeat after each DVD Boot) ###
Code:
$ sudo -p /media/user/SanDiskSDCZ
$ sudo mount /dev/sdb1 /media/user/SanDiskSDCZ
$ cd /media/user/SanDiskSDCZ/
### Download & Install Build System (Repeat after each DVD Boot) ###
Code:
$ sudo apt-get update
$ sudo apt-get install git-core build-essential libssl-dev libncurses5-dev unzip gawk zlib1g-dev
$ sudo apt-get install python2 wget
### Clone, Setup, & Make Entware Build Env ###
Code:
$ git clone https://github.com/Entware/Entware.git
$ cd Entware
# Update OpenWRT Feeds
$ ./scripts/feeds update -a
# Symlink Packages (Repeat after each DVD Boot)
$ make package/symlinks
# Copy the config specific to your Architecture and Kernel versions
$ cp configs/armv7-2.6.config .config
$ make tools/install && make toolchain/install && make target/compile
or
#$ make -j1 V=sc tools/install
#$ make -j1 V=sc toolchain/install
#$ make -j1 V=sc target/compile
### Download, Prepare, & Compile Test Package from OpenWRT Feed ###
Code:
#$ ./scripts/feeds install screen
or
$ make -j1 V=sc package/screen/download
$ make -j1 V=sc package/screen/check
$ find package/ -iname "*screen*"
package/feeds/packages/screen
$ make -j1 V=sc package/screen/prepare
$ make -j1 V=sc package/screen/compile
#$ make -j1 V=sc package/screen/install
#$ make package/index
$ find bin/ -iname "*screen*"
bin/targets/armv7-2.6/generic-glibc/packages/screen_4.8.0-2_armv7-2.6.ipk
### Download & Prepare OpenWRT Feed Package modified for Entware (When Available) ###
Code:
#$ ./scripts/feeds install proxychains-ng
or
$ make -j1 V=sc package/feeds/packages/proxychains-ng/download
$ make -j1 V=sc package/feeds/packages/proxychains-ng/check
$ find package/ -iname "*proxychains-ng*"
package/feeds/packages/proxychains-ng
### Edit the Makefile to use the /opt directory prefix ###
Code:
$ diff package/feeds/packages/proxychains-ng/Makefile.orig package/feeds/packages/proxychains-ng/Makefile
49c49
< /etc/proxychains.conf
---
> /opt/etc/proxychains.conf
54,56c54,56
< $(INSTALL_DIR) $(1)/usr/bin
< $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/proxychains4 $(1)/usr/bin/
< $(LN) proxychains4 $(1)/usr/bin/proxychains
---
> $(INSTALL_DIR) $(1)/opt/bin
> $(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/proxychains4 $(1)/opt/bin/
> $(LN) proxychains4 $(1)/opt/bin/proxychains
59,60c59,60
< $(INSTALL_DIR) $(1)/usr/lib
< $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libproxychains4.so $(1)/usr/lib/
---
> $(INSTALL_DIR) $(1)/opt/lib
> $(INSTALL_DATA) $(PKG_INSTALL_DIR)/opt/lib/libproxychains4.so $(1)/opt/lib/
63,64c63,64
< $(INSTALL_DIR) $(1)/etc
< $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/proxychains.conf $(1)/etc/
---
> $(INSTALL_DIR) $(1)/opt/etc
> $(INSTALL_DATA) $(PKG_INSTALL_DIR)/opt/etc/proxychains.conf $(1)/opt/etc/
### Select proxychains-ng for [M]odular inclusion under the SECTION => CATEGORY => SUBMENU of menuconfig ###
Code:
$ make menuconfig
define Package/proxychains-ng
SECTION:=net
CATEGORY:=Network
TITLE:=Redirect TCP traffic to a HTTP or SOCKS proxy
URL:=https://github.com/rofl0r/proxychains/
endef
### Compile OpenWRT Feed Package modified for Entware ###
Code:
$ make -j1 V=sc package/feeds/packages/proxychains-ng/prepare
$ make -j1 V=sc package/feeds/packages/proxychains-ng/compile
#$ make -j1 V=sc package/feeds/packages/proxychains-ng/install
#$ make package/index
$ find bin/ -iname "*proxychains-ng*"
bin/targets/armv7-2.6/generic-glibc/packages/proxychains-ng_4.15-1_armv7-2.6.ipk
### SFTP & SSH proxychains-ng Package to ProxyChains-NG Installation Machine(s) ###
Code:
$ cd bin/targets/armv7-2.6/generic-glibc/packages/
$ sftp admin@192.168.0.1
sftp> cd /tmp/mnt/SanDiskSDHC/
sftp> put proxychains-ng_4.15-1_armv7-2.6.ipk
$ ssh admin@192.168.0.1
# cd /tmp/mnt/SanDiskSDHC/
# opkg install ./proxychains-ng_4.15-1_armv7-2.6.ipk
# opkg list-installed|grep -i proxychains
proxychains-ng - 4.15-1
# opkg files proxychains-ng
Package proxychains-ng (4.15-1) is installed on root and has the following files:
/opt/bin/proxychains4
/opt/lib/libproxychains4.so
/opt/bin/proxychains
/opt/etc/proxychains.conf
# opkg info proxychains-ng
Package: proxychains-ng
Version: 4.15-1
Depends: libc, libssp, librt, libpthread
Status: install user installed
Architecture: armv7-2.6
Conffiles:
/opt/etc/proxychains.conf abeab0c91cbf2f8a3c87a45059a1c939d027fbd51d43df14e8dc1652da0f535b
Installed-Time: 1642910684
# /opt/bin/proxychains4
Usage: /opt/bin/proxychains4 -q -f config_file program_name [arguments]
-q makes proxychains quiet - this overrides the config setting
-f allows one to manually specify a configfile to use
for example : proxychains telnet somehost.com
More help in README file
# /opt/bin/proxychains4 wget -O - https://ifconfig.me
or
# LD_PRELOAD=/opt/lib/libproxychains4.so wget -O - https://ifconfig.me
Congratulations! You've Cross-Compiled a ProxyChains-NG Entware Package via Debian Live (Testing) DVD! The Possibilities are Endless with Good-Times Ahead!
References:
Code:
http://bin.entware.net/armv7sf-k2.6/
http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/weekly-live-builds/amd64/iso-hybrid/
https://packages.debian.org/search?keywords=search
https://oldwiki.archive.openwrt.org/about/toolchain
https://oldwiki.archive.openwrt.org/doc/howto/buildroot.exigence
https://oldwiki.archive.openwrt.org/doc/howto/build.a.package
https://github.com/Entware/Entware/wiki/How-to-add-a-new-package
https://github.com/Entware/Entware-ng/wiki/Using-gcc-%28native-compilation%29
https://github.com/rofl0r/proxychains-ng
https://github.com/amezin/openwrt-packages/blob/master/net/proxychains-ng/Makefile
### Full Edited proxychains-ng Makefile ###
Code:
$ cat feeds/packages/net/proxychains-ng/Makefile
#
# Copyright (C) 2019-2021 Daniel Bermond
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=proxychains-ng
PKG_VERSION:=4.15
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/rofl0r/proxychains-ng/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=c94edded38baa0447766f6e5d0ec1963bb27c7b55b2a78b305d6f58e171388f8
PKG_MAINTAINER:=Daniel Bermond <dbermond@archlinux.org>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/proxychains-ng
SECTION:=net
CATEGORY:=Network
TITLE:=Redirect TCP traffic to a HTTP or SOCKS proxy
URL:=https://github.com/rofl0r/proxychains/
endef
define Package/proxychains-ng/description
A hook preloader that allows to redirect TCP traffic of
existing dynamically linked programs through one or more
SOCKS or HTTP proxies.
endef
define Build/Compile
$(call Build/Compile/Default,all)
endef
define Build/Install
$(call Build/Install/Default,install install-config)
endef
define Package/proxychains-ng/conffiles
/opt/etc/proxychains.conf
endef
define Package/proxychains-ng/install
# binary executable
$(INSTALL_DIR) $(1)/opt/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/proxychains4 $(1)/opt/bin/
$(LN) proxychains4 $(1)/opt/bin/proxychains
# library
$(INSTALL_DIR) $(1)/opt/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/opt/lib/libproxychains4.so $(1)/opt/lib/
# config
$(INSTALL_DIR) $(1)/opt/etc
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/opt/etc/proxychains.conf $(1)/opt/etc/
endef
$(eval $(call BuildPackage,proxychains-ng))
Attachments
Last edited: