วิธีการทำให้ผลการ scan ของ nmap ออกมาดูดี
เราทราบกันดีว่า nmap เวลา scan ออกมามันจะเป็นผลแบบ console output ทีนี้หากเราต้องการให้ออกมาดูดี ดูสวย ใช้งานง่ายๆ ก็จำเป็นต้องใช้ตัวช่วยกันหน่อย โดย post นี้จะมาดูกันว่าใช้ tool ตัวไหนได้บ้างครับ
1. xsltproc
วิธีการใช้งานก็ไม่มีอะไรมากครับ เริ่มจากการ scan nmap แล้วให้ save ผลออกมาเป็น XML เช่น
1 |
nmap -A target -oX ~/Desktop/metaspliot2-nmap-scan.xml |
จากนั้นจึงทำการแปลงให้เป็น HTML โดยใช้ xsltproc
1 |
xsltproc ~/Desktop/metasploit2-nmap-scan.xml -o ~/Desktop/metasploit2-nmap-scan.html |
จากนั้นเปิด html อีกที
2. ใช้ nmap-bootstrap-xsl
เริ่มด้วยการ scan โดยใช้ stylesheet เพื่อ
1 |
nmap -sS -T4 -A -sC -oA scanme --stylesheet https://raw.githubusercontent.com/honze-net/nmap-bootstrap-xsl/master/nmap-bootstrap.xsl scanme.nmap.org scanme2.nmap.org |
จากนั้นเปิด scanme.xml จะได้หน้าตาประมาณด้านล่างครับ
1 |
http://htmlpreview.github.io/?https://github.com/honze-net/nmap-bootstrap-xsl/blob/master/scanme.html |
3. ใช้ envizon
จริงๆ envizon นั้นใช้สำหรับ environment virtualisation โดยเราสามารถใช้ map ได้เช่นกัน โดย setup ได้ดังนี้
3.1. Setup postgresql
1 2 3 |
git clone https://github.com/evait-security/envizon cd envizon bundle install --path vendor/bundle |
3.2. install requirement package
1 2 3 4 5 |
mkdir .ssl openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout .ssl/localhost.key -out .ssl/localhost.crt # If you want to use certificates located elsewhere, provide their pathes with SSL_CERT_PATH and SSL_KEY_PATH # Create a secret: RAILS_ENV=production bundle exec rails secret |
3.3. Configure file ใดๆอย่างเหมาะสม (config/secrets.yml)
Source::
- https://github.com/honze-net/nmap-bootstrap-xsl/
- https://medium.com/ehsahil/basic-penetration-testing-lab-1-7544969cb3ac
- https://github.com/evait-security/envizon