Questions tagged [c++]

The C++ programming language

C++ is a low-level programming language. It allows (but discourages) direct pointer manipulation, making it rife for security vulnerabilities.

Use this tag for questions about security that are directly related to C++, such as security analysis of C code and exploiting badly-written C++ code. Do not use this tag just because you're writing a program in C++, only if C++ is directly relevant to the question. Questions about programming in C++ are off-topic here, but can be asked on Stack Overflow.

103 questions
1
vote
2 answers

What cryptographic protocol is appropriate for the case where user needs access to a binary and encrypted configuration files?

This is a very newbie IT security question... I have to quickly implement a solution for our application that works like this... We have a binary executable that is given a configuration file. I need to encrypt the configuration file such that a…
owagh
  • 113
  • 4
1
vote
1 answer

Verify external data files for an application

I have a C++ application with an algorithm, whose usage I want to protect. The application needs several input data files to work (those may change for each client). My goal is to allow only unaltered input data files which were registered for…
Mike M
  • 135
  • 5
1
vote
1 answer

Why isn't sophisticated malware written with .NET?

I've been trying to research malware techniques lately, as malware analysis intrigues me. I've got a pretty heavy background in .NET, and based on my more than seven years experience in .NET, I feel that I could write a pretty complex piece of…
Boeckm
  • 127
  • 1
  • 4
1
vote
1 answer

Is it safe to distribute the server's certificate file with the client?

I've been working on making an SSL server/client on C++ using Boost. To load the certificates, I use the following code for each side: server.cpp boost::asio::ssl::context…
emredesu
  • 13
  • 2
1
vote
1 answer

The hidden meaning of the source code of the malware?

I'm studying the source code of malware developed in c++ and I have two questions in the source code below This is probably code that loads malicious dlls into memory. typedef BOOL (WINAPI *VirtualFreeT)( __in LPVOID lpAddress, __in SIZE_T…
useeffect
  • 13
  • 2
1
vote
3 answers

Can't inject meterpreter shellcode in c++ code

I want to inject meterpreter shellcode in a c++ program. When I create .exe file in msfvenom, I try it in my virtual machine (Windows 7) and it works well. But when I create shellcode and inject it into a c++ file, the program compiles successfully…
paladium
  • 11
  • 2
1
vote
0 answers

C/C++ code injection

I know how we do code injections with scripted languages like JavaScript, SQL, PHP, etc. and pretty much wherever a execute() function is used. However, I'm still unsure about how code injection works with compiled languages like C and C++ I've…
ChocolateOverflow
  • 3,452
  • 4
  • 17
  • 34
1
vote
1 answer

How secure is this schema between a Desktop App (c++) and an API (php)

as title says I'm writing a paid Desktop App that automates some process, it indirectly requires internet connection because MY app automates another Desktop app that requires internet connection. There is no webpage or such, only my Desktop App and…
1
vote
1 answer

Can deleting a non-inherited object more than once be exploited for code execution?

When assigning priority for a bug, we had an internal discussion whether in C++ deleting an object more than once can result in code execution if the pointer to object can be corrupted. For the objects having virtual destructor the answer seem to be…
George Y.
  • 3,504
  • 2
  • 10
  • 15
1
vote
2 answers

Exploitation tactics for heap over-reading?

One of recent CVEs particularly 2019-13615 related to VLC media player, attracted my attention because of the developer reaction: Any non-exploitable read overflow get CVSS of 9.8, like VLC is a server and you could do RCE and compromised the…
1
vote
0 answers

Getting Linux process list and state C++

I have a pet project where I am trying to develop a small antivirus program for Linux. I have already designed the mathematical model and the heuristic approach that I plan on using, yet now I am struggling when trying to fingerprint the host…
Mihai
  • 35
  • 3
1
vote
1 answer

Client-only authentication instead of server-only authentication, using OpenSSL

First, some background: I've got a C++-based client/server system that uses the OpenSSL C library to encrypt the client/server connections. This is done in (what I believe is) the canonical OpenSSL fashion; that is to say, the server holds a .pem…
1
vote
0 answers

Are code-pointer separation (CPS) and code-pointer integrity (CPI) about programming or compilers?

In computer security and control-flow integrity (CFI) there are two terms: code-pointer separation (CPS) and code-pointer integrity (CPI), defined as follows: Code-Pointer Integrity (CPI) is a property of C/C++ programs that guarantees absence of…
dt128
  • 11
  • 3
1
vote
2 answers

How is executable shellcode inserted?

How is shellcode (the payload) added to an executable file? Assume it is close source. How does the hacker then get the address of where it is? They need this for when they overwrite the return address... After the above is clarified, an example of…
user5623335
  • 381
  • 1
  • 4
  • 12
1
vote
2 answers

is it possible to craft exploits for non-open source C/C++ software without fuzzing?

imagine that if i wanted to find a vulnerability in a program that is used by a lot of people in order to exploit it. the program is open source and is written in C/C++ . would this even be possible (fuzzing excluded) as google tells me that it is…
harry
  • 21
  • 2