👨🏫 ในรูปได้ยกตัวอย่าง ช่องโหว่ของการเขียนโปรแกรม
ที่เปิดโอกาสให้ผู้ประสงค์ร้ายสามารถโจมตีด้วยวิธี
Command Injection
.
ช่องโหว่นี้เกิดจากในหลายๆ ภาษาโปรแกรมมิ่ง
ได้อนุญาติให้เรียกคำสั่งของระบบปฏิบัติการได้โดยตรง
ซึ่งสุ่มเสี่ยงให้ผู้โจมตีฉวยโอกาสนี้ฉีดคำสั่งเข้าไปในโค้ด
ด้วยการต่อท้ายด้วยข้อความ &&
จึงทำให้แทรกคำสั่งอันตรายเข้าไปได้ เช่น
:
del /F * บน window
หรือ rm -rf * บน linux
:
ในรูปได้ยกตัวอย่างโค้ดภาษา Java
ซึ่งทำงานบน Window
จะเห็นว่าสามารถใช้ && แล้วต่อท้ายด้วยคำสั่งอะไรก็ได้
เช่น && tasklist && dir เป็นต้น
.
แล้วถ้าโปรแกรมมันรันใน linux/Unix
ก็สามารถต่อคำสั่งเป็นลูกโซ่ด้วยข้อความ && หรือ ; ก็ได้
:
และไม่ใช่ Java ภาษาเดียว ที่มีช่องโหว่ประเภทนี้
มันเกิดได้หลายภาษา
ที่อนุญาติให้เรียกคำสั่งของระบบปฏิการโดยตรง
เช่น C#, Python, PHP และหลายๆ ภาษาที่ไม่ได้เอ่ยถึง
:
++++วิธีป้องกัน+++
🤔 ต้อง validate ข้อมูล input อย่างเข้มงวด เช่น
- กรอง input ที่เข้ามา กำหนดว่ามีอะไรได้บ้าง?
- input ที่เข้ามา ห้ามเป็นคำสั่งของระบบปฏิบัติการเด็ดขาด
- ห้ามมี && และ ; อยู่ใน input ที่เข้ามา
- เป็นต้น
.
😏 หรือจะเลี่ยงวิธีเขียนเรียกคำสั่งของระบบปฏิบัติการโดยตรง ไม่ต้องใช้ก็ย่อมได้
++++
เขียนโดย โปรแกรมเมอร์ไทย thai programmer
.
ดูตัวอย่างเพิ่มเติม
https://www.owasp.org/index.php/Command_Injection
👨 🏫 In the photo, for example, the loophole of programming.
Open doors for the evil wills to attack by the way.
Command Injection
.
This loophole is born in many programming languages.
Permission to call direct order of operating system
Who randomly risked this opportunity attacker to inject an order into code.
By ending with a text &&
It's so dangerous to insert like
:
del / F F on window
or rm-rf rf on linux
:
In the picture, for example, Java language code.
Which works on Window
Will see that I can use && and then end up with any order.
Like && tasklist && dir etc.
.
And if the program runs in linux / Unix
Can continue with chain order with text && or; either.
:
And not Java the only language has this type of loophole
It can be born in many languages.
Allowing to call direct command of the operational system.
Like C #, Python, PHP and many languages that are not mentioned.
:
++++ How to prevent +++
🤔 Must strictly validate input information like
- Input filter that comes to determine what's available?
- Input that comes to prohibit is an order of an operating system.
- Don't have && and; stay input that comes.
- etc.
.
😏 or avoid the way to write, call direct command of an operating system. No need to use it.
++++
Written by Thai programmer thai coder
.
See more previews
https://www.owasp.org/index.php/Command_InjectionTranslated
同時也有1部Youtube影片,追蹤數超過2萬的網紅Untyped 對啊我是工程師,也在其Youtube影片中提到,什麼是Bug? 她教電腦說人話 編譯器的發明 | Grace Hopper - The Queen of Code【她也懂電腦】#1 - 你知道電腦是怎麼聽懂人話的嗎?你知道編譯器是誰發明的嗎?你知道工程師口中常常講的bug是什麼嗎? Grace Hopper 葛麗絲·霍普 完全就是顛覆大眾對女性的...
「python many if」的推薦目錄:
- 關於python many if 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的精選貼文
- 關於python many if 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的精選貼文
- 關於python many if 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的最佳貼文
- 關於python many if 在 Untyped 對啊我是工程師 Youtube 的精選貼文
- 關於python many if 在 Too many if statements - Stack Overflow 的評價
- 關於python many if 在 Multiple "if" statements vs. if-elif-else: What's the difference? 的評價
- 關於python many if 在 Making Choices – Programming with Python - Our Lessons 的評價
python many if 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的精選貼文
วันนี้จะขอพูดถึงเครื่องมือตัวหนึ่ง 😃
ของโลกการเขียนซอฟต์แวร์ที่ชื่อ Selenium
คนละชื่อกับ Selenium ในตารางธาตุวิชาเคมีนะ
.
Selenium แห่งโลกซอฟต์แวร์
มันเป็นเครื่องมือและไลบรารี่ในคราวเดียวกัน
เอาไว้ควบคุมบราวเซอร์อัตโนมัติ
.
เวลาพูดถึงเครื่องมือ หรือ tool 🔧⚒
จะไม่เหมือนสว่านในการก่อสร้างนะ
ที่ช่วยทำอัตโนมัติทุกอย่าง จนสบายมือ ไม่เหนื่อย
.
selenium ถูกนิยามเป็น tool ก็จริง
แต่เราต้องมานั่งเขียนโปรแกรมอยู่ดี
ต้องทำงานถึก นั่งพิมพ์ดีด
ต้องเขียนโค้ดเพื่อควบคุมหน้าเว็บด้วยสองมือ
.
ประโยชน์
🐵 1) จุดประสงค์หลักที่มันเกิดขึ้นมา
เขาเอาไว้ใช้ทำ test suite เป็นสำคัญ
พูดง่ายๆ ทำเทสหน้าเว็บไซต์อัตโนมัตินั่นแหละ
.
เช่นเราสามารถเขียนโปรแกรมใส่รหัสผ่าน กดล็อกอิน
คลิกลิงค์โน่นนี้อัตโนมัติ ทดสอบเว็บไซต์ได้เลย
ใครทำเทสอัตโนมัติ นิยมมาก
.
🐼 2) ถ้าจะประยุกต์แอดวานซ์หน่อย
ก็เอาไปทำโรบอทควบคุมเว็บไซต์อัตโนมัติ
เช่น เขียนโปรแกรมให้มันเข้าเว็บ ไปเล่นหุ้นให้เอง
.
แต่นั้นแหละครับมันก็สามารถเอาไปใช้ในทางไม่ดีได้เช่นกัน 😰
เหมือนดาบสองคมเนอะ
.
Selenium รองรับได้หลายบราวเซอร์ดังๆ หลายเจ้า เช่น
Chrom(ium), Firefox, Internet Explorer, Opera, และ Safari
.
แต่ข้อแม้ยุ่งยากนิดหนึ่ง 😠
เราต้องดาวน์โหลด webdriver แต่ละเว็บบราวเซอร์มาก่อน
ถึงจะเขียนโปรแกรมใช้งานบราวเซอร์ยี่ห้อนั้นได้ดั่งใจนึก
(บราวเซอร์คนละยี่ห้อ คนละเวอร์ชั่น ก็คนละ webdriver นะ)
.
ปัจจุบันมันรองรับหลายภาษาเขียนโปรแกรมดังหลายตัว เช่น
Python, Java, C#, JavaScript, Ruby, PHP, Perl
.
สนใจไปศึกษาเพิ่มเติมได้ที่
https://www.selenium.dev/documentation/en/
.
ตัวอย่างรูปที่เห็นตามโพสต์
เป็นโค้ดของภาษา Python
(ต้องมี webdriver ในกรณีนี้เป็นของ Chrome)
จุดประสงค์เอาไว้ล็อกอินหน้า facebook
โดยไม่ต้องกรอกรหัสผ่านให้ปวดมือ
.
เขียนโค้ดสั้นๆ แค่นี้แหละ
เป็นไงเห็นแล้วง่ายไหม?
.
✍ เขียนโดย โปรแกรมเมอร์ไทย thai programmer
Today I'll talk about one tool 😃
of the software writing world named Selenium
Different name with Selenium in the chemical periodic table.
.
Selenium of the Software World
It's a tool and a library at the same time
To control the automatic browser
.
Time to talk about tools or tools 🔧⚒
Won't be like a span in construction.
The one that helps automate everything until it's comfortable. Not tired.
.
Selenium is defined as tool. It's true.
But we have to sit on programming anyway.
Got to work. Sitting in typing.
Code must be written to control webpage with two hands.
.
Benefits
🐵 1) The main purpose for which it happened.
It's important to use test suite
Easy to say. Automatic website test.
.
Like we can program password press log in
Click this link automatically. Test the website.
Who made the autograph test so popular
.
🐼 2) If I want to apply, add to my inbox.
It's going to automate website controller robot
Like programming, let's get on the web, play stocks for yourself.
.
But that's it. It can be used in a bad way too. 😰
It's like a two-edged sword.
.
Selenium supports many loud browsers, such as
Chrom(ium), Firefox, Internet Explorer, Opera, และ Safari
.
But a bit of a complication 😠
We need to download each webdriver before.
Even if I could write a program to use that brand of browser, I would like to think.
(Different brand of browser, different version, different webdriver)
.
Currently, it supports many languages. Many famous programming such as.
Python, Java, C #, JavaScript, Ruby, PHP, Perl
.
If you are interested in studying more, please visit.
https://www.selenium.dev/documentation/en/
.
preview photos seen by post
The code of Python language
(Webdriver is required. In this case, it's Chrome)
The purpose is to log in facebook page.
Without filling the password for hand pain
.
Write a short code just this.
How is it? It's easy to see?
.
✍ Written by Thai programmer thai coderTranslated
python many if 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的最佳貼文
🤓 น้องๆ รู้ไหมครับว่า computer vision
อ่านว่า "คอมพิวเตอร์วิชั่น"
เป็นศาสตร์ทางคอมชั้นสูงอีกแขนงหนึ่ง
ที่ทำให้คอมพิวเตอร์มองเห็นได้ดุจดังตามนุษย์
เป็นไงฟังแล้วเท่ห์มั๊ยละ
.
ปกติมนุษย์เวลาเห็นวัตถุ สิ่งของ สิ่งมีชีวิต อยู่ในรูป หรือในวีดีโอ
เช่น เห็นปูุ๊บก็จะบอกได้ทันทีว่า
ในรูปหรือวีดีโอมีหมา แมว แก้วน้ำ แจกัน ฯลฯ
เรื่องแบบนี้สำหรับคน ถือว่าโคตรรรรรรรรรง่ายๆ
.
แต่ทว่าในมุมของคอมพิวเตอร์
มันยากมากกกกกกกกกกกกกก
.
ถ้าคอมมันทำได้ก็ถือว่าฉลาดมากแล้ว
ถือว่า intelligent เป็นสิ่งอัจฉริยะในมุมของคอม
ซึ่งการแยกแยะว่าสิ่งที่อยู่ในรูปว่ามันเป็นอะไร
ภาษาอังกฤษเรียกว่า classification (แยกแยะประเภท)
.
สำหรับศาสตร์ computer vision 💻 💻
มันแตกแขนงได้หลายเทคนิค หลายสาย
แต่ในโพสต์นี้จะพูดถึงเฉพาะแค่ 2 เรื่อง เท่านั้นได้แก่
.
☑ 1) การทำ Object detection
เป็นการตรวจจจับวัตถุในรูป
ในมุมการ classification มันแค่บอกว่าสิ่งในรูปคืออะไร
แต่ Object detection จะไม่ใช่แค่บอกว่าสิ่งที่อยู่ในรูปคืออะไรเท่านั้น
.
😲 😲 มันเหมือนอัพเกรตจากความสามารถ classification
เพื่อพัฒนาไปตีกล่องสี่เหลี่ยมล้อมรอบ (ภาษาอังกฤษเรียกว่า Box)
ตีกล่องเพื่อบอกตำแหน่งสิ่งที่มันตรวจจับในรูปหรือในวีดีโอได้ ...โอ้วแม่เจ้าจะเทพไปถึงไหน
.
.
☑ 2) การทำ Segmentation
จะแอดวานซ์จาก Object detection
เหมือนเป็นเวอร์ชั่นอัพเกรตอีกต่อหนึ่ง
.
คือมันไม่ได้ตีกรอบล้อมรอบวัตถุนะ
แต่มันจะยิ่งกว่านั้น
...ก็คือมันจะไฮไลท์ (ฝรั่งบอกว่า mask)
....มันจะระบุพื้นที่วัตถุ สิ่งของ ที่มันตรวจจับได้ (เหมือนเราแรงงานไปยังวัตถุนั้น ๆ)
.
.
ซึ่งศาสตร์ computer vision ปัจจุบันนี้
นิยมเอา AI (ปัญญาประดิษฐ์) มาใช้งาน
จริงมันก็ทำอย่างอื่นได้นอกจากสองเรื่องที่ผ่าน เช่น
pose estimation ตรวจจับจุดต่างๆ ของมนุษย์ แบบกล่องสองผี 💀💀 💀 ....จนปรึ้นๆๆ น่ากลัวหรือเปล่า เป็นต้น
.
และมีข่าวดีสำหรับใครที่สนใจเขียนโปรแกรม 👏 👏
สำหรับงาน Object Detection กับ Segmentaion
ผมทำตัวอย่างการใช้งานไว้แล้ว
มี 5 แบบ ลองเข้าไปดูโค้ดได้ที่นี้
.
🔥 1. การช้งานไลบรารี่ imageai ตรวจจับวัตถุในรูป
https://colab.research.google.com/…/1uQnZfPlRhplvcZKWiXn1je…
🔥 2. การใช้งานไลบรารี่ pixellib ตรวจจับวัตถุในรูป
https://colab.research.google.com/…/1llWzReE3rS9wDfSGGm8M7R…
🔥 3. การใช้ไลบรารี่ Tensorflow ตัวอย่างของ Google ตรวจจับวัตถุในรูป
https://colab.research.google.com/…/12K-4uQ1tAvOukLb1-lwXx4…
🔥 4. การใช้ไลบรารี่ Detectron2 ของเฟสบุ๊ค ตรวจจับวัตถุในรูป
https://colab.research.google.com/…/1jnWFADFdZHz1LSyfXVKHY3…
🔥 5 ตัวอย่างการใช้โมเดล Msk RCNN ตรวจจับวัตถุในรูป
https://colab.research.google.com/…/1JGRIMQ1YSdMXkEZdC6QNGb…
.
ปล. มีแต่โค้ด python เพราะต้องทำใจอะนะ
เพราะงานด้านนี้ ภาษานี้คืออันดับหนึ่งในงาน AI ณ ห่วงเวลานี้
(สามารถไปอ่านตำราเรียน ม.1-2-3 มีเนื้อหา python อยู่ในตำรา)
.
.
+++++ขอประชาสัมพันธ์ (ขายของ)
📔 หนังสือ "ปัญญาประดิษฐ์ (AI) ไม่ยาก" เข้าใจได้ด้วยเลขม. ปลาย (เนื้อหาภาษาไทย)
.
ถ้าสนใจสั่งซื้อเล่ม 1 ก็สั่งซื้อได้ที่ (เล่มอื่นๆ กำลังทยอยตามมา)
👉 https://www.mebmarket.com/web/index.php…
.
ขออภัยยังไม่มีเล่มกระดาษจำหน่าย มีแต่ ebook
.
ส่วนตัวอย่างหนังสือ ก็ดูได้ลิงค์นี้
👉 https://www.dropbox.com/s/fg8l38hc0k9b…/chapter_example.pdf…
.
✍เขียนโดย โปรแกรมเมอร์ไทย thai programmer
🤓 Do you know that computer vision?
Read ′′ Computer Vision ′′
It's another elite computer science.
That makes computers visible as human eyes.
How are you? Are you cool?
.
Normally humans see objects of living things in the photo or video.
Such as seeing a crab, I can tell you right away.
In the picture or video, there are dogs, cats, mug, vase etc.
This kind of thing for people is considered simple.
.
But in the corner of computer
It's very difficult.
.
If a computer can do it, it's very clever.
Intelligent is considered genius in the corner of the computer.
Which digest what's in the picture is what it is.
English is called classification (type digest)
.
For computer vision science 💻 💻
It's broken. Many tricks. Many lines.
But in this post, it's only about 2 stories.
.
☑ 1) Object detection
Detection of the objects in the photo
In classification angle, it just says what is in the picture.
But Object detection won't just say what's in the picture.
.
😲 😲 It's like an upgrade from ability classification.
To develop, hit a square box, surround (English is called Box).
Hit the box to spot what it detects in the photo or video... Oh my god how can it be?
.
.
☑ 2) Making Segmentation
Will admin from Object detection
It's like another upgrade version.
.
Well, it doesn't hit the frame surrounding the object.
But it will be more than that.
... Well, it's going to be highlighted (Foreigner says mask)
.... It will identify the areas, objects, things that they detect (like we labor to that object).
.
.
The science of computer vision nowadays.
Popular to use AI (Artificial Intelligence)
True, it can do anything else but two things that pass, e.g.
pose estimation detects different points of human in two ghost box. 💀💀 💀 💀 💀.... so bad, scary, etc.
.
And some good news for anyone who is interested in programming 👏 👏
For Object Detection with Segmentaion
I made an example of use.
There are 5 designs. Check out the code here.
.
🔥 1. Imageai library work. Detection of objects in the photo.
https://colab.research.google.com/drive/1uQnZfPlRhplvcZKWiXn1jeytJIFEVLkV
🔥 2. usage of pixellib libraries. Detect objects in the photo.
https://colab.research.google.com/drive/1llWzReE3rS9wDfSGGm8M7RQ25jeEfSIi
🔥 3. uses of Tensorflow's Tensorflow library. A sample of Google detects objects in the photo.
https://colab.research.google.com/drive/12K-4uQ1tAvOukLb1-lwXx4bnXkeQupTk
🔥 4. Facebook's Detectron2 Library Uses rūp Objects Detector
https://colab.research.google.com/drive/1jnWFADFdZHz1LSyfXVKHY3fIwuY5F_uo
🔥 5 examples of using Msk RCN model. Detect objects in the photo.
https://colab.research.google.com/drive/1JGRIMQ1YSdMXkEZdC6QNGbI722tEQJTE
.
Ps. There are only code python because I need to get over it.
Because of this side job, this language is number one in AI event. At this time, I'm
(Can go to read textbooks. 1-2-3 python content in the textbook)
.
.
+++++ Public relations (selling items)
📔 The book ′′ Artificial Intelligence (AI) is not difficult It can be understood by the number. Tipping (Thai language content)
.
If you are interested in ordering book 1, you can order at (other books are gradually following).
👉 https://www.mebmarket.com/web/index.php?action=BookDetails&data=YToyOntzOjc6InVzZXJfaWQiO3M6NzoiMTcyNTQ4MyI7czo3OiJib29rX2lkIjtzOjY6IjEwODI0NiI7fQ&fbclid=IwAR11zxJea0OnJy5tbfIlSxo4UQmsemh_8TuBF0ddjJQzzliMFFoFz1AtTo4
.
Sorry, no paper books available. Only ebooks.
.
Personal like the book. You can see this link.
👉 https://www.dropbox.com/s/fg8l38hc0k9b0md/chapter_example.pdf?dl=0
.
✍ Written by Thai programmer thai coderTranslated
python many if 在 Untyped 對啊我是工程師 Youtube 的精選貼文
什麼是Bug? 她教電腦說人話 編譯器的發明 | Grace Hopper - The Queen of Code【她也懂電腦】#1
-
你知道電腦是怎麼聽懂人話的嗎?你知道編譯器是誰發明的嗎?你知道工程師口中常常講的bug是什麼嗎?
Grace Hopper 葛麗絲·霍普 完全就是顛覆大眾對女性的刻板印象的例子。她發明了compiler,在電腦科學領域中有極大的貢獻,被稱為電腦科學之母。若是沒有Grace Hopper, 我們就不會有Java, C++, python 之類的程式語言了!除此之外,還在美國海軍中有很傑出的表現。連美國前總統歐巴馬都頒發給她總統自由勳章。快來聽聽葛麗絲·霍普的驚人事蹟吧!
【她也懂電腦】為響應國際婦女節而啟發的系列。證明電腦科學本不屬於男性專有,打破本不應存在的刻板印象。希望能讓更多人認識這些成就不可被藐視的電腦科學界的女英雄們,讓更多女孩願意擁抱這個也屬於我們的電腦科學世界。
「女性不是電腦科學的外來者,更不是新來的。而我們寫下了電腦科學的歷史,更是使其進步不可或缺的動力。」
#SheInspiresMe #InternationalWomensDay #她也懂電腦 #國際婦女節 #GraceHopper
一定要看到影片最後面並且在「YouTube影片下方」按讚留言訂閱分享唷!
-
感謝各位支持,本頻道破500訂閱了~雖然在YouTube的世界算是非常少,但你們的每一個訂閱跟觀看讚好,我都非常珍惜非常感激!凱心琳我會繼續努力!
#500subs
歡迎留言告訴我你的想法,或是你想認識的厲害女性唷!
每(隔週)週四晚上9點更新,請記得開啟YouTube🔔通知!
-
【相關連結】
The Extraordinary Life of the 'Queen of Code': A Grace Hopper Biography
(https://interestingengineering.com/the-extraordinary-life-of-the-queen-of-code-a-grace-hopper-biography)
Grace Hopper Nanosecond Visual Aid (https://youtu.be/s5XMoLgZZ38)
【What I used to make this video】
個人電腦:Apple MacBook Pro [https://amzn.to/2HKgI2T]
拍攝錄音錄影: iPhone X [https://amzn.to/3c0s6Fu]
相機: Canon 80D [https://amzn.to/2VVmiYz]
錄音: Rode [https://amzn.to/3aqnzL2]
鍵盤: Logitech MX Keys Wireless Keyboard [https://amzn.to/3awqi5L]
【愛屋及烏】
Facebook 臉書粉專 👉 [https://www.facebook.com/untyped/]
Instagram 👉 [[https://www.instagram.com/untypedcoding/]
合作邀約 👉 untypedcoding@gmail.com
-
Untyped 對啊我是工程師 - There are so many data types in the world of computer science, so are the people who write the code. We aim to UNTYPE the stereotype of engineers and of how coding is only for a certain type of people.
凱心琳: 一個喜歡電腦科學邏輯推理,在科技圈努力為性別平等奮鬥的女工程師。
-
This video contains affiliate links, which means that if you click on one of the product links, I'll receive a small commission.
圖片影片音效:[giphy.com] [pngwave.com][freesound.org]

python many if 在 Multiple "if" statements vs. if-elif-else: What's the difference? 的推薦與評價

[Sorry for the bad audio quality!]If you want to check multiple conditions in your code, you can use a few "if ... ... <看更多>
python many if 在 Making Choices – Programming with Python - Our Lessons 的推薦與評價
We can also chain several tests together using elif , which is short for “else if”. The following Python code uses elif to print the sign of a number. ... <看更多>
python many if 在 Too many if statements - Stack Overflow 的推薦與評價
... <看更多>
相關內容