Archive

Archive for the ‘Uncategorized’ Category

Elasticsearch – how to parse MySQL general log

February 24, 2023 Leave a comment

Elasticsearch provides native integration using beats or Agent to collect MySQL errors/slow logs, however if you want detailed auditing via MySQL general log, you can parse the log as following:

  • Configure a new Pipeline and Processor using GROK, here is the GROK to parse MySQL Logs:

%{TIMESTAMP_ISO8601:transactionDate}   %{INT:LogId} %{WORD:Type}\t%{WORD:Type1} %{GREEDYDATA:Type3}

NOTE: please review the spaces properly , make sure to review it before deployment.

  • Create a new file stream integration in Elastic Agent, point the stream to the proper path where MySQL general logs are kept and configure the pipleline to be the newly created custom pipleline.

Have fun.

Categories: Uncategorized

You Recieve Connection Closed when connecting from Fortigate VPN SSL to Windows Server RDP 2012/2016/2019/2022

February 14, 2023 Leave a comment

Scenario:

You configured SSL VPN access through Fortigate (Either V6 or 6.5) and you configured a bookmark RDP connection, when connecting to servers you receive error Connection closed although traffic is allowed to the server via policy and RDP connection works localy

Solution:

Configure Group Policy to allow Encryption Oracle Remediation seto to vulenrable, older versions from FGT doesn’t support remediate option.

How to configure the GPO:

Computer Configuration -> Administrative Templates -> System -> Credentials Delegation then set Encryption Oracle Remediation to Vulnerable.

Categories: Uncategorized

RADZEN published application or Blazor WASM works only for localhosts

February 8, 2023 Leave a comment

Today I faced another cool issue, I have a Blazor app build via Radzen, the application works fine in VS Studio and Blazor studio.

When I published the application, I placed it on IIS server and it worked great, the issue that I can login only if I open the application from localhost on IIS, if I try using the FQDN or the IP it won’t, same for HTTP and HTTPS as well.

It took me a while to fiddle in the logs then I found:

  Authorization failed. These requirements were not met:
  DenyAnonymousAuthorizationRequirement: Requires an authenticated user

So, what is the issue, after some troubleshooting, I found that I enabled multitenancy in the app, all users where placed in the main tenant for the time being, but the base URL or hosts for the tenant was set to http://localhost:5000

after editing the Hosts in the tenant field to change it to my IP address, the application worked perfect, had to read this:

https://learn.microsoft.com/en-us/ef/core/miscellaneous/multitenancy

Categories: Uncategorized Tags: , ,

زي ميستيريوس كيس اوف انا مش انا – الجزء الاول – مقدمة

April 7, 2021 Leave a comment

زي ميستيريوس كيس اوف انا مش انا – الجزء الاول – مقدمة

==================
تنويه: كتبت المجموعة دي من المقالات عبر 2018 ، 2019 ، 2020 ، كل مرة كنت اكتب جزء و اما افتقد للوقت ، الجهد ، الخبرة او الدقة العلمية في جزء معين فاما اتوقف او اتوه ، لذا قد تأتي بعد الاجزاء غير متصلة او

Outdated

فلو حد عنده مراجعة فليتفضل

=================
اما الناس كانت بتتكلم عن ال

Hacking/Ethical hacking

كان ديما في نوشن يا اما نهاك الويب او الوايرلسس ، و طبعا في نوشن اختراق الويندوز ، طبعا الكل عارف انه في طرق كتير تقدر تخترق بيها الويندوز ، بس دايما كان عندي

Fascination

مش بكيفية الاختراق ، لا ازاي نخفي الاختراق ، علشان كده دايما اما كنت بحقق في مشكلة

Malware

ممكن ببقا مش عارف هو فين ، بس عارف ادور فين…

ده خلاني دايما ادور في حتتين ، النتوورك او الهاردديسك ، و ده سبب انه مثلا في تريجرات كان اول حاجة عملتها انه نقدر نشوف كل النتورك تررافيك بالبروسس بتاعته ، لانه دايما ال

Malware

عايز يتكلم على النتورك

بس كان في صندوق كده حاولت افتحه كتير ، اخد مني وقت و مجهود علشان افهم الصندوق ده اصلا ، و علشان افهم اما حفتحه حلاقي فيه ايه ، الميموري

صحيح في معلومات كتير اوي نقدر نعرفها عن السيستم و هل هو

Infected/hacked

و لا لاء من النتورك و الديسك ، بس لا غنى انه نبص جوا الميموري و نطلع منها البهاريز كلها ، بس البحث جوا الميموري عن

Malware

مش سهل زي ما انت متخيل

===============
من اكتر الحاجات اللي كانت بتخوفني ، هي انه يكون السيستم مخترق بس الهاكر قادر يعمل

Patching/hiding

للفيروس جوا بروسس شكلها منطقي زي

Svchosts.exe

لدرجة اني كرهت البروسس دي نفسها اصلا ، بس مش كتير لقيت الموضوع ده ، كان دايما المالوير رامي نفسه باسم مشابه

Svch0sts.exe

مثلا و حاطط نفسه في ال

Temp

بس ايه اللي ممكن يحصل لو الهاكر متقدم و بيلعب صح……………..

==================
السنة اللي فاتت كتبت مقال حوالين ال

Fileless attack https://www.facebook.com/Mahmoud.magdy.soliman/posts/10158696645230645

و ده حمسني اكتر انه لازم نبص جوا الميموري اكتر و نشوف هل فعلا البروسس اللي شغالة بتشغل كود مشبوه و لا لاء و هنا ده دور السلسة دي

السلسة دي كام جزء ، ححاول اجمعهم الفترة اللي جاية كالتالي:

  • الجزء الاول: How PE works حنشوف فيه ازاي الملف التنفيذي بيشتغل و بيعرف نفسه
  • الجزء الثاني: تكمله للجزء الاول مع نظرة لل DLL
  • الجزء الثالث: بعنوان : انت مش ابنيييييييييييييي و ايه العلاقة بين ال Parent/child process
  • الجزء الرابع : بعنوان:  لا مؤاخذة اقلع و فلقس علشان تتحقن و نظرة على ال Process injection
  • الجزء الخامس: بعنوان (على اد الايد مستوحى من برنامج ال CBC) و ازاي تعمل EDR في البيت

==========================
لو متابع من زمان فاحنا بصينا اكتر من مرة على ال

Process/thread

 و ايه الفروق بينهم ، بس هي ازاي اصلا البروسس بتتعمل ؟! يلا بينا

PE files or portable executables

هو الملف التنفيذي اللي يقدر ينفذ تعليمات برمجية مباشرة ، في شرح حلو اوي طويل عريض عنا

https://blog.kowalczyk.info/articles/pefileformat.html#:~:text=The%20PE%20file%20specification%20consists,body%20(the%20raw%20data).

بس احنا حنسيب كل حاجة و نروح على الحتة دي بتاعت ال Export data

اللي هي لو موجودة بتخلي ال

EXE/DLL

يعمل Export لل

Functions/variables to other EXE

typedef struct _IMAGE_EXPORT_DIRECTORY {

    ULONG   Characteristics;

    ULONG   TimeDateStamp;

    USHORT  MajorVersion;

    USHORT  MinorVersion;

    ULONG   Name;

    ULONG   Base;

    ULONG   NumberOfFunctions;

    ULONG   NumberOfNames;

    PULONG  *AddressOfFunctions;

    PULONG  *AddressOfNames;

    PUSHORT *AddressOfNameOrdinals;

} IMAGE_EXPORT_DIRECTORY, *PIMAGE_EXPORT_DIRECTORY;

هنا حنبص على 3 حاجات

NumberOfFunctions هو عدد الفانكشنز المتاحة للاكسبورت

NumberOfNames  هو فيه اسامي الفانكشنز المتاحة للاكسبورت

لو عايز تكمل ، حيكون عليك انه تقرا مقال قديم شويتين بقاله عشرين سنة https://docs.microsoft.com/en-us/archive/msdn-magazine/2002/march/inside-windows-an-in-depth-look-into-the-win32-portable-executable-file-format-part-2 علشان تبقا جاهز للجزء الثاني…..

هابي malware  ايفري ون

Categories: Uncategorized

Commvault Hyperscale Installation – notes from the field.

March 11, 2020 Leave a comment

WOW, it has been 4 years since I blogged here, I moved initially to my own website but I am returning here for the time being sharing with you some goodies.

In this blog post, I will share with you some insights about Commvault’s hyperscale appliances.

Commvault Hyperscale, is state of the art storage appliance that allows seamless protection, upgrade and expansion of backup storage.

Commvault is expanding in Egypt and I had the pleasure installing 2 of 3 appliances currently installed in Egypt.

After fiddling with the appliances, I want to share some insights about those appliances.

Part1: Fujitsu OEM Hyperscale Appliances

Those are the original HS ones that comes from Fujitsu, the come pre-installed with Hyperscale OS and all what you need is cable and configure them.

Cabling the appliances is simple as you have either 2 or 4 10G ports and 1 Gb port for iLO, here are the tricks:

  • 2 of the 10 Gbps ports will be connected to the public network and they will be used for data backups.
  • 2 of the 10 Gbps ports will be configure for internal cluster communication
  • 2 * 1 Gbps iLO will be connected to management network

Trick #1 is that production network must communicate with iLO ports, otherwise the cluster will not start, this is a pain in secure environments where it is a must to have iLO in out of band management configuration.

once you setup the devices and if you choose to install them with new Commvault installation (which installs RHEL virtualization and Commvault on a Windows VM), you will need to make sure the production network can reach your internal network, AD and most of the servers to backup them and join active directory.

Part2: HP DL G10 Hyperscale Appliances

Those are HP DL servers that comes with disks and you must install HS OS on them.

The first issue is don’t install the OS using memory cards, you must connect to iLO and mount the OS ISO using iLO and boot from it.

During the installation, the OS will enumerate disks, and it will detect the USB as a disk and tries to initialize it which will fail causing the OS install the fail, hence you must use the above method.

Once the OS is setup, configure the production and private NICs properly with required IPs, and connect the HS to existing Commcell server that you must install separately.

Notes from the field:

1- For HS OS (not the appliances) make sure that you update Commvault to the latest SPs and download Linux x86/x64 packages to the server the make sure to update the cache.

2- Join the appliances one by one to the Commcell, then update the remote cache of each appliance then update the appliance OS itself, then create scaleout storage.

3- Make sure that DNS names are properly mapping to the IPs of each HS appliance, otherwise you will see error (DNS name doesn’t map the device IP).

4- If you mistakenly configured the NICs, you can edit the nics configuration and bonding through editing /etc/sysconfig/network-scripts, do it carefully and edit it with extreme caution.

5- Check network configuration using ethtool and ifcfg utilities.

6- Firewalls are your enemy.

Happy installation.

 

Categories: Uncategorized

TMG Phase-put decisions’ table.

June 18, 2013 Leave a comment

I got this table that will help you in deciding how to replace TMG 2010 based on the feature used also comparing TMG and UAG, please feel free to share and reuse it.

Features

ISA

TMG

Solution Reference
Route

X

X

Windows Server 2012 RRAS Technet: Routing and Remote Access
http://technet.microsoft.com/en-us/network/bb545655
NAT

X

X

Windows Server 2012 RRAS Technet: Routing and Remote Access
http://technet.microsoft.com/en-us/network/bb545655
Edge Firewall

X

X

3rd party product
Stateful Packet filtering

X

X

3rd party product
Application Layer Firewalling

X

X

3rd party product
HTTP Filter

X

X

3rd party product
HTTPS Inspection

X

3rd party product
Intrusion Prevention (IPS) and Intrusion Detection (IDS) system

X

X

3rd party product
Web proxy and Web caching Server

X

X

Web proxy: 3rd party productWeb Caching Server:
– 3rd party product
– Windows Azure Caching Services for Cloud solutions integration
Windows Azure Caching Services
http://www.windowsazure.com/en-us/services/caching/
URL Filtering

X

3rd party product
Malware Inspection

X

3rd party product
Forward and reverse Proxy

X

X

Reverse proxy:
– UAG 2010
(*)
Windows 8.1 support for Web Application Proxy (**) – To be released
Forward proxy: 3rd Party
Publishing Exchange Server 2010 with Forefront Unified Access Gateway 2010 and Forefront Threat Management Gateway 2010
http://www.microsoft.com/en-us/download/confirmation.aspx?id=8946Deploying Forefront UAG for mobile devices
http://technet.microsoft.com/en-us/library/gg295317.aspx

What’s New For The Enterprise In Windows 8.1
http://blogs.windows.com/windows/b

/springboard

/archive/2013/06/03/what-s-new-for-the-enterprise-in-windows-8-1.aspx

VPN Server (Client VPN and Site to Site VPN)

X

X

Windows Server 2012 RRAS Technet: Routing and Remote Access
http://technet.microsoft.com/en-us/network/bb545655
E-Mail Protection Gateway

X

X

Exchange Online Protection Exchange Online Protection – homepage
http://office.microsoft.com/en-us/exchange/microsoft-exchange-online-protection-email-filter-and-anti-spam-protection-email-security-email-spam-FX103763969.aspx
SSL VPN UAG 2010 Forefron Unified Access Gateway 2010
http://www.microsoft.com/en-us/server-cloud/forefront/unified-access-gateway.aspx
(*) Choosing Between Forefront TMG or Forefront UAG
Exchange Related Deployment Scenario or Feature Forefront TMG Forefront UAG
Publish Microsoft Office Outlook Web App and the Exchange Control Panel (ECP) using forms-based authentication þ þ
Publish Outlook Anywhere using Basic or NTLM authentication þ þ
Publish Microsoft Exchange ActiveSync using Basic authentication þ þ
Provide load balancing for HTTP-based protocol accessing from the Internet þ þ
Support two-factor authentication for Outlook Web App þ þ
Support two-factor authentication for Exchange ActiveSync þ
Provide certificate-based authentication for Exchange ActiveSync, Outlook Web App, and ECP þ
Perform mail hygiene for Exchange with installation of the Edge Transport server role and Microsoft Forefront Protection 2010 for Exchange Server þ
Protect and filter Internet access for internal users from malware and other Web-based threats þ
Provide support for scaled up Outlook Anywhere deployments by using multiple source IP addresses þ
Check a client computer accessing Outlook Web App for presence of approved antivirus software, updates, etc. þ
Thoroughly clean up the client following an Outlook Web App session with settings configurable by the admin þ
Categories: Uncategorized

Thanks community – Awarded the vExpert award from VMware

June 2, 2013 Leave a comment

if you missed the announcement, the vExperts award for 2013 was announced last week http://blogs.vmware.com/vmtn/2013/05/vexpert-2013-awardees-announced.html, I am overwhelmed to be considered as vExpert this year, joining an execlusive group of elite 580 experts around the world.

Thanks everyone, I promise you to deliver and give more.

Categories: Uncategorized Tags: ,

Announcement: Exchange 2013 sp1 will support running from removable media such as “flash drives”

April 1, 2013 2 comments

Through a trusted resource at the product group, we got the information that sp1 of Exchange 2013 will support running from removable media such as flash drives, dvd drives and blue ray disks, this will allow greater flexibility and decouples the sw layer from hw layer allowing exxhamge to be delivered as remote application over terminal service session or running it as
portable app over linux machines

What a great news, can’t for service pack 1….

Categories: Uncategorized

شرح العلاقة بين مصر ،و هارفارد و اليابان و الثورة و الاخوان و ال ITIL

December 9, 2012 Leave a comment

الاسبوع الماضي حضرت كورس ال ITIL foundation لا  أدري هذه هي المرة الكم التي احضر فيها هذا الكورس و لكن هذه المرة هي المرة الاخيرة لانه انا اخدت الامتحان فور الانتهاء من الكورس الخميس الماضي.

الجديد في الكورس المرة دي انه وجدت الخيط اللي استطعت الربط به بين العديد من المواضيع الغير مترابطة و التي تشمل مصر ، اليابان و هارفارد و احداث الثورة، استمر بالقراءة اكي تفهم اكثر.

خلال الكورس تم عرض مفهوم Deming لتطوير النوعية ، المدرب قام بعرض نبذة اعتبرها مذهلة (و هي الحل لكل مشاكلنا الحالية) عن Deming هو قام بعرض النبذة عن دكتور Deming و لكن في رأسي تكون الرابط

يعتبر دكتور Deming من ابرز مؤسسين علم الجودة Quality improvement و بدأ هذا بعد ضرب اليابان بالقنبلة الذرية و انهيارها ابان الحرب العالمية الثانية ، قبل هذا التاريخ لم يكن لدى البشرية مفهوم واضح للجودة و تحسين الجودة ، حيث كانت البشرية عموما تتقبل المنتجات كما هي بدون جودة او غير ، حيث ذهب دكتور Deming المحاضر في هارفارد لكي يدرس اليابان بعد انهيارها و يرى كيف ستتطور.

وجد دكتور Deming انه اليابان في فترة 10 سنوات استطاعت النهوض من الانهيار التام الى التفوق الاقتصادي و الصناعي مرة أخرى و استطاع من خلال دراسة ما حدث ان يطور مفهوم و مبدأDeming في تطوير الجودة (Plan , do , check , act)

ديمينج وجد انه في امريكا و بريطانيا يتم تقبل المنتج او الوضع عموما كما هو ، فمثلا اذا ذهبت لشراء البيض من المحل و لم تجد البيض عنده فستقول للمحل متى ساجد البيض فيقول لك صاحب المحل اننا طلبناه و سيتم توصيله في غضون اسبوعين ، فانت كزبون ستذهب و انت سعيد لانه الان اتفقت و سيصلك البيض بعد اسبوعين.

في اليابان كان الوضع مختلف، فاذا ذهبت و طلبت البيض و جاءك الرد بان المحل يحتاج اسبوعين لتوصيل البيض ، فيمكنك السؤال لماذا ، فيرد عليك لانه نحتاج للذهاب للمزرعة لاحضار البيض ، فسترد لماذا لا تأخذ دراجة ، فيقوم صاحب المحل بأخذ دراجة و توصيل البيض في اسبوع مثلا.

المرة التي تليها عندما تطلب البيض و تجد انه يستلزم اسبوع لاحضار البيض فيمكنك ان تقترح ان يقوم صحب المحل بوضع الدجاج خلف المحل مثلا او استخدام سيارة و هكذا تستمر العملية ذاتيا الى ان تذهب و تجد البيض حيث تنتقل الى مرحلة اخرى لتطوير جودة البيض و هكذا…

وجد ديمينج انه هذا المفهوم قوي جدا ، و من خلاله تمكن اليابانيين من العودة و بقوة من الصفر الى المقدمة مرة أخرى.

و انا اتابع هذه المقدمة في الكورس تكونت في ذهني بعض النقاط التي اعتبرها اساسا لكل المشاكل السياسية و المجتمعية التي نمر بها الان ، اسردها في النقاط التالية:

  • ديمينج ، الدكتور في هارفارد، اراد البحث و التدليل في الاعماق اليابانية و استكشاف شئ جديد ، لم يكتف بانه دكتور في هارفارد بل ذهب لابعد مما هو ذلك ليكتشف علم جديد تماما.
  • الرغبة في التطوير و التحسين و تقبل النقد من الاخرين ، اليابانيين لم يكتفوا بانتاج البيض (مثلا) بعد الهزيمة فانت كمواطن في بلد منهار قد تكون سعيد جدا لوجود منتج ما اساسا ، لم يتقبل اليابانيين هذا الوضع و بدؤوا في تحسينه و هو ما اوصلهم لما هم فيه الان.
  • العالم لم يرفض دراسات و ابحاث ديمينج ، بل اصبحت علما الان.

اعتقد انه الثلاث نقاط بالاعلى هي اساس كل المشاكل في مصر ، فنحن لا نتيح للنخبة الحقيقية البحث و تنفيذ ابحاثها بل نظل نختار اهل الخبرة و الثقة و ليسوا اهل العلم في اتخاذ كل قراراتنا.

ثانيا ، ليس لدينا رغبة في التطور او القدرة النقد الذاتي البناء ، و لدينا قبول ليس بالوضع الموجود حاليا ، بل قبول برفض الاخر و عدم القدرة على التغيير ، فهذا سلفي انا ارفضه و سأظل هكذا فهو كذلك  و ان أتغير و هو لن يتغير و هذا ليبرالي او اخواني او…الخ الخ ارفضه و ان اتغير و هو لن يتغير ، اضف النقد الهدام و النقد للنقد.

ربما اكون مخطئا او مصيبا ، و لكنها استقراءات لواقع الحال ….المرير

Categories: Uncategorized

The UC Architects is online #mvpbuzz

June 20, 2012 Leave a comment

It’s my pleasure to let you know thatlast week, the UC architects community is launches, we will do regular Podcasts, you can download the first regular instalment of The UC Architects, a regular bi-weekly podcast focusing on Exchange and Lync including:

  • Exchange and Lync tips and tricks
  • Deep dives into new features and products
  • Round ups of the Exchange and Lync news so you don’t miss an interesting new tool made available by the community.

In this week’s episode, I talk to Dave Stork, John A Cook, Michael Van Horenbeek andSerkan Varoglu about Exchange 2010 SP2 Update Rollup 3 and why you should take notice, we chat about Exchange 15 (or is it 2013?) rumours and then chat about TechEd, MEC and what’s new this week around Lync and Exchange.

UC_Architects_PodCast_1

In future episodes you’ll also get to hear from the rest of the team, including Exchange and Lync MVPs Pat Richard,Mahmoud Magdy, Johan Veldhuis, Tom Arbuthnot and Ståle Hansen – along with Exchange and Lync bloggers Michel De Rooij, Paul Cunningham and Andrew Price. As you can see we’ve got quite a line-up – and we also hope to have some other guests in from the community and Exchange and Lync product teams too.

The UC Architects is available as an RSS feed you can subscribe to, and over the next couple of days will be available in the iTunes and Zune stores for free download too. Find out more by clicking the link below!

Download the podcast!

By the way – if you’re interested in getting involved or have any feedback, as well as our website we’ve got Facebook andLinkedIn groups along with our Twitter account, @TheUCArchitects

Categories: Uncategorized