$ sudo apt update
$ sudo apt install openvas
$ sudo gvm-setup
$ sudo gvm-start
Open web UI: http://localhost:9392
Add "Target" (hosts)
Check "Scan Configs"
Create new "Task"
Check results and report
$ sudo apt update
$ sudo apt install openvas
$ sudo gvm-setup
$ sudo gvm-start
Open web UI: http://localhost:9392
Add "Target" (hosts)
Check "Scan Configs"
Create new "Task"
Check results and report
How to manage services via cmd?
> sc \\comp-name config AVP start=demand
> sc \\comp-name config AVP start=disabled
> sc \\comp-name config AVP start=auto
How to escalade priv up to system?
1. Download and extract pack from Mark Russinovich
2. Run cmd from administrator
3. > psexec.exe -i -s cmd.exe
4. > whoami
5. > procexp64.exe
6. Find service with system priv
7. Open properties and permissions
8. Add user permissions for the current service
9. Go to the services and edit settings for service
Where is the hosts file?
C:\Windows\System32\drivers\etc\hosts
How to increase the hard disk size?
- shutdown VM
- add VirtualBox path to the PATH env. variable via computer properties
C:\Program Files\Oracle\VirtualBox
- open the cmd and go to the hard disk location
- modify disk
> VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
How to add shared folder?
- add folder via gui
- add current user to vbox group
$ sudo adduser $USER vboxsf
- logout
Victoria ( hdd[dot]by/victoria )
MiniTool Partition Wizard ( partitionwizard[dot]com )
...
...
How to create a systemd service?
Application:
$ cat myapp.sh
#!/usr/bin/bash
echo "I'm a test app" > /tmp/test.file
Service:
$ cat /etc/systemd/system/myapp.service
...$ sudo systemctl start myapp
Start on boot:
$ sudo systemctl enable myapp
How to disable beep speaker?
# temporary
$ sudo rmmod pcspkr
# permanently
$ sudo gedit /etc/modprobe.d/blacklist
blacklist pcspkr
$ reboot
SSH by key
$ ssh-keygen -t ed25519 -C "new"
$ cat ~/.ssh/config
Host x.x.x.x
HostName x.x.x.x$ ssh x.x.x.x
Target OS is Cent OS 7.
Step 1. Install Java
Download RPM Linux x64 RPM Package from oracle.com - jdk-11.0.11_linux-x64_bin.rpm1. Download archive with JDK from oracle website.
2. Copy it to special folder
$ sudo mkdir /usr/java
$ sudo cp ~/Downloads/jdk-8u281-linux-x64.tar.gz /usr/java
$ rm ~/Downloads/jdk-8u281-linux-x64.tar.gz
3. Unpack the archive
$ cd /usr/java
$ sudo tar xvfz jdk-8u281-linux-x64.tar.gz
$ sudo rm jdk-8u281-linux-x64.tar.gz
4. Add environment variable
$ vim ~/.profile
export JAVA_HOME=/usr/java/jdk1.8.0_281
export PATH=${PATH}:${JAVA_HOME}/bin
5. Apply changes
$ source ~/.profile
6. Check JAVA version
$ java -version
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)
####################
F3 - View file
F4 - Edit file
F5 - Copy file / folder
F6 - Move file / folder
F7 - Create new folder
F8 - Delete file / folder (via recycle bin)
####################
Shift + F4 - Create file
Shift + F6 - Rename file / folder
Shift + Delete - Delete file / folder (without recycle bin)
####################
Alt + F1 - Change drive ( left side)
Alt + F2 - Change drive ( right side)
Alt + F11 - Display view and edit history
Alt + F12 - Display folder history
####################
Ctrl + O - Hide/show both panels ( show cmd )
Ctrl + \ - Go to the root folder
Ctrl + Enter - Insert file name to cmd
Open Regedit:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Lenovo\System Update\Preferences\UserSettings\Scheduler
Set "Frequency" to "No"
Export cert from keystore
$ openssl pkcs12 -in keystore.p12 -out cert.pem -nodes
Show cert details
$ openssl x509 -in cert.pem -text -noout
Export public key from cert
$ openssl x509 -pubkey -noout -in cert.crt > pubkey.pem
Export private key from keystore in pem format
$ openssl pkcs12 -in keystore.p12 -nocerts -nodes -out key.pem
Convert key from pem to der format
$ openssl rsa -pubin -inform PEM -in pubkey.pem -outform DER -out pubkey.der
$ openssl rsa -pubin -inform PEM -in key.pem -outform DER -out key.der
Decrypt private key
$ openssl rsa -in key.pem -out private.key
Calculate Shake256 hash
$ cat public.key | openssl shake256
$ touch -a -m -t 202108180130.09 <file name>
show
$ netstat -rn
delete
$ sudo route delete default gw 192.168.88.1 eth1
send post request
$ curl -H "Content-Type: application/json" --data @body.json http://localhost:8080/ui/webapp/confExtract
$ tar -xvzf image.tar.gz
Create
$ tar -czvf image.tar.gz /path/to/dir
Show content
$ tar -ztvf image.tar.gz
Add padding to file
$ dd if=/dev/zero bs=1 count=8 >> public.pad.key
Replace A to B in file
$ cat input.file | sed 's/A/B/g' > output.file
Show contains
$ keytool -list -v -keystore keystore.jks
Convert keystore in JCEKS format to P12
$ keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -srcstoretype jceks -alias mycert
Import key/cert into jceks keystore from other
$ keytool -importkeystore -srckeystore source.jks -destkeystore keystore.jceks -srcstoretype jceks -alias mycert
Change password for key in keystore:
$ keytool -keypasswd -alias mycert -keystore keystore.jks
Delete alias from keystore:
$ keytool -delete -alias mycert -keystore keystore.jks
sudo apt-get install kodi
$ git config --global user.name "Ivan Ivanov"
$ git config --global user.email ivanov@example.com
$ git config --list
$ git config --global http.sslVerify false
# RSA (Rivest–Shamir–Adleman)
$ ssh-keygen -b 2048 -t rsa
# EdDSA (Edwards-curve Digital Signature Algorithm)
$ ssh-keygen -t ed25519 -C "rokshd@example.org"
Copy key pair to ~/.ssh/
Add path to key to config C:\Program Files\Git\etc\ssh\ssh_config
IdentityFile ~/.ssh/your-ssh-private-key
$ git init
$ git clone https://path/to/the/repository.git
$ git remote add origin git@github.com:path/to/the/repository.git
$ git push -u origin master
$ git -c http.sslVerify=false clone https://path/to/the/repository.git
Show current branch name$ git reset <file>
After committing changes to your branch, checkout master and pull it to get its latest changes from the repo
$ git checkout master
$ git pull origin master
Then checkout your branch and rebase your changes on master
$ git checkout RB
$ git rebase master...
or last two commands in one line:
$ git rebase master RB
$ python -m SimpleHTTPServer 8080
$ python -m http.server 8080
import http.server, ssl$ python3 ws.py
server_address = ('192.168.0.1', 8443)
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket,server_side=True,certfile='cert.pem',ssl_version=ssl.PROTOCOL_TLSv1_2)
httpd.serve_forever()
# скачиваем deb пакет с официального сайта https://www.happ.su/main/ru # установка deb пакета $ sudo dpkg -i /tmp/Happ.linux.x64.deb # устан...