Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(installer): chmod /DEBIAN and fakeroot #113

Merged
merged 4 commits into from
Jan 14, 2025

Conversation

hirntot
Copy link

@hirntot hirntot commented Jan 13, 2025

when installing the new script on Debian/lmde I get an error because the DEBIAN-Folder has wrong priviliges. This error was not existing 3 weeks ago. anyway, I found a solution, by adding a chmod line.

Also, the installed files belong to the user, even though they shold be secured. therefore, I use fakeroot for dpkg-deb, then the packages are made correctly.

note: this is my first pull request ever. Please doublecheck and forgive if I messed up.

also I didn't dive into that yml-stuff, maybe the build_package.yml also needs to get a fakeroot?

@Und3rf10w
Copy link
Owner

Re: fakeroot, aren't we anticipating that the installer.sh script is ran as root anyways? What's the need for it if you sudo installer.sh?

Do you have a reference for the vidalia suggestion removal? I believe you that it's no longer recommended, but if you have a link for it, that would be ideal

@hirntot
Copy link
Author

hirntot commented Jan 13, 2025

Re: fakeroot, aren't we anticipating that the installer.sh script is ran as root anyways? What's the need for it if you sudo installer.sh?

if you sudo copy or edit a file, the owner still stays the same. the same with dpkg-deb - the files just stay editable after installation.
you either have to chown everything or use fakeroot without messing with the ownership. At least, that's what I learned after I researched that issue.
(https://wiki.debian.org/FakeRoot)
anyway, let me show you my terminal output:

No1: original zip, unpacked and immediately started with following command (without chroot):

hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ sudo ./installer.sh 
/usr/bin/gpg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13248  100 13248    0     0  45321      0 --:--:-- --:--:-- --:--:-- 45369
Holen:1 http://security.debian.org bookworm-security InRelease [48,0 kB]
Holen:2 https://deb.debian.org/debian bookworm InRelease [151 kB]                                                                                             
[...] # just shortening pointless stuff here.
Holen:19 https://deb.debian.org/debian bookworm/main amd64 torsocks amd64 2.4.0-1 [74,3 kB]                                                                                                                                                  
Es wurden 32,9 MB in 28 s geholt (1.158 kB/s).                                                                                                                                                                                               
Vorkonfiguration der Pakete ...
Vormals nicht ausgewähltes Paket famfamfam-flag-png wird gewählt.
(Lese Datenbank ... 481973 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../00-famfamfam-flag-png_0.1-3.2_all.deb ...
Entpacken von famfamfam-flag-png (0.1-3.2) ...
[...] again: just shortening pointless text.
torsocks (2.4.0-1) wird eingerichtet ...
i2p-router (2.7.0-1~ubuntu1) wird eingerichtet ...
tor-geoipdb (0.4.7.16-1) wird eingerichtet ...
libjbigi-jni (2.7.0-1~ubuntu1) wird eingerichtet ...
i2p (2.7.0-1~ubuntu1) wird eingerichtet ...
Trigger für man-db (2.11.2-2) werden verarbeitet ...
**dpkg-deb: Fehler: Control-Verzeichnis hat falsche Zugriffsrechte 700 (muss >=0755 und <=0775 sein)**
dpkg: Fehler: Auf das Archiv »kali-anonsurf.deb« kann nicht zugegriffen werden: Datei oder Verzeichnis nicht gefunden
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 425 nicht aktualisiert.
dpkg: Fehler: Auf das Archiv »kali-anonsurf.deb« kann nicht zugegriffen werden: Datei oder Verzeichnis nicht gefunden
The package 'kali-anonsurf' did not install successfully.

No 2: with chroot, but not with fakeroot:

hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ ls -la /etc/init.d/anonsurf*
ls: Zugriff auf '/etc/init.d/anonsurf*' nicht möglich: Datei oder Verzeichnis nicht gefunden
hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ chmod 755 -R kali-anonsurf-deb-src/DEBIAN/
hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ sudo ./installer.sh 
/usr/bin/gpg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13248  100 13248    0     0  29049      0 --:--:-- --:--:-- --:--:-- 29052
OK:1 http://security.debian.org bookworm-security InRelease
OK:2 https://deb.debian.org/debian bookworm InRelease                                                                                                         
OK:3 https://deb.debian.org/debian bookworm-updates InRelease                                                                                                 
OK:4 https://deb.debian.org/debian bookworm-backports InRelease                                
Ign:5 http://packages.linuxmint.com faye InRelease                        
OK:6 http://packages.linuxmint.com faye Release   
Holen:7 https://deb.i2p.net bookworm InRelease [30,9 kB]
Es wurden 30,9 kB in 1 s geholt (24,4 kB/s).
Paketlisten werden gelesen… Fertig
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
secure-delete ist schon die neueste Version (3.1-8).
tor ist schon die neueste Version (0.4.7.16-1).
i2p ist schon die neueste Version (2.7.0-1~ubuntu1).
i2p-router ist schon die neueste Version (2.7.0-1~ubuntu1).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 425 nicht aktualisiert.
dpkg-deb: Paket »kali-anonsurf« wird in »kali-anonsurf.deb« gebaut.
Vormals nicht ausgewähltes Paket kali-anonsurf wird gewählt.
(Lese Datenbank ... 483457 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von kali-anonsurf.deb ...
Entpacken von kali-anonsurf (1.2.6.0) ...
kali-anonsurf (1.2.6.0) wird eingerichtet ...
hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ ls -la /etc/init.d/anonsurf*
-rwxr-xr-x 1 hirntot hirntot 11559 29. Dez 02:44 /etc/init.d/anonsurf

in the last line you see that the file is still my own file and therefore editable without root permissions. this file was not there before, as you see in the first line.

but after inserting fakeroot in the script, this problem is solved.

hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ xed installer.sh # adding fakeroot in line 28
hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ sudo apt purge kali-anonsurf 
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Die folgenden Pakete werden ENTFERNT:
  kali-anonsurf*
0 aktualisiert, 0 neu installiert, 1 zu entfernen und 425 nicht aktualisiert.
Nach dieser Operation werden 65,5 kB Plattenplatz freigegeben.
Möchten Sie fortfahren? [J/n] 
(Lese Datenbank ... 483466 Dateien und Verzeichnisse sind derzeit installiert.)
Entfernen von kali-anonsurf (1.2.6.0) ...
(Lese Datenbank ... 483457 Dateien und Verzeichnisse sind derzeit installiert.)
Löschen der Konfigurationsdateien von kali-anonsurf (1.2.6.0) ...
hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ ls -la /etc/init.d/anonsurf*
ls: Zugriff auf '/etc/init.d/anonsurf*' nicht möglich: Datei oder Verzeichnis nicht gefunden
hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ sudo ./installer.sh 
/usr/bin/gpg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13248  100 13248    0     0  24747      0 --:--:-- --:--:-- --:--:-- 24762
OK:1 http://security.debian.org bookworm-security InRelease
OK:2 https://deb.debian.org/debian bookworm InRelease                                                                          
Ign:3 http://packages.linuxmint.com faye InRelease                                                                             
OK:4 https://deb.debian.org/debian bookworm-updates InRelease                                  
OK:5 https://deb.debian.org/debian bookworm-backports InRelease           
OK:6 http://packages.linuxmint.com faye Release                           
Holen:7 https://deb.i2p.net bookworm InRelease [30,9 kB]
Es wurden 30,9 kB in 1 s geholt (23,9 kB/s).
Paketlisten werden gelesen… Fertig
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
secure-delete ist schon die neueste Version (3.1-8).
tor ist schon die neueste Version (0.4.7.16-1).
i2p ist schon die neueste Version (2.7.0-1~ubuntu1).
i2p-router ist schon die neueste Version (2.7.0-1~ubuntu1).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 425 nicht aktualisiert.
dpkg-deb: Paket »kali-anonsurf« wird in »kali-anonsurf.deb« gebaut.
Vormals nicht ausgewähltes Paket kali-anonsurf wird gewählt.
(Lese Datenbank ... 483457 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von kali-anonsurf.deb ...
Entpacken von kali-anonsurf (1.2.6.0) ...
kali-anonsurf (1.2.6.0) wird eingerichtet ...
hirntot@hirntot-virtual:~/Schreibtisch/kali-anonsurf-master$ ls -la /etc/init.d/anonsurf*
-rwxr-xr-x 1 root root 11559 29. Dez 02:44 /etc/init.d/anonsurf

Do you have a reference for the vidalia suggestion removal? I believe you that it's no longer recommended, but if you have a link for it, that would be ideal

https://support.torproject.org/misc/misc-9/
https://en.wikipedia.org/wiki/Vidalia_(software)


btw, a week ago I built a fully packed deb file for fun, that even works ootb, but my edits were messy and unstructured, further I have troubles getting along with that pull/push stuff... there might come more pull request in the near future...

Edit: I just realized, that python3-tk (in the requirements) is a relict from that, because I even built a graphical tool for it.

@Und3rf10w Und3rf10w merged commit cba9b7c into Und3rf10w:master Jan 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants