question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ArgumentException in Beacon.cs

See original GitHub issue

Hi, I hope its okay that I raised another issue. I tested this with CobaltStrike beacon v4 on x64 injected threads on two different Windows 10 VMs and it produced the following output:


Scanning processes for injected threads Found injected thread Process : <process name> Process ID : 4592 Thread ID : 5484

Scanning injected thread for CobaltStrike beacon

Unhandled Exception: System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at CobaltStrikeConfigParser.Beacon.ParseTLV(Byte[] configBytes) at ConsoleUI.Program.GetBeaconFromYaraScan(Dictionary2 beaconMatchOffsets, Byte[] bytes) in C:\Users<username>\CobaltStrikeScan\ConsoleUI\Program.cs:line 167 at ConsoleUI.Program.Main(String[] args) in C:\Users<username>\CobaltStrikeScan\ConsoleUI\Program.cs:line 52


I’m unable to debug CobaltStrikeConfigParser in the solution because of the build order so I wasn’t able to dig deeper. I tried adding some try catch blocks and checks for whether the dict contains the key, but that doesn’t seem to help.

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
x3419commented, Oct 18, 2020

Awesome! That fixed the issue. I appreciate the help

1reaction
x3419commented, Oct 18, 2020

I’ve uploaded the memdump here: https://easyupload.io/y22cxl Thanks I’ll try that commit. If you need a v4 beacon sample just let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iBeacon Windows 10 Console Application using C# · ...
public static BeaconData FromBytes(byte[] bytes). {. if (bytes[0] != 0x02) { throw new ArgumentException("First byte in array was exptected ...
Read more >
ArgumentException Class (System)
ArgumentException is thrown when a method is invoked and at least one of the passed arguments does not meet the parameter specification of...
Read more >
BluetoothLEAdvertisementDataS...
I'm trying to advertise an Eddystone beacon but my code fails at advertisementData.Data with an ArgumentException:.
Read more >
SE Server Extender and Essentials help thread
ArgumentException: An item with the same key has already been added. at ... looks like the problem is specifically ServerNetworkManager.cs
Read more >
Type: System.ArgumentException
ArgumentException is thrown when a method is invoked and at least one of the passed arguments does not meet the parameter specification of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found