Experiment of manually tampering with fisco bcos ledger transaction data in the development environment

1. Environmental preparation

purpose

Modify the data that has been on the chain, such as changing 65 in the input attribute below to 56:

raw data:

blockHash: 0xd6e8b6ca32f070169aa044d04455dc9ecbb73362e0a7f3aeaba3347131c88258

blockNumber: 0x6

gas: 0x11e1a300

from: 0x8554566216d3a85e4ed46084fc744cd177524bfe

transactionIndex: 0x0

to: 0x57a6e72c5cb194e1027427a4c9395d41683d7306

nonce: 0x903e745366997d55acf317484e92ea7268de4ea05b2389da6022649b8e3a5e

value: 0x0

hash: 0xff5c565141e0f78187f07fb43f95f262aac39955c7b47e1d8a1184990f21040c

gasPrice: 0x11e1a300

input: 

0x4ed3885e000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000066269616f6765000000000000000000000000000000000000000000000000000000000000

 

Modified data:

blockHash: 0xd6e8b6ca32f070169aa044d04455dc9ecbb73362e0a7f3aeaba3347131c88258

blockNumber: 0x6

gas: 0x11e1a300

from: 0x8554566216d3a85e4ed46084fc744cd177524bfe

transactionIndex: 0x0

to: 0x57a6e72c5cb194e1027427a4c9395d41683d7306

nonce: 0x903e745366997d55acf317484e92ea7268de4ea05b2389da6022649b8e3a5e

value: 0x0

hash: 0xff5c565141e0f78187f07fb43f95f262aac39955c7b47e1d8a1184990f21040c

gasPrice: 0x11e1a300

input: 

0x4ed3885e000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000066269616f6756000000000000000000000000000000000000000000000000000000000000

Chain environment

1. Download the chain building script

curl -#LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v2.6.0/build_chain.sh && chmod u+x build_chain.sh

2. Install the chain with mysql underlying storage

bash build_chain.sh -s mysql -l 127.0.0.1:2 -p 30300,20200,8545

0

3. The pagoda installs mysql and creates 2 databases (node1 node2) because there are 2 nodes

0

4. Modify the database configuration information (node0 and node1 must be changed), note that the mysql user needs root privileges to start the chain

node0:

0

node1:

0

5. Start the underlying chain

0

6. View database tables

0

Console environment

1. Execute download_console.sh in the node directory

0

2. Rename applicationContext-sample.xml to applicationContext.xml in the /root/test/nodes/127.0.0.1/console/conf directory

0

3. Copy all files under /root/test/nodes/127.0.0.1/sdk to /root/test/nodes/127.0.0.1/console/conf

0

4. Start the console and deploy the calling contract

0

It is found that the blog type stored in mysql is as shown in the following figure:

node1:

0

node2:

0

It is found that the table data of node1 and node2 are completely consistent after consensus

Install a blockchain browser to view related block data more intuitively

1. Clone the relevant code

git clone https://github.com/FISCO-BCOS/fisco-bcos-browser.git

0

2. Modify the configuration in common.properties

0

3. Installation

[root@localhost deploy]# python deploy.py installAll

===================== envrionment check... =====================

check git...

check finished Sucessfully.

check wget...

check finished Sucessfully.

check openssl...

check finished Sucessfully.

check curl...

check finished Sucessfully.

check nginx...

check finished sucessfully.

check java...

check finished sucessfully.

check server port..

check finished Sucessfully.

check web port...

check finished Sucessfully.

check db connection...

check finished Sucessfully.

===================== envrionment ready... =====================

===================== deploy start... =====================

The fisco-bcos-browser.zip compiled package already exists. Do you want to download it again? [y/n]:n

The fisco-bcos-browser.zip compilation package has been decompressed. Do you want to decompress it again? [y/n]:n

The database db_browser already exists, delete it and rebuild it? [y/n]:n

======= server start success! =======

======= web start success! =======

===================== deploy end... =====================

============== Visit through the following link and change the IP to the server IP ===============

http://IP:5100/

[root@localhost deploy]#

4. Visit http://192.168.119.132:5100/ to create a new group

0

5. New node

0

2. Start the experiment

1. Try to find a way to tamper with relevant data.

Change the last digit 9 of the last piece of hash data to 8 and try what will happen

0

After modification:

0

2. Let's call the contract to check and see, there seems to be no problem

0

6. Follow the steps above to change the last digit 9 of the last piece of hash data to 8 to try what will happen, check the transaction information and compare with the data in mysql. Found that the last digit of the hash in the blockchain browser is 8

0

Also found that the last digit is 9 can also visit

0

7. Guess the data should be stored in the value field (input attribute in transactions), but the type is blob, and how to modify it has not been studied in depth, so set the value to null and see the situation

node1:

0

node2:

0

Look at the browser again (seems to be useless, it is rare that we made a mistake in the table or field?):

0

It is suspected that the blockchain browser has a cache restart and a wave of services is looking at:

0

still the same:

 

0

Welcome to leave a message to discuss

 

Guess you like

Origin blog.csdn.net/ws327443752/article/details/108981457