Found another gem.



  • SELECT id FROM table WHERE id = @id

    What is this I don't even.



  •  it checks whether @id exists in the table, if it returns a record then it exists otherwise id is not in the table



  • @mikeTheLiar said:


    SELECT id FROM table WHERE id = @id

    What is this I don't even.

    That's like a typical EXISTS clause:

    select * from table1 where exists (select 'Batman Sucks' from table2 where table1.x = table2.y)
    

    Looks weird but it does the job, and nobody will ever know that Batman sucks. Sometimes you don't care what is selected, you just care that something was selected.



  • A terrible way of validating that the ID exists in the table....



  • To exists or not to exists.



  • Except this is a edit page. We know the record exists, because we've already retrieved the data. What this is really doing is converting a integer to a string.


  • Trolleybus Mechanic

    @mikeTheLiar said:

    Except this is a edit page. We know the record exists, because we've already retrieved the data. What this is really doing is converting a integer to a string.
     

    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.



  •  maybe they once had problems with concurrent updates deleting the record while we were editing so we have to continuously recheck



  • @Lorne Kates said:

    @mikeTheLiar said:

    Except this is a edit page. We know the record exists, because we've already retrieved the data. What this is really doing is converting a integer to a string.
     

    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.

    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.


  • Trolleybus Mechanic

    @Ronald said:

    @Lorne Kates said:
    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.
    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.
     

    Little known fact: that's exactly what caused Mir to crash. They tried to put Cyrillic in there. "Decomissioning" was a cover-up.

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

     


  • Considered Harmful

    @Lorne Kates said:

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

    Oh, I thought his sig was just the word "Hit Counter" as some kind of joke. Turns out it's blocked by the work proxy.

    Your sig works fine though, and it's making me want to start a dynamic image arms race.


  • Trolleybus Mechanic

    @joe.edwards said:

    Oh, I thought his sig was just the word "Hit Counter" as some kind of joke. Turns out it's blocked by the work proxy.
     

    That's called "layers".

    @joe.edwards said:

    Your sig works fine though, and it's making me want to start a dynamic image arms race.

    I'm waiting for someone to do some background-position and background-position css injection to present different images for each appearance of their sig on the page.

    @joe.edwards said:

    Are you scraping the HTML for the post counts?

    That'd involve a janky server-side webrequest and a questionable use of Regexes. I hope that answers your question.

     



  • @Lorne Kates said:

    @Ronald said:

    @Lorne Kates said:
    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.
    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.
     

    Little known fact: that's exactly what caused Mir to crash. They tried to put Cyrillic in there. "Decomissioning" was a cover-up.

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

     

    I just made your DDOS much easier... Even without doing a thing, within a day or two we should know what happens. My money is on 0000.



  • @Ronald said:

    @Lorne Kates said:

    @Ronald said:

    @Lorne Kates said:
    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.
    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.
     

    Little known fact: that's exactly what caused Mir to crash. They tried to put Cyrillic in there. "Decomissioning" was a cover-up.

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

     

    I just made your DDOS much easier... Even without doing a thing, within a day or two we should know what happens. My money is on 0000.

    Nah, it just disregards your request to limit the digits.



  • @Ben L. said:

    @Ronald said:
    @Lorne Kates said:

    @Ronald said:

    @Lorne Kates said:
    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.
    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.
     

    Little known fact: that's exactly what caused Mir to crash. They tried to put Cyrillic in there. "Decomissioning" was a cover-up.

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

     

    I just made your DDOS much easier... Even without doing a thing, within a day or two we should know what happens. My money is on 0000.

    Nah, it just disregards your request to limit the digits.

    You don't know that. You forced a number of digits that is smaller than the current value, that's a different test case.



  • @Ronald said:

    @Ben L. said:
    @Ronald said:
    @Lorne Kates said:

    @Ronald said:

    @Lorne Kates said:
    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.
    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.
     

    Little known fact: that's exactly what caused Mir to crash. They tried to put Cyrillic in there. "Decomissioning" was a cover-up.

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

     

    I just made your DDOS much easier... Even without doing a thing, within a day or two we should know what happens. My money is on 0000.

    Nah, it just disregards your request to limit the digits.

    You don't know that. You forced a number of digits that is smaller than the current value, that's a different test case.

    Do you have any idea how HTTP works?



  • @Ben L. said:

    @Ronald said:
    @Ben L. said:
    @Ronald said:
    @Lorne Kates said:

    @Ronald said:

    @Lorne Kates said:
    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.
    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.
     

    Little known fact: that's exactly what caused Mir to crash. They tried to put Cyrillic in there. "Decomissioning" was a cover-up.

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

     

    I just made your DDOS much easier... Even without doing a thing, within a day or two we should know what happens. My money is on 0000.

    Nah, it just disregards your request to limit the digits.

    You don't know that. You forced a number of digits that is smaller than the current value, that's a different test case.

    Do you have any idea how HTTP works?

    Do you have any idea what the common SMTP port is?



  • @mikeTheLiar said:

    @Ben L. said:
    @Ronald said:
    @Ben L. said:
    @Ronald said:
    @Lorne Kates said:

    @Ronald said:

    @Lorne Kates said:
    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.
    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.
     

    Little known fact: that's exactly what caused Mir to crash. They tried to put Cyrillic in there. "Decomissioning" was a cover-up.

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

     

    I just made your DDOS much easier... Even without doing a thing, within a day or two we should know what happens. My money is on 0000.

    Nah, it just disregards your request to limit the digits.

    You don't know that. You forced a number of digits that is smaller than the current value, that's a different test case.

    Do you have any idea how HTTP works?

    Do you have any idea what the common SMTP port is?
    25. Next question?



  • @Ben L. said:

    @mikeTheLiar said:
    @Ben L. said:
    @Ronald said:
    @Ben L. said:
    @Ronald said:
    @Lorne Kates said:

    @Ronald said:

    @Lorne Kates said:
    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.
    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.
     

    Little known fact: that's exactly what caused Mir to crash. They tried to put Cyrillic in there. "Decomissioning" was a cover-up.

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

     

    I just made your DDOS much easier... Even without doing a thing, within a day or two we should know what happens. My money is on 0000.

    Nah, it just disregards your request to limit the digits.

    You don't know that. You forced a number of digits that is smaller than the current value, that's a different test case.

    Do you have any idea how HTTP works?

    Do you have any idea what the common SMTP port is?
    25. Next question?

    Ok since you need to have everything explained to you in details (as usual) here is why HTTP has nothing to do with this. Below are 3 possible scenarios; we do not have access to the codebase so it's not possible to know which of these scenarios is implemented (there are of course more possible scenarios). To cover these, three different test cases would be needed; in any event, the DDOS proposition would be in a different test case than your solution of forcing a value of nbdigits that is lower than what can be displayed by the current value of the counter.

    Scenario 1

    if(currentCounterValueCanBeDisplayedWithProvidedNumberOfDigits())
    { 
        increaseCounter();  
    }
    displayCounter();
    

    Scenario 2

    if(currentCounterValueCanBeDisplayedWithProvidedNumberOfDigits())
    {
        increaseCounterThenDisplayIt();  
    }
    else
    {
        displayCounterWithoutIncreasing();
    }
    

    Scenario 3

    increaseCounter();  
    displayCounter();
    

    Note: it would be quite a challenge to cover all three cases since for at least one of them it would require to prevent anyone else in the world from calling the remote server with that specific page id. That's the challenge of red teaming a live system.

    Of course since you are a noob you will probably "decide" which one is more likely and ignore the risk of missing the target. That's why when you get your first job you will probably spend 6 months or 1 year executing test cases for real developers, until you understand that nobody gives a shit what you "decide" and that edge scenarios are not a luxury to test.

    Now do some typical Ben L and post some offtopic Go link and let's move on.



  • @Ronald said:

    @Ben L. said:
    @mikeTheLiar said:
    @Ben L. said:
    @Ronald said:
    @Ben L. said:
    @Ronald said:
    @Lorne Kates said:

    @Ronald said:

    @Lorne Kates said:
    Obviously you can't rely on .ToString().  What if the database changes the way to makes strings?  You need your strings to be consistent with the database.
    The problem with using ToString() in the client application is that you make the system vulnerable to a MITM attack. What if someone was to inject something that cannot be converted to a string on the way between the database and the application? Lives could be lost.
     

    Little known fact: that's exactly what caused Mir to crash. They tried to put Cyrillic in there. "Decomissioning" was a cover-up.

    Also, I'm tempted to DDOS your sig image to see what happens when it rolls over.

     

    I just made your DDOS much easier... Even without doing a thing, within a day or two we should know what happens. My money is on 0000.

    Nah, it just disregards your request to limit the digits.

    You don't know that. You forced a number of digits that is smaller than the current value, that's a different test case.

    Do you have any idea how HTTP works?
    Do you have any idea what the common SMTP port is?
    25. Next question?

    Ok since you need to have everything explained to you in details (as usual) here is why HTTP has nothing to do with this. Below are 3 possible scenarios; we do not have access to the codebase so it's not possible to know which of these scenarios is implemented (there are of course more possible scenarios). To cover these, three different test cases would be needed; in any event, the DDOS proposition would be in a different test case than your solution of forcing a value of nbdigits that is lower than what can be displayed by the current value of the counter.

    Scenario 1

    if(currentCounterValueCanBeDisplayedWithProvidedNumberOfDigits())
    { 
        increaseCounter();  
    }
    displayCounter();
    

    Scenario 2

    if(currentCounterValueCanBeDisplayedWithProvidedNumberOfDigits())
    {
        increaseCounterThenDisplayIt();  
    }
    else
    {
        displayCounterWithoutIncreasing();
    }
    

    Scenario 3

    increaseCounter();  
    displayCounter();
    

    Note: it would be quite a challenge to cover all three cases since for at least one of them it would require to prevent anyone else in the world from calling the remote server with that specific page id. That's the challenge of red teaming a live system.

    Of course since you are a noob you will probably "decide" which one is more likely and ignore the risk of missing the target. That's why when you get your first job you will probably spend 6 months or 1 year executing test cases for real developers, until you understand that nobody gives a shit what you "decide" and that edge scenarios are not a luxury to test.

    Now do some typical Ben L and post some offtopic Go link and let's move on.

     


    Warning: imagecreatefrompng(/usr/www/users/counter/ezeeinternet/images/digits/odometer/s.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory in /usr/www/users/counter/ezeeinternet/Ez_Counter.php on line 115

    Warning: imagesettile(): supplied argument is not a valid Image resource in /usr/www/users/counter/ezeeinternet/Ez_Counter.php on line 117

    Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/counter/ezeeinternet/Ez_Counter.php:115) in /usr/www/users/counter/ezeeinternet/Ez_Counter.php on line 123
    ‰PNG 

    IHDRh õQPLTEÿÿ4àæºtRNS@æØf IDAT™c <ºÏÃäIEND®B


     



  •        



  • @SysLord said:

           
     

    &nbdigits=-5.2

    At least it's consistent behaviour. What's the word? Orthogonal?


Log in to reply