You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
Lists/linux_general.txt

287 lines
14 KiB

-Qt for wayland requires qt5-wayland package and "export QT_QPA_PLATFORM=wayland"
-You still have tor and "arm" to monitor it
-Docker is pretty cool you should use it, https://www.kali.org/news/official-kali-linux-docker-images/
also works with wifite2, it basically is a shell-oriented low-weight high-performance virtual machine
wich can run prebuilt docker images or your personal docker images. Docs: https://docs.docker.com/
-Pacman commands:
"pacman -Syy" update repositories
"pacman -Su" update packages
"pacman -Qdtq" list unused/orphan packages
"pacman -R" remove a package
"pacman -S" install a package
"pacman -R $(pacman -Qdtq)" remove unused packages
"pacman -Rns" remove packages and its dependencies (recursively)
"pacman -Ql" list all package files and locations
"pacman -Qqe" list all installed packages
If you panic just do "sudo pacman -Syy" and then "sudo pacman -Su"
"rm -rf /var/lib/pacman/db.lck" remove pacman's transaction lock file
(to solve "could not unlock database" error)
-"acpi" is kinda important in laptops "acpi -i" for info, also "thinkpad_acpi" should be noted
-GREP basics:
GREP or "grep" is the most beautiful thing in the fucking universe, use it to filter results like:
"ps ax | grep whatyouwant" and it will find it another example is "dmesg | grep whatyouwant"
the | is used to pipe the output in another program like, can you guess it? grep
-You use "ps ax" to view all processes and their UIDs
-"https://wiki.archlinux.org/index.php/systemd" just helpful
-Remember: the ArchLinux wiki is your lord and savior
-Bluetooth usage:
Start the "bluetooth.service" service then refer to:
https://wiki.archlinux.org/index.php/Bluetooth_headset
https://wiki.archlinux.org/index.php/bluetooth
-https://github.com/trustedsec/social-engineer-toolkit
-Make some bash scripts you idiot, oh and this could be useful http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Type%20Something%20
-Upon installing linux, to add locales uncomment them in /etc/locale.gen and then run "locale-gen" as sudo
to search for fonts just open https://wiki.archlinux.org/index.php/Localization
NOTE: you need japanese and chinese locales and fonts to display those characters correctly
-Install "mesa", "lib32-mesa" and "vulkan-intel" for the graphics you dumb fuck
"https://wiki.archlinux.org/index.php/intel_graphics"
-To run .jar files in cli you must use "java -jar"
-To list all partitions "sudo fdisk -l"
-To check a disk's health you need "smartmontools", first check system compatibility with "sudo smartctl -c /dev/sdX"
then either do a short test "sudo smartctl -t short /dev/sdX" or a long test "sudo smartctl -t long /dev/sdX"
lastly do "sudo smartctl -H /dev/sdX" to get the results
-https://github.com/spacehuhn
-You are gefährliches halbwissen
-pikaur (AUR) to manage AUR packages
-Problem with xtensa-lx106 gcc for compiling esp8266 programs:
"https://community.zerynth.com/t/can-not-build-wifi-example-on-nodemcu-v3-error-building-native-c-driver/1280"
-Recompiling compilers for zerynth:
If facing compiling errors in zerynth, manually recompile the compiler for the board in ""~/.zerynth2/sys"
for example replacing the xtensa-lx106 compiler (esp8266) goes:
1-Move the old compiler folder somewhere safe (~/.zerynth2/sys/xtensa-lx106)
2-Clone and compile (as standalone) new compiler in a temporary folder, guide here -> "http://domoticx.com/sdk-esp8266-xtensa-architecture-toolchain/"
3-Move the newly created compiler folder (xtensa-lx106-elf) in ~/.zerynth2/sys and rename it as the original one (xtensa-lx106/)
4-Copy the old package.json in the new compiler folder
Better yet is to wait for an official fix and report the bug on the troubleshooting section
Also the same thing has to be done with the xtensa-lx6 compiler (esp32)
"https://dl.espressif.com/doc/esp-idf/latest/get-started/linux-setup.html"
-Fixing Arduino permissions:
Source: https://www.howtogeek.com/50787/add-a-user-to-a-group-or-second-group-on-linux/
"ls -la /dev/tty*" and see which group TTYs are in, then add yourself to that group:
"usermod -a -G examplegroup exampleusername" or just use "$USER" to add current user, then reboot.
-Theming gnome:
download the theme packages at "https://www.gnome-look.org/" and unzip them
then depending if it is an icon theme or an normal theme place them in
"/usr/share/icons" or "/usr/share/themes" accordingly
-Adding executables and shortcuts:
Refers to:
https://askubuntu.com/questions/322772/how-do-i-add-an-executable-to-my-search-path
https://unix.stackexchange.com/questions/3809/how-can-i-make-a-program-executable-from-everywhere
You have to add them to your $PATH, example: "export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin"
Quote "If you just type export PATH=$PATH:</path/to/file> at the command line it will only last for the length of the session.
If you want to change it permanently add export PATH=$PATH:</path/to/file> to your ~/.bashrc file (just at the end is fine)."
-Use "clamav" as antivirus: "https://wiki.archlinux.org/index.php/ClamAV", to update use "freshclam" as sudo
and to scan "clamscan --recursive --infected /path/to/something"
-If by nay chance you need a key's datasheet, like for copying it with just a photo (more on that later ;),
check out Silca's "the catalogue" it tell dimensions and the catalog's page of the key: https://thecatalogue.silca.biz/
-Power cord names and standards: http://community.fs.com/blog/small-power-cord-big-difference.html
-Circuit design guide for DC/DC converters (1/10): https://www.torexsemi.com/technical-support/application-note/design-guide-for-dcdc-converter/whats-dcdc-converters/
-It may be useful to download some sites that I list here on top of the whole arch wiki and Wikipedia
a guide is found here: https://www.youtube.com/watch?v=LjeQKE_tEcA&index=4&t=0s&list=PLY_0BKX9I82YNPNxRZRbGEqaxRdpSAk6a
and also an official guide from Wikipedia itself: https://en.wikipedia.org/wiki/Wikipedia:Database_download
-Some of my own playlists:
Hacking "https://www.youtube.com/playlist?list=PLY_0BKX9I82YNPNxRZRbGEqaxRdpSAk6a"
Thing to do "https://www.youtube.com/playlist?list=PLY_0BKX9I82bwbEh80pKXGSkiNt_2xgUP"
Linux useful (WIP) "https://www.youtube.com/playlist?list=PLY_0BKX9I82ZCWMlV6N0d9IxbQt32Cvs0"
CR-10 "https://www.youtube.com/playlist?list=PLY_0BKX9I82aiEm96d0tvK3KWw1opw6dR"
Electronic basics "https://www.youtube.com/playlist?list=PLY_0BKX9I82b5DYjdoY-iGHgfqH6Msv4A"
-Nixie tubes and stuff:
https://threeneurons.wordpress.com/miscellaneous-projects/improvised-tube%20sockets/
https://threeneurons.wordpress.com/nixie-power-supply/
https://threeneurons.wordpress.com/links/data-sheets/
-Some git stuff:
Creating a repo and pushing the first commit: "https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/"
basically it's a matter of defining the remote (origin) repo "git remote add origin <repo URL>"
committing the changes in local repo "git commit -m "message" "
pushing before first pull "git pull origin master --allow-unrelated-histories" the last part is just to merge the repos (if needed)
and finally pushing the changes "git push origin master", or in atom just publish
Using 2 factor auth. in command line and atom: "https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/"
basically you have to use a access token instead of the password, these are unique and you can only
see them once, so be careful with them!
-Powertop usage:
Arch page: https://wiki.archlinux.org/index.php/powertop
To start powertop use "sudo powertop"
For the first calibration use "sudo powertop --calibrate", NOTE: it takes a few minutes and during
that time the screen may go (it does) black for a few minutes too, just let it run.
To set everything to "good" do "sudo powertop --auto-tune",
to make the auto-tune start at boot refer to the Arch wiki or "how to create a sysemd service"
NOTE: in order to apply changes and stuff you have to leave it running for some time to let it
take its measures and stuff
-Power management:
Arch page: https://wiki.archlinux.org/index.php/Power_management#Power_management_with_systemd
To change the actions to take when power button or lid switch events occur:
modify the conf. file at /etc/systemd/logind.conf or /etc/systemd/logind.conf.d/*.conf
-Use mitmf or ettercap to start mitm then use ferret to capture cookies (ferret -i eth0)
use hamster to set session cookies and then in browser set the proxy settings to manual giving the address
provided by hamster and finally open that link
-Who are you? "whoami"
-Where am I? "groups"
-Adding executables not located in /bin/ (downloaded from internet):
Refers to:
https://askubuntu.com/questions/322772/how-do-i-add-an-executable-to-my-search-path
https://unix.stackexchange.com/questions/3809/how-can-i-make-a-program-executable-from-everywhere
Adding them momentarily:
Add them to your $PATH, example: "export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin"
Adding them at the start of the session:
Using bashrc:
Add export PATH=$PATH:</path/to/file> (the bin/ folder) to your ~/.bashrc file (just at the end is fine)
Using cron:
Add export PATH=$PATH:</path/to/file> to your crontab file:
Open your crontab file using "crontab -e" for current user or "crontab -e -u username" fo others
At the end of the file add "@reboot export PATH=$PATH:</path/to/file>"
NOTE: probably it is best do to add the command in the "su" cron file
-Checking system errors:
Refers to:
https://wiki.archlinux.org/index.php/Systemd#Journal
https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs
If your distro users systemctl the easiest way to check errors is to look up the recent
events in the system logs to do that type "journalctl"
-Windows:
Adding programs to PATH:
Source: https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/
Open: Control panel -> system -> advanced system settings -> environment variables
On windows 7 or 8:
Set the variable name to "Path"
Add the path to the program preceded by ";" ex. "...;C:\path\to\something"
On windows 10:
Click on "New"
Enter the path to the program
Retrieving the windows product key:
Open a console with admin privileges
Type "wmic path softwarelicensingservice get OA3xOriginalProductKey"
-Creating a systemd (systemctl) service (aka how to make a program start at boot):
Guides and references:
https://askubuntu.com/questions/112705/how-do-i-make-powertop-changes-permanent
https://wiki.archlinux.org/index.php/powertop
https://askubuntu.com/questions/919054/how-do-i-run-a-single-command-at-startup-using-systemd
Create a file under /etc/systemd/system/ and call it <whatever>.service
Then follow the formatting {
[Unit]
Description=PowerTOP auto tune
[Service]
Type=idle # Not necessary
Environment="TERM=dumb" # Not necessary
ExecStart="PATHTOEXECUTABLE --OPTIONS"
[Install]
WantedBy=multi-user.target
}
And then enable it using "systemctl whatever.service enable"
# NETWORK SECTION
-Gathering information on network cards ie IP, MAC, status, etc.
With ifconfig, just type "ifconfig" and it will give:
ether: the MAC address
inet: the network ip address
netmatsk: the netmask duh
inet6: the network ipv6
With iwconfig (specifically for wireless cards), just type "iwconfig" and it will give:
Mode: monitor or managed
ESSID: the ESSID (name) of the connected network
Frequency
Access Point: the MAC address of the AP
Signal level: the power/quality of the signal
Among other informations
Sites for public IP discovery and information gathering:
https://www.iplocation.net/
http://www.whatsmyip.org/
-Changing the MAC address:
Using macchanger:
The general usage is "macchanger [OPTIONS] interface", the most common options being
-A for a random MAC,
-r to reset to the original one,
-a to change it to a random MAC of some type (same vendor),
-b to set the "locally administered" bit set to false or
-m XX:XX:XX:XX:XX:XX to manually set the MAC address.
Using ifconfig:
First disable the interface using "ifconfig <interface> down"
Then change the MAC address using "ifconfig <interface> hw ether 00:XX:XX:XX:XX:XX"
it has to begin with 00:*
Then finally re-enable the interface with "ifconfig <interface> up"
To prevent the MAC address from reverting to its original state you can configure the network manager
to not scan for other networks using a random MAC address (that is done for security by many OSs and
also by phones), to achieve this you have to change the conf. file for your network manager:
For GNOME (kali) add {
[device]
wifi.scan-rand-mac-address=preserve
[connection]
ethernet.cloned-mac-address=preserve
wifi.cloned-mac-address=preserve
}
to /etc/NetworkManager/NetworkManager.conf
-Changing interfaces to monitor mode:
Not mandatory but best use is to first use "airmon-ng check kill", this kills all processes
that could interfere with the process and later with the attacks
Using airmon-ng:
Simply use "airmon-ng start <interface>" to put it in monitor mode
And "airmon-ng stop <interface>" to revert it to managed
NOTE: when using airmon-ng it will change the interface name by adding *mon to its name
for example wlan0 becomes wlan0mon
Using iwconfig (useful since first method is not always reliable):
Disable interface using "ifconfig <interface> down" or "ifdown <interface>"
Change to minitor mode with "iwconfig <interface> mode monitor"
Re-enable interface with "ifconfig <interface> up" or "ifup <interface>"
To revert it back to managed disable the interface then do "iwconfig <interface> mode managed"
then re-enable the interface
-Restarting network interfaces:
Without ssh:
Disable and re-enable the interface with "ifdown <interface>" and then "ifup <interface>"
or "ifconfig <interface> down" and then "ifconfig <interface> up"
On ssh:
Non systemd "/etc/init.d/networking restart"
Systemd (Arch) "systemctl restart NetworkManager"
-Enabling IP forwarding:
Arch page: https://wiki.archlinux.org/index.php/Internet_sharing_(Italiano)
"echo 1 > /proc/sys/net/ipv4/ip_forward"
To revert it back:
"echo 0 > /proc/sys/net/ipv4/ip_forward"