robertdavidgraham / masscan

TCP port scanner, spews SYN packets asynchronously, scanning entire Internet in under 5 minutes.
GNU Affero General Public License v3.0
23.45k stars 3.06k forks source link

Finally masscan working for termux without connect to wlan. #780

Open anasfanani opened 4 months ago

anasfanani commented 4 months ago

I spent 2 days search how to run masscan with termux only with LTE network, because limitation of rmnet_data, I try to create dummy interface ethX, virtual eth pair to network namespace, deal with iptables route, etc really make frustation, only can run masscan with success while connected as client to AP.

Recently I discovered to install docker in termux https://gist.github.com/oofnikj/e79aef095cd08756f7f26ed244355d62 , because manual way is too complicated, I want easy way instead, go to https://github.com/egandro/docker-qemu-arm and follow instruction to install.

Login to alpine linux and install masscan and libpcap-dev with:

apk update
apk add masscan
apk add libpcap-dev

Result:

alpine:~# masscan -p80 1.1.1.1 -v
[+] pcap: found library: libpcap.so
[+] interface = eth0
[+] if(eth0): pcap: libpcap version 1.10.4 (with TPACKET_V3)
[+] if(eth0): successfully opened
[+] interface-type = 1
if:eth0: type=ethernet(1)
[+] source-mac = 52-54-00-12-34-56
[+] source-ip = 10.0.2.15
[+] router-ip = 10.0.2.2
[+] arp: 10.0.2.2 == 52-55-0a-00-02-02
[+] router-mac-ipv4 = 52-55-0a-00-02-02
Starting masscan 1.3.2 (http://bit.ly/14GZzcT) at 2024-05-29 00:55:47 GMT
Initiating SYN Stealth Scan
Scanning 1 hosts [1 port/host]
[+] starting transmit thread #0
[+] starting throttler: rate = 100.00-pps
[+] starting receive thread #0
[+] transmit thread #0 complete
[+] waiting for threads to finish
Discovered open port 80/tcp on 1.1.1.1
Logan147 commented 4 months ago

哎呀,自己编译内核启用docker,实现安装原生支持运行docker就ok拉,没多大问题,2天就解决的事

Logan147 commented 4 months ago

qemu效率极低,没法使用python多线程技术,虽然有一个在aarch64架构上可以运行x86架构程序的优点,但是效率太低了

anasfanani commented 4 months ago

qemu效率极低,没法使用python多线程技术,虽然有一个在aarch64架构上可以运行x86架构程序的优点,但是效率太低了

不幸的是我无法自己编译内核,实际上我真的希望 Masscan 无需路由器即可工作。 但我的搜索只找到了 qemu。