this post was submitted on 23 Apr 2025
796 points (99.1% liked)

[Moved to !iiiiiiitttttttttttt@programming.dev, check pinned post.] iiiiiiitttttttttttt.

884 readers
19 users here now

you know the computer thing is it plugged in?

Moved to !iiiiiiitttttttttttt@programming.dev.

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] emberpunk@lemmy.ml 32 points 2 days ago (1 children)

OK listen hear me out. Perfect opportunity for guests to learn how to ssh tunnel to port forward to their local device ๐Ÿ˜…

[โ€“] stembolts@programming.dev 17 points 2 days ago* (last edited 2 days ago) (1 children)

I'll save noobies some time.

for (( i=1; i<65536; i++ ));do  
  for (( j=1; j<256; i++ ));do  
    ssh -L $j$i:127.0.0.1:$i -N 192.168.1.$j &  
  done  
done  

What could go wrong?

Okay clearly this won't work because there aren't enough local ports to match to 16 bits of ports on potentially 255 machines, but with some slight modification I could add in a test to only increment the local port if the forward is successful and thereby create the dumbest-ass port forwarding script ever.

[โ€“] InnerScientist@lemmy.world 10 points 2 days ago (1 children)

ip a a 127.0.0.2/8 dev lo

You have a whole /8 subnet of localhost, do it.

[โ€“] stembolts@programming.dev 13 points 2 days ago* (last edited 2 days ago)

I like where your head is at.

We could also save some time just parsing something like..

nmap --top-ports 100 192.168.1.0/24 | grep -e "report" -e "open"  

We have the technology, we can be stupid.