Showing posts with label security. Show all posts
Showing posts with label security. Show all posts

Sunday, March 8, 2009

התרשמויותי ממפגש קהילת .NET וניתוח התמודדות עם מתקפות באמצעות ווב 2.0

שלום,

שלום לכולם,

ביום שלישי השתתפתי בסמינר שבו דובר על מתקפות בתחום ה-web 2.0. להלן סיכום הפגישה מנקודת מבטי, למי שמתעניין:

התרשמויותי ממפגש ניתוח והתמודדות עם מתקפות בעולם ה-Web2.0

ראשית, הנה תאור המפגש כפי שהופיע בהזמנה:

שלום,

הנך מוזמן למפגש קהילת אבטחת מידע - .Net security user group

שיתקיים בתאריך ה 3-3-09

התכנסות ב-17:30 בבית מיקרוסופט, רח' הפנינה 2 רעננה.

שם המפגש- ניתוח והתמודדות עם מתקפות בעולם ה Web2

בהרצאה זאת נסקור את מגוון המתקפות והאיומים בצד הלקוח, וכיצד ניתן לנצל את טכנולוגיות ה - Web 2 למימוש מתקפות אלו.

במהלך ההרצאה נסקור כלים לניתוח אירועים בצד הלקוח כגון client honey וכלים נוספים המאפשרים לבצע ניתוח מעמיק למתרחש בצד הלקוח.

להלן תיאור המפגש באנגלית:

What are web 2.0 attacks ? do you know how to defend against web 2.0 attacks? How is it related to man in the endpoint attack?

this session will be focused on how to defend against web 2.0 attacks and man in the endpoint attacks.

with technologies such as Ajax and Silverlight the client is much more involved, it's no more protecting the server but now we will need to protect the client who's on the public network.

do you know if someone is attacking your machine ? how ?

if you don't have all the answers for those questions you are welcome to joint this session at March 3th, Microsoft Israel, 2 Hapnina St. Raanana. Floor 0 at 17:30.

Presenter: Nimrod luria, Information Security Architect, Qrity.

סדר יום:

18:00 -17:30 התכנסות וכיבוד קל.

18:00 -19:00 הצגת האיומים בצד הלקוח.

19:00-19:15 הפסקה.

19:15-20:30 המשך הרצאה, מתקפות WEB2 מצד הלקוח ודרכי התגוננות.

20:30- 21:00 שאלות פתוחות בנושא.

קהל יעד

מפתחים, מנהלי פרויקטים ו ר"צ, אנשי תשתיות, מומחי ומנהלי אבטחת מידע.

מרצה: נמרוד לוריא ארכיטקט אבטחת מידע, חברת www.Qrity.com Qrity.

קהילה זו נפגשת כל יום שלישי ראשון בחודש אי זוגי (בד"כ).

אשמח לראותך, להרשמה לחץ כאן: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032405780&Culture=he-IL

ירון חקון, מנהל הקהילה yaron@2bsecure.co.il .

כרגיל, ניתן להעביר את ההזמנה ללקוחות \עובדים \ חברים וכול מי שמתעניין, ההשתתפות בחינם.

ולעצם הסקירה שלי:

הגעתי למקום בשסיבות חמש ושלושים. מיקרוסופט תופסת בבניין שם שלוש קומות. בכל קומה יש להם לובי יפייפה. בקומה 0 שם גם התקיים הכינוס (באולם הכנסים שנראה כמו חדר קולנוע קטן) הלובי עוד יותר יפה.

כפי שמוזכר בהזמנה את הנושאים העביר נמרוד לוריה מחברת Q.rity. הקישורים בסיכום שלי נאספו על ידי והם לא הובאו ע"י המרצה, אלא אם ציינתי זאת במפורש. הסיכום הוא שלי ובמילים שלי ולא בהכרח מדגיש את אותם הדברים שהדגיש המרצה או מתרכז בנושאים שאליו כיוון המרצה.

הנושא הראשון שעליו דובר הוא alternate data streams. כעקרון, מדובר במנגנון שנמצא ב-ntfs שהיא אחת ממערכות הקבצים הנמצאות בשימוש במערכות הפעלה windows. המנגנון מאפשר לשמור רצף של בתים (a stream of bytes) ולגשת אליו ולערוך בו שינויים כאשר הרצף מוצמד לקבצים. ראו מדריכון על הנושא פה. ייתרון וחסרון של השיטה הוא (בין שאר היתרונות והחסרונות) שהרצף נגיש אבל לא נראה למי שלא מחפשו במפורש (למשל ע"י שימוש בתוכנה streams או תוכנות אחרות שמשמשות כ-streams reader, למשל הנה קישור להורדה פה והנה עוד אחת פה). הנה קישור שמצאתי למאמר שבו מוסבר יפה הנושא, וחלק מההשלכות שלו הקשורות לאבטחה. עוד קישור לעמוד שמסביר יפה, אם כי נכתב די מזמן נמצא פה.

נמרוד הראה כמה קל לשמור קוד JavaScript כ-alternate data stream לקובץ תמים כלשהו, למשל קובץ טקסט רגיל. ואז להעיר או להריץ את הקוד בסביבת המשתמש עם הרשאות המשתמש. באותו האופן הראה נמרוד את ההשלכות לכתיבת קובץ הרצה, למשל exe, והרצתו בסביבת המשתמש.

ושילוב מעניין, למשל, זה שהודגם: תוכנה ה"משחזרת ססמאות נשכחות" (זאת הגדרת התפקיד המכובסת של התוכנה...) לסביבת חלונות, pspv.exe, יכולה להכתב כ-alternate data stream שרוכב על קובץ JavaScript. באופן זה הקוד הזדוני יורד למחשב המשתמש. ואז אם יש גישה (זה כבר מסבירים בהרצאות אחרות איך משיגים גישה להרצת קבצים אצל משתמשים וזה לא היה הנושא של השיחה הזאת) בקלות מריצים ומקבלים מידע רגיש של המשתמש.

הנה כמה שורות פקודה שהוזכרו תוך כדי ההסבר:

type pspv.exe > pspvonjs.js:pspv.exe

start .\pspvonjs.js:pspv.exe

streams –s c:\Inetpub\wwwroot\demo\

מידע מעניין שהוזכר תוך כדי דיון היה שדפדפן chrome מאפשר הרצת alternate data streams. נסו להכניס קוד הרצה (למשל לפי הדוגמה שלמעלה) לקובץ שזמין באתר אינטרנט וגלשו אליו באמצעות chrome ובדקו אם זה מריץ את הקוד על מכונת החלונות שלכם או שלא. למשל:

http://foo.com/x.txt:malicious.exe

עוד דבר מעניין שלמדתי שאפשר לעשות הוא להכניס קוד JavaScript בתוך קבצי gif באופן שישנם דפדפנים שיריצו את קוד ה-JavaScript. אפשר לחשוב על זה בתור סוג של cross site scripting. וראו הדגמה קלילה שמצאתי באתר הבא (אפשר לדלג ישר לפרק שמונה: chapter 8 – XSS upload).

נמרוד הציג את השיטה כאמצעי הפצה נח של וירוסים, רוגלות ובאופן כללי רושעות. כדי להראות איך גורמים למידע להשאר בצד המשתמש הוא נתן לדוגמה שיטה אחת שניתן לשמור מידע באמצעות silverlight כדי לעשות בו שימוש אח"כ. הנה קישור ליומן הרשת של Ian Blackburn שמסביר יפה את השיטה. אני יכול להסביר למי שמעוניין איך אפשר לשמור קבצים בצד הלקוח ב-FireFox וב-Internet Explorer ע"י שימוש ב-client side persistence, לרבות שימוש ב-sessionStorage וב-globalStorage ב-FireFox ושימוש ב-userData ב-Internet Explorer. וכמובן ישנן שיטות דומות עבור flash וכן דפדפנים שונים מממשים מסדי נתונים עם מנשק SQL שגם באמצעותם ניתן לשמור ולנהל מידע שאינו בהכרח תלוי עמוד/אתר/דומיין.

למי שבכל זאת ספקן לגבי יכולות הרצת קוד אצל המשתמש הנה שיטה שכבר טופלה ואינה נתמכת בדפדפנים מעודכנים (אבל תעבוד יפה אצל משתמשים שלא מתעדכנים בעדכוני אבטחה):

var x=new ActiveXObject("Wscript.shell");

x.run("\path\to\file\");

return false;

המסלול לקובץ יכול בהחלט להיות כזה שמפעיל קוד הרצה שמודבר ל-Wscript.shell כ-alternate data stream. למשל חשבו על מסלול שנראה כמו c:\some\folder\Wscript.shell:malicious.exe.

עוד דיון שהתפתח היה על נושא ה-cross domain מה שידוע בתור שיטות עקיפה ל-same origin policy שנועדה לשמור על פרטיות מידע של גולשים באתרי אינטרנט. אחת מהמדוברות היתה עריכה ושינויים בקובץ crossdomain.cml שעושים בו שימוש ב-flash ו-silverlight ובקבצים דומים ב-development frameworks שונים שעושים בהם שימוש מפתחי אתרים. אפשר לחשוב איך ניתן לעקוף את ה-same domain policy שנאכף ע"י הדפדפנים עבור קוד JavaScript ע"י תיווך באמצעות אובייקטי Flash שעבורם הוגדרו הקלות ב-crossdomain.xml. זה יכול להיות אמצעי להעברת מידע לרבות גניבת מידע בין domains ובאופן מעשי עקיפת מודל האבטחה.

עוד באותו נושא הציג נמרוד את __defineGetter__ שנמצא בפרוייקט מוזילה ובאמצעותו ניתן היה (ואולי בגרסראות מסויימות עדיין ניתן) לשנות אפקטיבית את ה-domain בהקשר שבו רץ קוד JavaScript כך שניתן יהיה להעביר מידע בין domains. הנה כך כדוגמה:

document.__defineGetter__("domain",function(){return "safe.com";});

וראו קישור לדוגמה נוספת פה.

גם במהלך ההרצאה היו גלישות לדיונים על web services וגם בהפסקה הספקתי לשמוע קצת שיחות בנושאי web services. רשמים שאני זוכר הם:

· אנשים חושבים ששימוש ב-SAML יפתור להם את כל בעיות האבטחה, אע"פ שאין להם מושג במשמעות של SAML, במימוש של SAML וביישום נכון שלו. אין לקהל שהייתי בו (לפחות זה שדיבר בקול, אני הרי לא יודע מה אנשים חושבים לעצמם או יודעים ולא מגלים) הבנה ביישום של SAML בהקשרים של web services באמצעות .NET או בכלל. אם אני טועה, אני אשמח לדעת. בכל אופן התרשמתי שהשיטה המקובלת היא לשלוח בקשות ל-web service או באמצעות SOAP requests שאין להם כלל מנגנוני הזדהות (authentication information in security sections/tokens/assertions) או שיש שימוש בשיטה הפשוטה של שם משתמש ואולי גם ססמה ב-cleartext ע"י שימוש ב-basic HTTP authentication או ב-UsernameToken (הנה דוגמה, יש עוד דוגמאות).

· הטענה היתה שבשעה שיש תוקף שיש לו גישה לצד המשתמש אזי אין לו בעיה לצפות בתכנים ולשנותם בין אם יש ובין אם אין SSL כי יש אפשרות לקבל גישה למידע דרך ה-wininet טרם הטיפול לצורך SSL). ההמלצה של נמרוד היתה להשתמש ב-SAML לצורך ווידוא זהות המשתמש וה-data integrity של מה שנשלח, אבל הוא לא הרחיב ואני לא הבנתי איך גם זה לא פגיע באותה מידה אם יש גישה ל-wininet.

החלק השני של הסמינר עסק בנושא של התקפות על צד המשתמש, להבדיל מהתקפות על השרתים ועל האפליקציות. נמרוד השמיע הבחנה שלו שהתקיפה על שרתים ועל אפליקציות דרך האינטרנט הולכת והופכת קשה יותר ודורשת יותר ויותר תחכום מהתוקפים לאור שימוש ב-web application firewalls (הוא מכנה משום מה web application firewall בשם הגנרי אימפרבה, שאותי באופן אישי זה מצער בתור עובד של F5 שמפתחת ומוכרת ASM). לא נראה שמישהו מהקהל קבל על ההבחנה של נמרוד.

הנושא התמקד בשאלה "איך אני יכול לדעת שאני מותקף או מודבק ע"י רושעה כלשהי?" היו כל מיני תשובות כמו "כשהמערכת לא עובדת כרגיל" או תגובות ציניות כגון "כשהגישה לאינטרנט הופכת מהירה מאד" וכיוצא באלה. נמרוד התמקד בכלי בשם httpreplay והראה איך אפשר לעשות בו שימוש ודן במגבלות ובאפשרויות.

נמרוד הציג כלים וסיפר על שלל כלים אחרים (אך לא פירט לצערי) שניתן וכדאי לעשות בהם שימוש כדי לנטר את המתרחש בצד המשתמש על מנת לנסות ולזהות תעבורה חשודה. נמרוד סיפר על תחום שמכונה HoneyClient (ראו פרוייקט של MITRE בשם זה וגם הסבר על הנושא בויקיפדיה), שזה אמור להיות לצד הלקוח מה ש-HoneyPot הוא לצד השרת.

כלים נוספים שהוזכרו אך לא היתה התעמקות בהם ובאופן השימוש בהם:

· strace

· wininet debug

· שימוש ב- detoursלצורך איסוף מידע

· honeyC

· spyBye

· phoneyC

· honeyMonkey

· capture-HPC

· MITRE honeyclient

אני לא יודע לספר על הכלים הללו כי אין לי נסיון בשימוש וידע על אף אחד מהם. אני מקווה למצוא זמן ולנסות להבין יותר על הכלים האלה ומה שעומד מאחוריהם.

לסיום ניסיתי לקבל טיפ על איך אפשר לקבל שליטה (לכל הפחות לקרוא את התוכן של...) על HTTP Request איך שהוא יוצא מהדפדפן באמצעות JavaScript (למשל, לראות איך נראה ה-request לאחר לחיצה על כפתור ה-submit של טופס). מה שקיבלתי זה ששלחו אותי לחקור את הקוד של firebug. אם יש למישהו טיפ יותר ישיר לתשובה אני מאד אשמח לדעת.

זהו.

אני חושב שזה היה מפגש מאד מעניין ומאד מחכים. וודאי אם אצליח להתעמק בכל הנושאים שהוצגו על קצה המזלג. אני מקווה להצליח ולהשתתף בעוד מפגשים מסוג זה, נראה שזאת דרך לא רעה בכלל להרחיב את הידע.

שלמה.

Tuesday, November 11, 2008

What is nonrepudiation?

What is nonrepudiation?

To repudiate is, according to Merriam-Webster's dictionary:

  1. to divorce or separate formally from (a woman)
  2. to refuse to have anything to do with : disown
  3. a: to refuse to accept ; especially : to reject as unauthorized or as having no binding force b: to reject as untrue or unjust
  4. to refuse to acknowledge or pay
Nonrepudiation, when in comes to Security, or especially to security in a
networking environment is, according to Wikipedia:
Non-repudiation is the concept of ensuring that a party in a dispute cannot repudiate, or refute the validity of a statement or contract. Although this concept can be applied to any transmission, including television and radio, by far the most common application is in the verification and trust of signatures.
In regard to digital security, the cryptological meaning and application of non-repudiation shifts to mean:[1]

  • A service that provides proof of the integrity and origin of data.
  • An authentication that with high assurance can be asserted to be genuine.

Proof of data integrity is typically the easiest of these requirements to accomplish. A data hash or checksum, such as MD5 or CRC, is usually sufficient to establish that the likelihood of data being undetectably changed is extremely low. Even with this safeguard, it is still possible to tamper with data in transit, either through a man-in-the-middle attack or phishing. Due to this flaw, data integrity is best asserted when the recipient already possesses the necessary verification information.

The most common method of asserting the digital origin of data is through digital certificates, a form of public key infrastructure to which digital signatures belong. They can also be used for encryption. It is important to note that the digital origin only means that the certified/signed data can be, with reasonable certainty, trusted to be from somebody who possesses the private key corresponding to the signing certificate. If the key is not properly safeguarded by the original owner, digital forgery can become a major concern.

Friday, December 14, 2007

Alcatel Launches XML Security Box

I just read Alcatel Launches XML Security Box, Searches for Software Partners and got curios: ha! yet another big-fish is going into the XML market. The press release on Alcatel's website, surprisingly, doesn't say much about neither web services related functionality in general or about XML in particular. So if you see the focus in XML as the article on Network Computing suggests, then Alcatel is also becoming a player in the XML market and should probably be listed in the list of players in the XML/WS market that I made in another post a while ago. If this is indeed the case or not -- let's wait and see.

An advantage, according to Andy Dornan from Network Computing is by specialized XML Software that is combined with XML hardware. This makes me wonder if indeed this special purpose XML hardware will beat the multi-purpose multi-core processors hardware.

Another advantage, according to Dornan, it that the appliance also includes identity management, service provisioning and a UDDI registry. F5 has Firepass which can probably contribute identity management functionality. F5's ASM is already integrated into BIGIP and TMOS, so load balancing and acceleration are already available, along with other functionality and products that F5 has to offer on the same appliance.

It is an interesting announcement. I'll stay tuned to see if more XML related information becomes available.

Tuesday, May 29, 2007

OWASP-IL mini conference

https://www.owasp.org/index.php/2nd_OWASP_IL_mini_conference

Unfortunately, I didn't attend, and I could only read the presentations online. Hopefully some of my friends from work who did attend will give a summarizing presentations on the new things for us to learn from the conference.

From my own reading I liked the talk about positive security, although there is nothing new presented there.

Thursday, March 8, 2007

Threats on Web applications -- nice summary and introduction

Researchers from the Honeynet Project are monitoring attacks by providing systems on which attackers perform their vulnerability exploits. There is a paper listing their findings and conclusions titled: Know your Enemy:Web Application Threats. Using Honeypots to learn about HTTP-based attacks.

The conclusions and future work is listed below:

Conclusions

Web applications present a very high risk, and an attractive target to attackers for the following reasons: Firstly, the quality of the code is often rather poor and many vulnerabilities of commonly used code are published. Second, attacks can often be performed using PHP and shell scripts, which are much easier to develop and use than buffer-overflow exploits. Thirdly, tools such as search engines provide a very easy way for attackers to locate vulnerable web applications. We believe that web servers present relatively high-value targets for attackers since they are more likely to have higher bandwidth connections than the average desktop computer. They will also typically need to access the organisation's databases and so may provide a stepping stone for an attacker who wishes to recover such data.

Although significant effort is being made to improve code quality in many web applications, the volume of existing code, and the amount of new code being written are causing the number of vulnerabilities being reported to remain quite high. (For example, the number one cross-platform vulnerability listed in the SANS Top 20 Survey is web applications.) Since the other factors - public availability, easy exploitation and web applications being easy to locate via search engines - are not likely to change significantly, we can expect to see these trends carrying on into the future.

Future Work

In order to acquire a greater amount of information the deployment process will be stream-lined. Therefore we plan to develop a live CD or an easy-to-install VMware image of our honeypots. Further, the level of detail of the emulation performed by our honeypots will be increased to improve the realism of the simulation and more accurately mimic a genuinely vulnerable web application. These improvements will enable us to observe a wider range of attack patterns and threats that are launched against today's web applications. Finally it would be very interesting to monitor bogus web spiders. This could be done by setting up a new honeypot that denotes its web pages as not-to-be indexed and logs any access to them.

Thursday, February 1, 2007

XML processor attacks continues

Following my blog post from yesterday about XML processor attacks, I'd like to add additional information based on a discussion which I started on the xml-dev mailing list.

David Megginson says that:

* XML REC does not specify or limits any name, literal lengths, number of attributes, depth of nested elements and so on. As a result these are a target for DoD attack on the XML processor. He suggests a few tests that can be used on an XML processor to make sure whether or not it can terminate processor prior to running out of its resources and make a graceful exit rather than crash. He states that any XML parser should have built in limitations on such properties.

* He also lists the risks in allowing processing of external fragments.

* He explains how access to an external resource, e.g., a schema or DTD, can be subject to a DoS if the location has been compromised.


derek denny-brown says that:

* a naive implementation of duplicate attribute detection or a namespace prefix lookup, e.g., using a stack implementation where the Nth string is being matched against the other N-1 strings, has an O(N^2) complexity. He also suggests that if the implementation is hash based and the attacker can guess your hashing algorithm, then the O(N^2) complexity for processing time can also be imposed on the parser.
* he also estimates that it would be quite hard to craft an attack that leverages these vulnerabilities to do much damage since the scan is extremely fast, so by limiting the size of the accepted document such attacks can be practically blocked.

Richard Salz says that:

* it should be pretty easy to cause a DoS with short messages with a very large (he gives 1 million as an example) elements depth. Another example would be badly fragmented nested elements. He further gives examples of very long element names, attribute names, namespace prefixes, and excessively long attribute or namespace declarations values.
* he states that the a-symmetrical nature gives advantage to the attacker as producing an attack is as simple as printing text while processing the received documents in such cases yields expensive computation.



I'm still collecting material and organizing it, and I hope that I will be able in the next few days to write a detailed and more organized summary on the subject. I'll post it here on my blog and will probably also announce its availability on xml-dev at least to be polite and write back my conclusions and contributions to the discussion.