glibc版本更换与git clone解决

Ubuntu更换glibc

前言

git clone 失败/ping github.com ping不通问题解决

拉取报错fatal:unable to access 解决:

修改hosts文件

1.访问https://github.com.ipaddress.com/www.github.com 获取目前github.com实际ip

2.修改 /etc/hosts 文件: sudo vim /etc/hosts ,添加 github's ip github.com (xx.xxx.xx github.com)

3.更新hosts文件:source /etc/hosts

大概原理:

(好像会被和谐...)

github的CDN(Content Delivery Network,内容分发网络利用全局负载技术将用户的访问指向当时较近的最佳的CDN节点)被伟大的墙屏蔽,导致我们在国内访问github非常慢。

通过修改hosts文件的方法来绕过国内DNS解析(Domain Name System,域名系统DNS),网络通讯大部分都是基于TCP/IP的,而TCP/IP是基于IP地址的,所以计算机在网络上进行通讯时只能识别IP地址,而不能认识域名(github.com),所以DNS将域名解析为IP地址,DNS工作原理如下所示:

域名:www.qq.com
	|		   |
	D     N     S
	|		   |
IPV4: 119.147.15.13

由于github只是被DNS污染,而不是像Google那样被IP封锁,所以不需要科.学.上.网也不需要海外的服务器辅助,修改后也能直接访问github的CDN节点(主DNS根据一系列策略确定当时最适当的CDN节点,并将解析的结果即IP地址发给用户,用户向给定的CDN节点请求相应网站的内容),从而达到加速的目的。

patchelf + glibc_all_in_one

——64位程序

1.glibc_all_in_one

首先从github上拉取项目:git clone https://github.com/NixOS/patchelf.git

具体操作

到该项目目录下输入:

./update_list #更新list最新版本的glibc
cat list #查看可下载的glibc
cat old_list #查看旧版本的glibc
./2.27-3ubuntu1.0_amd64 #下载所需版本glibc

2.patchelf

首先从github上拉取项目:git clone https://github.com/NixOS/patchelf

具体操作

到该目录下输入:

./bootstrap.sh
./configure
make
sudo make install
make check

3.生成所需的符号链接

cd /lib64 #进入64位的目录

sudo su #进入root状态

ln -s /home/glibc-all-in_one/libs/2.27-3ubuntu1_amd64/ld-2.27.so ./27_1-linux.so.2 #./27_1-linux.so.2为自己取的

ls -l #查看生成的符号链接

4.更改elf文件的ld和libc

patchelf --set-interpreter /lib64/27_1-linux.so.2 ./elf

patchelf --replace-needed libc.so.6 /home/hyq2/glibc-all-in_one/libs/2.27-3ubuntu1_amd64 #libc.so.6为需要替换的libc路径 第二个参数是需要加载的glibc目录
ldd ./elf #查看elf的ld和libc

docker

容器技术

  • dockerfile
  • image
  • container

理解:image(镜像) -- 可执行文件 ;container(容器) -- 运行起来的进程 ;dockerfile -- image的源代码 ; docker -- dockerfile的”编译器“

docker build (dockerfile) --> image ; docker run (image) --> container

docker hub : image 商店

docker pull : 从docker hub 下载 image并存放至本地供使用

安装好docker后,使用docker从 Docker Hub 下载镜像时速度会非常慢,为了提高镜像下载速度,可以使用阿里云镜像加速器来提升(pull得更快)

加速参考链接:https://www.gaoyuanqi.cn/docker-aliyun-jiasuqi/

pwndocker

官方文档:https://github.com/skysider/pwndocker

docker pull skysider/pwndocker

参考链接上:https://nocbtm.github.io/2020/02/24/skysider-pwndocker-正确使用姿势/#前言

参考链接下:https://risuxx.github.io/2020/07/07/pwn做题环境/

参考链接

ping不通github,如何解决?https://blog.csdn.net/weixin_42232769/article/details/105655388

加载不同glibc版本https://blog.csdn.net/qq_41560595/article/details/114597342

posted @ 2022-02-27 23:05  hyq2  阅读(462)  评论(0编辑  收藏  举报