{"id":200,"date":"2018-09-08T15:38:43","date_gmt":"2018-09-08T07:38:43","guid":{"rendered":""},"modified":"2023-12-27T10:12:50","modified_gmt":"2023-12-27T02:12:50","slug":"cisco-asa%e5%9b%ba%e4%bb%b6%e7%a0%b4%e8%a7%a3%e5%92%8c%e5%8a%a8%e6%80%81%e8%b0%83%e8%af%95%e8%bd%af%e4%bb%b6%e7%b3%bb%e7%bb%9f%e6%96%b9%e6%b3%95%ef%bc%88%e5%8c%85%e6%8b%ac%e7%a1%ac%e4%bb%b6%e8%b0%83","status":"publish","type":"post","link":"http:\/\/weizn.net\/?p=200","title":{"rendered":"Cisco ASA\u56fa\u4ef6\u7834\u89e3\u548c\u52a8\u6001\u8c03\u8bd5\u8f6f\u4ef6\u7cfb\u7edf\u65b9\u6cd5\uff08\u5305\u62ec\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff09"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_17 counter-hierarchy\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><i class=\"ez-toc-glyphicon ez-toc-icon-toggle\"><\/i><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/weizn.net\/?p=200\/#%E4%B8%80%E3%80%81%E8%99%9A%E6%8B%9F%E5%8C%96%E8%B0%83%E8%AF%95\" title=\"\u4e00\u3001\u865a\u62df\u5316\u8c03\u8bd5\">\u4e00\u3001\u865a\u62df\u5316\u8c03\u8bd5<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/weizn.net\/?p=200\/#Cisco_ASA_802%EF%BC%9A\" title=\"Cisco ASA 802\uff1a\">Cisco ASA 802\uff1a<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/weizn.net\/?p=200\/#ASA_842\" title=\"ASA 842:\">ASA 842:<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/weizn.net\/?p=200\/#%E4%BA%8C%E3%80%81%E7%A1%AC%E4%BB%B6%E8%B0%83%E8%AF%95\" title=\"\u4e8c\u3001\u786c\u4ef6\u8c03\u8bd5\">\u4e8c\u3001\u786c\u4ef6\u8c03\u8bd5<\/a><\/li><\/ul><\/nav><\/div>\n<p>\u7b14\u8005\u5728\u5b89\u5168\u5ba2\u4e0a\u7684\u4e24\u7bc7\u5bf9Cisco ASA\u519b\u706b\u5e93\u9006\u5411\u5206\u6790\u7684\u6587\u7ae0\uff1a<\/p>\n<p><a href=\"https:\/\/www.anquanke.com\/post\/id\/84614\"><a href=\"https:\/\/www.anquanke.com\/post\/id\/84614\">https:\/\/www.anquanke.com\/post\/id\/84614<\/a><\/a><\/p>\n<p><a href=\"https:\/\/www.anquanke.com\/post\/id\/85030\"><a href=\"https:\/\/www.anquanke.com\/post\/id\/85030\">https:\/\/www.anquanke.com\/post\/id\/85030<\/a><\/a><\/p>\n<p>\u4ee5\u53ca\u4e00\u4e2aASA\u653b\u51fb\u6846\u67b6\u7684\u9879\u76ee\uff1a<a href=\"https:\/\/github.com\/weizn11\/Cisco_ASA_Backdoor\"><a href=\"https:\/\/github.com\/weizn11\/Cisco_ASA_Backdoor\">https:\/\/github.com\/weizn11\/Cisco_ASA_Backdoor<\/a><\/a><\/p>\n<p>\u4f46\u524d\u7f6e\u6761\u4ef6\u662f\u8981\u6709\u5bf9ASA\u52a8\u6001\u8c03\u8bd5\u7684\u80fd\u529b\uff0c\u672c\u6587\u662f\u7b14\u8005\u5f53\u65f6\u4f7f\u7528\u7684ASA\u52a8\u6001\u8c03\u8bd5\u65b9\u6cd5\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 14px;\">Cisco ASA\u8c03\u8bd5\u53ef\u5206\u4e3a\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff0c\u5176\u4e2d\u786c\u4ef6\u8c03\u8bd5\u65b9\u6cd5\u53ef\u4ee5\u652f\u6301\u6240\u6709\u7248\u672c\u7684ASA\u7cfb\u7edf\uff0c\u865a\u62df\u5316\u8c03\u8bd5\u76ee\u524d\u53ea\u652f\u6301ASA 802\u548cASA 842\u4e24\u4e2a\u7248\u672c\uff0c\u4e3b\u8981\u539f\u56e0\u662f\u53ea\u6709\u8fd9\u4e24\u4e2a\u7248\u672c\u7684\u7cfb\u7edf\u652f\u6301\u865a\u62df\u5316\u73af\u5883\uff0c\u4e0b\u9762\u5206\u5f00\u8bb2\u89e3\u4e24\u79cd\u8c03\u8bd5\u65b9\u6cd5\u3002<\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">\u00a0<\/span><\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B8%80%E3%80%81%E8%99%9A%E6%8B%9F%E5%8C%96%E8%B0%83%E8%AF%95\"><\/span><span style=\"font-size: 18px;\"><span style=\"font-size: 18px;\"><strong>\u4e00\u3001\u865a\u62df\u5316\u8c03\u8bd5<\/strong><\/span><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Cisco_ASA_802%EF%BC%9A\"><\/span><span style=\"font-size: 14px;\">Cisco ASA 802\uff1a<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-size: 14px;\">#\u00a0<\/span><span style=\"font-size: 14px;\">binwalk -e asa802-k8.bin<\/span><\/p>\n<p><a id=\"ematt:439\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/f3cc1473346014.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-317\" title=\"f3cc1473346014\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/f3cc1473346014.jpg\" alt=\"f3cc1473346014\" width=\"1234\" height=\"206\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/f3cc1473346014.jpg 1234w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/f3cc1473346014-300x50.jpg 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/f3cc1473346014-1024x171.jpg 1024w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/f3cc1473346014-768x128.jpg 768w\" sizes=\"auto, (max-width: 1234px) 100vw, 1234px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px; line-height: 21px;\">\u89e3\u538b\u7684\u6587\u4ef6\u4e2d\u53ea\u7559\u4e0b1228B0\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\"># <\/span><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">rm -rf !(<\/span><span style=\"font-size: 14px; line-height: 21px; white-space: normal;\">1228B0<\/span><span style=\"font-size: 14px;\">)<\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\">cpio\u89e3\u538b\u6587\u4ef6\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">#\u00a0<\/span><span style=\"font-size: 14px;\">cpio -i &#8211;make-directories &lt; <\/span><span style=\"font-size: 14px;\">1<\/span><span style=\"font-size: 14px;\">228B0<\/span><span style=\"font-size: 14px;\"> \u00a0&#8211;no-absolute-filenames<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\"># rm\u00a0<\/span><span style=\"font-size: 14px; line-height: 21px; white-space: normal;\">1<\/span><span style=\"font-size: 14px; line-height: 21px; white-space: normal;\">228B0<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><a id=\"ematt:441\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/15601473346392.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-318\" title=\"15601473346392\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/15601473346392.jpg\" alt=\"15601473346392\" width=\"978\" height=\"130\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/15601473346392.jpg 978w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/15601473346392-300x40.jpg 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/15601473346392-768x102.jpg 768w\" sizes=\"auto, (max-width: 978px) 100vw, 978px\" \/><\/a><\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u00a0<\/span><\/p>\n<p><span style=\"font-size: 14px; line-height: 21px;\"><span style=\"font-size: 14px;\">vim\u7f16\u8f91etc\/init.d\/rcS\u6587\u4ef6\uff0c\u5c06\u6700\u540e\u4e00\u884c\u6ce8\u91ca\u540e\uff0c\u6539\u4e3a\/bin\/sh<\/span><span style=\"font-size: 14px;\">\uff1a<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px; line-height: 21px;\"><a id=\"ematt:443\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/799b1473346702.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-319\" title=\"799b1473346702\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/799b1473346702.jpg\" alt=\"799b1473346702\" width=\"690\" height=\"194\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/799b1473346702.jpg 690w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/799b1473346702-300x84.jpg 300w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/a><br \/>\n<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u00a0<\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">\u5c06vmlinuz\u6587\u4ef6copy\u51fa\u6765\u4f5c\u4e3aGNS3\u4e2d\u7684<\/span><span style=\"font-size: 14px;\">\u5185<\/span><span style=\"font-size: 14px;\">\u6838\u542f\u52a8\u6587\u4ef6\uff0c\u7136\u540e\u628a\u6b64\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u7528cpio\u6253\u5305\u4e3agz\u6587\u4ef6<\/span><span style=\"font-size: 14px;\">\uff1a<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><a id=\"ematt:445\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/d0091473346957.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-320\" title=\"d0091473346957\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d0091473346957.jpg\" alt=\"d0091473346957\" width=\"902\" height=\"77\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d0091473346957.jpg 902w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d0091473346957-300x26.jpg 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d0091473346957-768x66.jpg 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/a><br \/>\n<\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">#\u00a0<\/span><span style=\"font-size: 14px;\">cp vmlinuz ..\/asa802-k8.kernel<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">#\u00a0<\/span><span style=\"font-size: 14px;\">find . | cpio -o -H newc | gzip -9 &gt; ..\/asa802-k8.gz<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u5c06\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5bfc\u5165\u5230GNS3\u4e2d\uff0c\u5176\u4e2dqemu\u4f7f\u75280.13.0\u7248\u672c\uff0cNetwork type\u9009\u62e9pcnet\uff0c\u5e76\u52fe\u9009\u662f\u7528legacy\u7f51\u7edc\u6a21\u5f0f\u3002\u9ad8\u7ea7\u8bbe\u7f6e\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\"><a id=\"ematt:451\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/032b1473347568.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-321\" title=\"032b1473347568\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/032b1473347568.jpg\" alt=\"032b1473347568\" width=\"597\" height=\"487\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/032b1473347568.jpg 597w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/032b1473347568-300x245.jpg 300w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/a><br \/>\n<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u5176\u4e2dKernel\u547d\u4ee4\u4e3a\uff1a\u00a0<\/span><span style=\"font-size: 14px;\">console=ttyS0,9600n8 bigphysarea=16384 auto nousb ide1=noprobe hda=980,16,32<\/span><\/p>\n<p><span style=\"font-size: 14px;\">Options\uff1a\u00a0<\/span><span style=\"font-size: 14px;\">-hdachs 980,16,32 -vnc :1 -serial telnet:192.168.75.1:1111,server,nowait<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u6ce8\u610f\uff1aOptions\u4e2d\u7684\u4e32\u53e3\u8bbe\u7f6e\u9700\u8981\u548cgns3\u00a0<\/span><span style=\"font-size: 14px;\">s<\/span><span style=\"font-size: 14px;\">e<\/span><span style=\"font-size: 14px;\">r<\/span><span style=\"font-size: 14px;\">v<\/span><span style=\"font-size: 14px;\">e<\/span><span style=\"font-size: 14px;\">r\u7684IP\u5730\u5740\u4e00\u81f4\u3002<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u914d\u7f6e\u597d\u540e\u542f\u52a8\uff0c\u53d1\u73b0\u8fdb\u5165\u4e86ASA\u5e95\u5c42Linux\u7cfb\u7edf\uff1a<\/span><\/p>\n<p><a id=\"ematt:449\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/18e21473347518.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-322\" title=\"18e21473347518\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/18e21473347518.jpg\" alt=\"18e21473347518\" width=\"909\" height=\"421\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/18e21473347518.jpg 909w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/18e21473347518-300x139.jpg 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/18e21473347518-768x356.jpg 768w\" sizes=\"auto, (max-width: 909px) 100vw, 909px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">Cisco<br \/>\nASA\u9632\u706b\u5899\u7684\u6574\u4e2a\u52a0\u8f7d\u6d41\u7a0b\u5982\u4e0b\u56fe\uff1a<\/span><\/p>\n<p><a id=\"ematt:453\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/15601474963261.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-323\" title=\"15601474963261\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/15601474963261.jpg\" alt=\"15601474963261\" width=\"910\" height=\"991\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/15601474963261.jpg 910w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/15601474963261-275x300.jpg 275w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/15601474963261-768x836.jpg 768w\" sizes=\"auto, (max-width: 910px) 100vw, 910px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u5728\u8fd9\u91cc\u6211\u4eec\u66f4\u52a0\u5173\u5fc3\u7684\u5c06\u662f\u6700\u540e\u4e09\u4e2a\u6b65\u9aa4\uff0c<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">rcS<\/span><span style=\"font-size: 14px;\">\u4f5c\u4e3a\u4e00\u4e2a<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">shell<\/span><span style=\"font-size: 14px;\">\u811a\u672c\u63a7\u5236\u7740<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">lina_monitor<\/span><span style=\"font-size: 14px;\">\u7684\u542f\u52a8\u65b9\u5f0f\uff0c\u5982\u4f20\u5165\u7684\u53c2\u6570\u63a7\u5236\uff0c<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">lina_monitor<\/span><span style=\"font-size: 14px;\">\u4ee5\u521b\u5efa\u5b50\u8fdb\u7a0b\u7684\u65b9\u5f0f\u542f\u52a8<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">lina<\/span><span style=\"font-size: 14px;\">\u7a0b\u5e8f\uff0c\u5e76\u5bf9<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">lina<\/span><span style=\"font-size: 14px;\">\u8fdb\u7a0b\u8fdb\u884c\u76d1\u89c6\u548c\u7ba1\u63a7\u3002\u5176\u4e2d<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">lina<\/span><span style=\"font-size: 14px;\">\u5c31\u662f<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">Cisco ASA<\/span><span style=\"font-size: 14px;\">\u9632\u706b\u5899\u7684\u4e3b\u7a0b\u5e8f\uff0c\u57fa\u672c\u5305\u542b\u4e86<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">ASA<\/span><span style=\"font-size: 14px;\">\u6240\u6709\u7684\u4e1a\u52a1\u903b\u8f91\u4ee3\u7801\uff0c\u5728\u7cfb\u7edf\u5185\u5b58\u4e2d\uff0c<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">lina<\/span><span style=\"font-size: 14px;\">\u5c06<\/span><span lang=\"EN-US\" style=\"font-size: 14px;\">fork<\/span><span style=\"font-size: 14px;\">\u591a\u4e2a\u5b50\u8fdb\u7a0b\u534f\u540c\u5de5\u4f5c\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/span><\/p>\n<p><a id=\"ematt:455\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/799b1474963290.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-324\" title=\"799b1474963290\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/799b1474963290.jpg\" alt=\"799b1474963290\" width=\"631\" height=\"323\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/799b1474963290.jpg 631w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/799b1474963290-300x154.jpg 300w\" sizes=\"auto, (max-width: 631px) 100vw, 631px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u5bf9PID\u4e3a221\u7684\u8fdb\u7a0b\u8fdb\u884c\u8c03\u8bd5\uff0c\u5b9e\u9a8c\u8bc1\u660e\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528lina_monitor\u5f00\u542fgdbserver\uff0cgdbserver\u4f1a\u88abattach\u5230lina\u7684\u5b50\u8fdb\u7a0b\u4e0a\uff0c\u65e0\u6cd5\u51c6\u786e\u7684\u63a5\u6536\u5230\u4fe1\u53f7\uff0c\u9700\u8981\u5728lina\u5df2\u7ecf\u542f\u52a8\u540e\uff0c<\/span>\u5728\u7528gdbserver attach\u5230\u76f8\u5173\u8fdb\u7a0b\u4e0a\uff0c\u901a\u8fc7\u81ea\u5df1\u7f16\u5199\u7684\u7a0b\u5e8f\u8f85\u52a9\u5b9e\u73b0\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include &lt;unistd.h&gt;\n\n#define BUF_SIZE 10000\n\nchar *cmd = \\\n\"en\\n\"\n\"\\n\"\n\"conf t\\n\"\n\"int e0\/0\\n\"\n\"nameif outside\\n\"\n\"ip addr %s 255.255.255.224\\n\"\n\"no shut\\n\"\n\"exit\\n\"\n\"router rip\\n\"\n\"network 10.0.0.33\\n\"\n\"exit\\n\"\n\n\"snmp-server host outside 10.0.0.2 community public\\n\"\n\"snmp-server community public\\n\"\n\"snmp-server enable traps syslog\\n\"\n\"route outside 0 0 10.0.0.33\\n\"\n\"end\\n\"\n\"ping 10.0.0.2\\n\";\n\nint main(int argc, char *argv[])\n{\nint i;\nint pid;\nint exitVal;\nint rdPipe[2], wrPipe[2];\nchar *pBuf = NULL;\nchar *confBuf = NULL;\nFILE *cmdResults = NULL;\n\nconfBuf = (char *)malloc(2000);\nmemset(confBuf, 0x00, 2000);\n\nsprintf(confBuf, cmd, argv[1]);\n\nprintf(\"[+] cmdline: \");\nfor(i=0; i&lt;argc; i++)\n{\nprintf(\"%s \", argv[i]);\n}\nputs(\"\");\n\n\/\/create pipe\nif(pipe(rdPipe)!=0 || pipe(wrPipe)!=0)\n{\nprintf(\"[-] Create pipe failed.\\n\");\nreturn -1;\n}\n\npid = fork();\nif(pid == 0)\n{\nclose(rdPipe[0]);\nclose(wrPipe[1]);\n\n\/\/dup2(rdPipe[1], STDOUT_FILENO);\ndup2(wrPipe[0], STDIN_FILENO);\n\npid = fork();\nif(pid == 0)\n{\nprintf(\"[+] launch lina...\\n\");\nexecl(\"\/asa\/bin\/lina\", \"\/asa\/bin\/lina\", \"-s\", NULL);\n}\n\nexit(0);\n}\n\nwait(&amp;exitVal);\n\nclose(rdPipe[1]);\nclose(wrPipe[0]);\n\nusleep(1000*1000*7);\nprintf(\"%s\\n\", confBuf);\nwrite(wrPipe[1], confBuf, strlen(confBuf));\n\nusleep(1000*1000*5);\n\npBuf = (char *)malloc(BUF_SIZE);\nmemset((void *)pBuf, NULL, BUF_SIZE);\n\ncmdResults = popen(\"ls -l \/proc\/\", \"r\");\nfread(pBuf, sizeof(char), BUF_SIZE - 1, cmdResults);\nprintf(\"%s\", pBuf);\n\nfclose(cmdResults);\nfree(pBuf);\nfree(confBuf);\n\nexecl(\"\/bin\/gdbserver\", \"\/bin\/gdbserver\", \"\/dev\/ttyS1\", \"--attach\", \"222\", NULL);\n\n\/*-------------------------------------------------------------------------------------------------*\/\n\nreturn 0;\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u7f16\u8bd1\u547d\u4ee4\u4e3a\uff1agcc -o launcher\u00a0launcher.c -Wl,&#8211;hash-style=sysv<\/p>\n<h3 style=\"white-space: nowrap;\"><span class=\"ez-toc-section\" id=\"ASA_842\"><\/span><span style=\"font-size: 14px;\">ASA 842:<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"white-space: nowrap;\"><span style=\"font-size: 14px;\">1.\u5236\u4f5cvmlinuz\u6587\u4ef6\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u5148\u5c06.bin\u6587\u4ef6\u5bfc\u51fa\u4e3a\u5341\u516d\u8fdb\u5236\u6587\u4ef6\uff1a<\/span><\/p>\n<p><a id=\"ematt:457\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/d0091474964196.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-325\" title=\"d0091474964196\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d0091474964196.jpg\" alt=\"d0091474964196\" width=\"764\" height=\"77\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d0091474964196.jpg 764w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d0091474964196-300x30.jpg 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u5728\u6587\u4ef6\u4e2d\u67e5\u627e\u5173\u952e\u5b57\u201cbooting\u201d\uff1a<\/span><\/p>\n<p><a id=\"ematt:461\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/032b1474964378.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-326\" title=\"032b1474964378\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/032b1474964378.jpg\" alt=\"032b1474964378\" width=\"808\" height=\"80\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/032b1474964378.jpg 808w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/032b1474964378-300x30.jpg 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/032b1474964378-768x76.jpg 768w\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u5b9a\u4f4d\u5230\u76f8\u5e94\u7684\u884c\uff1a<\/span><\/p>\n<p><a id=\"ematt:463\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/18e21474964499.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-327\" title=\"18e21474964499\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/18e21474964499.jpg\" alt=\"18e21474964499\" width=\"722\" height=\"196\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/18e21474964499.jpg 722w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/18e21474964499-300x81.jpg 300w\" sizes=\"auto, (max-width: 722px) 100vw, 722px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u5c06\u4e0a\u56fe\u6240\u793a\u7684\u7279\u5f81\u884c\u4f5c\u4e3avmlinuz\u6587\u4ef6\u7684\u8d77\u59cb\u5730\u5740\uff0c\u8bb0\u5f55\u4e0b\u6b64\u5730\u5740\u3002\u5728\u4eceasa.hex\u6587\u4ef6\u4e2d\u67e5\u627e\u5173\u952e\u5b57\u201crootfs.img\u201d\uff1a<\/span><\/p>\n<p><a id=\"ematt:465\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/fe5d1474964653.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-328\" title=\"fe5d1474964653\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/fe5d1474964653.jpg\" alt=\"fe5d1474964653\" width=\"765\" height=\"61\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/fe5d1474964653.jpg 765w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/fe5d1474964653-300x24.jpg 300w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u5b9a\u4f4d\u5230\u76f8\u5e94\u7684\u884c\uff1a<\/span><\/p>\n<p><a id=\"ematt:467\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/8cda1474964810.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-329\" title=\"8cda1474964810\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/8cda1474964810.jpg\" alt=\"8cda1474964810\" width=\"732\" height=\"146\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/8cda1474964810.jpg 732w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/8cda1474964810-300x60.jpg 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u5c06\u4e0a\u56fe\u6240\u793a\u7684\u7279\u5f81\u884c\u4f5c\u4e3avmlinuz\u6587\u4ef6\u7684\u672b\u5c3e\u5730\u5740\uff08\u4e0d\u5305\u542b\u6b64\u884c\uff09\uff0c\u8bb0\u5f55\u4e0b\u5730\u5740\uff0c\u4f7f\u7528dd\u547d\u4ee4\u5c06\u6b64\u6bb5\u6587\u4ef6\u5185\u5bb9\u5bfc\u51fa\u4e3avmlinuz\u6587\u4ef6\uff1a<\/span><\/p>\n<p><a id=\"ematt:469\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/30e61474965111.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-330\" title=\"30e61474965111\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/30e61474965111.jpg\" alt=\"30e61474965111\" width=\"1085\" height=\"90\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/30e61474965111.jpg 1085w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/30e61474965111-300x25.jpg 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/30e61474965111-1024x85.jpg 1024w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/30e61474965111-768x64.jpg 768w\" sizes=\"auto, (max-width: 1085px) 100vw, 1085px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">2.\u89e3\u538bASA\u7cfb\u7edf\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u4f7f\u7528binwalk -e\u89e3\u538b\u51farootfs.img\u6587\u4ef6\uff0c\u5c06\u5176\u5b83\u90fd\u5220\u9664\uff1a<\/span><\/p>\n<p><a id=\"ematt:471\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/ae561474974226.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-331\" title=\"ae561474974226\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/ae561474974226.jpg\" alt=\"ae561474974226\" width=\"1240\" height=\"273\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/ae561474974226.jpg 1240w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/ae561474974226-300x66.jpg 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/ae561474974226-1024x225.jpg 1024w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/ae561474974226-768x169.jpg 768w\" sizes=\"auto, (max-width: 1240px) 100vw, 1240px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u4f7f\u7528\u4e0b\u5217\u547d\u4ee4\u89e3\u538b\u51falinux\u7cfb\u7edf\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\">$\u00a0cpio -i &#8211;make-directories &lt; rootfs.img &#8211;no-absolute-filenames<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u7f16\u8f91\u201c\/asa\/scripts\/rcS\u201d\u811a\u672c\uff0c\u6539\u52a8\u5982\u4e0b\u56fe\uff1a<\/span><\/p>\n<p><a id=\"ematt:473\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201609\/62bf1474974432.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-332\" title=\"62bf1474974432\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/62bf1474974432.jpg\" alt=\"62bf1474974432\" width=\"892\" height=\"688\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/62bf1474974432.jpg 892w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/62bf1474974432-300x231.jpg 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/62bf1474974432-768x592.jpg 768w\" sizes=\"auto, (max-width: 892px) 100vw, 892px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u6700\u540e\u4f7f\u7528\u4e0b\u5217\u547d\u4ee4\u6253\u5305\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\">$\u00a0find . | cpio -o -H newc | gzip -9 &gt; ..\/asa842.gz<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u5728GNS3\u4e2d\uff0c\u6a21\u62df\u6240\u9700\u7684\u547d\u4ee4\u5982\u4e0b\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\">Kernel cmdline:\u00a0ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536 ide1=noprobe no-hlt<\/span><\/p>\n<p><span style=\"font-size: 14px;\">Options:\u00a0-icount auto -hdachs 980,16,32 -vga none -vnc none -serial telnet:192.168.56.1:3333,server,nowait<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u8fdb\u5165Cisco ASA 842\u7684linux\u7cfb\u7edf\u540e\uff0c\u4f7f\u7528\u4e0b\u5217\u547d\u4ee4\u6b63\u5e38\u542f\u52a8ASA\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\">$ .\/lina -t -e eth0 -e eth1 -e eth2 -e eth3<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u4f7f\u7528\u4e0b\u5217\u547d\u4ee4\u542f\u52a8gdbserver:<\/span><\/p>\n<p><span style=\"font-size: 14px;\">$ gdbserver \/dev\/ttyS1 \/asa\/bin\/lina -t -g -l -e\u00a0<\/span><span style=\"white-space: normal; font-size: 14px;\">eth0 -e eth1 -e eth2 -e eth3<\/span><\/p>\n<p><span style=\"white-space: normal;\">\u00a0<\/span><\/p>\n<p><span style=\"font-size: 14px;\">Refer:\u00a0<\/span><\/p>\n<p><span style=\"font-size: 14px;\"><a href=\"http:\/\/www.bearmr.com\/index.php\/repack-gns3-asa842-asa904\/\">http:\/\/www.bearmr.com\/index.php\/repack-gns3-asa842-asa904\/<\/a><\/span><\/p>\n<h2 style=\"white-space: normal;\"><span class=\"ez-toc-section\" id=\"%E4%BA%8C%E3%80%81%E7%A1%AC%E4%BB%B6%E8%B0%83%E8%AF%95\"><\/span><span style=\"font-size: 14px;\"><strong><span style=\"font-size: 18px;\">\u4e8c\u3001\u786c\u4ef6\u8c03\u8bd5<\/span><\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">\u4ee5\u4e0b\u4f7f\u7528ASA 922-4\u7248\u672c\u7684\u56fa\u4ef6\u4f5c\u4e3a\u6f14\u793a\uff0c\u4e3b\u8981\u6d41\u7a0b\u53ef\u5f52\u4e3a\u4e09\u6b65\uff1a<\/span><br \/>\n<span style=\"font-size: 14px;\">1\uff09\u89e3\u538bASA\u56fa\u4ef6\u4e2d\u7684Linux\u7cfb\u7edf\u3002<\/span><br \/>\n<span style=\"font-size: 14px;\">2\uff09\u4fee\u6539Linux\u7cfb\u7edf\u4e2d\u542f\u52a8ASA\u7684\u6d41\u7a0b\uff0c\u4f7f\u5176\u8fdb\u5165\u5230\u8c03\u8bd5\u6a21\u5f0f\u3002<\/span><br \/>\n<span style=\"font-size: 14px;\">3\uff09\u91cd\u65b0\u6253\u5305\u56fa\u4ef6\uff0c\u5237\u5165ASA\u786c\u4ef6\u8bbe\u5907\uff0c\u901a\u8fc7\u4e32\u53e3\u8c03\u8bd5\u3002<\/span><br \/>\n<span style=\"font-size: 14px;\">\u8be6\u7ec6\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/span><\/span><\/p>\n<p style=\"white-space: normal;\"><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">1. \u901a\u8fc7binwalk\u5206\u6790\u548c\u89e3\u538b\u56fa\u4ef6\u6587\u4ef6\u7ed3\u6784\uff1a<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">$ binwalk -e asa922-4-k8.bin<\/span><br \/>\n<a id=\"ematt:525\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/4a471539083107.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-333\" title=\"4a471539083107\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/4a471539083107.png\" alt=\"4a471539083107\" width=\"1253\" height=\"214\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/4a471539083107.png 1253w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/4a471539083107-300x51.png 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/4a471539083107-1024x175.png 1024w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/4a471539083107-768x131.png 768w\" sizes=\"auto, (max-width: 1253px) 100vw, 1253px\" \/><\/a><br \/>\n<\/span><\/p>\n<p style=\"white-space: normal;\"><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">2. \u53ea\u4fdd\u7559\u89e3\u538b\u540e\u7684rootfs.img\u6587\u4ef6\uff0c\u5220\u9664\u5176\u4f59\u7684\uff1a<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">$ rm \u2013rf !(rootfs.img)<\/span><br \/>\n<span style=\"font-size: 14px;\">3. \u4f7f\u7528cpio\u547d\u4ee4\u5c06rootfs.img\u4e2d\u7684linux\u7cfb\u7edf\u6587\u4ef6\u89e3\u538b\u51fa\u6765\uff1a<\/span><br \/>\n<span style=\"font-size: 14px;\">$ cpio -i &#8211;make-directories &lt; rootfs.img &#8211;no-absolute-filenames<\/span><br \/>\n<a id=\"ematt:527\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/fb5c1539083267.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-334\" title=\"fb5c1539083267\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/fb5c1539083267.png\" alt=\"fb5c1539083267\" width=\"1209\" height=\"89\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/fb5c1539083267.png 1209w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/fb5c1539083267-300x22.png 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/fb5c1539083267-1024x75.png 1024w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/fb5c1539083267-768x57.png 768w\" sizes=\"auto, (max-width: 1209px) 100vw, 1209px\" \/><\/a><br \/>\n<\/span><\/p>\n<p style=\"white-space: normal;\"><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">4. \u5220\u9664\u955c\u50cf\u6587\u4ef6rootfs.img:<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">$ rm rootfs.img<\/span><\/span><\/p>\n<p style=\"white-space: normal;\"><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">5. \u6b64\u65f6\u9700\u8981\u4fee\u6539ASA\u5e95\u5c42Linux\u7cfb\u7edf\u4e2d\u7684\u5f15\u5bfc\u987a\u5e8f\uff0c\u7f16\u8f91\/asa\/scripts\/rcS\u811a\u672c\uff0c\u6dfb\u52a0\u8fdb\u5165console\u547d\u4ee4\u884c\u7684\u8bed\u53e5\uff1a<\/span><\/span><span style=\"font-size: 14px;\"><a id=\"ematt:529\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/10fb1539083269.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-335\" title=\"10fb1539083269\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/10fb1539083269.png\" alt=\"10fb1539083269\" width=\"668\" height=\"105\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/10fb1539083269.png 668w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/10fb1539083269-300x47.png 300w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><\/a><br \/>\n<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u6ce8\u91ca\u6389\u540e\u7eed\u53ef\u80fd\u4f1a\u5f71\u54cd\u6211\u4eec\u63a7\u5236\u6d41\u7a0b\u7684\u4ee3\u7801\uff1a<\/span><\/p>\n<p><span style=\"font-size: 14px;\"><a id=\"ematt:531\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/09dd1539083271.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-336\" title=\"09dd1539083271\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/09dd1539083271.png\" alt=\"09dd1539083271\" width=\"915\" height=\"103\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/09dd1539083271.png 915w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/09dd1539083271-300x34.png 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/09dd1539083271-768x86.png 768w\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" \/><\/a><\/span><\/p>\n<p style=\"white-space: normal;\"><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">6. \u5728\u6b64Linux\u7cfb\u7edf\u4e2d\u9700\u8981\u5199\u4e00\u4e2a\u542f\u52a8\u5668\u6765\u6267\u884c\u6211\u4eec\u671f\u671b\u7684\u6d41\u7a0b\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5199\u597d\u7684\u542f\u52a8\u5668\uff0c\u5176\u4e2d\u4e00\u4e9b\u4ee3\u7801\u53ef\u80fd\u653e\u5728\u5728\u4e0d\u540c\u7248\u672c\u7684ASA\u4e2d\u9700\u8981\u505a\u4e00\u4e9b\u4fee\u6539\uff1a<\/span><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><span style=\"font-size: 14px;\">1\uff09 \u5728\u8fdb\u5165gdbserver\u8fdb\u884c\u8c03\u8bd5\u65f6\uff0c\u9700\u8981\u6307\u660egdbserver\u5730\u5740\uff0c\u4e0d\u540c\u7248\u672cASA\u7684gdbserver\u53ef\u80fd\u4e0d\u540c\u3002\u6b64\u5916\uff0c\u542f\u52a8ASA\u4e3b\u7a0b\u5e8flina\u540e\uff0c\u5141\u8bb8\u5411lina\u5199\u5165\u914d\u7f6e\u547d\u4ee4\uff0c\u53ef\u66f4\u6539\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><br \/>\n<\/span><\/p>\n<div><a id=\"ematt:533\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/82661539083272.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-337\" title=\"82661539083272\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/82661539083272.png\" alt=\"82661539083272\" width=\"550\" height=\"39\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/82661539083272.png 550w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/82661539083272-300x21.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><\/div>\n<div>\n<p><span style=\"font-size: 14px;\">2\uff09 \u8fdb\u5165gdbserver\u8c03\u8bd5\u524d\u9700\u8981\u5173\u95ed\u5f53\u524d\u5360\u7528\u4e32\u53e3\u7684\u8fdb\u7a0b\uff0c\u4e00\u822c\u4e3aASA\u4e2d\u63a7\u5236\u6d41\u7a0b\u7684\u811a\u672c\u548cconsole\u8fdb\u7a0b\uff0c\u5728\u4e0d\u540c\u7248\u672c\u7684ASA\u4e2d\u8fdb\u7a0b\u540d\u53ef\u80fd\u4e0d\u4e00\u6837\uff0c\u9700\u8981\u505a\u76f8\u5e94\u4fee\u6539\uff0c\u5173\u95ed\u987a\u5e8f\u548c\u6b64\u5217\u8868\u4e2d\u7684\u987a\u5e8f\u76f8\u540c\uff0c\u540d\u79f0\u5fc5\u987b\u548c&#8221;\/proc\/pid\/cmdline&#8221;\u4e2d\u7684\u5185\u5bb9\u76f8\u540c\uff0c\u6539\u52a8\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<div><a id=\"ematt:535\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/f19c1539083274.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-338\" title=\"f19c1539083274\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/f19c1539083274.png\" alt=\"f19c1539083274\" width=\"528\" height=\"27\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/f19c1539083274.png 528w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/f19c1539083274-300x15.png 300w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><\/a><\/div>\n<p><span style=\"font-size: 14px;\">3\uff09 \u4f7f\u7528launcher\u6765\u63a7\u5236ASA\u542f\u52a8\u6d41\u7a0b\uff0c\u6709\u53ef\u9009\u53c2\u6570\uff0c\u201d-d\u201d\u53c2\u6570\u53ef\u4f7fASA\u7cfb\u7edf\u5728\u540e\u53f0\u8fd0\u884c\uff0c\u901a\u8fc7lina_monitor\u542f\u52a8\u4e3b\u7a0b\u5e8flina\uff0c\u4e0d\u540c\u7248\u672c\u7684lina_monitor\u4f20\u5165\u53c2\u6570\u4e0d\u4e00\u5b9a\u4e00\u6837\uff0c\u9700\u8981\u505a\u76f8\u5173\u9002\u914d\uff0c\u542f\u52a8\u65f6\u53ef\u4fee\u6539\u4f20\u5165\u53c2\u6570\uff1a<\/span><\/p>\n<div><a id=\"ematt:537\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/9eb91539083276.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-339\" title=\"9eb91539083276\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/9eb91539083276.png\" alt=\"9eb91539083276\" width=\"708\" height=\"238\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/9eb91539083276.png 708w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/9eb91539083276-300x101.png 300w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/a><\/div>\n<\/div>\n<p><span style=\"font-size: 14px;\">4\uff09 launcher\u4e2d\u201d-o\u201d\u53c2\u6570\u5141\u8bb8\u76f4\u63a5\u5728\u540e\u53f0\u542f\u52a8lina\u8fdb\u7a0b\uff0c\u4e0d\u7528\u901a\u8fc7lina_monitor\u542f\u52a8lina\uff0c\u53ef\u4ee5\u76f4\u63a5\u5411lina\u4e2d\u4f20\u5165\u53c2\u6570\u3002\u5728lina\u4e2d\u6709\u4e00\u4e2a\u9690\u85cf\u53c2\u6570\u201d-s\u201d\uff0c\u53ef\u4f7flina\u8fdb\u7a0b\u4e2d\u4e0d\u521b\u5efa\u591a\u7ebf\u7a0b\uff0c\u4ec5\u4ee5\u5355\u7ebf\u7a0b\u5de5\u4f5c\uff0c\u5176\u4e2d\u201d-p\u201d\u53c2\u6570\u6307\u5b9alina\u7684\u7236\u8fdb\u7a0bPID\uff0c\u90e8\u5206\u7248\u672c\u7684lina\u5728\u53d1\u73b0\u7236\u8fdb\u7a0b\u4e0d\u662flina_monitor\u540e\u4f1a\u5411\u7236\u8fdb\u7a0bPID\u53d1\u9001\u7ec8\u6b62\u4fe1\u53f7\uff0c\u9020\u6210\u7236\u8fdb\u7a0b\u5173\u95ed\uff0c\u6b64\u5904\u9700\u8981\u6ce8\u610f\u5728\u8c03\u8bd5\u65f6\u53ef\u80fd\u9020\u6210\u7684\u5176\u5b83\u95ee\u9898\u3002\u4fee\u6539\u5411lina\u4f20\u5165\u53c2\u6570\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<p><a id=\"ematt:539\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/602e1539083278.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-340\" title=\"602e1539083278\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/602e1539083278.png\" alt=\"602e1539083278\" width=\"794\" height=\"374\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/602e1539083278.png 794w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/602e1539083278-300x141.png 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/602e1539083278-768x362.png 768w\" sizes=\"auto, (max-width: 794px) 100vw, 794px\" \/><\/a><\/p>\n<p>5\uff09 launcher\u4e0d\u52a0\u53c2\u6570\u76f4\u63a5\u8fd0\u884c\u4f1a\u542f\u52a8lina_monitor\u7684\u8c03\u8bd5\u6a21\u5f0f\u5bf9lina\u8fdb\u884c\u8c03\u8bd5\uff0c\u8fd9\u91cc\u53ef\u4ee5\u6709\u4e24\u79cd\u9009\u62e9\uff0c\u4f7f\u7528lina_monitor\u542f\u52a8gdbserver\u6216\u76f4\u63a5\u542f\u52a8gdbserver\uff0c\u90e8\u5206\u7248\u672c\u5fc5\u987b\u8981\u7528gdbserver\u76f4\u63a5\u542f\u52a8lina\uff0c\u53ef\u4fee\u6539\u76f8\u5173\u4ee3\u7801\uff1a<\/p>\n<p><a id=\"ematt:541\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/7afb1539083281.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-341\" title=\"7afb1539083281\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/7afb1539083281.png\" alt=\"7afb1539083281\" width=\"992\" height=\"409\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/7afb1539083281.png 992w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/7afb1539083281-300x124.png 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/7afb1539083281-768x317.png 768w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><\/a><\/p>\n<p>6\uff09 launcher\u4f7f\u7528\u201d-a\u201d\u53c2\u6570\u53ef\u8ba9gdbserver attach\u5230\u6307\u5b9aPID\u7684\u8fdb\u7a0b\u4e0a\u8fdb\u884c\u8c03\u8bd5\uff0c\u201d-a\u201d\u53c2\u6570\u63a5\u6536\u8fdb\u7a0bPID\u3002<br \/>\n7\uff09 gcc\u7f16\u8bd1launcher\uff0c\u5728ASA 832\u7248\u672c\u4e4b\u524dlinux\u7684glibc\u7248\u672c\u4e3a2.3.2\uff0c\u4eceASA 842\u5f00\u59cb\u4f7f\u7528\u7684glibc\u7248\u672c\u4e3a2.9\u3002\u5728\u9ad8\u7248\u672c\u7684glibc\u73af\u5883\u4e2d\u7f16\u8bd1\u7684\u7a0b\u5e8f\u53ef\u80fd\u65e0\u6cd5\u5728glibc 2.3.2\u73af\u5883\u4e2d\u8fd0\u884c\uff0c\u539f\u56e0\u662f\u8c03\u7528\u7684\u5e93\u51fd\u6570\u7248\u672c\u53ef\u80fd\u65e0\u6cd5\u5339\u914d\uff0c\u6b64\u5916\uff0c\u5728glibc 2.3.2\u4e2d\u65e0\u6808\u4fdd\u62a4\u9009\u9879\uff0c\u800c\u5728glibc 2.9\u4e2d\u9ed8\u8ba4\u4f1a\u5f00\u542f\u6808\u4fdd\u62a4\uff0c\u56e0\u6b64\u9ad8\u7248\u672c\u7684glibc\u7f16\u8bd1\u7684\u7a0b\u5e8f\u5728\u4f4e\u7248\u672cglibc\u73af\u5883\u4e2d\u8fd0\u884c\uff0c\u9664\u4e86\u4fdd\u8bc1\u51fd\u6570\u8c03\u7528\u7b26\u53f7\u8868\u5728\u4f4e\u7248\u672cglibc\u4e2d\u53ef\u88ab\u5339\u914d\u5230\u4ee5\u5916\uff0c\u8fd8\u9700\u8981\u5173\u95ed\u6808\u4fdd\u62a4\u9009\u9879\u3002\u53ef\u7528nm\u547d\u4ee4\u67e5\u770b\u7a0b\u5e8f\u4e2d\u7684\u7b26\u53f7\u4fe1\u606f\uff0c\u4ee5\u786e\u8ba4glibc\u7248\u672c\u662f\u5426\u5339\u914d\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u7f16\u8bd1\uff1a<br \/>\n$ gcc -o launcher launcher.c -Wl,&#8211;hash-style=sysv -zexecstack -fno-stack-protector<br \/>\nlauncher\u5728\u63a5\u7ba1\u63a7\u5236\u6d41\u7a0b\u540e\uff0c\u4e0d\u4f1a\u5728console\u4e2d\u8f93\u51fa\u65e5\u5fd7\u4fe1\u606f\uff0c\u5176\u8f93\u51fa\u6d41\u88ab\u91cd\u5b9a\u5411\u5230\/mnt\/disk0\/launcher.log\u548c\/mnt\/disk0\/debug.log\u6587\u4ef6\u4e2d\u3002<\/p>\n<ol start=\"7\">\n<li>\u5c06\u7f16\u8bd1\u597d\u7684launcher\u653e\u5230\/bin\/\u76ee\u5f55\u4e0b\uff0c\u4f7f\u7528cpio\u5c06linux\u7cfb\u7edf\u6587\u4ef6\u8fdb\u884c\u6253\u5305\uff1a<\/li>\n<\/ol>\n<p>$ find . | cpio -o -H newc &gt; ..\/rootfs.img<br \/>\n<a id=\"ematt:543\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/586e1539083285.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-342\" title=\"586e1539083285\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/586e1539083285.png\" alt=\"586e1539083285\" width=\"809\" height=\"50\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/586e1539083285.png 809w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/586e1539083285-300x19.png 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/586e1539083285-768x47.png 768w\" sizes=\"auto, (max-width: 809px) 100vw, 809px\" \/><\/a><\/p>\n<p>8.\u7531\u4e8e\u5728linux\u7cfb\u7edf\u4e2d\u6dfb\u52a0\u4e86\u6587\u4ef6\uff0c\u5bfc\u81f4\u91cd\u65b0\u538b\u7f29\u6b64\u955c\u50cf\u540e\uff0c\u538b\u7f29\u6587\u4ef6\u5927\u5c0f\u4f1a\u589e\u957f\uff0c\u7136\u800c\u5728ASA bin\u56fa\u4ef6\u4e2d\uff0c\u591a\u5904\u5185\u90e8\u8c03\u7528\u7684\u5730\u5740\u5df2\u88ab\u5199\u6b7b\uff0c\u6240\u4ee5\u968f\u610f\u589e\u5927\u56fa\u4ef6\u4e2d\u7684\u90e8\u5206\u5185\u5bb9\u957f\u5ea6\uff0c\u4f1a\u9020\u6210\u5f88\u591a\u5176\u5b83\u95ee\u9898\uff0c\u56e0\u6b64\u4e0d\u80fd\u589e\u5927\u538b\u7f29\u540e\u7684\u7cfb\u7edf\u6587\u4ef6\u5927\u5c0f\u3002\u7ecf\u6d4b\u8bd5\u53d1\u73b0\uff0c\u5bf9\u4e8e\u955c\u50cf\u6587\u4ef6rootfs.img\uff0cASA\u56fa\u4ef6\u5728\u5236\u4f5c\u8fc7\u7a0b\u4e2d\u4f7f\u7528gzip\u538b\u7f29\u7b97\u6cd5\uff0c\u9ed8\u8ba4\u538b\u7f29\u7387\u4e3a\u201d-6\u201d\uff0c\u5e76\u4f7f\u7528\u201d&#8211;name\u201d\u547d\u4ee4\u5c06\u6587\u4ef6\u540d\u4e5f\u6dfb\u52a0\u5230\u538b\u7f29\u5305\u5185\u3002\u7531\u4e8egzip\u6700\u9ad8\u538b\u7f29\u7387\u53ef\u6307\u5b9a\u4e3a\u201d-9\u201d\uff0c\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06rootfs.img\u538b\u7f29\u4e3a\u6bd4\u539f\u672c\u56fa\u4ef6\u5185\u7684\u538b\u7f29\u6587\u4ef6\u5c0f\uff1a<br \/>\n$ gzip \u2013name -9 \u2013c rootfs.img &gt; gz<br \/>\n<a id=\"ematt:545\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/59b21539083286.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-343\" title=\"59b21539083286\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/59b21539083286.png\" alt=\"59b21539083286\" width=\"696\" height=\"55\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/59b21539083286.png 696w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/59b21539083286-300x24.png 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/59b21539083286-680x55.png 680w\" sizes=\"auto, (max-width: 696px) 100vw, 696px\" \/><\/a><\/p>\n<p>\u6b64\u5916\uff0c\u8fd8\u9700\u8981\u77e5\u9053\u539f\u672c\u56fa\u4ef6\u4e2d\u7cfb\u7edf\u538b\u7f29\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5bf9binwalk\u521d\u6b21\u89e3\u538b\u51fa\u6765\u7684rootfs.img\u955c\u50cf\u538b\u7f29\u540e\u53ef\u5f97\u5230\uff1a<br \/>\n$ gzip \u2013name \u2013c rootfs.img &gt; gz<br \/>\n<a id=\"ematt:547\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/9eb61539083288.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-344\" title=\"9eb61539083288\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/9eb61539083288.png\" alt=\"9eb61539083288\" width=\"702\" height=\"55\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/9eb61539083288.png 702w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/9eb61539083288-300x24.png 300w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/a><\/p>\n<p>\u56e0\u6b64\u53ef\u4ee5\u5f97\u5230\u5728\u4f7f\u7528\u9ad8\u538b\u7f29\u7387\u751f\u6210\u7684\u6587\u4ef6\u6bd4ASA\u56fa\u4ef6\u4e2d\u7684\u7cfb\u7edf\u6587\u4ef6\u603b\u5927\u5c0f\u5c0f\u4e86131669\u5b57\u8282\uff0c\u8fd9\u90e8\u5206\u9700\u8981\u75280x00\u5b57\u7b26\u586b\u5145\uff0c\u7528\u4ee5\u4e0bPython\u811a\u672c\u751f\u6210\u586b\u5145\u6587\u4ef6\uff1a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">import sys\nfile = open(\"padding\", \"w\")\npadding_str = [\"\\x00\" for i in range(int(sys.argv[1]))]\nfile.write(\"\".join(padding_str))\nfile.close()<\/pre>\n<p><a id=\"ematt:549\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/c00b1539083289.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-345\" title=\"c00b1539083289\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/c00b1539083289.png\" alt=\"c00b1539083289\" width=\"585\" height=\"57\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/c00b1539083289.png 585w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/c00b1539083289-300x29.png 300w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/a><\/p>\n<ol start=\"9\">\n<li>\n<p>\u5c06ASA\u56fa\u4ef6\u4e2d\u7684\u5185\u5bb9\u53ef\u5206\u4e3a\u4e09\u4e2a\u90e8\u5206\uff1ahead\u3001gz\u548ctail\uff0c\u5176\u4e2dgz\u90e8\u5206\u5c31\u662fLinux\u7cfb\u7edf\uff0c\u73b0gz\u90e8\u5206\u5df2\u7ecf\u5236\u4f5c\u597d\uff0chead\u548ctail\u53ef\u76f4\u63a5\u4eceASA\u56fa\u4ef6\u4e2d\u8fdb\u884c\u63d0\u53d6\u3002\u5728\u56fe\u4e00\u4e2d\uff0c\u4f7f\u7528binwalk\u5206\u6790\u51faASA\u56fa\u4ef6\u7684\u6587\u4ef6\u7ed3\u6784\uff0c\u4ece\u8d77\u59cb\u5904\u5230\u201drootfs.img\u201d\u6807\u8bc6\u5904\uff0c\u6b64\u90e8\u5206\u6570\u636e\u7528dd\u547d\u4ee4\u5bfc\u51fa\u540e\u4f5c\u4e3ahead\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<br \/>\n$ dd if=asa922-4-k8.bin of=head bs=1 count=1501296<br \/>\ntail\u90e8\u5206\u7684\u8d77\u59cb\u5730\u5740\u5728binwalk\u4e2d\u5b9a\u4f4d\u7684\u5e76\u4e0d\u51c6\u786e\uff0c\u56e0\u6b64\u901a\u8fc7head\u957f\u5ea6+\u539f\u672cgz\u7684\u957f\u5ea6\u6765\u786e\u5b9atail\u7684\u8d77\u59cb\u5730\u5740\uff0c\u540c\u6837\u901a\u8fc7dd\u547d\u4ee4\u5bfc\u51fa\u4e3a\u5355\u72ec\u6587\u4ef6\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<br \/>\n$ dd skip=30391972 if=asa922-4-k8.bin of=tail bs=1<br \/>\n\u6700\u540e\u4f7f\u7528cat\u547d\u4ee4\u62fc\u63a5\u6210\u5b8c\u6574\u7684ASA bin\u6587\u4ef6\uff1a<a id=\"ematt:551\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/7b6f1539083291.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-346\" title=\"7b6f1539083291\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/7b6f1539083291.png\" alt=\"7b6f1539083291\" width=\"629\" height=\"110\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/7b6f1539083291.png 629w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/7b6f1539083291-300x52.png 300w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>\u901a\u8fc7tftp\u4e0a\u4f20\u5236\u4f5c\u597d\u7684ASA\u56fa\u4ef6\uff08\u4e0d\u53ef\u4e0a\u4f20\u4e0e\u5f53\u524dASA\u4e0a\u8fd0\u884c\u7248\u672c\u76f8\u540c\u7684\u56fa\u4ef6\uff01\uff09\uff0c\u53d1\u73b0\u6709\u6821\u9a8c\u548c\u9650\u5236\uff1a<\/p>\n<\/li>\n<\/ol>\n<p><a id=\"ematt:553\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/d6421539083293.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-347\" title=\"d6421539083293\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d6421539083293.png\" alt=\"d6421539083293\" width=\"701\" height=\"61\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d6421539083293.png 701w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/d6421539083293-300x26.png 300w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><\/a><\/p>\n<p>\u5176\u4e2d\u7b2c\u4e00\u884cMD5\u662f\u5199\u5728ASA\u56fa\u4ef6\u4e2d\u7684\u503c\uff0c\u7b2c\u4e8c\u884c\u662f\u8ba1\u7b97\u51fa\u7684\u503c\uff0c\u5728ASA\u56fa\u4ef6\u4e2d\u67e5\u627e\u8fd9\u4e32MD5\u503c\uff0c\u7136\u540e\u5c06\u5176\u6539\u4e3a\u8ba1\u7b97\u51fa\u7684MD5\u503c\uff0c\u5e76\u5c06MD5\u7684CRC\u6821\u9a8c\u548c\u6539\u4e3a0x0000\uff0c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><a id=\"ematt:555\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/1e411539083295.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-348\" title=\"1e411539083295\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/1e411539083295.png\" alt=\"1e411539083295\" width=\"465\" height=\"35\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/1e411539083295.png 465w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/1e411539083295-300x23.png 300w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<p>\u4fdd\u5b58\u540e\u91cd\u65b0\u4e0a\u4f20\uff0c\u8fd4\u56de\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<p><a id=\"ematt:557\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/c9ba1539083297.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-349\" title=\"c9ba1539083297\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/c9ba1539083297.png\" alt=\"c9ba1539083297\" width=\"709\" height=\"59\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/c9ba1539083297.png 709w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/c9ba1539083297-300x25.png 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/a><\/p>\n<p>\u6b64\u65f6\u53d1\u73b0\u6587\u4ef6MD5\u503c\u5df2\u7ecf\u5339\u914d\u4e86\uff0cCRC\u6821\u9a8c\u503c\u4e5f\u88abASA\u8ba1\u7b97\u597d\u4e86\uff0c\u76f4\u63a5\u5199\u5165\u5230\u56fa\u4ef6\u7684\u76f8\u5e94\u4f4d\u7f6e\u5373\u53ef\uff0c\u6ce8\u610f\u5c0f\u7aef\u5b57\u8282\u987a\u5e8f\uff0c\u518d\u6b21\u4e0a\u4f20\u53ef\u901a\u8fc7\u9a8c\u8bc1\u3002<\/p>\n<ol start=\"11\">\n<li>\u542f\u52a8\u540e\u53ef\u4f7f\u7528launcher\u8fdb\u5165\u8c03\u8bd5\u6a21\u5f0f\uff0c\u5982\u4e0b\u56fe\uff1a<a id=\"ematt:559\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/88391539083300.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-350\" title=\"88391539083300\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/88391539083300.png\" alt=\"88391539083300\" width=\"500\" height=\"278\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/88391539083300.png 500w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/88391539083300-300x167.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/li>\n<\/ol>\n<p>\u5728minicom\u4e2d\u5173\u95ed\u4e32\u53e3\u8fde\u63a5\uff0c\u5728gdb\u4e2d\u8fdc\u7a0b\u8fde\u63a5\u5230\u4e32\u53e3\u4e0a\u8fdb\u884c\u8c03\u8bd5\uff0c\u5982\u4e0b\uff1a<\/p>\n<p><a id=\"ematt:561\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/0a281539083304.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-351\" title=\"0a281539083304\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/0a281539083304.jpg\" alt=\"0a281539083304\" width=\"664\" height=\"129\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/0a281539083304.jpg 664w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/0a281539083304-300x58.jpg 300w\" sizes=\"auto, (max-width: 664px) 100vw, 664px\" \/><\/a><\/p>\n<p>\u5728ASA\u4e0a\u8fdb\u884c\u8fdc\u7a0bgdb\u8c03\u8bd5\u7684\u5927\u81f4\u65b9\u5f0f\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><a id=\"ematt:563\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/b9df1539083310.jpg\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-352\" title=\"b9df1539083310\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/b9df1539083310.jpg\" alt=\"b9df1539083310\" width=\"2560\" height=\"1938\" \/><\/a><\/p>\n<p>\u5728\u4f7f\u7528IDA\u8fdb\u884c\u8fdc\u7a0bGDB\u8c03\u8bd5\u65f6\uff0c\u9700\u8981\u5904\u7406\u4e24\u4e2a\u4fe1\u53f7\uff0c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><a id=\"ematt:565\" href=\"http:\/\/www.weizn.net\/content\/uploadfile\/201810\/a1691539083314.png\" data-rel=\"penci-gallery-image-content\"  target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-353\" title=\"a1691539083314\" src=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/a1691539083314.png\" alt=\"a1691539083314\" width=\"976\" height=\"527\" srcset=\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/a1691539083314.png 976w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/a1691539083314-300x162.png 300w, http:\/\/weizn.net\/wp-content\/uploads\/2020\/09\/a1691539083314-768x415.png 768w\" sizes=\"auto, (max-width: 976px) 100vw, 976px\" \/><\/a><\/p>\n<p>\u9644\uff1a<br \/>\n\u786c\u4ef6\u8c03\u8bd5\u4e2dlauncher\u7a0b\u5e8f\u5b8c\u6574\u4ee3\u7801\uff1a<\/p>\n<pre class=\"prettyprint lang-cpp linenums EnlighterJSRAW\" data-enlighter-language=\"c\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include &lt;unistd.h&gt;\n#include &lt;dirent.h&gt;\n#include &lt;signal.h&gt;\n#include &lt;sys\/stat.h&gt;\n#include &lt;limits.h&gt;\n#include &lt;fcntl.h&gt;\n\n#define GDBSERV_PATH \"\/bin\/gdbserver\"\n#define INPUT_CMD \"en\\nadmin\\n123\\nshow kernel process\\n   \\n\"\n\nchar *gl_KillProcList[] = {\"\/bin\/sh\", \"\/etc\/init.d\/rcS\", \"\/etc\/init.d\/S99asastart\", \"\/asa\/scripts\/rcS\", NULL};\n\nenum\n{\n    E_Debug = 0x01,\n    E_Daemon,\n    E_Orphan,\n    E_Attach,\n};\n\nint trav_dir(const char *const dirPath, const int maxDeep, void (*handler)(char *, char *), char *param)\n{\n    DIR *dp = NULL;\n    struct dirent *pEntry = NULL;\n    struct stat statBuf;\n    char filePath[256];\n    char newDirPath[256];\n\n    if(maxDeep == 0) return 0;\n    if(dirPath == NULL || strlen(dirPath) == 0 || handler == NULL) return -1;\n\n    dp = opendir(dirPath);\n    if(dp == NULL)\n    {\n        printf(\"Can't open dir,'%s'\\n\", dirPath);\n        return -1;\n    }\n\n    while((pEntry = readdir(dp)) != NULL)\n    {\n        memset(filePath, 0x00, sizeof(filePath));\n        strcat(filePath, dirPath);\n        if(filePath[strlen(filePath) - 1] != '\/') strcat(filePath, \"\/\");\n        strcat(filePath, pEntry-&gt;d_name);\n\n        lstat(filePath, &amp;statBuf);\n        if(S_ISDIR(statBuf.st_mode))\n        {\n            \/\/dir\n            if(pEntry-&gt;d_name[0] == '.') continue;\n\n            memset(newDirPath, 0x00, sizeof(newDirPath));\n            strcat(newDirPath, filePath);\n            trav_dir(newDirPath, maxDeep - 1, handler, param);\n        }\n        else\n        {\n            \/\/file\n            handler(filePath, param);\n        }\n    }\n    closedir(dp);\n\n    return 0;\n}\n\nint strrncmp(const char *m_str, const char *c_str, int len)\n{\n    int mStrLen;\n    int cStrLen;\n    int index;\n\n    mStrLen = strlen(m_str);\n    cStrLen = strlen(c_str);\n\n    if(cStrLen &lt; len) return -1;\n\n    for(index = 1; index &lt;= len; ++index)\n    {\n        if(m_str[mStrLen - index] != c_str[cStrLen - index])\n            return -1;      \n    }\n\n    return 0;\n}\n\nvoid file_handler(char *filePath, char *procName)\n{\n    char *pStart = NULL;\n    FILE *file = NULL;\n    char readBuf[1024];\n    int i, pid;\n\n    for(i = strlen(filePath) - 1; i &gt;= 0; i--)\n    {\n        if(filePath[i] == '\/')\n        {\n            pStart = &amp;filePath[i] + 1;\n            break;\n        }\n    }\n    if(pStart == NULL) return;\n    if(strcmp(pStart, \"cmdline\")) return;\n\n    file = fopen(filePath, \"rt\");\n    if(file == NULL) return;\n\n    memset(readBuf, 0x00, sizeof(readBuf));\n    if(fread(readBuf, sizeof(char), sizeof(readBuf) - 1, file) &lt;= 0)\n    {\n        fclose(file);\n        return;\n    }\n\n    if(strrncmp(readBuf, procName, strlen(procName)) == 0)\n    {\n        printf(\"Found process: %s\\t\", readBuf);\n    }\n    else\n    {\n        fclose(file);\n        return;\n    }\n\n    memcpy(pStart, \"stat\", strlen(\"stat\"));\n    *(pStart + strlen(\"stat\")) = 0x00;\n\n    fclose(file);\n    file = fopen(filePath, \"rt\");\n    if(file == NULL) return;\n    \/*\n    if(fscanf(file, \"%d\", &amp;pid) != 1)\n    {\n        fclose(file);\n        return;\n    }*\/\n    memset(readBuf, 0x00, sizeof(readBuf));\n    if(fread(readBuf, sizeof(char), sizeof(readBuf) - 1, file) &lt;= 0)\n    {\n        fclose(file);\n        return;\n    }\n    for(pStart = readBuf; *pStart &lt; '0' || *pStart &gt; '9'; ++pStart);\n    for(i = 0; pStart[i] &gt;= '0' &amp;&amp; pStart[i] &lt;= '9'; ++i);\n    pStart[i] = 0x00;\n\n    pid = atoi(pStart); \n    kill(pid, 9);\n    printf(\"Kill pid: %d\\n\", pid);\n    fclose(file);\n\n    return;\n}\n\nint kill_proc()\n{\n    int i;\n\n    for(i = 0; gl_KillProcList[i] != NULL; i++)\n    {\n        trav_dir(\"\/proc\", 2, file_handler, gl_KillProcList[i]);\n    }\n\n    return 0;\n}\n\nchar *itoa(int num)\n{\n    static char numStr[100];\n    char swap;\n    int i;\n\n    memset(numStr, 0x00, sizeof(numStr));\n\n    for(i = 0; num ; ++i)\n    {\n        numStr[i] = num % 10 + '0';\n        num \/= 10;\n    }\n\n    for(i = 0; i &lt; strlen(numStr) \/ 2; ++i)\n    {\n        swap = numStr[i];\n        numStr[i] = numStr[strlen(numStr) - i - 1];\n        numStr[strlen(numStr) - i - 1] = swap;\n    }\n\n    return numStr;\n}\n\nint main(int argc, char *argv[])\n{\n    int pid, parentPid;\n    int inPipe[2], outPipe[2], errPipe[2];\n    char readBuf[PIPE_BUF + 1];\n    int readSize;\n    FILE *file = NULL;\n    struct timeval timeo;\n    fd_set fdRead;\n    int exitVal;\n    int i;\n    int sw;\n    char *pAttPid = NULL;\n\n    if(argc &lt; 1 || argc &gt; 3) return -1;\n    if(argc &gt; 1)\n    {\n        if(!strcmp(\"-d\", argv[1]))\n        {\n            sw = E_Daemon;\n        }\n        else if(!strcmp(\"-o\", argv[1]))\n        {\n            sw = E_Orphan;\n        }\n        else if(!strcmp(\"-a\", argv[1]))\n        {\n            sw = E_Attach;\n            pAttPid = argv[2];\n        }\n        else\n        {\n            return -1;\n        }\n    }\n    else\n    {\n        sw = E_Debug;\n    }\n\n    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n    if(sw == E_Daemon)\n    {\n        printf(\"The lina_monitor process will start.\\n\");\n    }\n    else if(sw == E_Orphan)\n    {\n        printf(\"The lina process will start.\\n\");\n    }\n    else\n    {\n        printf(\"Please disconnect the serial port!\\ngdbserver will start.\\n\");\n        \/\/printf(\"Press Ctrl\/C to cancel in.\\n\");\n        for(i = 5; i &gt; 0; i--)\n        {\n            printf(\"%d \", i);\n            fflush(stdout);\n            usleep(1000*1000);\n        }\n        puts(\"\");\n        fflush(stdout);\n    }\n\n    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n    pid = fork();\n    if(pid != 0)\n    {\n        usleep(1000);\n        exit(0);\n    }\n    setsid();\n    parentPid = getpid();\n\n    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n    if(sw == E_Orphan || sw == E_Daemon)\n    {\n        file = fopen(\"\/mnt\/disk0\/launcher.log\", \"w\");\n        if(file == NULL)\n        {\n            \/\/puts(\"Create launcher.log failed.\");\n        }\n    }\n    else\n    {\n        file = fopen(\"\/mnt\/disk0\/debugger.log\", \"w\");\n        if(file == NULL)\n        {\n            \/\/puts(\"Create debugger.log failed.\");\n        }\n    }\n\n    pipe(inPipe);\n    pipe(outPipe);\n    pipe(errPipe);\n    dup2(inPipe[0], STDIN_FILENO);\n    dup2(outPipe[1], STDOUT_FILENO);\n    dup2(errPipe[1], STDERR_FILENO);\n\n    printf(\"============Log===========\\n\");\n\n    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n    if(sw == E_Daemon)\n    {\n        pid = fork();\n        if(pid == 0)\n        {\n            close(inPipe[1]);\n            close(outPipe[0]);\n            close(errPipe[0]);\n\n            execl(\"\/asa\/bin\/lina_monitor\", \"\/asa\/bin\/lina_monitor\", NULL);\n        }\n        close(inPipe[0]);\n        write(inPipe[1], INPUT_CMD, strlen(INPUT_CMD));\n    }\n    else if(sw == E_Orphan)\n    {\n        pid = fork();\n        if(pid == 0)\n        {\n            close(inPipe[1]);\n            close(outPipe[0]);\n            close(errPipe[0]);\n            parentPid = getpid();\n\n            pid = fork();\n            if(pid == 0)\n            {\n                setsid();\n                execl(\"\/asa\/bin\/lina\", \"\/asa\/bin\/lina\", \"-p\", itoa(parentPid), \"-s\", NULL);\n            }\n            while(1) usleep(1000);\n            exit(0);\n        }\n        close(inPipe[0]);\n        write(inPipe[1], INPUT_CMD, strlen(INPUT_CMD));\n    }\n    else\n    {\n        kill_proc();\n    }\n\n    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n    if(sw == E_Debug || sw == E_Attach)\n    {\n        usleep(1000*1000*2);\n        pid = fork();\n        if(pid == 0)\n        {\n            close(inPipe[1]);\n            close(outPipe[0]);\n            close(errPipe[0]);\n\n            printf(\"gdbserver will start...\\n\");\n            if(sw == E_Debug)\n            {\n                \/\/execl(\"\/asa\/bin\/lina_monitor\", \"\/asa\/bin\/lina_monitor\", \"-g\", \"-d\", \"-s\", \"\/dev\/ttyS0\", NULL);\n                execl(GDBSERV_PATH, GDBSERV_PATH, \"\/dev\/ttyS0\", \"\/asa\/bin\/lina\", \"-p\", itoa(parentPid), \"-s\", NULL);\n            }\n            else\n            {\n                printf(\"%s attach %s\\n\", GDBSERV_PATH, pAttPid);\n                execl(GDBSERV_PATH, GDBSERV_PATH, \"\/dev\/ttyS0\", \"--attach\", pAttPid, NULL);\n            }\n            exit(0);\n        }\n    }\n\n    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n    while(file != NULL)\n    {\n        memset(&amp;timeo, 0x00, sizeof(timeo));\n        timeo.tv_usec = 100;\n\n        FD_ZERO(&amp;fdRead);\n        FD_SET(outPipe[0], &amp;fdRead);\n        FD_SET(errPipe[0], &amp;fdRead);\n        if(select((outPipe[0] &gt; errPipe[0] ? outPipe[0] : errPipe[0]) + 1, &amp;fdRead, NULL, NULL, &amp;timeo) &lt;= 0) continue;\n\n        if(FD_ISSET(outPipe[0], &amp;fdRead))\n        {\n            memset(readBuf, 0x00, sizeof(readBuf));\n            if((readSize = read(outPipe[0], readBuf, sizeof(readBuf) - 1)) &lt;= 0)\n            {\n                continue;\n            }\n            fwrite(readBuf, sizeof(char), readSize, file);\n            fflush(file);\n        }\n        else\n        {\n            memset(readBuf, 0x00, sizeof(readBuf));\n            if((readSize = read(errPipe[0], readBuf, sizeof(readBuf) - 1)) &lt;= 0)\n            {\n                continue;\n            }\n            fwrite(readBuf, sizeof(char), readSize, file);\n            fflush(file);\n        }\n    }\n    while(1) usleep(1000*1000);\n\n    return 0;\n}<\/pre>\n<p>\u53e6\u4e00\u79cd\u8c03\u8bd5\u65b9\u5f0f\uff1a<br \/>\n<a href=\"https:\/\/community.rapid7.com\/community\/metasploit\/blog\/2016\/06\/14\/asa-hack\">https:\/\/community.rapid7.com\/community\/metasploit\/blog\/2016\/06\/14\/asa-hack<\/a><br \/>\n\u8fd9\u79cd\u65b9\u6cd5\u53ea\u652f\u6301ASA 924\u7248\u672c\uff0c\u901a\u8fc7\u4fee\u6539\u5185\u6838\u542f\u52a8\u547d\u4ee4\u8fdb\u5165console\uff0c\u7136\u540e\u4f7f\u7528lina_monitor\u8fdb\u5165\u8c03\u8bd5\u6a21\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cisco ASA\u8c03\u8bd5\u53ef\u5206\u4e3a\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff0c\u5176\u4e2d\u786c\u4ef6\u8c03\u8bd5\u65b9\u6cd5\u53ef\u4ee5\u652f\u6301\u6240\u6709\u7248\u672c\u7684ASA\u7cfb\u7edf\uff0c\u865a\u62df\u5316\u8c03\u8bd5\u76ee\u524d\u53ea\u652f\u6301ASA 802\u548cASA 842\u4e24\u4e2a\u7248\u672c\uff0c\u4e3b\u8981\u539f\u56e0\u662f\u53ea\u6709\u8fd9\u4e24\u4e2a\u7248\u672c\u7684\u7cfb\u7edf\u652f\u6301\u865a\u62df\u5316\u73af\u5883\uff0c\u4e0b\u9762\u5206\u5f00\u8bb2\u89e3\u4e24\u79cd\u8c03\u8bd5\u65b9\u6cd5\u3002<\/p>\n","protected":false},"author":1,"featured_media":359,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[321],"tags":[],"class_list":["post-200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cisco ASA\u56fa\u4ef6\u7834\u89e3\u548c\u52a8\u6001\u8c03\u8bd5\u8f6f\u4ef6\u7cfb\u7edf\u65b9\u6cd5\uff08\u5305\u62ec\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff09 - Wayne&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/weizn.net\/?p=200\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cisco ASA\u56fa\u4ef6\u7834\u89e3\u548c\u52a8\u6001\u8c03\u8bd5\u8f6f\u4ef6\u7cfb\u7edf\u65b9\u6cd5\uff08\u5305\u62ec\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff09 - Wayne&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"Cisco ASA\u8c03\u8bd5\u53ef\u5206\u4e3a\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff0c\u5176\u4e2d\u786c\u4ef6\u8c03\u8bd5\u65b9\u6cd5\u53ef\u4ee5\u652f\u6301\u6240\u6709\u7248\u672c\u7684ASA\u7cfb\u7edf\uff0c\u865a\u62df\u5316\u8c03\u8bd5\u76ee\u524d\u53ea\u652f\u6301ASA 802\u548cASA 842\u4e24\u4e2a\u7248\u672c\uff0c\u4e3b\u8981\u539f\u56e0\u662f\u53ea\u6709\u8fd9\u4e24\u4e2a\u7248\u672c\u7684\u7cfb\u7edf\u652f\u6301\u865a\u62df\u5316\u73af\u5883\uff0c\u4e0b\u9762\u5206\u5f00\u8bb2\u89e3\u4e24\u79cd\u8c03\u8bd5\u65b9\u6cd5\u3002\" \/>\n<meta property=\"og:url\" content=\"http:\/\/weizn.net\/?p=200\" \/>\n<meta property=\"og:site_name\" content=\"Wayne&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-08T07:38:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-27T02:12:50+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/weizn.net\/wp-content\/uploads\/2018\/09\/sale_10872_primary_image_wide.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zinan\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/weizn.net\/#website\",\"url\":\"http:\/\/weizn.net\/\",\"name\":\"Wayne&#039;s Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/weizn.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/weizn.net\/?p=200#primaryimage\",\"inLanguage\":\"zh-Hans\",\"url\":\"http:\/\/weizn.net\/wp-content\/uploads\/2018\/09\/sale_10872_primary_image_wide.jpg\",\"contentUrl\":\"http:\/\/weizn.net\/wp-content\/uploads\/2018\/09\/sale_10872_primary_image_wide.jpg\",\"width\":1000,\"height\":500},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/weizn.net\/?p=200#webpage\",\"url\":\"http:\/\/weizn.net\/?p=200\",\"name\":\"Cisco ASA\\u56fa\\u4ef6\\u7834\\u89e3\\u548c\\u52a8\\u6001\\u8c03\\u8bd5\\u8f6f\\u4ef6\\u7cfb\\u7edf\\u65b9\\u6cd5\\uff08\\u5305\\u62ec\\u786c\\u4ef6\\u8c03\\u8bd5\\u548c\\u865a\\u62df\\u5316\\u8c03\\u8bd5\\uff09 - Wayne&#039;s Blog\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=200#primaryimage\"},\"datePublished\":\"2018-09-08T07:38:43+00:00\",\"dateModified\":\"2023-12-27T02:12:50+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/weizn.net\/?p=200#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/weizn.net\/?p=200\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/weizn.net\/?p=200#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"http:\/\/weizn.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cisco ASA\\u56fa\\u4ef6\\u7834\\u89e3\\u548c\\u52a8\\u6001\\u8c03\\u8bd5\\u8f6f\\u4ef6\\u7cfb\\u7edf\\u65b9\\u6cd5\\uff08\\u5305\\u62ec\\u786c\\u4ef6\\u8c03\\u8bd5\\u548c\\u865a\\u62df\\u5316\\u8c03\\u8bd5\\uff09\"}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/weizn.net\/?p=200#article\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/?p=200#webpage\"},\"author\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"headline\":\"Cisco ASA\\u56fa\\u4ef6\\u7834\\u89e3\\u548c\\u52a8\\u6001\\u8c03\\u8bd5\\u8f6f\\u4ef6\\u7cfb\\u7edf\\u65b9\\u6cd5\\uff08\\u5305\\u62ec\\u786c\\u4ef6\\u8c03\\u8bd5\\u548c\\u865a\\u62df\\u5316\\u8c03\\u8bd5\\uff09\",\"datePublished\":\"2018-09-08T07:38:43+00:00\",\"dateModified\":\"2023-12-27T02:12:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=200#webpage\"},\"wordCount\":519,\"commentCount\":3,\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"image\":{\"@id\":\"http:\/\/weizn.net\/?p=200#primaryimage\"},\"thumbnailUrl\":\"http:\/\/weizn.net\/wp-content\/uploads\/2018\/09\/sale_10872_primary_image_wide.jpg\",\"articleSection\":[\"\\u5e94\\u7528\\u5b89\\u5168\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/weizn.net\/?p=200#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\",\"name\":\"zinan\",\"logo\":{\"@id\":\"http:\/\/weizn.net\/#personlogo\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cisco ASA\u56fa\u4ef6\u7834\u89e3\u548c\u52a8\u6001\u8c03\u8bd5\u8f6f\u4ef6\u7cfb\u7edf\u65b9\u6cd5\uff08\u5305\u62ec\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff09 - Wayne&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/weizn.net\/?p=200","og_locale":"zh_CN","og_type":"article","og_title":"Cisco ASA\u56fa\u4ef6\u7834\u89e3\u548c\u52a8\u6001\u8c03\u8bd5\u8f6f\u4ef6\u7cfb\u7edf\u65b9\u6cd5\uff08\u5305\u62ec\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff09 - Wayne&#039;s Blog","og_description":"Cisco ASA\u8c03\u8bd5\u53ef\u5206\u4e3a\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff0c\u5176\u4e2d\u786c\u4ef6\u8c03\u8bd5\u65b9\u6cd5\u53ef\u4ee5\u652f\u6301\u6240\u6709\u7248\u672c\u7684ASA\u7cfb\u7edf\uff0c\u865a\u62df\u5316\u8c03\u8bd5\u76ee\u524d\u53ea\u652f\u6301ASA 802\u548cASA 842\u4e24\u4e2a\u7248\u672c\uff0c\u4e3b\u8981\u539f\u56e0\u662f\u53ea\u6709\u8fd9\u4e24\u4e2a\u7248\u672c\u7684\u7cfb\u7edf\u652f\u6301\u865a\u62df\u5316\u73af\u5883\uff0c\u4e0b\u9762\u5206\u5f00\u8bb2\u89e3\u4e24\u79cd\u8c03\u8bd5\u65b9\u6cd5\u3002","og_url":"http:\/\/weizn.net\/?p=200","og_site_name":"Wayne&#039;s Blog","article_published_time":"2018-09-08T07:38:43+00:00","article_modified_time":"2023-12-27T02:12:50+00:00","og_image":[{"width":1000,"height":500,"url":"http:\/\/weizn.net\/wp-content\/uploads\/2018\/09\/sale_10872_primary_image_wide.jpg","path":"\/app\/wp-content\/uploads\/2018\/09\/sale_10872_primary_image_wide.jpg","size":"full","id":359,"alt":"","pixels":500000,"type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zinan","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"14 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/weizn.net\/#website","url":"http:\/\/weizn.net\/","name":"Wayne&#039;s Blog","description":"","publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/weizn.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"ImageObject","@id":"http:\/\/weizn.net\/?p=200#primaryimage","inLanguage":"zh-Hans","url":"http:\/\/weizn.net\/wp-content\/uploads\/2018\/09\/sale_10872_primary_image_wide.jpg","contentUrl":"http:\/\/weizn.net\/wp-content\/uploads\/2018\/09\/sale_10872_primary_image_wide.jpg","width":1000,"height":500},{"@type":"WebPage","@id":"http:\/\/weizn.net\/?p=200#webpage","url":"http:\/\/weizn.net\/?p=200","name":"Cisco ASA\u56fa\u4ef6\u7834\u89e3\u548c\u52a8\u6001\u8c03\u8bd5\u8f6f\u4ef6\u7cfb\u7edf\u65b9\u6cd5\uff08\u5305\u62ec\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff09 - Wayne&#039;s Blog","isPartOf":{"@id":"http:\/\/weizn.net\/#website"},"primaryImageOfPage":{"@id":"http:\/\/weizn.net\/?p=200#primaryimage"},"datePublished":"2018-09-08T07:38:43+00:00","dateModified":"2023-12-27T02:12:50+00:00","breadcrumb":{"@id":"http:\/\/weizn.net\/?p=200#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/weizn.net\/?p=200"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/weizn.net\/?p=200#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/weizn.net\/"},{"@type":"ListItem","position":2,"name":"Cisco ASA\u56fa\u4ef6\u7834\u89e3\u548c\u52a8\u6001\u8c03\u8bd5\u8f6f\u4ef6\u7cfb\u7edf\u65b9\u6cd5\uff08\u5305\u62ec\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff09"}]},{"@type":"Article","@id":"http:\/\/weizn.net\/?p=200#article","isPartOf":{"@id":"http:\/\/weizn.net\/?p=200#webpage"},"author":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"headline":"Cisco ASA\u56fa\u4ef6\u7834\u89e3\u548c\u52a8\u6001\u8c03\u8bd5\u8f6f\u4ef6\u7cfb\u7edf\u65b9\u6cd5\uff08\u5305\u62ec\u786c\u4ef6\u8c03\u8bd5\u548c\u865a\u62df\u5316\u8c03\u8bd5\uff09","datePublished":"2018-09-08T07:38:43+00:00","dateModified":"2023-12-27T02:12:50+00:00","mainEntityOfPage":{"@id":"http:\/\/weizn.net\/?p=200#webpage"},"wordCount":519,"commentCount":3,"publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"image":{"@id":"http:\/\/weizn.net\/?p=200#primaryimage"},"thumbnailUrl":"http:\/\/weizn.net\/wp-content\/uploads\/2018\/09\/sale_10872_primary_image_wide.jpg","articleSection":["\u5e94\u7528\u5b89\u5168"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/weizn.net\/?p=200#respond"]}]},{"@type":["Person","Organization"],"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264","name":"zinan","logo":{"@id":"http:\/\/weizn.net\/#personlogo"}}]}},"_links":{"self":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=200"}],"version-history":[{"count":13,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions"}],"predecessor-version":[{"id":983,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions\/983"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/media\/359"}],"wp:attachment":[{"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}