News for hackers. Stuff that matters.
Re:How to steal a developer's local database by jlgaddis on Thursday September 01, 2016 @02:45PM (#12407835)
I'll point out for the benefit of others that not all operating systems treat 127.0.0.0/8 as belonging to the loopback interface.

Linux does, so this will probably work for the majority of users here, but, I believe, it will not work for FreeBSD, for example (I'm on an iPad and don't have an SSH client at the moment so I can't verify). In those cases, however, you can add "aliases" to the loopback interface, with specific IP addresses in the 127/8 subnet, and then use them.

Re:How to steal a developer's local database by JonathonW on Thursday September 01, 2016 @05:01PM (#12408851)
On OSX (and, I suspect, vanilla FreeBSD), this looks like (replacing 127.1.2.3 with the address you want to use; 0xff000000 must stay the same, since netmasks of all addresses on an interface must not confict if they're on the same subnet):

    sudo ifconfig lo0 alias 127.1.2.3 0xff000000
And then, when you're done:

    sudo ifconfig lo0 -alias 127.1.2.3
to tear it back down.
Re:How to steal a developer's local database by X-Istence on Thursday September 01, 2016 @08:00PM (#12409757)
Recommendation for aliases on an interface is to use 255.255.255.255 as the netmask on FreeBSD.

For example to add extra interfaces to lo0 on FreeBSD you may use:

  ipv4_addrs_lo0="127.0.0.2-5/8"
in rc.conf

And now those addresses are automatically assigned to lo0, the netmask will be set to 255.255.255.255 automatically for all but the first in that range (.2). Since 127.0.0.1 is unconditionally assigned to lo0, you could also use:

  ipv4_addrs_lo0="127.0.0.2-5/32"
This is what I do on FreeBSD.
Re:How to steal a developer's local database by JonathonW on Friday September 02, 2016 @02:43AM (#12411322)
The ifconfig man page just says the netmask must be "non-conflicting" if on the same subnet as the first network address for the interface (that'd be 127.0.0.1/8 for lo0). I'm presuming the narrower netmask qualifies as non-conflicting?
Re:How to steal a developer's local database by X-Istence on Sunday September 04, 2016 @12:13AM (#12422649)
Yes indeed!
Re:How to steal a developer's local database by inferiorhuman on Thursday September 01, 2016 @05:29PM (#12409043)
On FreeBSD at least you can assign whatever address you want to a loopback interface. I'm currently using aliases on a loopback device (lo1 in this case) for host <-> jail communication. The jails get 172.16.0.0/16.

You can manage this trivially in rc.conf and then restart the netif and route services.

Re:How to steal a developer's local database by andrewstuart2 on Thursday September 01, 2016 @03:00PM (#12407951)
Yeah, good point. I fired up my Windows VM and confirmed that I can listen on a randomly-chosen 127.* address as well, so that should mean most people don't need that extra step. :-)
Re:How to steal a developer's local database by cimnine on Thursday September 01, 2016 @06:08PM (#12409251)
I had some fun with this as well a while ago. It's too bad that with IPv6 we'll only get one loopback address (i.e. ::1) and not again a whole loopback subnet.
Re:How to steal a developer's local database by kijin on Thursday September 01, 2016 @11:15PM (#12410575)
IPv6 has a humongous private network range, though. fd00:/8 has 2^120 IP addresses. You could set up a Docker bridge with that range and run containers with random addresses. Correctly guessing one of 2^120 addresses would be nearly as difficult as cracking AES128.