php – Advanced SQL Injection Test

As a task for my cybersecurity course, I have been entrusted with the execution of a penetration test in a login form that is meant to be vulnerable to SQL injection and, if we can not do so, we must execute a force attack gross in the form. I have not been successful in searching for vulnerabilities, even when using sqlmap. I was wondering if someone could help me find a better tool or exploitation. Thanks in advance.

waf – Applications registered in Cloudflare as "XSS, HTML Injection – Body"

Rule name: XSS, HTML injection – Body
Ruler: 100096BHTML

For about a week, requests that match this WAF rule have increased significantly on a customer's website. This is an example of a graph that shows only the number of requests marked during 24 hours:

Requests marked more than 24 hours

This affects all types of objectives. Surprisingly for me, especially static files are requested. Each IP address requests a series of files. The number of files can vary between a few and a few hundred. The set of files requested for each IP address seems to be legitimate.

The sources of the requests are the legitimate IP blocks of the mobile telephony providers and the Internet providers in the home of the main target countries of the website.

I wonder, how can I deal with this?

  • It is not entirely clear to me what exactly is wrong with these requests. I suppose your body contains things that it should not contain.
  • If my guess is correct, I would need to register the application bodies.
  • The registration of the request bodies is critical from a data protection problem (GDPR, etc.).
  • They may be false positives, but how can I prove it?

c # – Dependency injection error

insert the description of the image here

I am using xUnit to perform my tests, I'm trying to access my. ChampionshipsController, so I have to pass the value shown in the image as a parameter, but I am receiving the following error.

They would know how to help me.

My test class:

public class ChampionshipTest
{
private const string IdReturnsOk = "2021";
private const string IdNotFound = "XXXX";

(in English).

private readonly ICompetitionService _competitionManager;

public ChampionshipTest (
Competitive competitionManager)
{
_competitionManager = competitionManager;

_campeonato = new ChampionsController (_competitionManager);
}

    [Fact]
    public async Task Championship_GetById_ValuesReturnsOkResponse ()
{
var response = await _campeonato.Get (IdReturnsOk);

var objectResponse = response to ObjectResult;

Assert.Equal (200, objectResponse.StatusCode);
}

    [Fact]
    public async Task Championship_GetById_ReturnsNotFoundResponse ()
{
var answer = expected _campeonato.Get (IdNotFound);

var objectResponse = response to ObjectResult;

Assert.Equal (404, objectResponse.StatusCode);
}
}

And here is my Controller:

public class ChampionshipsController: ControllerBase
{
private readonly ICompetitionService _competitionManager;

public ChampionsController (
Competitive competitionManager)
{
_competitionManager = competitionManager;
}

// GET api / championships / 5
    [HttpGet("{id}")]
    public async Task Get (string id)
{
HttpResponseMessage respToken = await _competitionManager.GetIdCompetitionAsync (id);

string content = respToken.Content.ReadAsStringAsync (). Result;

if (respToken.StatusCode == HttpStatusCode.OK)
{
return Ok (content);
}
other
{
return StatusCode (StatusCodes.Status500InternalServerError);
}
}

}

Functional analysis: Does each open linear injection map between Banach spaces assign closed sets to closed sets?

Leave $ X $ Y $ Y $ Be spaces of Banach and $ T in L (X, Y) $ Injective and open. Make $ T $ Mapping closed sets to closed sets?

I know that this is not true if we eliminate the requirement of injectivity ($ X: = mathbb {R} ^ 2 $, $ Y: = mathbb {R} $, $ T (x, y) = x $) but I am struggling to find a counterexample or proof.

injection – infected USB drives in mice

I bought a mouse on aliexpress. It was quite cheap. It works well enough to be on par with a mouse that I can buy here for 4 times the price. I know, this is a well-known business model, and those mice are exactly the same.

However, when buying them here or there, how can I tell if a malicious code is running at the same time I am using it? F.i. a keylogger running at the same time from the mouse?

c # – Class of container for the system dialog to allow dependency injection

The next class is a wrapper for Microsoft.Win32.SaveFileDialog. I have implemented the use of Microsoft.Win32.SaveFileDialog in this way because I'm using the ISaveFileDialog Interface as a dependency throughout my code base.

public class SaveFileDialog: ISaveFileDialog
{
Public bool Save (content string, string SuggestFileExtension = null, string suggestFileExtensionName = null, string SuggestFileName = null)
{
string filter = "All files | *. *";

if (SuggestFileExtension! = null)
{
filter = $ "{SuggestFileExtensionName? string.Empty} | * {SuggestFileExtension} |" + filter;
}

Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog
{
FileName = SuggestFileName ?? string.Empty,
DefaultExt = SuggestFileExtension ?? string.Empty,
Filter = filter
};

switch (dlg.ShowDialog ())
{
true case:
returns WriteFile (dlg.FileName, content);
default:
false return;
}
}

private bool WriteFile (string filePath, string content)
{
try
{
File.WriteAllText (filePath, content);
true returns
}
capture (PathTooLongException)
{
false return;
}
capture (DirectoryNotFoundException)
{
false return;
}
capture (IOException)
{
false return;
}
capture (UnauthorizedAccessException)
{
false return;
}
catch (System.Security.SecurityException)
{
false return;
}
}
}

While this is working, I am struggling to refactor this class to allow unit tests since there is currently no way to simulate / reject the Microsoft.Win32.SaveFileDialog – Have I missed a trick here? Or is there really a nice way to do a unit test and should you rely on integration tests?


I know I could refactor the capture blocks to be

capture (Exception)
{
false return;
}

Or even be

catch (Exception ex) when (ex is PathTooLongException
|| ex is DirectoryNotFoundException
........)
{
false return;
}

But I'd like to keep them as they are because I'd like to avoid catching all the exceptions and I'm using a Visual Studio add-on to help me manage the exceptions and complain when I use the second option.

Thanks for any help!

python: skip logging in with SQL injection with additional password verification

I'm having fun with SQL injection attacks, and I'm currently trying to skip a login using SQLi.

I think I have found the SQL query well, however, this module also implemented an additional password verification, to verify that the password entry matches the query.

The website is served using Python and FLASK

query = "SELECT * FROM users WHERE username = & # 39; admin & UNION SELECT null, password, null FROM users where username = & # 39; admin & # 39; - AND password = & # 39;[User Input]some_password & # 39; "
result = db.execute (query) .fetchallI ()

# Then verify if the password entry equals the query output
row = result[0]
yes row["password"] == password: # problematic password check
try:
session["user_id"] = int (row["id"])
session["username"] = row["username"]
    return redirect (url_for ("bank.index"))

I will probably be able to decipher the rest of SQLi if I can skip the verification of the password.

Any ideas?

asp.net – Object reference ServiceLocator.Current not set for dependency injection in ASPX?

I am trying to check an ASPX code but the following line sends me an error of object reference not established (ServiceLocator.Current), I ask that if there is someone who can put me in context about what I need so that I do not have the error

var solr = ServiceLocator.Current.GetInstance <ISolrOperations> ();

Dependency injection and shared / non-shared object and cron job

Something interesting happens to the Magento2 code and I can not realize what I missed. The same code works perfectly through the browser and does not work through cron.

(in the administration area) I calculate the result in AnotherClass that must depend on the value of $ this-> myProperty.

$ this-> myProperty is maintained in MyWorkingClass and read from AnotherClass because (in my opinion) the structure will create a new instance of AnotherClass where this property is not established.

Everything works as expected when I run Magento in the browser. But when you run cron (either manually in cli-cron: run or by programming) I see an unexpected result in the records.

Any help is appreciated!

`

MyWorkingClass class
{
$ private myProperty;

...

public function doStuff ($ params)
{
$ result = $ this-> someFactory-> create () -> getSomethingUseful ();
$ this-> logEverything ($ result);
$ this-> myProperty = 1;
$ result = $ this-> someFactory-> create () -> getSomethingUseful ();
$ this-> logEverything ($ result);
}

Public function getMyProperty ()
{
returns $ this-> myProperty;
}
...
}

AnotherClass class
{
...

Public function getSomethingUseful ()
{
$ objectManager =  Magento  Framework  App  ObjectManager :: getInstance ();
$ myClassObject = $ objectManager-> get (& # 39; Vendor  Module  Model  MyWorkingClass & # 39;);
$ myProperty = $ myClassObject-> getMyProperty ();
yes ($ myProperty == 1) {
$ result = 2 * 2;
return "Everything is fine now! 2 x 2 = $ result";
}
back "Nothing works, 2 x 2 = 5";
}

} `