Friday, October 02, 2026
Stop da hibernating!
Friday, September 11, 2026
Compiling Busybox stuff
Busybox
https://github.com/mirror/busybox/releases/tag/1_36_1
make menuconfig
make
You might need to edit .config
Set the CONFIG_TC to N and another CONFIG_TCPSVD to N as well to build on latest kernel
DOwnload deb and extract binary
https://pkgs.org/search/?q=xxx
ar x xxx.deb
Bash shortcuts!
Find all files that smells like xxx and copy to thumb
find /search/root -type f -name '*partial*' -exec cp --parents -t /media/user/thumb {} +
Getting a specific app version
apt update
#LIst all available versions
apt-cache policy <package_name>
#install the specific version
sudo apt install <package_name>=<package_version>
Cryptsetup!
cryptsetup luksFormat /dev/sss
cryptsetup luksOpen /dev/sss lala
sudo mkfs.ext4 /dev/mapper/lala
sudo mkdir /mnt/encrypted
sudo mount /dev/mapper/lala /mnt/encrypted
sudo umount /mnt/encrypted
sudo cryptsetup luksClose encrypted_drive
* https://codelucky.com/cryptsetup-command-linux/
Reverse SSH
ssh -N -L 18789:127.0.0.1:18789 user@somewhere
Saturday, March 28, 2026
Multiple VNC Users on a debian / ubuntu
Problem: My kids want to VNC into a VM and use it.
Solution:
apt update && apt install tigervnc-standalone-server xfce4 xfce4-goodies
adduser kid1
su - kid1
You should now be in the kid1 user.
==== KID1 ====
vncpasswd
nano ~/.vnc/xstartup
==== CODE ====
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4
==== CODE ====
chmod +x ~/.vnc/xstartup
exit
==== KID1 ====
On the server,
nano /etc/tigervnc/vncserver.users
==== CODE ====
:3=kid1 #This means port 5900 + 3 = kid1 screen
==== CODE ====
systemctl daemon-reload
systemctl enable tigervncserver@:3.service
systemctl start tigervncserver@:3.service
Might need UFW allow
ufw allow 5901:5905/tcp
Default is listen to 127.0.0.1
To listen to 0.0.0.0
vim /etc/tigervnc/vncserver-config-defaults
enable > $localhost="no"
Blank screen after some time while using ESXi + Ubuntu / Debian
Problem: After some time, the screen went black. From VCSA, unable to click console.
Solution1: If you still can ssh, ssh in and issue `sudo systemctl restart gdm` for a temp fix.
Solution2: `sudo apt install -y dconf-editor gnome-shell-extension-manager`
Run dconf-editor in a GUI, search for power especially org > gnome > settings-daemon > plugins > power > ambient-enabled.
Turn off all sleep features.
Solution 3:
Changing the settings in /etc/gdm3/custom.conf to WaylandEnable=false worked well.
Links: https://github.com/vmware/open-vm-tools/issues/725
Wednesday, July 24, 2019
DDWRT Stupid USB Tethering
WAN Set as auto
cd /lib/modules/4.4.89
insmod usbnet.ko
insmod cdc_ether.ko
insmod rndis_host.ko
ifconfig usb0 up
udhcpc -i usb0
It should auto up and just need the following iptables
iptables --table nat --append POSTROUTING --out-interface usb0 -j MASQUERADE
Friday, July 27, 2018
Updating old esx servers to ESXi 6.7
Power all VM.
Turn on maintenance mode.
Enable SSH
SSH into the server
esxcli network firewall ruleset set -e false -r httpClient
esxcli software sources profile list --depot=https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep 6.7
esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.7.0-8169922-standard
Might wanna open another SSH
tail -f /var/log/esxupdate.log
esxcli network firewall ruleset set -e false -r httpClient
reboot
6.7.0 (Build 8169922) -> :)
Copied from: https://tinkertry.com/easy-update-to-esxi-67
Wednesday, July 25, 2018
Using OSX High Sierra on a VMWARE ESXi
hdiutil create -o /tmp/HighSierra.cdr -size 5200m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
mv /tmp/HighSierra.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ High\ Sierra
hdiutil convert ~/Desktop/InstallSystem.dmg -format UDTO -o ~/Desktop/HighSierra.iso
Monday, November 13, 2017
Kali Linux - Creating your own distro
As remaster-sys might not work, ( i think ), went on to figure if it's really possible.
As he sucks in googling, here are the steps for my own reference.
Install Kali to a VM.
apt update && apt install curl git live-build
git clone git://git.kali.org/live-build-config.git
cd live-build-config
Inside the kali-config folder, there are various "environments" available.
I choose the LIGHT version as though it's a variant of the XFCE env, it's really light.
With this in mind, lets add some "special" packages that my colic wants.
Edit the config in kali-config/variant-light/package-lists/kali.list.chroot
Add your packages etc.
As he wanted to add custom "code and scripts" as well, add them to kali-config/common/includes.chroot/ folder. EG: root/Desktop/aaa.txt will make the aaa.txt appear on the root desktop.
To enable SSH on startup,
echo ‘update-rc.d -f ssh enable’ >> kali-config/common/hooks/01-start-ssh.chroot
chmod 755 kali-config/common/hooks/01-start-ssh.chroot
Once done, build the image.
./build.sh --variant light --verbose
Drink coffee and the build ISO will be at: images/xxx.iso
REF: https://www.cybrary.it/0p3n/create-kali-linux-iso/
REF: https://kali.training/chapter-9/building-custom-kali-live-iso-images/
Tuesday, October 31, 2017
VM Fusion Persistant Disk
Open up the VMX File in your editor.
Search for your workdisk
scsi0:1.fileName = "YOUROWKDISK-000001.vmdk"
Add in the following lines
scsi0:1.mode = "independent-persistent"
snapshot.disabled = "TRUE"
snapshot.action = "keep"
To take snapshot. Shut down the VM.
Then take the snapshot
Wednesday, October 04, 2017
Blank screen after some dist-upgrade
Took wayyyyy too long and i just killed it.
However, next reboot, everything was black. =_+''
After booting, press Ctrl+Alt+F1~F12.
This should get you a terminal.
Login as root
dpkg --configure -a
WAIT PATIENTLY ( which i failed )
Once done, reboot, volia.
Friday, June 09, 2017
Auto Backup MYSQL DB table structure
I would usually check in my code but not my DB design.
Below is a sh file that backup the MySQL table structure.
Not the best script. But it does the job.
#!/bin/bash
Host=localhost
BDir=/root/SQLStructureBackup/
Dump="/usr/bin/mysqldump -d -h $Host -u BACKUPUSER -pSOMEPASSWORDHERE "
MySQL=/usr/bin/mysql
Today=$(date +%Y-%b-%d)
# Get a list of all databases
Databases=$(echo "SHOW DATABASES" | $MySQL -u BACKUPUSER -pSOMEPASSWORDHERE)
for db in $Databases; do
date=`date`
file="$BDir/$Today-$db.sql.gz"
echo "Backing up '$db' from '$Host' on '$date' to: "
echo " $file"
$Dump $db | gzip > $file
done
Tuesday, June 07, 2016
Getting SAMBA to work
apt-get install samba smbfs
Edit the samba config file at /etc/samba/smb.conf
# Global parameters
[global]
workgroup = HOME
netbios name = SAMBA
server string = Samba Server %v
map to guest = Bad User
log file = /var/log/samba/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
preferred master = No
local master = No
dns proxy = No
security = User
hosts allow = 127. XXX.XXX
interfaces = 127.0.0.1/8 XXX.XXX.XXX.XXX/16
bind interfaces only = yes
guest account = nobody
null passwords = no
username level = 6
#password level = 6
encrypt passwords = true
unix password sync = yes
domain master = no
preserve case = yes
short preserve case = yes
# Share
[files]
path = /files/
valid users = SOMEUSERHERE
read only = No
create mask = 0777
directory mask = 0777
useradd -c "NAME HERE" SOMEUSERHERE
smbpasswd -a SOMEUSERHERE
*Note that usually samba will not start if your config is wrong..
Friday, April 15, 2016
Single boot kali into MAC
Decided to install it with kali.
Pop in kali usb and press OPTION to boot menu.
Should see a WINDOWS and EFI BOOT partition.
Choose windows and install normally.
After installation, boot back to LIVE MODE.
zsh: correct 'gdisk' to 'fdisk' [nyae]? n
GPT fdisk (gdisk) version 0.8.5
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): B6A4398E-3590-4BB7-AA57-D64EF74860D0
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 4077 sectors (2.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 4095 1024.0 KiB EF02
2 4096 943585279 449.9 GiB 0700
3 943585280 976771071 15.8 GiB 8200
Command (? for help): r
Recovery/transformation command (? for help): h
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 2
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default 07): 83
Set the bootable flag? (Y/N): y
Unused partition space(s) found. Use one to protect more partitions? (Y/N): n
Recovery/transformation command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
root@kali:~#
Syncing Apple Wireless Mouse and keyboard to kali
Holding on the keyboard power button throughout the syncing not sure if it works.
Bluetooth setup was a hassle.
So...
apt-get install blueman
Then run blueman-manager
:P
Thursday, April 07, 2016
Setting up mod-security for apache.
Lets go...
apt-get install libapache2-modsecurity
Verify that all is well. If there is a shared, all is well.
apachectl -M | grep --color security
Rename the config file..
mv /etc/modsecurity/modsecurity.conf{-recommended,}
Restart apache
/etc/init.d/apache2 restart
Logs should be in /var/log/apache2/modsec_audit.log
Let's enable modsecurity
nano /etc/modsecurity/modsecurity.conf
SecRuleEngine DetectionOnly becomes SecRuleEngine On
SecResponseBodyAccess On becomes SecResponseBodyAccess Off
Restart apache
Test SQL injection
Create a php
Change password to suit your database.
Login to MYSQL.
mysql -u root -p
create database sample;
connect sample;
create table users(username VARCHAR(100),password VARCHAR(100));
insert into users values('jesin','pwd');
insert into users values('alice','secret');
quit;
Test your page to see if can login.
Then under username, use this: ' or true --
Note the space behind --
You should be able to login. FUCK!!!!
Lets get the ruleset.
wget "https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/v2.2.5"
tar -zxf
Lets move the ruleset
rm -rf /usr/share/modsecurity-crs/*
mkdir /usr/share/modsecurity-crs
mv SpiderLabs-owasp-modsecurity-crs-5c28b52/* /usr/share/modsecurity-crs/
cd /usr/share/modsecurity-crs/
mv modsecurity_crs_10_setup.conf.example modsecurity_crs_10_setup.conf
cd /usr/share/modsecurity-crs/activated_rules/
ln -s ../modsecurity_crs_10_setup.conf .
for f in `ls /usr/share/modsecurity-crs/base_rules/` ; do sudo ln -s /usr/share/modsecurity-crs/base_rules/$f /usr/share/modsecurity-crs/activated_rules/$f ; done
for f in `ls /usr/share/modsecurity-crs/optional_rules/` ; do sudo ln -s /usr/share/modsecurity-crs/optional_rules/$f /usr/share/modsecurity-crs/activated_rules/$f ; done
nano /etc/apache2/mods-available/mod-security.conf
Add in the following 2 lines
Include "/usr/share/modsecurity-crs/*.conf"
Include "/usr/share/modsecurity-crs/activated_rules/*.conf"
Make sure that mod-security.conf is something like that...
# Default Debian dir for modsecurity's persistent data
SecDataDir /var/cache/modsecurity
# Include all the *.conf files in /etc/modsecurity.
# Keeping your local configuration in that directory
# will allow for an easy upgrade of THIS file and
# make your life easier
Include "/etc/modsecurity/*.conf"
Include "/usr/share/modsecurity-crs/*.conf"
Include "/usr/share/modsecurity-crs/activated_rules/*.conf"
You might need to a2enmod headers or apt-get install libapache2-mod-proxy-html
Remove relevant rules if needed.
Also check that the mod-security.conf does not load duplicate conf
Test your injection, it should fail.
The site: https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project requires modsecurity >= 2.7.
PFSense with snort
Decided to install snort.
Go to System > Packages > Available Packages > find Snort
Install it.
Get oinkcode from snort website.
Go back to services > snort
Go to global settings
Tick Install Snort VRT Rules
Paste oinkcode
Check Install Snort Community
Check ETOpen
Set auto update to 1 day.
Save.
Go to updates tab.
Update the rules.
Go back to Snort Interfaces tab.
Add a new interface
Set interface to WAN.
Save
Edit the WAN interface.
Check the snort Snort GPLv2 Community Rules (VRT CERTIFED) to enable the snort rules.
and remember to save!
Reference: https://techknight.eu/2015/03/14/pfsense-snort-idsips-basic-setup-and-configuration/
Wednesday, April 06, 2016
Connect WPA2 on linux
And i need to connect it via wifi.
apt-get install
Know your interface first...
nano /etc/network/interfaces
| auto wlan0 |
| iface lo inet loopback |
| iface eth0 inet dhcp |
| allow-hotplug wlan0 |
| iface wlan0 inet static ( Else use iface wlan0 inet dhcp ) |
| address 192.168.1.155 |
| netmask 255.255.255.0 |
| gateway 192.168.1.1 |
| wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf |
| iface default inet dhcp |
| ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev |
| update_config=1 |
| network={ |
| ssid="NYO_WWWP" |
| psk="topsecret" |
| proto=RSN |
| key_mgmt=WPA-PSK |
| pairwise=CCMP |
| auth_alg=OPEN |
| } |
Monday, April 04, 2016
Install .Net Framework 3.5 on windows 10
Monday, March 28, 2016
VMWare Workstation 12 - Kali Rolling - No internet too...
Which unfortunately, LAN and WIFI is spoilt...
Being a poor guy as usual, did not have money to buy a USB wireless adapter....
So....
Lets do it the HARD CORE USB THUMBDRIVE WAY!
Install VMWare.
Get the installer from the website. It's a bundle file.
chmod +x {bundle name}
./{bundle name}
VMWare installation will start.
Next all the way, for CDKEY, google youtube. There's a key out there that works...
After installation, while trying to run vmware
Should get an error saying that some headers are not found.
FUGGGGGG!
No internet, how to update?????
On another internet PC somewhere far far away...
On kali-rolling, the headers are unfortunately linux-headers-4.0.0 ( uname -r )
In the kali-rolling repo, the headers are 4.4.0 ( apt-cache search linux-headers )
HOW HOW HOW!
Let's revert the apt/sources.list and change it to SANA repo.
nano /etc/apt/sources.list
deb http://http.kali.org/kali sana main non-free contrib deb http://security.kali.org/kali-security sana/updates main contrib non-free deb-src http://http.kali.org/kali sana main non-free contrib deb-src http://security.kali.org/kali-security sana/updates main contrib non-free
apt-get flush && apt-get autoremove
apt-get update
apt-cache search linux-headers
You should see that there is a linux-headers-4.0.0
Lets download this and move it to the lousy office laptop.
This command will list the packages (deb) files needed and output to a urls.txt
apt-get -qq --print-uris install build-essential linux-headers-$(uname -r) | cut -d\' -f2 > urls.txt
Lets download the deb files...
mkdir temp
mv urls.txt temp/
cd temp
wget -i urls.txt
Once done, move everything over to the no internet laptop.
dpkg -i *.deb