👨🏫 ในรูปได้ยกตัวอย่าง ช่องโหว่ของการเขียนโปรแกรม
ที่เปิดโอกาสให้ผู้ประสงค์ร้ายสามารถโจมตีด้วยวิธี
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
php injection 在 純靠北工程師 Facebook 的最佳貼文
#純靠北工程師43p
----------
某大型中心設於某國立大學內的工讀內容如下
薪水:3x00
表面工作時數:一周兩次,沒事即可維護離開
實際工作時數:對方在非工讀時間內打電話給你,要你立即維護網頁、新增資料,如果沒接電話,他會
while(接電話){call();}
------
工作技能如下
熟悉資訊安全、熟悉PHP、熟悉CSS、更換網頁憑證(SSL FOR FREE)、熟悉資料庫CRUD、熟悉NAS操作、熟悉以XAMPP架設
------
工作內容如下
維護網頁內容(RWD)、新增網頁內容、修改網頁原先架構(有時)
資料庫新增資料表、同一份資料表需再中心人員有需求時,任意新增變更資料表內屬性、設置NAS自動備援、維護網頁資安部分(SQL INJECTION、XSS...等)...等眾多事項。
------
其他事項:
1.中心人員會跟你說阿程式不就複製貼上嗎,因為整個中心的人只有你會寫程式
2.中心為該校內建築金源最多之一,但網頁是幾萬元包給學生寫的,憑證是使用SSL FOR FREE
3.須隨call隨更新
----------
🗳️ [群眾審核] https://kaobei.engineer/cards/review
👉 [GitHub Repo] https://github.com/init-engineer/init.engineer
📢 [匿名發文] https://kaobei.engineer/cards/create
🥙 [全平台留言] https://kaobei.engineer/cards/show/5317
php injection 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的最佳貼文
👨🏫 ในรูปได้ยกตัวอย่าง ช่องโหว่ของการเขียนโปรแกรม
ที่เปิดโอกาสให้ผู้ประสงค์ร้ายสามารถโจมตีด้วยวิธี
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