[ / / / / / / / / / / / / / ] [ dir / 27chan / hamradio / imouto / leftpol / pinoy / tk / u / yg ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Name
Email
Subject
Comment *
File
Select/drop/paste files here
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

[–]

 No.816374>>816376 >>816405 >>818565 [Watch Thread][Show All Posts]

I'm sure all you fags have already installed gentoo so this is irrelevant for you, but if you have any debian-based systems, this is a way to automate mac-address spoofing on boot.


#!/bin/bash
#Vendor MAC spoof script (randomize your MAC at boot, co-operates with Network Manager, there should be no rejection by routers for "fake" MACs)
#Before doing anything, make sure you have macchanger installed! (sudo apt-get install macchanger), and write down your device names (from "ifconfig" in bash)
#First, navigate to /etc/NetworkManager/NetworkManager.conf and add the following to the NetworkManager.conf:
# [connection]
# ethernet.cloned-mac-address=preserve
# wifi.cloned-mac-address=preserve
#Second, use root privileges to make this script executable, then copy this script to /etc/init.d/
#Third, make the script execute on boot by typing "update-rc.d mcc.sh defaults 100" in bash
#Don't forget to check your device names with "ifconfig" in bash! Make sure they match with the script!
#You can also run this script at any time for a fresh cloned MAC or change the switch to "-a" from "-A" to get a random mac that corresponds to your chipset vendor
#That's it, enjoy having a less traceable device!

# Stop Network Manager
service network-manager stop

# Disable the network devices
ifconfig eth0 down
ifconfig wlan0 down

# Spoof the mac addresses
/usr/bin/macchanger -A eth0
venmac=$(macchanger -A wlan0 | awk '/^New MAC:/{print $3}');
find /etc/NetworkManager/system-connections -type f -exec sh -c "sed -i \"/^cloned-mac-address.*/d;/^\[wifi\]/a\cloned-mac-address=$venmac\" \"{}\"" \;

# Re-enable the devices
ifconfig eth0 up
ifconfig wlan0 up

#Restart Network Manager
service network-manager start

 No.816376

>>816374 (OP)

forgot to include script name, mcc.sh.

I ran into a ton of difficulty trying to script this because sed was being a stone bitch, so I just awk'd the macchanger output.


 No.816378>>816382 >>816386

Why would you put this after the interfaces have already been brought up? That's dumb - you've already handed the network your real mac by this point. It needs to be part of whatever you're using to bring the interfaces up as a precondition rather than hack it by cycling interfaces like a Pajeet.


 No.816382>>816389 >>816390

>>816378

How do I computer.

If you have a more elegant solution, Anon, have at 'er. I spent way more time than it's worth just getting this to work. Even though I've seen you guys shitposting that systemd is a botnet, a lot of people use it. The only distro I know that has anything like this script for randomization is a Kali script that sucks ass, is a billion lines long, and overcomplicates the whole process.

Hell, wouldn't one of you guys be able to push an update that at least enables ufw by default for the normalfags? I don't know of a debian-based install that does even that.


 No.816386

>>816378

do you always boot your system already networked?


 No.816389>>818483 >>818510

>>816382

I know bringing up ufw is a tangent, but it's just my point that normalfag distros have basically negative ability to do what a lot of you guys take for granted.

As another aside, if you have any OpenRC live distros that you can recommend, I'm interested in checking it out. The systemd team seems pretty jewish from what I've heard, but the biggest trouble for OpenRC adoption is not having a solid livecd with an easy install process as far as I've been able to determine, I checked distrowatch but everything seems fairly complicated. OpenRC Mint would be breddy gud imo.

Microsoft products are dead and dying right now, I don't think the user experience could possibly get worse than Windows 10. Year of the linux desktop is rapidly approaching.


 No.816390>>816400 >>816401

>>816382

If you're using /etc/network/interfaces, a pre-up line will do. If you're letting network-manager completely take over then I don't know, I don't use that piece of shit. It's probably similar to systemd-networkd where you'll need to add a service script in /etc/systemd that has a Before= for whatever target it reserves for pre-config.


 No.816400

>>816390

NetworkManager has a pre-up target in /etc/NetworkManager/dispatcher.d but it sounds like it might be after bringing the link up but before bringing up the interface instead of what it should be: before it brings anything up. More fucking poor design from systemdicks garbage.


 No.816401>>816409

>>816390

I'm not nearly that deep into the linux 'tism hole for that. I don't even properly know how commandline syntax really works, let alone regular expressions.

I blame all the wasted years of using DOS then moving right to GUIs.


 No.816405>>816415

>>816374 (OP)

Why do you use /usr/bin/macchanger in one location but just macchanger in another?


 No.816409>>816411

>>816401

I'm way deep into that hole (I designed embedded networking devices) but I don't know how NetworkManager works. It's a convoluted mess and designed by people who only understand networking from a desktop user's perspective. It's very difficult to understand what it actually does as the functionality is spread across several different programs all communicating via messaging.


 No.816411>>816414

>>816409

Do you know what NetworkManager does, about why it exists?


 No.816414

>>816411

Yes. In theory it's listening to events via udev and coordinating setting up network interfaces. In practice it's an unholy binding between multiple systemd components and systemd-networkd communicating over dbus which is difficult to unravel.

In our products I listen to udev events directly and handle setting up interfaces via a python service and it's very straight-forward in comparison.


 No.816415

>>816405

I wasn't sure if setting the variable in bash with the full path would fuck up the script. Just an inconsistency from the original scripts that I left alone.


 No.816466>>816478

Did you know you can simply use mac-address=XX:XX:XX:XX:XX:XX in /etc/network/interfaces then restart networking to use the new address? It seems like a lot of effort to do something so simple.


 No.816478>>816491

>>816466

"This page intentionally left blank"


 No.816491

>>816478

Sorry, I meant hwaddress ether XX:XX:XX:XX:XX:XX

It's been awhile since I had need to do this.


 No.818483

>>816389

Artix (default Arch version, Manjaro version, ArchBang has an option for an Artix-version download).


 No.818510

>>816389

>he doesn't think things can get worse

hold this beer.


 No.818565

>>816374 (OP)

The ArchWiki explains how to do this at boot as well as post-boot (which is what your script is optimal for).

https://wiki.archlinux.org/index.php/MAC_address_spoofing




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
19 replies | 0 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / 27chan / hamradio / imouto / leftpol / pinoy / tk / u / yg ][ watchlist ]