quinta-feira, novembro 28, 2019

PXE Boot Live Kali Linux | Kali Linux Live Network Booting | Booting Kali Linux Live over HTTP


Need to read first

In short therms you only need to grab live files from ISO and configure menu as follow

label Kali^Live
        menu label Kali^Live
        kernel vmlinuz
        append vga=788 initrd=initrd.img append boot=live components fetch=http://192.168.1.1/filesystem.squashfs

-------

Download Kali PXE Netboot Images


Now, we need to create a directory to hold the Kali Netboot image and download the image we wish to serve from the Kali repos.

mkdir -p /tftpboot 
cd /tftpboot 
 # for 64 bit systems:  
wget http://repo.kali.org/kali/dists/kali/main/installer-amd64/current/images/netboot/netboot.tar.gz 
 # for 32 bit systems:  
wget http://repo.kali.org/kali/dists/kali/main/installer-i386/current/images/netboot/netboot.tar.gz 
tar zxpf netboot.tar.gz 
 rm netboot.tar.gz



Configure Target to Boot From Network


With everything configured, you can now boot your target system and configure it to boot from the network. It should get an IP address from your PXE server and begin booting Kali.



Booting Over HTTP ?

In this example, we will obtain the kernel, initrd, and squashfs filesystem we need from a full Kali Linux release ISO from within the “live” directory. We copy the initrd and kernel into the TFTP root folder, while the squashfs file goes into the web root:

mkdir /mnt/iso 
 mount -o loop kali-linux-1.1.0a-amd64.iso /mnt/iso/  
cp /mnt/iso/live/{initrd.img,vmlinuz} /tftpboot/ 
cp /mnt/iso/live/filesystem.squashfs /var/www/ 
 apachectl start



In this example, we’ll obtain the kernel, initrd, and squashfs filesystem from a full Kali Linux release ISO (in the “live” directory) and then proceed to boot the kernel and initrd over PXE. Once the boot screen appears, we need to alter a few boot parameters as shown in the screenshot below:


Or menu, can look like this

label Kali^Live
        menu label Kali^Live
        kernel vmlinuz
        append vga=788 initrd=initrd.img append boot=live components fetch=http://192.168.1.1/filesystem.squashfs


As the squashfs filesystem loads to RAM, the filesystem itself can’t be larger than the amount of RAM available on the computer – meaning that for booting a standard Kali ISO as shown above, we’d need at least 4 GB of RAM. Of course, this can be remedied by making smaller, custom Kali ISO images, perhaps with different toolsets and uses.



quinta-feira, novembro 14, 2019

android tools linux user in plugdev group; are your udev rules wrong?

https://github.com/M0Rf30/android-udev-rules/blob/master/android-udev.conf

android tools linux user in plugdev group; are your udev rules wrong?


# Clone this repository
git clone https://github.com/M0Rf30/android-udev-rules.git
cd android-udev-rules
# Copy rules file
sudo cp -v 51-android.rules /etc/udev/rules.d/51-android.rules
# OR create a sym-link to the rules file - choose this option if you'd like to update your udev rules using git.
sudo ln -sf "$PWD"/51-android.rules /etc/udev/rules.d/51-android.rules
# Change file permissions
sudo chmod a+r /etc/udev/rules.d/51-android.rules
# If adbusers group already exists remove old adbusers group
groupdel adbusers
# add the adbusers group if it's doesn't already exist
sudo mkdir -p /usr/lib/sysusers.d/ && sudo cp android-udev.conf /usr/lib/sysusers.d/
sudo systemd-sysusers # (1)
# OR on Fedora:
groupadd adbusers
# Add your user to the adbusers group
sudo usermod -a -G adbusers $(whoami)
# Restart UDEV
sudo udevadm control --reload-rules
sudo service udev restart
# OR on Fedora:
sudo systemctl restart systemd-udevd.service
# Restart the ADB server
adb kill-server
# Replug your Android device and verify that USB debugging is enabled in developer options
adb devices
# You should now see your device

quarta-feira, outubro 23, 2019

Restart ttyUSB or linux usb to serial force stop

Simple steps
modprobe -r ch341modprobe -r usbserialmodprobe ch341
---
explanation...

The below seems to solve my problem, but not always.
  1. Find the driver associated to your ttyUSBx device.
    [my-pc]# cat /proc/tty/drivers
    /dev/tty             /dev/tty        5       0 system:/dev/tty
    /dev/console         /dev/console    5       1 system:console
    /dev/ptmx            /dev/ptmx       5       2 system
    /dev/vc/0            /dev/vc/0       4       0 system:vtmaster
    rfcomm               /dev/rfcomm   216 0-255 serial
    usbserial            /dev/ttyUSB   188 0-253 serial
    ttyprintk            /dev/ttyprintk   5       3 console
    serial               /dev/ttyS       4 64-111 serial
    pty_slave            /dev/pts      136 0-1048575 pty:slave
    pty_master           /dev/ptm      128 0-1048575 pty:master
    unknown              /dev/tty        4 1-63 console
    
    You can see that /dev/ttyUSB uses usbserial. Now dig a little further:
    [my-pc]# lsmod | grep usbserial
      usbserial              37173  1 pl2303
    
    In my case, my USB-to-serial converter is a Prolific PL2303. If you have a FTDI adapter, I think you should see ftdi_sio instead of pl2303.
  2. Unload the driver
    sudo modprobe -r pl2303 #or the name that matches your config
    sudo modprobe -r usbserial
  3. Re-load the driver
    sudo modprobe pl2303 #or the name that matches your config
  4. Re-launch your serial communication