{"id":356,"date":"2024-08-06T19:38:06","date_gmt":"2024-08-06T11:38:06","guid":{"rendered":"https:\/\/blog.kishere.cn\/?p=356"},"modified":"2026-01-07T09:37:34","modified_gmt":"2026-01-07T01:37:34","slug":"win-linux%e5%ae%9e%e7%94%a8%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/blog.kishere.cn\/?p=356","title":{"rendered":"win\/linux\u5b9e\u7528\u547d\u4ee4"},"content":{"rendered":"<h2>\u6587\u4ef6\u6821\u9a8c<\/h2>\n<p>win<\/p>\n<pre><code class=\"language-shell line-numbers\">certutil -hashfile (filename) [hashfun]\n<\/code><\/pre>\n<p>hashfun\u4e3ahash\u7b97\u6cd5\uff0c\u53ef\u4ee5\u9009\u62e9MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512<\/p>\n<p>linux<\/p>\n<pre><code class=\"language-shell line-numbers\">md5sum (filename)\n<\/code><\/pre>\n<h2>linux\u67e5\u770b\u6587\u4ef6\u5939\u5927\u5c0f<\/h2>\n<pre><code class=\"language-shell line-numbers\">du -sh\ndu -sh *\ndu -a #\u663e\u793a\u6240\u6709\ndu -h #\u6362\u7b97\u5927\u5c0f\u4e3aG\u3001M\ndu -d 1 #\u7edf\u8ba1\u6587\u4ef6\u5939\u7684\u6df1\u5ea6\u4e3a1\n<\/code><\/pre>\n<h2>run\u6587\u4ef6<\/h2>\n<pre><code class=\"language-shell line-numbers\">a.run --target tempDir #\u89e3\u538b\u5230tempDir\u6587\u4ef6\u5939\n<\/code><\/pre>\n<h2>\u7aef\u53e3\u8f6c\u53d1<\/h2>\n<pre><code class=\"language-shell line-numbers\">ssh -g -L 0.0.0.0:9988:169.254.76.122:22 ubuntu@169.254.76.122\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u5728powerhsell\u4e2d\u4f7f\u7528<\/p>\n<p>\u6216\u8005\u76f4\u63a5\u4f7f\u7528\u4ee5\u4e0b\u811a\u672c\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\"># \u63d0\u793a\u7528\u6237\u8f93\u5165 IP \u5730\u5740\u6216\u57df\u540d\n<span class=\"katex math inline\">input = Read-Host \"\u8bf7\u8f93\u5165 IP \u5730\u5740\u6216\u57df\u540d\"\n\n# \u6784\u5efa SSH \u547d\u4ee4<\/span>sshCommand = \"ssh -g -L 0.0.0.0:9988:<span class=\"katex math inline\">{input}:22 ubuntu@<\/span>input\"\n\nWrite-Host <span class=\"katex math inline\">sshCommand\n\n# \u6267\u884c SSH \u547d\u4ee4\nStart-Process powershell -ArgumentList \"-NoExit\", \"-Command\",<\/span>sshCommand\n<\/code><\/pre>\n<h2>\u67e5\u770b\u4f9d\u8d56<\/h2>\n<p>\u5148\u6253\u5f00VS\u5f00\u53d1\u4eba\u5458\u547d\u4ee4\u884c\uff0c\u8fd9\u4e2a\u7a0b\u5e8f\u5728VS\u5b89\u88c5\u76ee\u5f55\u4e0b<\/p>\n<pre><code class=\"language-shell line-numbers\">dumpbin.exe \/dependents filename.exe\n<\/code><\/pre>\n<h2>\u67e5\u770b\u65e5\u5fd7<\/h2>\n<p>win<\/p>\n<pre><code class=\"language-shell line-numbers\">Get-Content a.log -Wait #powershell \u6267\u884c -Wait\u53ef\u4ee5\u5b9e\u65f6\u5237\u65b0\nGet-Content a.log -Tail 10 #\u83b7\u53d6\u6700\u540e10\u884c\nGet-Content a.log | -Select-String \"error\" #\u8fc7\u6ee4error\n#16\u8fdb\u5236\u663e\u793a\u6700\u540e32\u4e2a\u6570\u636e\nGet-Content \"(1).raw\" -Encoding Byte -ReadCount 1 -Tail 32 | Format-Hex\n<\/code><\/pre>\n<p>linux<\/p>\n<pre><code class=\"language-shell line-numbers\">tail -f -n 100 a.log #-f\u5b9e\u65f6\u5237\u65b0\uff0c-n\u663e\u793a\u6700\u540e 100 \u884c\n# \u67e5\u770b\u6700\u540e16\u4e2a\u5b57\u8282\uff08\u4ee5\u5341\u516d\u8fdb\u5236\u663e\u793a\uff09\ntail -c 16 filename.bin | hexdump -C\n# \u7528xxd\u67e5\u770b\u6700\u540e\u51e0\u884c\uff08\u6bcf\u884c16\u5b57\u8282\uff09\nxxd filename.bin | tail -n 5\n<\/code><\/pre>\n<h2>\u66f4\u6539\u6587\u4ef6\u5c5e\u6027<\/h2>\n<pre><code class=\"language-shell line-numbers\">chmod 666 \/doc\nchmod +x \/doc\n\nchgrp root \/doc #\u5c06doc\u7684\u6240\u5c5e\u7ec4\u66f4\u6539\u4e3aroot\n<\/code><\/pre>\n<h2>\u4fee\u6539\u6587\u4ef6\u6362\u884c\u7b26<\/h2>\n<pre><code class=\"language-shell line-numbers\">sed -i 's\/\\r\/\/' $(find . -name '*.sh') #\u4fee\u6539\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709 .sh\u7684\u6362\u884c\u7b26\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u4ef6\u6821\u9a8c win certutil -hashfile (filename) [hashfun] hashfun\u4e3ahash\u7b97\u6cd5\uff0c\u53ef\u4ee5\u9009\u62e9MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512 linux md5sum (filename) linux\u67e5\u770b\u6587\u4ef6\u5939\u5927\u5c0f du -sh du -sh * du -a #\u663e\u793a\u6240\u6709 du -h #\u6362\u7b97\u5927\u5c0f\u4e3aG\u3001M du -d 1 #\u7edf\u8ba1\u6587\u4ef6\u5939\u7684\u6df1\u5ea6\u4e3a1 run\u6587\u4ef6 a.run &#8211;target tempDir #\u89e3\u538b\u5230tempDir\u6587\u4ef6\u5939 \u7aef\u53e3\u8f6c\u53d1 ssh -g -L 0.0.0.0:9988:169.254.76.122:22 ubuntu@169.254.76.122 \u53ef\u4ee5\u5728powerhsell\u4e2d\u4f7f\u7528 \u6216\u8005\u76f4\u63a5\u4f7f\u7528\u4ee5\u4e0b\u811a\u672c\uff1a # \u63d0\u793a\u7528\u6237\u8f93\u5165 IP \u5730\u5740\u6216\u57df\u540d input = Read-Host &#8220;\u8bf7\u8f93\u5165 IP \u5730\u5740\u6216\u57df\u540d&#8221; # \u6784\u5efa SSH \u547d\u4ee4sshCommand = &#8220;ssh -g -L 0.0.0.0:9988:{input}:22 ubuntu@input&#8221; Write-Host sshCommand # \u6267\u884c SSH \u547d\u4ee4 Start-Process powershell -ArgumentList &#8220;-NoExit&#8221;, &#8220;-Command&#8221;,sshCommand \u67e5\u770b\u4f9d\u8d56 \u5148\u6253\u5f00VS\u5f00\u53d1\u4eba\u5458\u547d\u4ee4\u884c\uff0c\u8fd9\u4e2a\u7a0b\u5e8f\u5728VS\u5b89\u88c5\u76ee\u5f55\u4e0b dumpbin.exe \/dependents filename.exe \u67e5\u770b\u65e5\u5fd7 win Get-Content a.log -Wait #powershell \u6267\u884c -Wait\u53ef\u4ee5\u5b9e\u65f6\u5237\u65b0 Get-Content a.log -Tail 10 #\u83b7\u53d6\u6700\u540e10\u884c Get-Content a.log | -Select-String &#8220;error&#8221; #\u8fc7\u6ee4error #16\u8fdb\u5236\u663e\u793a\u6700\u540e32\u4e2a\u6570\u636e Get-Content &#8220;(1).raw&#8221; -Encoding Byte -ReadCount 1 -Tail 32 | Format-Hex linux tail -f -n 100 a.log #-f\u5b9e\u65f6\u5237\u65b0\uff0c-n\u663e\u793a\u6700\u540e 100 \u884c # \u67e5\u770b\u6700\u540e16\u4e2a\u5b57\u8282\uff08\u4ee5\u5341\u516d\u8fdb\u5236\u663e\u793a\uff09 tail -c 16 filename.bin | hexdump -C # \u7528xxd\u67e5\u770b\u6700\u540e\u51e0\u884c\uff08\u6bcf\u884c16\u5b57\u8282\uff09 xxd filename.bin | tail -n 5 \u66f4\u6539\u6587\u4ef6\u5c5e\u6027 chmod 666 \/doc chmod +x \/doc chgrp root \/doc #\u5c06doc\u7684\u6240\u5c5e\u7ec4\u66f4\u6539\u4e3aroot \u4fee\u6539\u6587\u4ef6\u6362\u884c\u7b26 sed -i &#8216;s\/\\r\/\/&#8217; $(find . -name &#8216;*.sh&#8217;) #\u4fee\u6539\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709 .sh\u7684\u6362\u884c\u7b26<\/p>\n","protected":false},"author":1,"featured_media":52,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/posts\/356"}],"collection":[{"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=356"}],"version-history":[{"count":17,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/posts\/356\/revisions"}],"predecessor-version":[{"id":523,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/posts\/356\/revisions\/523"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/media\/52"}],"wp:attachment":[{"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}