Position: Home page » Equipment » Redis mining without verification

Redis mining without verification

Publish: 2021-04-16 22:20:09
1. First of all, it is necessary to identify whether this is a money digging application, then understand its operation mode, and finally determine whether it can play.
2. <? PHP
/ / step 1: instantiate the redis object
$redis = new redis()
/ / step 2: set the IP and port of PHP client
$redis - & gt; connect(" 127.0.0.1",& quot; 6379");
/ / Part 3: configure the connection password to detect the connection status of the redis server

/ / if the connection fails, it ends directly and outputs
$auth = $redis - & gt; auth(' zhenai') or die(" Redis server connection failed & quot;)< br />// var_ mp($auth); If the connection is successful, return true, otherwise return false

/ / the fourth step is available, but do not use
echo $connect_ status=$redis-> ping();< br />if($connect_ status==="+ PONG")< br />{
echo " Redis server connected successfully & quot
}
/ / it's so simple
3. 1. String string data structure is a simple key value type. Value can be not only a string, but also a number (when the number type can be represented by long, encoding is an integer, and the rest is stored in sdshdr as a string). With strings, the current function of memcached can be fully realized, and the efficiency is higher. You can also enjoy the scheled persistence of redis (you can choose RDB mode or AOF mode), operation log, replication and other functions. In addition to providing the same get, set, incr, decr operations as memcached, redis also provides the following operations: 2. Hash dictionary in memcached, we often package some structured information into HashMap, and store it as a string value (generally in JSON format) after serialization on the client, such as the user's nickname, age, gender, integral, etc. At this time, when you need to modify one of the items, you usually need to take out the string (JSON), then deserialize it, modify the value of an item, and then serialize it into a string (JSON) to store it back. Simply modifying an attribute to do so many things will cost a lot, and it is not suitable for some situations where concurrent operations are possible (for example, two concurrent operations need to modify points). Redis's hash structure allows you to modify only one attribute value just like updating an attribute in a database. 3. List - list list is a list (redis uses the list of double ended list). I believe people who have learned the knowledge of data structure should be able to understand its structure. Using the list structure, we can easily achieve the latest news ranking and other functions (such as Sina Weibo's timeline). Another application of list is message queue. You can use the * push operation of list to store the task in the list, and then the worker thread can use pop operation to take out the task for execution. Redis also provides an API to operate a certain element in the list. You can directly query and delete a certain element in the list. 4. Set -- set is a set, and the concept of set is a combination of non plicate values. With the set data structure provided by redis, some collective data can be stored. For example, in microblog applications, all the followers of a user can be stored in a collection, and all the fans can be stored in a collection. Because redis is very user-friendly, it provides intersection, union, difference and other operations for the collection, so it is very convenient to realize functions such as common concern, common preference, second degree friends, etc. for all the above collection operations, you can also use different commands to choose whether to return the results to the client or save them in a new collection. 1. Common friends and second degree friends 2. Using uniqueness, you can count all independent IP3. When friends recommend, you can find the intersection according to the tag, and if it is greater than a certain threshold, you can recommend 5. Sortedset: compared with sets, sortedsets adds a weight parameter score to the elements in the set, so that the elements in the set can be ordered according to score, For example, in a sortedsets that stores the scores of the whole class, the set value can be the student number of the students, and the score can be the score of the test. In this way, when the data is inserted into the set, the natural sorting has been carried out. In addition, sortedsets can be used to make weighted queues. For example, the score of ordinary messages is 1, and the score of important messages is 2. Then the worker thread can choose to obtain the work tasks in the reverse order of score. Give priority to important tasks.
4. Download redis
after downloading, the location
CD to D: &; Java\ The directory location in the 64 bit graph is

so the startup is successful

to set the redis password, you need to find the requirepass keyword in redis.conf, set the password to 123456

redis-cli.exe to enter the client
and then auth 123456 notes: auth password
set object name [a] value [123]
get object name [a]

after that, you can use the local redis
note: redis does not need to set the password, so it does not need to execute the command of auth.
5. redis配置密码
1.通过配置文件进行配置
yum方式安装的redis配置文件通常在/etc/redis.conf中,打开配置文件找到
<pre name="code" class="plain">#requirepass foobared</pre>
去掉行前的注释,并修改密码为所需的密码,保存文件
<pre name="code" class="plain">requirepass myRedis</pre>
重启redi
<pre name="code" class="plain">sudo service redis restart #或者 sudo service redis stop sudo redis-server /etc/redis.conf</pre>
这个时候尝试登录redis,发现可以登上,但是执行具体命令是提示操作不允许
<pre name="code" class="plain">redis-cli -h 127.0.0.1 -p 6379 redis 127.0.0.1:6379> redis 127.0.0.1:6379> keys * (error) ERR operation not permitted redis 127.0.0.1:6379> select 1 (error) ERR operation not permitted redis 127.0.0.1:6379[1]> </pre>
尝试用密码登录并执行具体的命令看到可以成功执行
<pre name="code" class="plain">redis-cli -h 127.0.0.1 -p 6379 -a myRedis redis 127.0.0.1:6379> keys * 1) "myset" 2) "mysortset" redis 127.0.0.1:6379> select 1 OK redis 127.0.0.1:6379[1]> config get requirepass 1) "requirepass" 2) "myRedis"</pre>
2.通过命令行进行配置
<pre name="code" class="plain">redis 127.0.0.1:6379[1]> config set requirepass my_redis OK redis 127.0.0.1:6379[1]> config get requirepass 1) "requirepass" 2) "my_redis"</pre>
无需重启redi
使用第一步中配置文件中配置的老密码登录redis,会发现原来的密码已不可用,操作被拒绝
<pre name="code" class="plain">redis-cli -h 127.0.0.1 -p 6379 -a myRedis redis 127.0.0.1:6379> config get requirepass (error) ERR operation not permitted</pre>
使用修改后的密码登录redis,可以执行相应操作
<pre name="code" class="plain">redis-cli -h 127.0.0.1 -p 6379 -a my_redis redis 127.0.0.1:6379> config get requirepass 1) "requirepass" 2) "my_redis </pre>
尝试重启一下redis,用新配置的密码登录redis执行操作,发现新的密码失效,redis重新使用了配置文件中的密码
<pre name="code" class="plain">sudo service redis restart Stopping redis-server: [ OK ] Starting redis-server: [ OK ] redis-cli -h 127.0.0.1 -p 6379 -a my_redis redis 127.0.0.1:6379> config get requirepass (error) ERR operation not permitted redis-cli -h 127.0.0.1 -p 6379 -a myRedis redis 127.0.0.1:6379> config get requirepass 1) "requirepass" 2) "myRedis"</pre>
除了在登录时通过 -a 参数制定密码外,还可以登录时不指定密码,而在执行操作前进行认证
<pre name="code" class="plain">redis-cli -h 127.0.0.1 -p 6379 redis 127.0.0.1:6379> config get requirepass (error) ERR operation not permitted redis 127.0.0.1:6379> auth myRedis OK redis 127.0.0.1:6379> config get requirepass 1) "requirepass" 2) "myRedis" </pre>
3.master配置了密码,slave如何配置
若master配置了密码则slave也要配置相应的密码参数否则无法进行正常复制的
lave中配置文件内找到如下行,移除注释,修改密码即可
<pre name="code" class="plain">#masterauth mstpassword</pre>
6. In short, redis is a powerful key value database. There are two reasons why redis is powerful: it has fast response speed (so the data is stored in memory and only written to disk when necessary), and rich features (it supports multiple data types and complex operations on each type). In fact, an important feature of redis is that it is not a normal database
7. Memcached stores and accesses data in the form of key value, maintains a huge hashtable in memory, reces the time complexity of data query to o (1), and ensures high-performance access to data.
8.

1. The safer way is to control by binding IP

please find the following configuration in redis.conf file

? If you want you can bind a single interface, if the bind option is not
? Specified all the interfaces will listen for incoming connections.

? Bind 127.0.0.1

remove the comment before bind 127.0.0.1, Then change 127.0.0.1 to the IP address where you are allowed to access your redis server, which means that only this IP is allowed to access

in this case, we can no longer use redis server when starting redis server: redis server path / redis.conf, which specifies the configuration file to be loaded when starting, where path / is the directory where the redis configuration file you modified above is located, This method is not very good. I can't help but have multiple machines accessing a redis service

2. Set the password to provide remote login

open the redis.conf configuration file, find the requirepass, and then modify it as follows:

requirepass yourpassword
yourpassword is the password of redis verification. After setting the password, it is found that you can login, but you cannot execute the command

the command is as follows:

redis cli - H yourip - P yourport / / start the redis client and connect to the server
keys * / / output all the keys in the server

report an error as follows
(error) err operation not permitted


at this time, you can use the authorization command to authorize, and no error will be reported

the command is as follows:

auth youpassword

in addition, When connecting to the server, you can specify the login password to avoid entering the above authorization command separately.

the command is as follows:

redis cli - H yourip-p yourport - a youpassword

in addition to configuring the verification password in the configuration file redis.conf, you can also set the password through the command line on the started redis server, but this method is temporary, When the server restarts, the password must be reset. The way to set the password on the command line is as follows:

config set requirepass your password

sometimes we don't know whether the current redis server has set the verification password, or we forget what the password is. We can enter the command through the command line to view the password, The command is as follows:

config get requirepass

if the redis server does not have a password configured, it will get nil. If the password is configured, but when the redis client connects to the redis server, it does not log in with a password for verification, and it will prompt: operation not permitted. At this time, you can use the command: auth yourpassword to verify the password, If you execute config set requirepass again, you will see yourpassword

because redis has a strong concurrency ability and only uses passwords, the attacker may send a large number of password guessing requests in a short time, which is easy to crack violently. Therefore, it is suggested that the longer the password, the better, for example, 20 bits The password is clear in the conf file, so don't worry about forgetting it.)

9. Mining and medicine will not give verification code, only planting will give verification code. But you don't want to fight the monster. If you kill the monster, you will get a verification code.
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750