window.addEventListener("load", function(){ alert("کانال تلگرام ما : www.telegram.me/PulseLab"); }); ترشحات ذهنی | اکسپلویتینگ
جسارت های در باب امنیت اطلاعات و الکترونیک .
Learning Perl - Writing Exploits5-2
یکشنبه دوازدهم شهریور ۱۳۹۱ ساعت 14:56 | نوشته ‌شده به دست سیروس | ( )

این بخش برای کسانی مورد مفهوم است که در مورد پرل از قبل مطالعه داشتند . در زیر کد اصلی این کتاب رو می بینید که در مورد حلقه بحث شده است که کار هر خط در جلوی آن بعد از عملگر # نوشته شده است .

#!/usr/bin/perl -w
#Loop Tutorial
##################################
#                         FULLY Commented                       #
#################################
 
#While Loops
#Format
# while (Comparison) {
# Action }
#While loops will loop while the comparison is true, if it changes to false, it will no longer continue to loop through its set of action(s).
$i = 1;
while($i <= 5) {
print "While:" . $i . "\n";
$i++;
}
 
#For Loops
#Format
# for (init_expr; test_expr; step_expr;) {
#   ACTION  }
##
# Init expression is done first, then the test expression is tested to be true or false then --
#  the step expression is executed.
for($t = 1; $t <= 5; $t++) {
print "For:" . $t . "\n";
}
 
#Until Loops
#Format
# until (Comparison) {
# Action }
##
# An until loop tests the true false comparison, if it is true, it will continue to loop until the comparison changes to a
# false state.
$p = 1;
until($p == 6) { #It's six because when $p becomes = 5, it doesnt go through the set of action sequences; therefore, 5 isn't printed.
print "Until:" . $p . "\n";
$p++;
}
#Foreach Loops
#Used most commonly to loop through lists
#Format
# foreach $num (@array) {
# Action }
$n = 1;
foreach $n (1..5) {
print "Foreach:" . $n . "\n";
$n++;
}

 

این بخش هم ترجمه بالا است ولی با این فرق که خودم قسمت بالا رو بازنویسی کردم و این بخش رو هم می زارم تا خودتون بخونید ، تقریبا همونائی بودند که در بالا تفصیر کردیم ولی با مثالهای واقعی تر . ( البته گفته نویسنده ای اصلی )


Elcom CMS آسیب پذیر است !
سه شنبه هفتم شهریور ۱۳۹۱ ساعت 21:36 | نوشته ‌شده به دست سیروس | ( )

Release Date.              24-Aug-2012
Last Update.               -
Vendor Notification Date.  28-Oct-2011
Product.                   Elcom CMS - Community Manager
Platform.                  ASP.NET
Affected versions.         Elcom Community Manager version 7.4.10 and
possibly others
Severity Rating.           High
Impact.                    Exposure of system information
                           Exposure of sensitive information
                           System Access
Attack Vector.             Remote with authentication
Solution Status.           Fixed in version 7.5 and later (not verified by
SOS)
CVE reference.             CVE - not yet assigned

Details.
The https://[server]/UploadStyleSheet.aspx script does not validate the file
type passed in the parameter "myfile0" on the server side allowing the
uploading and execution of ASPX files. An attacker can upload an ASPX web
shell and execute commands with web server user privileges.

Proof of Concept (port scanning).
A shell uploaded using the vulnerable
(https://[server]/UploadStyleSheet.aspx) script can be accessed at the
following location: https://[server]/UserUploadedStyles/shell.aspx

Solution.
Upgrade to version 7.5 or later.


Learning Perl - Writing Exploits4
شنبه چهارم شهریور ۱۳۹۱ ساعت 20:46 | نوشته ‌شده به دست سیروس | ( )

شرطی

در هر زبان برنامه نویسی توابه شرطی وجود دارد و زبان پرل نیز از این قاعده خارج نیست . برای این منظور بیشتر در زبان پرل از If استفاده می شود .

کار توبع شرطی به این صورت است که یک شرط را بیان می شود اگر ورودی طبق شرط تعریف شده بود عمل ادامه برنامه در غیر این صورت error به برای مثال بچه که بودم بابام به من گفته اگه درس بخونی معدلت بالا بشه برات به PS می گیرم در غیر این صورت باید تابستان می رفتم سر کلاسهای سال آینده صورت کلی این تابع به صورت زیر است .

#!/usr/bin/perl –w

$variables[1]=  XXXXXX

$Variables[2]= YYYYY

If ($Variables[1]>$Variables[2])

{

ادامه برنامه دنبال شود ...........

}

Else

{

نمایش خطاء .......

};

حالا بیاید توی این یک برنامه واقعی ایجاد کنیم . به کد زیر توجه کنید :

#!/usr/bin/perl –w

$s1=22

$s2=11 

If ($s1>$s2)

{

Print “$s1 is Greater”

}

Else

{

Print “$s2 is Greater”

};

بیایئد ببینیم چی کار کردیم ما در ابتدا دو متغییر تعریف کردیم که به ترتیب عبارتند از$s1 و $s2 که به ترتیب مقدار آنها برابر با 22 و 11 بوده است . با تابع if شرط را اینگونه بیان کردیک که اگر$s1 از$s2 بزرگتر باشد در خروجی چاپ کن $s1 is Greater که بعد از آن هم با else که با if می اید گفیتم اگه شرط درست نبود در خروجی $s2 is greater رو چاپ کن .

در کد بالا از دستور else استفاده شده ، اما همیشه این طور نیست گاهی اوقات برنامه نویسی فقط درستی را چک میکند و در صورت اینکه شرط درست نباشد چی می شه چیزی رو تعیین نمی کنه  برای مثال بالا اگر از else استفاده نکنیم موردی پیش نمی اید بری مثال کوتاه شده ای کد بالا را مشاهده کنید :

#!/usr/bin/perl –w

$s1=22

$s2=11

If ($s1>$s2)

{

Print “$s1 is Greater”

};

البته روشهای دیگر نیز برای استفاده از ساختار وجود دارد که در این مقاله نمی گنجد . برای مطالعه بیشتر می توانید به کتابهای در این زمینه مراجعه فرمائید.  ;)


 
دیگر موارد