Hello Navi

note and sharing

使用 Docker 运行 MySQL

1. 快速启动 MySQL 容器

1
sudo docker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:latest
  • 使用 -p 3306:3306 将主机的 3306 端口映射到容器的 3306 端口。
  • 使用 --name mysql 为容器命名为 mysql
  • 使用 -e MYSQL_ROOT_PASSWORD=123456 设置 MySQL 的 root 用户密码为 123456
  • 使用 -d mysql:latest 后台运行最新版本的 MySQL。

2. 使用挂载卷启动

持久化数据和配置

1
2
3
4
5
6
7
sudo docker run --name mysql \
-p 3306:3306 \
-v /usr/local/docker/mysql/conf:/etc/mysql \
-v /usr/local/docker/mysql/logs:/var/log/mysql \
-v /usr/local/docker/mysql/data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=123456 \
-d mysql:latest

3. 进入 MySQL 容器

1
2
sudo docker exec -it mysql bash
mysql -uroot -p123456
  • sudo docker exec -it mysql bash 命令进入名为 mysql 的容器的 bash 环境。
  • mysql -uroot -p123456 命令使用 root 用户登录 MySQL,密码为 123456

4. 从本地复制文件到容器

如果需要将本地文件复制到容器中,可以使用以下命令:

1
2
docker cp 本地文件路径 ID全称:容器路径
docker cp /path/to/file.sql mysql:/root

5. 在 MySQL 中创建数据库和导入数据

1
2
3
4
mysql> create database name;
mysql> use name;
mysql> set names utf8;
mysql> source /name.sql;

不同色调的红色

  • 红色 (Red)
  • 粉红 (Pink)
  • 红褐色 (Sorrel)
  • 绯红 (Scarlet)
  • 紫红 (Purplish Red)
  • 酒红 (Wine Red)
  • 土红 (Reddle)
  • 深紫红 (Prune)
  • 淡红 (Pale Red)
  • 朱红色 (Vermilion)
  • 玫瑰红 (Rosy)
  • 橘红 (Jacinth)
  • 血红 (Blood-red)
  • 草莓红 (Strawberry Red)
  • 脸红的 (Blushing)
  • 腥红 (Crimson)
  • 珊瑚红 (Coral)

more

Encycolorpedia一个提供颜色代码和颜色匹配称呼的网站

  • 颜色代码查询:通过输入颜色代码(如 HEX、RGB)来获取详细的颜色信息。
  • 命名颜色:列出了具有特定名称的颜色及其代码。

Match The Colors - Retryables匹配给定的颜色的在线游戏

  • 游戏玩法:使用三个滑块来调整 RGB 颜色值,尽量匹配提供的目标颜色。

pwn

useful

  • pwn
    • https://ch4r1l3.github.io/page/4/

IDA

function name

sub_4003E0

strings

  • SHIFT F12

pseudocode

OSINT

  • https://www.google.com/advanced_search
  • https://yandex.com/
  • https://tineye.com/

fakenamegenerator

  • https://www.fakenamegenerator.com/

exiftool

  • https://onlineexifviewer.com/

satellite image

https://www.google.com/maps/@37.4219999,-122.0840575,3a,75y,35.56h,90t/data=!3m6!1e1!3m4!1sAFQjCNGR9Z5wZj4Y6h8q8zQ5hZ1Zl7q6Q!2e0!7i13312!8i6656

geoguessr tips

  • https://somerandomstuff1.wordpress.com/2019/02/08/geoguessr-the-top-tips-tricks-and-techniques/

email

  • https://phonebook.cz
  • https://www.voilanorbert.com/
  • clearbit connect
  • email checker
    • https://email-checker.net/check

domain

  • https://www.whois.com/whois/

data breach

  • https://dehashed.com/
  • https://weleakinfo.io/
  • https://namechk.com
  • https://whatsmyname.app/?trk=article-ssr-frontend-pulse_little-text-block
  • https://www.whitepages.com/
  • https://www.truepeoplesearch.com/
  • https://webmii.com/
  • https://thatsthem.com/
  • https://www.spokeo.com/
  • https://voterrecords.com/

hash decrypt

  • https://hashes.com/en/decrypt/hash

phone

  • https://www.truecaller.com/
  • https://calleridtest.com/

twitter search advanced

  • https://twitter.com/search-advanced
  • https://www.tweetbinder.com/blog/twitter-geocode/
  • https://thoughtfaucet.com/search-twitter-by-location/examples/
    • From the url
    • Entering the search string below let’s you use twitter location search to see their tweets:
    • geocode:38.890550,-77.009017,.02km
    • The above string will give you Tweets in a 0.02km radius around the Capitol. You can expand or shrink the geofence however you like however you like. But if you want to search Twitter for a specific date range, for example, 1/6/2021, you’ll need to add that as well:
    • geocode:38.890550,-77.009017,.02km
    • since:2021-01-05 until:2021-01-07

twitter tool

  • xPro pay to use
  • api change

maybe useful

OSINT Framework

  • https://osintframework.com/ ### integration tool
  • https://www.aware-online.com/en/ ### long-tail keyword
  • https://keywordtool.io/

网络分层模型

OSI模型(Open Systems Interconnection model),该模型分为7层:

  1. 物理层(Physical Layer)
  2. 数据链路层(Data Link Layer)
  3. 网络层(Network Layer)
  4. 传输层(Transport Layer)
  5. 会话层(Session Layer)
  6. 表示层(Presentation Layer)
  7. 应用层(Application Layer)
  • tap: 属于数据链路层(第2层)。tap设备用于在以太网帧级别操作。

  • tun, vpn: 属于网络层(第3层)。tun设备用于IP包级别操作,VPN通常工作在第3层(网络层)。

  • icmp: 属于网络层(第3层)。ICMP(Internet Control Message Protocol)用于网络设备间的控制信息传递,如ping命令。

in short

1
2
3
4
5
6
7
8
9
- **tap**: 2层(数据链路层)
- **tun, vpn**: 3层(网络层)
- **icmp**: 3层(网络层)
- **TCP/UDP**: 4层(传输层)
- **socks**: 7层(应用层)建立连接和传输数据时也涉及传输层(第4层)
- **system proxy (clash default)**: 7层(应用层)no ICMP
- **proxychains**: 7层(应用层)no ICMP
- **HTTP/HTTPS、FTP、SMTP**: 7层(应用层)
- **SSH**: 7层(应用层)使用传输层协议(通常是 TCP)22 port

tips:

  • SOCKS4:支持基本的 TCP 流量转发,不支持 UDP。
  • SOCKS5:扩展了 SOCKS4 的功能,增加了对 UDP 流量的支持,并且提供了更强的认证和安全特性。
  • proxychains 是一个工具,它会拦截应用程序的网络连接,并通过代理服务器转发这些连接。它通常用于让应用程序通过 SOCKS 或 HTTP 代理连接到网络。由于 proxychains 操作的是应用程序层的流量,并且修改传输层的连接请求,它应归类为应用层(第7层),尽管操作涉及传输层(第4层)的连接。

Configuring Proxy Settings

In the development world, setting up a proxy is a common task, especially when working behind a corporate firewall or when you want to ensure secure and private browsing. Proxies act as intermediaries between your computer and the internet, helping in filtering requests, improving security, and managing network traffic more efficiently.

NPM

Setting up Proxy in NPM

To configure npm to use a proxy, you can use the npm config set command as follows:

1
2
npm config set proxy "http://localhost:7890"
npm config set https-proxy "http://localhost:7890"

Here, http://localhost:7890 is the address of your proxy server. Change it according to your proxy server's IP address and port number.

Removing Proxy Configuration

If you need to remove the proxy configuration, for instance, when you're not behind a proxy anymore, you can use the npm config delete command:

1
2
npm config delete proxy
npm config delete https-proxy

Linux Shell Proxy Configuration

Setting up Proxy

You can set proxy environment variables in the shell as follows:

1
2
export http_proxy="http://localhost:7890"
export https_proxy="https://localhost:7890"

Replace localhost:7890 with your proxy server's IP address and port. Note the difference in the protocol (http vs. https) for http_proxy and https_proxy.

Removing Proxy Configuration

To revert the changes or to disable the use of a proxy, you can unset these environment variables:

1
2
unset http_proxy
unset https_proxy

Pip Proxy Configuration

Using Proxy with Pip

1
pip --proxy http://localhost:7890 install somepackage

Replace http://localhost:7890 with your proxy's URL. Append the name of the package you wish to install instead of somepackage.

git

1
2
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890
1
2
git config --global http.https://github.com.proxy http://127.0.0.1:7890
git config --global https.https://github.com.proxy https://127.0.0.1:7890
1
2
3
git config --global --unset http.proxy
git config --global --unset https.proxy

unfinished

跨平台换行符差异导致的密码破解失败

在进行密码破解任务时,我遇到了一个典型但容易被忽视的问题:不同操作系统间的换行符差异。在这篇博客中,我将分享我的经验和解决方案,希望能帮助那些可能面临同样挑战的人。

背景

Windows 系统上生成了一个用于密码破解的字典文件,文件中的换行符遵循 Windows 的标准,即 CRLF (\r\n)。然而,我的破解工具运行在 WSL 环境中,该环境以及大多数 Linux 工具期望的换行符是 LF (\n)。

我确定字典中有正确密码。当使用 VSCodeWSL 终端运行如下fcrackzip命令时,破解尝试失败了

1
fcrackzip -D -p ./vspro/passwords.txt -u flag.zip

通过file命令检查字典文件,确认了问题所在:

1
2
➜  code file ./vspro/passwords.txt
./vspro/passwords.txt: ASCII text, with CRLF line terminators

这表明文件是用 CRLF 作为换行符的,而不是 WSLLinux 工具期望的 LF

解决方案

If conditions permit

linux 环境中使用脚本生成字典。

Else 使用指令转换换行符

为了解决这个问题,我需要将字典文件中的 CRLF 换行符转换为LFLinuxWSL提供了一个非常方便的工具dos2unix,它可以实现这种转换。

1
sudo apt update && sudo apt install dos2unix

安装完成后,使用dos2unix命令转换文件:

1
dos2unix ./vspro/passwords.txt

验证转换

转换完成后,再次使用file命令验证文件的换行符:

1
2
➜  code file ./vspro/passwords.txt
./vspro/passwords.txt: ASCII text

这次,文件描述不再提到CRLF换行符,说明转换成功。

重新尝试破解

转换换行符后,我再次运行了fcrackzip命令,这次成功破解了ZIP文件的密码。

end

This experience highlights that, when working across different platforms, even minor details like line breaks can lead to significant obstacles. Despite their seeming insignificance, these differences can greatly impact how files are processed and texts are parsed. Thankfully, with the use of straightforward tools and commands, these issues can be easily overcome, allowing for a seamless workflow.

I hope this blog post assists those facing similar challenges in cross-platform tasks, such as password cracking or any activity involving text file processing. Remember, when you come across unusual issues, it's worth starting with the basics, like the seemingly trivial matter of line breaks.