Dec 23, 2020

Vim

Copy, Cut, Paste

Press v to select characters, or uppercase V to select whole lines
Move the cursor to the end of what you want to cut.
Press d to cut (or y to copy).
Move to where you would like to paste.
Press P to paste before the cursor, or p to paste after.

Oct 20, 2020

Burp Suite

How to configure correct russian language in response?

User options - Character Sets - Use a specific character set - CESU-8

How to configure a mitm proxy? 

В настройках браузера установить proxy на 127.0.0.1:8080. В настройках Burp включить proxy: Proxy -> Options -> галочка напротив 127.0.0.1:8080.

Если приложение работает по https, то еще необходимо импортировать сертификат в бразуер.

Сдедать export сертификата из Burp (Proxy -> Options -> Export CA)

Сделать import сертификата в браузер.

Выключить прерывание запросов в Burp: Proxy -> Intercept is off.

На этом этапе веб-приложение должно успешно работать в браузере.

Далее все запросы из браузера будут видны во вкладке Proxy -> HTTP History. Там можно смотреть и реквесты и респонсы.

Для того, чтобы выполнить модифкацию запроса нужно кликнуть по нему правой кнопкой и выбрать "Send to repeater". Перейти во вкладку Repeater и там можно изменять запрос и отправлять его много раз.

Sep 28, 2020

HowTo FAR

####################

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)

####################

Shif­t + F4 - Create file

Shif­t + 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

Sep 17, 2020

How to disable lenovo update notifications

 Open Regedit:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Lenovo\System Update\Preferences\UserSettings\Scheduler

Set "Frequency" to "No"

Sep 14, 2020

How to decrypt oracle password



SQL Developer:

%APPDATA%\SQL Developer\system*\o.jdeveloper.db.connection*\connections.xml

<StringRefAddr addrType="password">
<Contents>F35q3vdbVrI=</Contents>
</StringRefAddr>

%APPDATA%\SQL Developer\system*\o.sqldeveloper*\product-preferences.xml

<value n="db.system.id" v="3e8efb59-8a5a-4c13-b1d5-ff64f987787f"/>

$ java Decrypt_V4 F35q3vdbVrI= 3e8efb59-8a5a-4c13-b1d5-ff64f987787f

https://github.com/ReneNyffenegger/Oracle-SQL-developer-password-decryptor

$ python sqldeveloperpassworddecryptor.py -d 3e8efb59-8a5a-4c13-b1d5-ff64f987787f -p F35q3vdbVrI=

https://github.com/maaaaz/sqldeveloperpassworddecryptor

++++++++++++++++++

In Oracle 10g and all previous versions, the password is not encrypted at all. It is simply a DES hash that is salted with the username, both of which can be found quite easily in the DBA_USERS view.


In Oracle 11g, if backwards compatibility is not necessary, SHA-1 is used exclusively, uses an unlisted salt, and is a much harder nut to crack.


Question: I need to understand the importance of the spare4 column of the user$ table. This is not documented in Oracle but I understand that spare4 can be used to compromise Oracle passwords. Can you shed some light on the spare4 column?

Answer: Starting in Oracle 11g, the Oracle the hash password is no longer stored in DBA_USERS. Instead, the hash password is stored inside the SYS.USER$ table in the column "password" and "spare4″.

If your password_versions is 11g only then you will need to look in the sys.user$ spare4 column and you will see a much larger hex number. This is because Oracle has switched to the SHA-1 algorithm.

This means that there are different ways password can be set depending on whether "password" and "spare4″ are set in SYS.USER$.

This new SHA-1 algorithm is more secure than the old, and unlike the 10g and lower hashing does not appear to use the username to generate the hash instead a new salt value is added which is stored in the last 20 characters of the SPARE4 hash. It is possible the salt is somehow derived from the username but Oracle has not documented this feature for obvious reasons.


++++++++++++++++

Oracle Password Algorithm (7-10g Rel.2)

Up to 30 characters long. All characters will be converted to uppercase before the hashing starts
8-byte hash, encrypted with a DES encryption algorithm without real salt (just the username).
The algorithm can be found in the book "Special Ops Host And Network Security For Microsoft, Unix, And Oracle" on page 727.

Oracle database 11g offers the (optional) possibility to use passwords up to 30 characters (uppercase/lowercase). In Oracle 11g the passwords are now hashed with DES (column: password) AND using SHA-1 (column: spare4). The SHA-1 passwords are now supporting mixed-case passwords. In 11g the password hashes are no longer available in dba_users.

Oracle (7-10g R2) encrypts the concatenation of (username||password)
and sys/temp1 and system/p1 have the identical hashkey (2E1168309B5B9B7A)
Oracle (11g R1) uses SHA-1 to hash the concatenation of (password||salt)


Location of Oracle password hashes


Database - SYS.USER$ - Password
Oracle Password File
Data File of the system tablespace
(full) Export-Files
archive logs


Show Oracle password hashkey (old DES hash)

You should always select database users from the table not from the views (ALL_USERS, DBA_USERS). An explanation (modification of database views via rootkits) can be found here.


DBA_USERS : SELECT username, password FROM DBA_USERS;
SYS.USER$ : SELECT name,password FROM SYS.USER$ WHERE password is not null;


Show Oracle password hashkey (11g, new SHA-1 hash)

In 11g the password hash is no longer accessible via dba_users


SYS.USER$ : SELECT name,spare4 FROM SYS.USER$ WHERE password is not null;


How to change an Oracle password temporarily?

In Oracle it is possible to change a password temporarily. This can be useful for DBA which act as a different user.

SQL> select username,password from dba_users where username='SCOTT';

USERNAME PASSWORD
-------- ----------------
SCOTT F894844C34402B67

SQL> alter user scott identified by mypassword;


Now login with the following credentials: scott/tiger
After doing your work you can change the password back by using an undocumented feature called "by values"

SQL> alter user scott identified by values 'F894844C34402B67';






Q: How are Oracle passwords encrypted?


A: Oracle passwords are encrypted using the Data Encryption Standard (DES) algorithm to create eight-byte hashes stored in the table SYS.USER$.To create the hash, the username and the password are appended together and broken up into eight-byte pieces.The first eight bytes of the username/password are used as a key to DES encrypt the magic number 0x0123456789ABCDEF.The resulting eight bytes are then encrypted with the next eight bytes of the username/password, resulting in a new eight-byte value.This process is repeated until the entire username/password has been used. One interesting characteristic to note is the “salt” used to create the hash. The salt is actually the username.This adds some additional security in that different users with the same passwords will have different hashes. However, it falls short of a true salt in that the same password will always hash to the same value when used by the same user.

May 21, 2020

HowTo Unix Tools

find and grep

Linux:

$ find / -name jre 2>&1 | grep -v "Permission denied"

$ find / -name jre 2>/dev/null

Solaris:

$ find ./ -type f -exec grep "foo" {} +
$ find ./ -name "name of file" -type f -exec grep "sign of parameter" {} + | grep -v "ignore me"

openssl

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

nc

listen tcp port:

$ nc -lv <port>

telnet

connect to tcp port:

$ telnet <ip> <port>

finish connect:

Ctrl + ] - go to cmd
telnet> close - close the connection

touch

$ touch -a -m -t 202108180130.09 <file name>

networking

show
$ netstat -rn

show default gw
$ ip route

delete
$ sudo route delete default gw 192.168.88.1 eth1

curl

send post request

$ curl -H "Content-Type: application/json" --data @body.json http://localhost:8080/ui/webapp/conf

send GET request

$ curl http://localhost:8080/ui/webapp/conf

tar

Extract

$ tar -xvzf image.tar.gz

Create

$ tar -czvf image.tar.gz /path/to/dir

Show content

$ tar -ztvf image.tar.gz

dd

Add padding to file

$ dd if=/dev/zero bs=1 count=8 >> public.pad.key

sed

Replace A to B in file

$ cat input.file | sed 's/A/B/g' > output.file

keytool

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


Kubernetes

kubectl installation $ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl...