{"id":93539,"date":"2024-04-09T06:35:11","date_gmt":"2024-04-08T22:35:11","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=93539"},"modified":"2024-04-09T06:35:11","modified_gmt":"2024-04-08T22:35:11","slug":"linux-test-mand","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-test-mand.html","title":{"rendered":"Linux \u4e3b\u673a\u8d85\u5168\u6e17\u900f\u6d4b\u8bd5\u547d\u4ee4\u6c47\u603b"},"content":{"rendered":"
\n
\n
\n

\u5982\u4e0b\u662f\u4e00\u4efd Linux \u673a\u5668\u7684\u6e17\u900f\u6d4b\u8bd5\u5907\u5fd8\u5f55\uff0c\u662f\u5728\u540e\u671f\u5f00\u53d1\u671f\u95f4\u6216\u8005\u6267\u884c\u547d\u4ee4\u6ce8\u5165\u7b49\u64cd\u4f5c\u65f6\u7684\u4e00\u4e9b\u5178\u578b\u547d\u4ee4\uff0c\u8bbe\u8ba1\u4e3a\u6d4b\u8bd5\u4eba\u5458\u8fdb\u884c\u672c\u5730\u679a\u4e3e\u68c0\u67e5\u4e4b\u7528\u3002<\/p>\n

\u6b64\u5916\uff0c\u4f60\u8fd8\u53ef\u4ee5\u4ece\u8fd9\u513f\u9605\u8bfb\u5230\u8bb8\u591a\u5173\u4e8e\u6e17\u900f\u6d4b\u8bd5\u7684\u6587\u7ae0\u3002<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
netstat -tulpn<\/td>\n\u5728 Linux \u4e2d\u663e\u793a\u5bf9\u5e94\u4e86\u8fdb\u7a0bID\uff08PID\uff09\u7684\u7f51\u7edc\u7aef\u53e3\u3002<\/td>\n<\/tr>\n
watch ss -stplu<\/td>\n\u901a\u8fc7\u5957\u63a5\u5b57\u5b9e\u65f6\u89c2\u5bdf TCP, UDP \u7aef\u53e3\u3002<\/td>\n<\/tr>\n
lsof -i<\/td>\n\u663e\u793a\u786e\u8ba4\u4e86\u7684\u8fde\u63a5\u3002<\/td>\n<\/tr>\n
macchanger -m MACADDR INTR<\/td>\n\u5728 KALI Linux \u4e0a\u4fee\u6539 MAC \u5730\u5740\u3002<\/td>\n<\/tr>\n
ifconfig eth0 192.168.2.1\/24<\/td>\n\u5728 Linux \u4e2d\u8bbe\u7f6e ID \u5730\u5740\u3002<\/td>\n<\/tr>\n
ifconfig eth0:1 192.168.2.3\/24<\/td>\n\u5728 Linux \u4e2d\u5411\u73b0\u6709\u7684\u7f51\u7edc\u63a5\u53e3\u6dfb\u52a0 IP \u5730\u5740\u3002<\/td>\n<\/tr>\n
ifconfig eth0 hw ether MACADDR<\/td>\n\u4f7f\u7528 ifconfig \u4fee\u6539 Linux \u4e2d\u7684 MAC \u5730\u5740\u3002<\/td>\n<\/tr>\n
ifconfig eth0 mtu 1500<\/td>\n\u5728 Linux \u4e2d\u4f7f\u7528 ifconfig \u4fee\u6539 MTU \u7684\u5927\u5c0f\uff0c\u5c06 1500 \u6539\u4e3a\u4f60\u60f3\u8981\u7684 MTU\u3002<\/td>\n<\/tr>\n
dig -x 192.168.1.1<\/td>\n\u5bf9 IP \u5730\u5740\u8fdb\u884c\u53cd\u5411\u67e5\u627e\u3002<\/td>\n<\/tr>\n
host 192.168.1.1<\/td>\n\u5728\u4e00\u4e2a IP \u5730\u5740\u4e0a\u8fdb\u884c\u53cd\u5411\u67e5\u627e\uff0c\u9002\u7528\u4e8e\u6ca1\u6709\u5b89\u88c5 dig \u7684\u60c5\u51b5\u3002<\/td>\n<\/tr>\n
dig @192.168.2.2 domain.com -t AXFR<\/td>\n\u4f7f\u7528 dig \u6267\u884c\u4e00\u6b21 DNS \u533a\u57df\u4f20\u8f93\u3002<\/td>\n<\/tr>\n
host -l domain.com nameserver<\/td>\n\u4f7f\u7528 host \u6267\u884c\u4e00\u6b21 DNS \u533a\u57df\u4f20\u8f93\u3002<\/td>\n<\/tr>\n
nbtstat -A x.x.x.x<\/td>\n\u83b7\u53d6 IP \u5730\u5740\u5bf9\u5e94\u7684\u57df\u540d\u3002<\/td>\n<\/tr>\n
ip addr add 192.168.2.22\/24 dev eth0<\/td>\n\u5411 Linux \u6dfb\u52a0\u4e00\u4e2a\u9690\u85cf\u7684 IP \u5730\u5740\uff0c\u5728\u6267\u884c ifconfig \u547d\u4ee4\u65f6\u4e0d\u4f1a\u663e\u793a\u8fd9\u4e2a IP \u5730\u5740\u3002<\/td>\n<\/tr>\n
tcpkill -9 host google.com<\/td>\n\u963b\u6b62\u4ece\u4e3b\u673a\u8bbf\u95ee google.com\u3002<\/td>\n<\/tr>\n
echo \"1\" > \/proc\/sys\/net\/ipv4\/ip_forward<\/td>\n\u542f\u7528 IP \u8f6c\u53d1\uff0c\u5c06 Linux \u76d2\u5b50\u53d8\u6210\u4e00\u4e2a\u8def\u7531\u5668\u2014\u2014\u8fd9\u6837\u5c31\u65b9\u4fbf\u901a\u8fc7\u8fd9\u4e2a\u76d2\u5b50\u6765\u8fdb\u884c\u8def\u7531\u6d41\u91cf\u7684\u63a7\u5236\u3002<\/td>\n<\/tr>\n
echo \"8.8.8.8\" > \/etc\/resolv.conf<\/td>\n\u4f7f\u7528 Google \u7684 DNS\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n
\n
\n
\n
\u7cfb\u7edf\u4fe1\u606f\u547d\u4ee4<\/strong><\/div>\n

\u5bf9\u4e8e\u672c\u5730\u7684\u679a\u4e3e\u68c0\u67e5\u5f88\u6709\u7528\u3002<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
whoami<\/td>\n\u663e\u793a Linux \u4e0a\u5f53\u524d\u5df2\u767b\u5f55\u7528\u6237\u3002<\/td>\n<\/tr>\n
id<\/td>\n\u5411\u7528\u6237\u663e\u793a\u5f53\u524d\u5df2\u767b\u5f55\u7684\u7528\u6237\u548c\u7ec4\u3002<\/td>\n<\/tr>\n
last<\/td>\n\u663e\u793a\u6700\u540e\u4e00\u6b21\u767b\u9646\u7684\u7528\u6237\u3002<\/td>\n<\/tr>\n
mount<\/td>\n\u663e\u793a\u5df2\u6302\u8f7d\u7684\u9a71\u52a8\u3002<\/td>\n<\/tr>\n
df -h<\/td>\n\u7528\u4eba\u7c7b\u53ef\u8bfb\u7684\u8f93\u51fa\u663e\u793a\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5\u3002<\/td>\n<\/tr>\n
echo \"user:passwd\" | chpasswd<\/td>\n\u7528\u4e00\u884c\u547d\u4ee4\u91cd\u7f6e\u5bc6\u7801\u3002<\/td>\n<\/tr>\n
getent passwd<\/td>\n\u5217\u51fa Linux \u4e0a\u7684\u7528\u6237\u3002<\/td>\n<\/tr>\n
strings \/usr\/local\/bin\/blah<\/td>\n\u663e\u793a\u975e\u6587\u672c\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u4f8b\u5982\uff1a\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u91cc\u9762\u6709\u4ec0\u4e48\u3002<\/td>\n<\/tr>\n
uname -ar<\/td>\n\u663e\u793a\u8fd0\u884c\u4e2d\u7684\u5185\u6838\u7248\u672c\u3002<\/td>\n<\/tr>\n
PATH=$PATH:\/my\/new-path<\/td>\n\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u8def\u5f84\uff0c\u65b9\u4fbf\u8fdb\u884c\u672c\u5730\u6587\u4ef6\u7cfb\u7edf\uff08FS\uff09\u64cd\u4f5c\u3002<\/td>\n<\/tr>\n
history<\/td>\n\u663e\u793a\u7528\u6237\u5728\u4e4b\u524d\u6267\u884c\u7684 bash \u811a\u672c\u5386\u53f2\u8bb0\u5f55\uff0c\u8fd8\u6709\u6572\u5165\u7684\u547d\u4ee4\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u57fa\u4e8e Redhat \/ CentOS \/ RPM \u7684\u53d1\u884c\u7248<\/strong><\/span><\/div>\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
cat \/etc\/redhat-release<\/td>\n\u663e\u793a Redhat \/ CentOS \u7248\u672c\u53f7\u3002<\/td>\n<\/tr>\n
rpm -qa<\/td>\n\u5728\u57fa\u4e8e RPM \u7684 Linux \u4e0a\u5217\u51fa\u6240\u6709\u5df2\u7ecf\u5b89\u88c5\u4e0a\u7684 RPM \u5305\u3002<\/td>\n<\/tr>\n
rpm -q --changelog openvpn<\/td>\n\u68c0\u67e5\u5df2\u5b89\u88c5\u7684 RPM \u662f\u5426\u9488\u5bf9 CVE \u6253\u4e86\u8865\u4e01\uff0c\u53ef\u4ee5\u7528 grep \u547d\u4ee4\u8fc7\u6ee4\u51fa\u8ddf CVE \u6709\u5173\u7684\u8f93\u51fa\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n
\n
\u00a0YUM \u547d\u4ee4<\/strong><\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n
\n
\n
\n

\u57fa\u4e8e RPM \u7684\u7cfb\u7edf\u4f7f\u7528\u4e86\u5305\u7ba1\u7406\u5668, \u4f60\u53ef\u4ee5\u7528\u8fd9\u4e9b\u547d\u4ee4\u83b7\u53d6\u5230\u6709\u5173\u5df2\u5b89\u88c5\u5305\u6216\u8005\u5176\u5b83\u5de5\u5177\u7684\u6709\u7528\u4fe1\u606f\u3002<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
yum update<\/td>\n\u4f7f\u7528 YUM \u66f4\u65b0\u6240\u6709\u7684 RPM \u5305\uff0c\u4e5f\u4f1a\u663e\u793a\u51fa\u54ea\u4e9b\u5df2\u7ecf\u8fc7\u65f6\u4e86\u3002<\/td>\n<\/tr>\n
yum update httpd<\/td>\n\u66f4\u65b0\u5355\u72ec\u7684\u5305\uff0c\u5728\u6b64\u4f8b\u4e2d\u662f HTTPD (Apache)\u3002<\/td>\n<\/tr>\n
yum install package<\/td>\n\u4f7f\u7528 YUM \u5b89\u88c5\u4e00\u4e2a\u5305\u3002<\/td>\n<\/tr>\n
yum --exclude=package kernel* update<\/td>\n\u5728\u4f7f\u7528 YUM \u65f6\u5c06\u4e00\u4e2a\u5305\u6392\u9664\u5728\u5916\u4e0d\u66f4\u65b0\u3002<\/td>\n<\/tr>\n
yum remove package<\/td>\n\u4f7f\u7528 YUM \u5220\u9664\u5305\u3002<\/td>\n<\/tr>\n
yum erase package<\/td>\n\u4f7f\u7528 YUM \u5220\u9664\u5305\u3002<\/td>\n<\/tr>\n
yum list package<\/td>\n\u5217\u51fa\u6709\u5173 yum \u5305\u7684\u4fe1\u606f\u3002<\/td>\n<\/tr>\n
yum provides httpd<\/td>\n\u663e\u793a\u4e00\u4e2a\u5305\u662f\u7684\u7528\u9014\uff0c\u4f8b\u5982\uff1a Apache HTTPD Server\u3002<\/td>\n<\/tr>\n
yum info httpd<\/td>\n\u663e\u793a\u5305\u4fe1\u606f\uff0c\u67b6\u6784\uff0c\u7248\u672c\u7b49\u4fe1\u606f\u3002<\/td>\n<\/tr>\n
yum localinstall blah.rpm<\/td>\n\u4f7f\u7528 YUM \u6765\u5b89\u88c5\u672c\u5730 RPM\uff0c \u4ece\u8d44\u6e90\u5e93\u8fdb\u884c\u5b89\u88c5\u3002<\/td>\n<\/tr>\n
yum deplist package<\/td>\n\u663e\u793a\u5305\u7684\u63d0\u4f9b\u65b9\u4fe1\u606f\u3002<\/td>\n<\/tr>\n
yum list installed | more<\/td>\n\u5217\u51fa\u6240\u6709\u5df2\u5b89\u88c5\u7684\u5305\u3002<\/td>\n<\/tr>\n
yum grouplist | more<\/td>\n\u663e\u793a\u6240\u6709\u7684 YUM \u5206\u7ec4\u3002<\/td>\n<\/tr>\n
yum groupinstall 'Development Tools'<\/td>\n\u5b89\u88c5 YUM \u5206\u7ec4\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n
\n
\n
\n
\u57fa\u4e8e Debian \/ Ubuntu \/ .deb \u7684\u53d1\u884c\u7248<\/strong><\/span><\/div>\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
cat \/etc\/debian_version<\/td>\n\u663e\u793a Debian \u7248\u672c\u53f7\u3002<\/td>\n<\/tr>\n
cat \/etc\/*-release<\/td>\n\u663e\u793a Ubuntu \u7248\u672c\u53f7\u3002<\/td>\n<\/tr>\n
dpkg -l<\/td>\n\u5728\u57fa\u4e8e Debian \/ .deb \u7684 Linux \u53d1\u884c\u7248\u4e0a\u5217\u51fa\u6240\u6709\u5df2\u5b89\u88c5\u7684\u5305\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
Linux \u7528\u6237\u7ba1\u7406<\/strong><\/div>\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
useradd new-user<\/td>\n\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Linux \u7528\u6237\u3002<\/td>\n<\/tr>\n
passwd username<\/td>\n\u91cd\u7f6e Linux \u7528\u6237\u5bc6\u7801, \u5982\u679c\u4f60\u662f root \u7528\u6237\uff0c\u53ea\u8981\u8f93\u5165\u5bc6\u7801\u5c31\u884c\u4e86\u3002<\/td>\n<\/tr>\n
deluser username<\/td>\n\u5220\u9664\u4e00\u4e2a Linux \u7528\u6237\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
Linux \u89e3\u538b\u7f29\u547d\u4ee4<\/strong><\/div>\n

\u5982\u4f55\u5728 Linux \u4e0a\u89e3\u6790\u4e0d\u540c\u7684\u538b\u7f29\u5305 (tar, zip, gzip, bzip2 \u7b49\u7b49) \uff0c\u4ee5\u53ca\u5176\u5b83\u7684\u4e00\u4e9b\u7528\u6765\u5728\u538b\u7f29\u5305\u4e2d\u8fdb\u884c\u641c\u7d22\u7b49\u64cd\u4f5c\u7684\u5c0f\u6280\u5de7\u3002<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
unzip archive.zip<\/td>\n\u5728 Linux \u4e0a\u63d0\u53d6 zip \u5305\u4e2d\u7684\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
zipgrep *.txt archive.zip<\/td>\n\u5728\u4e00\u4e2a zip \u538b\u7f29\u5305\u4e2d\u641c\u7d22\u3002<\/td>\n<\/tr>\n
tar xf archive.tar<\/td>\n\u5728 Linux \u4e0a\u63d0\u53d6 tar \u5305\u4e2d\u7684\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
tar xvzf archive.tar.gz<\/td>\n\u5728 Linux \u4e0a\u63d0\u53d6 tar.gz \u5305\u4e2d\u7684\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
tar xjf archive.tar.bz2<\/td>\n\u5728 Linux \u4e0a\u63d0\u53d6 tar.bz2 \u5305\u4e2d\u7684\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
tar ztvf file.tar.gz | grep blah<\/td>\n\u5728\u4e00\u4e2a tar.gz \u6587\u4ef6\u4e2d\u641c\u7d22\u3002<\/td>\n<\/tr>\n
gzip -d archive.gz<\/td>\n\u5728 Linux \u4e0a\u63d0\u53d6 gzip \u4e2d\u7684\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
zcat archive.gz<\/td>\n\u5728 Linux \u4ee5\u4e0d\u89e3\u538b\u7f29\u7684\u65b9\u5f0f\u8bfb\u53d6\u4e00\u4e2a gz \u6587\u4ef6\u3002<\/td>\n<\/tr>\n
zless archive.gz<\/td>\n\u7528\u8f83\u5c11\u7684\u547d\u4ee4\u5b9e\u73b0\u5bf9 .gz \u538b\u7f29\u5305\u76f8\u540c\u7684\u529f\u80fd\u3002<\/td>\n<\/tr>\n
zgrep 'blah' \/var\/log\/maillog*.gz<\/td>\n\u5728 Linux \u4e0a\u5bf9 .gz \u538b\u7f29\u5305\u91cc\u9762\u7684\u5185\u5bb9\u6267\u884c\u641c\u7d22\uff0c\u6bd4\u5982\u641c\u7d22\u88ab\u538b\u7f29\u8fc7\u7684\u65e5\u5fd7\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
vim file.txt.gz<\/td>\n\u4f7f\u7528 vim \u8bfb\u53d6 .txt.gz \u6587\u4ef6\uff08\u6211\u4e2a\u4eba\u7684\u6700\u7231\uff09\u3002<\/td>\n<\/tr>\n
upx -9 -o output.exe input.exe<\/td>\n\u5728 Linux \u4e0a\u4f7f\u7528 UPX \u538b\u7f29 .exe \u6587\u4ef6\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n
\n
\n
\n
Linux \u538b\u7f29\u547d\u4ee4<\/strong><\/div>\n\n\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
zip -r file.zip \/dir\/*<\/td>\n\u5728 Linux \u4e0a\u521b\u5efa\u4e00\u4e2a .zip \u6587\u4ef6\u3002<\/td>\n<\/tr>\n
tar cf archive.tar files<\/td>\n\u5728 Linux \u4e0a\u521b\u5efa\u4e00\u4e2a tar \u6587\u4ef6\u3002<\/td>\n<\/tr>\n
tar czf archive.tar.gz files<\/td>\n\u5728 Linux \u4e0a\u521b\u5efa\u4e00\u4e2a tar.gz \u6587\u4ef6\u3002<\/td>\n<\/tr>\n
tar cjf archive.tar.bz2 files<\/td>\n\u5728 Linux \u4e0a\u521b\u5efa\u4e00\u4e2a tar.bz2 \u6587\u4ef6\u3002<\/td>\n<\/tr>\n
gzip file<\/td>\n\u5728 Linux \u4e0a\u521b\u5efa\u4e00\u4e2a .gz \u6587\u4ef6\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
Linux \u6587\u4ef6\u547d\u4ee4<\/strong><\/div>\n

Samba \u547d\u4ee4<\/strong>\u4ece Linux \u8fde\u63a5\u5230 Samba \u5171\u4eab\u3002<\/p>\n

\r\n$\u00a0smbmount \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/server\/share\u00a0\/mnt\/win\u00a0-o\u00a0user=username,password=password1\r\n$\u00a0smbclient\u00a0-U\u00a0user \u00a0 \u00a0 \u00a0 \\\\\\\\server\\\\share\r\n$\u00a0mount\u00a0-t\u00a0cifs\u00a0-o\u00a0username=user,password=password \u00a0 \/\/x.x.x.x\/share\u00a0\/mnt\/share\r\n<\/pre>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
df -h blah<\/td>\n\u5728 Linux \u4e0a\u663e\u793a\u6587\u4ef6\/\u76ee\u5f55\u7684\u5927\u5c0f\u3002<\/td>\n<\/tr>\n
diff file1 file2<\/td>\n\u5728 Linux \u4e0a\u6bd4\u5bf9\/\u663e\u793a\u4e24\u4e2a\u6587\u4ef6\u4e4b\u95f4\u7684\u5dee\u522b\u3002<\/td>\n<\/tr>\n
md5sum file<\/td>\n\u5728 Linux \u4e0a\u751f\u6210 MD5 \u6458\u8981\u3002<\/td>\n<\/tr>\n
md5sum -c blah.iso.md5<\/td>\n\u5728 Linux \u4e0a\u68c0\u67e5\u6587\u4ef6\u7684 MD5 \u6458\u8981\uff0c\u8fd9\u91cc\u5047\u8bbe\u6587\u4ef6\u548c .md5 \u5904\u5728\u76f8\u540c\u7684\u8def\u5f84\u4e0b\u3002<\/td>\n<\/tr>\n
file blah<\/td>\n\u5728 Linux \u4e0a\u67e5\u627e\u51fa\u6587\u4ef6\u7684\u7c7b\u578b\uff0c\u4e5f\u4f1a\u5c06\u6587\u4ef6\u662f 32 \u8fd8\u662f 64 \u4f4d\u663e\u793a\u51fa\u6765\u3002<\/td>\n<\/tr>\n
dos2unix<\/td>\n\u5c06 Windows \u7684\u884c\u7ed3\u675f\u7b26\u8f6c\u6210 Unix\/Linux \u7684\u3002<\/td>\n<\/tr>\n
base64 < input-file > output-file<\/td>\n\u5bf9\u8f93\u5165\u6587\u4ef6\u8fdb\u884c Base64 \u7f16\u7801\uff0c\u7136\u540e\u8f93\u51fa\u4e00\u4e2a\u53eb\u505a output-file \u7684 Base64 \u7f16\u7801\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
base64 -d < input-file > output-file<\/td>\n\u5bf9\u8f93\u5165\u6587\u4ef6\u8fdb\u884c Base64 \u89e3\u7801\uff0c\u7136\u540e\u8f93\u51fa\u4e00\u4e2a\u53eb\u505a\u00a0output-file \u7684 Base64 \u89e3\u7801\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
touch -r ref-file new-file<\/td>\n\u4f7f\u7528\u6765\u81ea\u4e8e\u5f15\u7528\u6587\u4ef6\u7684\u65f6\u95f4\u6233\u6570\u636e\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\uff0c\u653e\u4e0a -r \u4ee5\u7b80\u5355\u5730\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
rm -rf<\/td>\n\u4e0d\u663e\u793a\u786e\u8ba4\u63d0\u793a\u5c31\u5220\u9664\u6587\u4ef6\u548c\u76ee\u5f55\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n
\n
\n
\n
\u6253\u7834 shell \u7684\u9650\u5236<\/strong><\/div>\n

\u8981\u8c22\u8c22 G0tmi1k(\uff08\u6216\u8005\u4ed6\u53c2\u8003\u8fc7\u7684\u5185\u5bb9\uff09\u3002<\/p>\n

Python \u5c0f\u6280\u5de7\uff1a<\/p>\n

python\u00a0-c\u00a0'import\u00a0pty;pty.spawn(\"\/bin\/bash\")'<\/span>\r\necho\u00a0os.system('\/bin\/bash'<\/span>)\r\n\/bin\/sh\u00a0-i<\/pre>\n
Misc \u547d\u4ee4<\/strong><\/div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
init 6<\/td>\n\u4ece\u547d\u4ee4\u884c\u91cd\u542f Linux \u3002<\/td>\n<\/tr>\n
gcc -o output.c input.c<\/td>\n\u7f16\u8bd1 C \u4ee3\u7801\u3002<\/td>\n<\/tr>\n
gcc -m32 -o output.c input.c<\/td>\n\u4ea4\u53c9\u7f16\u8bd1 C \u4ee3\u7801\uff0c\u5728 64 \u4f4d Linux \u4e0a\u5c06\u7f16\u8bd1\u51fa\u00a032 \u4f4d\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
unset HISTORYFILE<\/td>\n\u5173\u95ed bash \u5386\u53f2\u65e5\u5fd7\u8bb0\u5f55\u529f\u80fd\u3002<\/td>\n<\/tr>\n
rdesktop X.X.X.X<\/td>\n\u4ece Linux \u8fde\u63a5\u5230 RDP \u670d\u52a1\u5668\u3002<\/td>\n<\/tr>\n
kill -9 $$<\/td>\n\u5173\u6389\u5f53\u524d\u7684\u4f1a\u8bdd\u3002<\/td>\n<\/tr>\n
chown user:group blah<\/td>\n\u4fee\u6539\u6587\u4ef6\u6216\u8005\u76ee\u5f55\u7684\u6240\u6709\u8005\u3002<\/td>\n<\/tr>\n
chown -R user:group blah<\/td>\n\u4fee\u6539\u6587\u4ef6\u6216\u8005\u76ee\u5f55\uff0c\u4ee5\u53ca\u76ee\u5f55\u4e0b\u9762\u6587\u4ef6\/\u76ee\u5f55\u7684\u62e5\u6709\u8005 \u2014\u2014 \u9012\u5f52\u6267\u884c chown\u3002<\/td>\n<\/tr>\n
chmod 600 file<\/td>\n\u4fee\u6539\u6587\u4ef6\/\u76ee\u5f55\u7684\u6743\u9650\u8bbe\u5b9a, \u8be6\u60c5\u89c1 [Linux \u6587\u4ef6\u7cfb\u7edf\u6743\u9650](#linux-file-system-permissions) \u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u6e05\u9664 bash \u5386\u53f2\uff1a<\/p>\n

\u00a0$\u00a0ssh\u00a0user@X.X.X.X\u00a0|\u00a0cat\u00a0\/dev\/null\u00a0>\u00a0~\/.bash_history<\/pre>\n<\/div>\n<\/div>\n<\/div>\n
\n
\n
\n
Linux \u6587\u4ef6\u7cfb\u7edf\u6743\u9650<\/strong><\/div>\n\n\n\n\n\n\n\n\n\n\n
\u53d6\u503c<\/th>\n\u610f\u4e49<\/th>\n<\/tr>\n<\/tbody>\n
777<\/td>\nrwxrwxrwx \u6ca1\u6709\u9650\u5236\uff0c\u5b8c\u5168\u53ef\u8bfb\u53ef\u5199\u53ef\u6267\u884c\uff08RWX\uff09\uff0c\u7528\u6237\u53ef\u4ee5\u505a\u4efb\u4f55\u4e8b\u60c5\u3002<\/td>\n<\/tr>\n
755<\/td>\nrwxr-xr-x \u62e5\u6709\u8005\u53ef\u5b8c\u5168\u8bbf\u95ee\uff0c\u5176\u4ed6\u4eba\u53ea\u80fd\u8bfb\u53d6\u548c\u6267\u884c\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
700<\/td>\nrwx------\u00a0\u62e5\u6709\u8005\u53ef\u5b8c\u5168\u8bbf\u95ee\uff0c\u5176\u4ed6\u4eba\u90fd\u4e0d\u80fd\u8bbf\u95ee\u3002<\/td>\n<\/tr>\n
666<\/td>\nrw-rw-rw- \u6240\u6709\u4eba\u53ef\u4ee5\u8bfb\u53d6\u548c\u5199\u5165\uff0c\u4f46\u4e0d\u53ef\u6267\u884c\u3002<\/td>\n<\/tr>\n
644<\/td>\nrw-r--r-- \u62e5\u6709\u8005\u53ef\u4ee5\u8bfb\u53d6\u548c\u5199\u5165\uff0c\u5176\u4ed6\u4eba\u53ea\u53ef\u4ee5\u8bfb\u53d6\u3002<\/td>\n<\/tr>\n
600<\/td>\nrw-------\u00a0\u62e5\u6709\u8005\u53ef\u4ee5\u8bfb\u53d6\u548c\u5199\u5165\uff0c\u5176\u4ed6\u4eba\u90fd\u4e0d\u80fd\u8bbf\u95ee\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
Linux \u6587\u4ef6\u7cfb\u7edf\u7684\u6e17\u900f\u6d4b\u8bd5\u5907\u5fd8\u5f55<\/strong><\/div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u76ee\u5f55<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
\/<\/td>\n\/ \u4e5f\u88ab\u79f0\u4e3a\u201c\u659c\u6760\u201d\u6216\u8005\u6839\u3002<\/td>\n<\/tr>\n
\/bin<\/td>\n\u7531\u7cfb\u7edf\u3001\u7cfb\u7edf\u7ba1\u7406\u5458\u4ee5\u53ca\u7528\u6237\u5171\u4eab\u7684\u901a\u7528\u7a0b\u5e8f\u3002<\/td>\n<\/tr>\n
\/boot<\/td>\nBoot \u6587\u4ef6, \u542f\u52a8\u52a0\u8f7d\u5668(grub), \u5185\u6838, vmlinuz<\/td>\n<\/tr>\n
\/dev<\/td>\n\u5305\u542b\u4e86\u5bf9\u7cfb\u7edf\u8bbe\u5907\u3001\u5e26\u6709\u7279\u6b8a\u5c5e\u6027\u7684\u6587\u4ef6\u7684\u5f15\u7528\u3002<\/td>\n<\/tr>\n
\/etc<\/td>\n\u91cd\u8981\u7684\u7cfb\u7edf\u914d\u7f6e\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
\/home<\/td>\n\u7cfb\u7edf\u7528\u6237\u7684\u4e3b\u76ee\u5f55\u3002<\/td>\n<\/tr>\n
\/lib<\/td>\n\u5e93\u6587\u4ef6\uff0c\u5305\u62ec\u7cfb\u7edf\u548c\u7528\u6237\u90fd\u9700\u8981\u7684\u6240\u6709\u7c7b\u578b\u7684\u7a0b\u5e8f\u7684\u6587\u4ef6\u3002<\/td>\n<\/tr>\n
\/lost+found<\/td>\n\u6587\u4ef6\u64cd\u4f5c\u5931\u8d25\u4f1a\u88ab\u4fdd\u5b58\u5728\u8fd9\u91cc\u3002<\/td>\n<\/tr>\n
\/mnt<\/td>\n\u5916\u90e8\u6587\u4ef6\u7cfb\u7edf\u7684\u6807\u51c6\u6302\u8f7d\u70b9\u3002<\/td>\n<\/tr>\n
\/media<\/td>\n\u5916\u90e8\u6587\u4ef6\u7cfb\u7edf\uff08\u6216\u8005\u67d0\u4e9b\u53d1\u884c\u7248\uff09\u7684\u6302\u8f7d\u70b9\u3002<\/td>\n<\/tr>\n
\/net<\/td>\n\u6574\u4e2a\u8fdc\u7a0b\u6587\u4ef6\u7cfb\u7edf\u7684\u6807\u51c6\u6302\u8f7d\u70b9 \u2014\u2014\u00a0nfs\u3002<\/td>\n<\/tr>\n
\/opt<\/td>\n\u4e00\u822c\u90fd\u662f\u5305\u542b\u4e00\u4e9b\u9644\u52a0\u7684\u6216\u8005\u7b2c\u4e09\u65b9\u8f6f\u4ef6\u3002<\/td>\n<\/tr>\n
\/proc<\/td>\n\u4e00\u4e2a\u5305\u542b\u4e86\u7cfb\u7edf\u8d44\u6e90\u76f8\u5173\u4fe1\u606f\u7684\u865a\u62df\u6587\u4ef6\u7cfb\u7edf\u3002<\/td>\n<\/tr>\n
\/root<\/td>\nroot \u7528\u6237\u7684\u4e3b\u76ee\u5f55\u3002<\/td>\n<\/tr>\n
\/sbin<\/td>\n\u7531\u7cfb\u7edf\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u6765\u4f7f\u7528\u7684\u7a0b\u5e8f\u3002<\/td>\n<\/tr>\n
\/tmp<\/td>\n\u4f9b\u7cfb\u7edf\u4f7f\u7528\u7684\u4e34\u65f6\u7a7a\u95f4\uff0c\u91cd\u542f\u65f6\u4f1a\u88ab\u6e05\u7a7a\u3002<\/td>\n<\/tr>\n
\/usr<\/td>\n\u4f9b\u6240\u6709\u7528\u6237\u76f8\u5173\u7a0b\u5e8f\u4f7f\u7528\u7684\u7a0b\u5e8f\u3001\u5e93\u3001\u6587\u6863\u7b49\u7b49\u3002<\/td>\n<\/tr>\n
\/var<\/td>\n\u5b58\u50a8\u6240\u6709\u7531\u7528\u6237\u521b\u5efa\u7684\u53ef\u53d8\u6587\u4ef6\u548c\u4e34\u65f6\u6587\u4ef6\uff0c\u6bd4\u5982\u65e5\u5fd7\u6587\u4ef6\u3001\u90ae\u4ef6\u961f\u5217\u3001\u540e\u53f0\u6253\u5370\u7a0b\u5e8f\uff0cWeb\u670d\u52a1\u5668\uff0c\u6570\u636e\u5e93\u7b49\u7b49\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n
Linux \u4e2d\u6709\u8da3\u7684\u6587\u4ef6\/\u76ee\u5f55<\/strong><\/div>\n<\/div>\n<\/div>\n
\n
\n
\n

\u5982\u679c\u4f60\u60f3\u5c1d\u8bd5\u8fdb\u884c\u7279\u6743\u5347\u7ea7\/\u6267\u884c\u540e\u671f\u5f00\u53d1\uff0c\u8fd9\u4e9b\u90fd\u662f\u4f60\u503c\u5f97\u4e00\u77a7\u7684\u547d\u4ee4\u3002<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u8def\u5f84<\/th>\n\u63cf\u8ff0<\/th>\n<\/tr>\n<\/tbody>\n
\/etc\/passwd<\/td>\n\u5305\u542b\u4e86\u672c\u5730 Linux \u7684\u7528\u6237\u3002<\/td>\n<\/tr>\n
\/etc\/shadow<\/td>\n\u5305\u542b\u4e86\u54c8\u5e0c\u8fc7\u7684\u672c\u5730\u8d26\u6237\u5bc6\u7801\u3002<\/td>\n<\/tr>\n
\/etc\/group<\/td>\n\u5305\u542b\u4e86\u672c\u5730\u8d26\u6237\u5206\u7ec4\u3002<\/td>\n<\/tr>\n
\/etc\/init.d\/<\/td>\n\u5305\u542b\u4e86\u670d\u52a1\u7f51\u521d\u59cb\u5316\u811a\u672c \u2013 \u5177\u4f53\u90fd\u5b89\u88c5\u4e86\u4e9b\u5565\u5e94\u8be5\u503c\u5f97\u4e00\u77a7\u3002<\/td>\n<\/tr>\n
\/etc\/hostname<\/td>\n\u7cfb\u7edf\u7684 hostname\u3002<\/td>\n<\/tr>\n
\/etc\/network\/interfaces<\/td>\n\u7f51\u7edc\u63a5\u53e3\u3002<\/td>\n<\/tr>\n
\/etc\/resolv.conf<\/td>\n\u7cfb\u7edf\u7684 DNS \u670d\u52a1\u3002<\/td>\n<\/tr>\n
\/etc\/profile<\/td>\n\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u3002<\/td>\n<\/tr>\n
~\/.ssh\/<\/td>\nSSH \u5bc6\u94a5\u3002<\/td>\n<\/tr>\n
~\/.bash_history<\/td>\n\u7528\u6237\u7684 bash \u5386\u53f2\u65e5\u5fd7\u3002<\/td>\n<\/tr>\n
\/var\/log\/<\/td>\nLinux \u7cfb\u7edf\u7684\u65e5\u5fd7\u6587\u4ef6\u4e00\u822c\u5c31\u88ab\u5b58\u653e\u5728\u8fd9\u91cc\u3002<\/td>\n<\/tr>\n
\/var\/adm\/<\/td>\nUNIX \u7cfb\u7edf\u7684\u65e5\u5fd7\u6587\u4ef6\u4e00\u822c\u5c31\u88ab\u5b58\u5728\u5728\u8fd9\u91cc\u3002<\/td>\n<\/tr>\n
\/var\/log\/apache2\/access.log\/var\/log\/httpd\/access.log<\/td>\nApache \u8bbf\u95ee\u65e5\u5fd7\u6587\u4ef6\u901a\u5e38\u7684\u5b58\u5728\u8def\u5f84\u3002<\/td>\n<\/tr>\n
\/etc\/fstab<\/td>\n\u6302\u8f7d\u7684\u6587\u4ef6\u7cfb\u7edf\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u7ffb\u8bd1 : LeoXu<\/p>\n<\/div>\n<\/div>\n<\/div>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.oschina.net\/translate\/important-penetration-testing-cheat-sheet<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/linux-test-mand.html<\/a>\u7f16\u8f91\uff1a\u5f20\u96c4\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5982\u4e0b\u662f\u4e00\u4efd Linux \u673a\u5668\u7684\u6e17\u900f\u6d4b\u8bd5\u5907\u5fd8\u5f55\uff0c\u662f\u5728\u540e\u671f\u5f00\u53d1\u671f\u95f4\u6216\u8005\u6267\u884c\u547d\u4ee4\u6ce8\u5165\u7b49\u64cd\u4f5c\u65f6\u7684\u4e00\u4e9b\u5178\u578b\u547d\u4ee4\uff0c\u8bbe\u8ba1\u4e3a\u6d4b […]<\/p>\n","protected":false},"author":643,"featured_media":93540,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-93539","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/93539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=93539"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/93539\/revisions"}],"predecessor-version":[{"id":93576,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/93539\/revisions\/93576"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/93540"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=93539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=93539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=93539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}